diff --git a/go.mod b/go.mod index c2f076ace73..f74167351e3 100644 --- a/go.mod +++ b/go.mod @@ -3,92 +3,102 @@ module github.com/openshift/hive go 1.15 require ( - github.com/Azure/azure-sdk-for-go v43.2.0+incompatible - github.com/Azure/go-autorest/autorest v0.10.0 + github.com/Azure/azure-sdk-for-go v45.0.0+incompatible + github.com/Azure/go-autorest/autorest v0.11.6 github.com/Azure/go-autorest/autorest/azure/auth v0.4.1 - github.com/Azure/go-autorest/autorest/to v0.3.1-0.20191028180845-3492b2aff503 - github.com/aws/aws-sdk-go v1.32.3 + github.com/Azure/go-autorest/autorest/to v0.4.0 + github.com/aws/aws-sdk-go v1.34.21 github.com/blang/semver/v4 v4.0.0 github.com/evanphx/json-patch v4.9.0+incompatible github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 github.com/go-bindata/go-bindata v3.1.2+incompatible - github.com/go-logr/logr v0.2.1 + github.com/go-logr/logr v0.3.0 github.com/golang/mock v1.4.4 - github.com/golangci/golangci-lint v1.26.0 - github.com/google/uuid v1.1.1 + github.com/golangci/golangci-lint v1.31.0 + github.com/google/uuid v1.1.2 github.com/gophercloud/utils v0.0.0-20210113034859-6f548432055a github.com/heptio/velero v1.0.0 github.com/jonboulle/clockwork v0.1.0 github.com/json-iterator/go v1.1.10 github.com/miekg/dns v1.1.22 github.com/modern-go/reflect2 v1.0.1 - github.com/onsi/ginkgo v1.12.1 - github.com/onsi/gomega v1.10.1 + github.com/onsi/ginkgo v1.14.1 + github.com/onsi/gomega v1.10.2 github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible - github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7 - github.com/openshift/cluster-api v0.0.0-20191129101638-b09907ac6668 - github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200120152131-1b09fd9e7156 + github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab + github.com/openshift/cluster-api v0.0.0-20191129101638-b09907ac6668 // indirect + github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201203141909-4dc702fd57a5 github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20200504092944-27473ea1ae43 github.com/openshift/cluster-autoscaler-operator v0.0.0-20190521201101-62768a6ba480 github.com/openshift/generic-admission-server v1.14.1-0.20200903115324-4ddcdd976480 - github.com/openshift/installer v0.9.0-master.0.20201103204150-888dc5bab60c - github.com/openshift/library-go v0.0.0-20200918101923-1e4c94603efe - github.com/openshift/machine-api-operator v0.2.1-0.20200429102619-d36974451290 + github.com/openshift/installer v0.9.0-master.0.20210201172249-df32ad26dd6f + github.com/openshift/library-go v0.0.0-20201109112824-093ad3cf6600 + github.com/openshift/machine-api-operator v0.2.1-0.20201111151924-77300d0c997a github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.7.1 github.com/sirupsen/logrus v1.6.0 - github.com/spf13/cobra v1.0.0 + github.com/spf13/cobra v1.1.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.6.1 github.com/vmware/govmomi v0.22.2 golang.org/x/lint v0.0.0-20200302205851-738671d3881b - golang.org/x/mod v0.3.0 - golang.org/x/net v0.0.0-20200707034311-ab3426394381 - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - golang.org/x/time v0.0.0-20191024005414-555d28b269f0 - google.golang.org/api v0.25.0 - gopkg.in/ini.v1 v1.51.0 - gopkg.in/yaml.v2 v2.3.0 - k8s.io/api v0.19.0 - k8s.io/apiextensions-apiserver v0.19.0 - k8s.io/apimachinery v0.19.0 - k8s.io/cli-runtime v0.19.0 + golang.org/x/mod v0.4.0 + golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb + golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 + golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e + google.golang.org/api v0.33.0 + gopkg.in/ini.v1 v1.61.0 + gopkg.in/yaml.v2 v2.4.0 + k8s.io/api v0.19.5 + k8s.io/apiextensions-apiserver v0.19.5 + k8s.io/apimachinery v0.19.5 + k8s.io/cli-runtime v0.19.5 k8s.io/client-go v12.0.0+incompatible k8s.io/cluster-registry v0.0.6 - k8s.io/code-generator v0.19.0 + k8s.io/code-generator v0.19.5 k8s.io/klog v1.0.0 - k8s.io/kube-aggregator v0.19.0 - k8s.io/kubectl v0.19.0 - k8s.io/utils v0.0.0-20200729134348-d5654de09c73 + k8s.io/kube-aggregator v0.19.5 + k8s.io/kubectl v0.19.5 + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 sigs.k8s.io/cluster-api-provider-aws v0.0.0 sigs.k8s.io/cluster-api-provider-azure v0.0.0 sigs.k8s.io/cluster-api-provider-openstack v0.0.0 sigs.k8s.io/controller-runtime v0.6.2 - sigs.k8s.io/controller-tools v0.4.0 + sigs.k8s.io/controller-tools v0.4.1 sigs.k8s.io/yaml v1.2.0 ) // from installer replace ( - github.com/Azure/go-autorest => github.com/tombuildsstuff/go-autorest v14.0.1-0.20200416184303-d4e299a3c04a+incompatible - github.com/Azure/go-autorest/autorest => github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200416184303-d4e299a3c04a - github.com/Azure/go-autorest/autorest/azure/auth => github.com/tombuildsstuff/go-autorest/autorest/azure/auth v0.4.3-0.20200416184303-d4e299a3c04a + github.com/kubevirt/terraform-provider-kubevirt => github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3 github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20200715132148-0f91f62a41fe github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20190821174549-a2a477909c1d github.com/terraform-providers/terraform-provider-aws => github.com/openshift/terraform-provider-aws v1.60.1-0.20200630224953-76d1fb4e5699 github.com/terraform-providers/terraform-provider-azurerm => github.com/openshift/terraform-provider-azurerm v1.40.1-0.20200707062554-97ea089cc12a github.com/terraform-providers/terraform-provider-ignition/v2 => github.com/community-terraform-providers/terraform-provider-ignition/v2 v2.1.0 - sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200506073438-9d49428ff837 - sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200120114645-8a9592f1f87b - sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20200526112135-319a35b2e38e + kubevirt.io/client-go => kubevirt.io/client-go v0.29.0 + sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20201022175424-d30c7a274820 + sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20201016155852-4090a6970205 + sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20201116051540-155384b859c5 ) -// needed because otherwise v12.0.0 is picked up as a more recent version -replace k8s.io/client-go => k8s.io/client-go v0.19.0 - -// needed because otherwise installer fetches a library-go version that requires bitbucket.com/ww/goautoneg which is dead -// Tagged version fetches github.com/munnerz/goautoneg instead -replace github.com/openshift/library-go => github.com/openshift/library-go v0.0.0-20200918101923-1e4c94603efe +// from installer as part of https://github.com/openshift/installer/pull/4350 +// Prevent the following modules from upgrading version as result of terraform-provider-kubernetes module +// The following modules need to be locked to compile correctly with terraform-provider-azure and terraform-provider-google +replace ( + github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.8.2 + github.com/Azure/go-autorest/autorest/azure/cli => github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 + github.com/Azure/go-autorest/autorest/date => github.com/Azure/go-autorest/autorest/date v0.2.0 + github.com/Azure/go-autorest/autorest/validation => github.com/Azure/go-autorest/autorest/validation v0.2.1-0.20191028180845-3492b2aff503 + github.com/apparentlymart/go-cidr => github.com/apparentlymart/go-cidr v1.0.1 + github.com/go-openapi/spec => github.com/go-openapi/spec v0.19.0 + github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.4.1 + github.com/hashicorp/go-plugin => github.com/hashicorp/go-plugin v1.2.2 + github.com/ulikunitz/xz => github.com/ulikunitz/xz v0.5.7 + google.golang.org/api => google.golang.org/api v0.25.0 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 + google.golang.org/grpc => google.golang.org/grpc v1.29.1 +) -// temporary hack fix for https://github.com/kubernetes/kubernetes/issues/95300 -replace k8s.io/apiserver => github.com/staebler/apiserver v0.19.1-0.20201005174924-a3ef0d1e45df +// needed because otherwise v12.0.0 is picked up as a more recent version +replace k8s.io/client-go => k8s.io/client-go v0.19.5 diff --git a/go.sum b/go.sum index 72c5b0e20b7..1f0e6ed9ec1 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.36.0/go.mod h1:RUoy9p/M4ge0HzT8L+SDZ8jg+Q6fth0CiBuhFJpSV40= cloud.google.com/go v0.37.2/go.mod h1:H8IAquKe2L30IxoupDgqTaQvKSwF/c8prYHynGIWQbA= cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= @@ -21,14 +20,23 @@ cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bP cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0 h1:EpMNVUorLiZIELdMZbCYX/ByTFCdoYopYAGxaGVz9ms= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go v0.64.0/go.mod h1:xfORb36jGvE+6EexW71nMEtL025s3x6xvuYUKM4JLv4= +cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.6.0/go.mod h1:hyFDG0qSGdHNz8Q6nDN8rYIkld0q/+5uBZaelxiDLfE= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.1.0/go.mod h1:B6ByKcIdYmhoyDzmOnQxyOhN6r05qnewYIxxG6L0/b4= +cloud.google.com/go/bigtable v1.5.0/go.mod h1:713PsD2nkJwTioSe6vF/sFCAcjhINJ62cEtKCr8u+F8= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -39,6 +47,9 @@ cloud.google.com/go/storage v1.4.0/go.mod h1:ZusYJWlOshgSBGbt6K3GnB3MT3H1xs2id9+ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.7.0/go.mod h1:jGMIBwF+L/tL6WN/W5InNgYYu4HP0DvGB6rQ1mufWfs= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.11.0/go.mod h1:/PAbprKS+5msVYogBmczjWalDXnQ9mr64yEq9YnyPeo= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f/go.mod h1:sk5LnIjB/nIEU7yP5sDQExVm62wu0pBh3yrElngUisI= contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= @@ -48,7 +59,6 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AlecAivazis/survey/v2 v2.0.5/go.mod h1:WYBhg6f0y/fNYUuesWQc0PKbJcEliGcYHB9sNT3Bg74= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= @@ -60,41 +70,61 @@ github.com/Azure/azure-sdk-for-go v32.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v36.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v42.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v42.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v43.2.0+incompatible h1:H8jfb+wuVlLqyP1Nr6zqapNxqhgwshD5OETJsBO74iY= github.com/Azure/azure-sdk-for-go v43.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v45.0.0+incompatible h1:/bZYPaJLCqXeCqQqEeEIQg/p7RNafOhaVFhC6IWxZ/8= +github.com/Azure/azure-sdk-for-go v45.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.6.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.7.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v10.15.4+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v11.7.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.3-0.20191028180845-3492b2aff503/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.10.0/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.11.3/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= +github.com/Azure/go-autorest/autorest v0.11.6 h1:LIzfhNo9I3+il0KO2JY1/lgJmjig7lY0wFulQNZkbtg= +github.com/Azure/go-autorest/autorest v0.11.6/go.mod h1:V6p3pKZx1KKkJubbxnDWrzNhEIfOy/pTGasLqzHIPHs= github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/azure/cli v0.2.0/go.mod h1:WWTbGPvkAg3I4ms2j2s+Zr5xCGwGqTQh+6M2ZqOczkE= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.0/go.mod h1:rNYMNAefZMRowqCV0cVhr/YDW5dD7afFq9nXAXL4ykE= +github.com/Azure/go-autorest/autorest/azure/auth v0.4.1 h1:VDSqmaEc8ECZdfavoa1KmVpIVTGTc+v/2jvHGmCYvSE= +github.com/Azure/go-autorest/autorest/azure/auth v0.4.1/go.mod h1:5TgH20II424SXIV9YDBsO4rBCKsh39Vbx9DvhJZZ8rU= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= github.com/Azure/go-autorest/autorest/to v0.3.1-0.20191028180845-3492b2aff503 h1:2McfZNaDqGPjv2pddK547PENIk4HV+NT7gvqRq4L0us= github.com/Azure/go-autorest/autorest/to v0.3.1-0.20191028180845-3492b2aff503/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= +github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= +github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= github.com/Azure/go-autorest/autorest/validation v0.2.1-0.20191028180845-3492b2aff503 h1:RBrGlrkPWapMcLp1M6ywCqyYKOAT5ERI6lYFvGKOThE= github.com/Azure/go-autorest/autorest/validation v0.2.1-0.20191028180845-3492b2aff503/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/Azure/go-ntlmssp v0.0.0-20191115210519-2b2be6cc8ed4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= +github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -105,11 +135,17 @@ github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157 h1:hY39LwQHh+1kaovmIjOrlqnXNX6tygSRfLkkK33IkZU= github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/Djarvur/go-err113 v0.1.0 h1:uCRZZOdMQ0TZPHYTdYpoC0bLYJKPEHPUJ8MeAa51lNU= +github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= +github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= +github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.0.2/go.mod h1:oesJ8kPONMONaZgtiHNzUShJbksypC5kWczhZAf6+aU= @@ -153,7 +189,7 @@ github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0 github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajeddeloh/go-json v0.0.0-20170920214419-6a2fe990e083/go.mod h1:otnto4/Icqn88WCcM4bhIJNSgsh9VLBuspyyCfvof9c= github.com/ajeddeloh/yaml v0.0.0-20170912190910-6b94386aeefd/go.mod h1:idhzw68Q7v4j+rQ2AGyq3OlZW2Jij9mdmGA4/Sk6J0E= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -167,18 +203,22 @@ github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1 github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xpath v1.1.2/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13/go.mod h1:7kfpUbyCdGJ9fDRCp3fopPQi5+cKNHgTE4ZuNrO71Cw= github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= +github.com/apparentlymart/go-versions v1.0.0/go.mod h1:YF5j7IQtrOAOnsGkniupEA5bfCjzd7i14yu0shZavyM= github.com/apple/foundationdb/bindings/go v0.0.0-20190411004307-cd5c9d91fad2/go.mod h1:OMVSB21p9+xQUIqlGizHPZfjK+SHws1ht+ZytVDoz9U= github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -190,6 +230,7 @@ github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD github.com/armon/go-proxyproto v0.0.0-20190211145416-68259f75880e/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= @@ -205,8 +246,11 @@ github.com/aws/aws-sdk-go v1.25.47/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.28.8/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.24/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.3 h1:E3OciOGVlJrv1gQ2T7/Oou+I9nGPB2j978THQjvZBf0= github.com/aws/aws-sdk-go v1.32.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.21 h1:M97FXuiJgDHwD4mXhrIZ7RJ4xXV6uZVPvIC2qb+HfYE= +github.com/aws/aws-sdk-go v1.34.21/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -216,11 +260,14 @@ 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/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderdocs v0.6.0/go.mod h1:W6wVZPtBa6V5bpjaK1eJAoVCL/7B4Amfrld0dro+fHU= +github.com/bflad/tfproviderdocs v0.7.0/go.mod h1:W6wVZPtBa6V5bpjaK1eJAoVCL/7B4Amfrld0dro+fHU= github.com/bflad/tfproviderlint v0.14.0/go.mod h1:1Jtjs6DPKoyqPrbPyMiy33h0ViO2h831uzoOuikCA60= +github.com/bflad/tfproviderlint v0.18.0/go.mod h1:0fdh7JywihC58Io8AZ+gpcmQtJggse0MCOXF2tMmnAQ= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= @@ -229,10 +276,13 @@ 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/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/bmatcuk/doublestar v1.2.1/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= +github.com/bmatcuk/doublestar v1.3.2/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bombsimon/wsl/v3 v3.0.0 h1:w9f49xQatuaeTJFaNP4SpiWSR5vfT6IstPtM62JjcqA= github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/bombsimon/wsl/v3 v3.1.0 h1:E5SRssoBgtVFPcYWUOFJEcgaySgdtTNYzsSKDOY7ss8= +github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= @@ -292,9 +342,12 @@ github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containers/image v3.0.2+incompatible/go.mod h1:8Vtij257IWSanUQKe1tAeNOm2sRVkSqQTVQ1IlwI3+M= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/container-linux-config-transpiler v0.9.0/go.mod h1:SlcxXZQ2c42knj8pezMiQsM1f+ADxFMjGetuMKR/YSQ= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -319,8 +372,10 @@ github.com/coreos/ignition v0.33.0/go.mod h1:WJQapxzEn9DE0ryxsGvm8QnBajm/XsS/Pkr github.com/coreos/ignition v0.34.0/go.mod h1:WJQapxzEn9DE0ryxsGvm8QnBajm/XsS/PkrDqSpz+bA= github.com/coreos/ignition/v2 v2.3.0/go.mod h1:85dmM/CERMZXNrJsXqtNLIxR/dn8G9qlL1CmEjCugp0= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/prometheus-operator v0.35.0/go.mod h1:XHYZUStZWcwd1yk/1DjZv/fywqKIyAJ6pSwvIr+v9BQ= github.com/coreos/prometheus-operator v0.38.0/go.mod h1:xZC7/TgeC0/mBaJk+1H9dbHaiEvLYHgX6Mi1h40UPh8= github.com/coreos/vcontext v0.0.0-20190529201340-22b159166068/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE= github.com/coreos/vcontext v0.0.0-20200225161404-ee043618d38d/go.mod h1:z4pMVvaUrxs98RROlIYdAQCKhEicjnTirOaVyDRH5h8= @@ -340,6 +395,8 @@ github.com/cznic/ql v1.2.0/go.mod h1:FbpzhyZrqr0PVlK6ury+PoW3T0ODUV22OeWIxcaOrSE github.com/cznic/sortutil v0.0.0-20150617083342-4c7342852e65/go.mod h1:q2w6Bg5jeox1B+QkJ6Wp/+Vn0G/bo3f1uY7Fn3vivIQ= github.com/cznic/strutil v0.0.0-20171016134553-529a34b1c186/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc= github.com/cznic/zappy v0.0.0-20160723133515-2533cb5b45cc/go.mod h1:Y1SNZ4dRUOKXshKUbwUapqNncRrho4mkjQebgEHZLj8= +github.com/daixiang0/gci v0.2.4 h1:BUCKk5nlK2m+kRIsoj+wb/5hazHvHeZieBKWd9Afa8Q= +github.com/daixiang0/gci v0.2.4/go.mod h1:+AV8KmHTGxxwp/pY84TLQfFKp2vuKXXJVzF3kD/hfR4= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -347,6 +404,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892/go.mod h1:CTDl0pzVzE5DEzZhPfvhY/9sPFMQIxaJ9VAMs9AagrE= github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= github.com/deislabs/oras v0.8.1/go.mod h1:Mx0rMSbBNaNfY9hjpccEnxkOqJL6KGjtxNHPLC4G4As= +github.com/denis-tingajkin/go-header v0.3.1 h1:ymEpSiFjeItCy1FOP+x0M2KdCELdEAHUsNa8F+hHc6w= +github.com/denis-tingajkin/go-header v0.3.1/go.mod h1:sq/2IxMhaZX+RRcgHfCRx/m0M5na0fBt4/CRe7Lrji0= github.com/denisenkom/go-mssqldb v0.0.0-20190412130859-3b1d194e553a/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= @@ -383,6 +442,8 @@ github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNE github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s= +github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= @@ -412,8 +473,10 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/emicklei/go-restful v2.9.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/emicklei/go-restful v2.10.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.14.2+incompatible h1:uyx8VgUCryEkh7qbr8rEtrA0rGDEJ73F5lOJdB5m3V8= +github.com/emicklei/go-restful v2.14.2+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -432,10 +495,11 @@ github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.1.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.4.0/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= @@ -457,6 +521,7 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -465,7 +530,13 @@ github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA= github.com/go-critic/go-critic v0.4.1 h1:4DTQfT1wWwLg/hzxwD9bkdhDQrdJtxe6DUTadPlrIeE= github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= +github.com/go-critic/go-critic v0.5.2 h1:3RJdgf6u4NZUumoP8nzbqiiNT8e1tC2Oc7jlgqre/IA= +github.com/go-critic/go-critic v0.5.2/go.mod h1:cc0+HvdE3lFpqLecgqMaJcvWWH77sLdBp+wLGPM1Yyo= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -483,9 +554,13 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= +github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= +github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= @@ -509,9 +584,10 @@ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1 github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.17.2/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -519,18 +595,11 @@ github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.17.2/go.mod h1:QO936ZXeisByFmZEO1IS1Dqhtf4QV1sYYFtIq6Ld86Q= github.com/go-openapi/runtime v0.18.0/go.mod h1:uI6pHuxWYTy94zZxgcwJkUWa9wbIlhteGfloI10GD4U= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= -github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k4= +github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.17.2/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= @@ -542,9 +611,11 @@ github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/ github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.4/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/validate v0.17.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= @@ -583,6 +654,9 @@ github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUD github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2XQaA= github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-toolsmith/typep v1.0.2 h1:8xdsa1+FSIH/RhEkgnD1j2CJOy5mNllW1Q9tRiYwvlk= +github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4/FHQWkvVRmgijNXRfzkIDHh23ggEo= github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= @@ -590,6 +664,8 @@ github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6 github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.0 h1:EWCvMGGxOjsgwlWaP+f4+Hh6yrrte7JeFL2S6b+0hdM= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= +github.com/gobuffalo/flect v0.2.2 h1:PAVD7sp0KOdfswjAw9BpLCU9hXo7wFSzgpQ+zNeks/A= +github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= @@ -603,7 +679,10 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.7.1 h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc= github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.8.0 h1:MSdYClljsF3PbENUUEx85nkWfJSGfzYI9yEBZOJz6CY= +github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -611,23 +690,21 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang-migrate/migrate/v4 v4.6.2/go.mod h1:JYi6reN3+Z734VZ0akNuyOJNcrg45ZL7LDBMW3WGJL0= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.0.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -638,7 +715,6 @@ github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -670,12 +746,16 @@ github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 h1:pe9JHs3cHHDQgO github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70uaOiMbNnluTg7gyQhtGqLQncQh+4J8= github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= +github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d h1:pXTK/gkVNs7Zyy7WKgLXmpQ5bHTrq5GDsp8R9Qs67g0= +github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= github.com/golangci/golangci-lint v1.18.0/go.mod h1:kaqo8l0OZKYPtjNmG4z4HrWLgcYNIJ9B9q3LWri9uLg= github.com/golangci/golangci-lint v1.26.0 h1:CLLGRSA9BLMiNvsWPXHioYAdfIx9tkgdVWyA6bIdYCo= github.com/golangci/golangci-lint v1.26.0/go.mod h1:tefbO6RcigFzvTnDC+Y51kntVGgkuCAVsC+mnfbPruc= +github.com/golangci/golangci-lint v1.31.0 h1:+m9I3LEmxXLpymkXRPkDQGzOVBmBYm16UtDiXqZxWek= +github.com/golangci/golangci-lint v1.31.0/go.mod h1:aMQuNCA+NDU5+4jLL5pEuFHoue0IznKE2+/GsFvvs8A= github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547/go.mod h1:0qUabqiIQgfmlAmulqxyiGkkyF6/tOGSnY2cnPVwrzU= github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI= github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= @@ -686,10 +766,14 @@ github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29M github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 h1:EL/O5HGrF7Jaq0yNhBLucz9hTuRzj2LdwGBOaENgxIk= github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= +github.com/golangci/misspell v0.3.5 h1:pLzmVdl3VxTOncgzHcvLOKirdvcx/TydsClUQXTehjo= +github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 h1:leSNB7iYzLYSSx3J/s5sVf4Drkc68W2wm4Ixh/mr0us= github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1aiNg8JbBMO2+E1WIQ+j/gL4SQqGPg= github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= +github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039 h1:XQKc8IYQOeRwVs36tDrEmTgDgP88d5iEURwpmtiAlOM= +github.com/golangci/revgrep v0.0.0-20180812185044-276a5c0a1039/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= @@ -710,6 +794,11 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-metrics-stackdriver v0.0.0-20190816035513-b52628e82e2a/go.mod h1:o93WzqysX0jP/10Y13hfL6aq9RoUvGaVdkrH5awMksE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -718,8 +807,11 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.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/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -727,6 +819,8 @@ github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v0.0.0-20170306145142-6a5e28554805/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -734,6 +828,8 @@ github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww= github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= @@ -741,14 +837,11 @@ github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE0 github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gookit/color v1.1.7/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= +github.com/gookit/color v1.2.5/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= +github.com/gookit/color v1.2.9/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.0.0-20190212181753-892256c46858/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gophercloud/gophercloud v0.2.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= @@ -756,14 +849,16 @@ github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEo github.com/gophercloud/gophercloud v0.6.0/go.mod h1:GICNByuaEBibcjmjvI7QvYJSZEbGkcYwAR7EZK2WMqM= github.com/gophercloud/gophercloud v0.6.1-0.20191025185032-6ad562af8c1f/go.mod h1:GICNByuaEBibcjmjvI7QvYJSZEbGkcYwAR7EZK2WMqM= github.com/gophercloud/gophercloud v0.6.1-0.20191122030953-d8ac278c1c9d/go.mod h1:ozGNgr9KYOVATV5jsgHl/ceCDXGuguqOZAzoQ/2vcNM= +github.com/gophercloud/gophercloud v0.10.1-0.20200424014253-c3bfe50899e5/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss= github.com/gophercloud/gophercloud v0.12.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss= -github.com/gophercloud/gophercloud v0.12.1-0.20200821143728-362eb785d617 h1:8Kj1KcL5PXrH3CIC+U5LnbyfueWr/Fh/4CdM5yP+XKM= -github.com/gophercloud/gophercloud v0.12.1-0.20200821143728-362eb785d617/go.mod h1:w2NJEd88d4igNL1KUHzBsKMvS/ByJTzgltTGWKT7AC8= +github.com/gophercloud/gophercloud v0.12.1-0.20200827191144-bb4781e9de45 h1:qvMqZxf8hx1Udiv1dXTp9rmGflhBYvgoVva+AQBJ4XM= +github.com/gophercloud/gophercloud v0.12.1-0.20200827191144-bb4781e9de45/go.mod h1:w2NJEd88d4igNL1KUHzBsKMvS/ByJTzgltTGWKT7AC8= github.com/gophercloud/utils v0.0.0-20190124231947-9c3b9f2457ef/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= github.com/gophercloud/utils v0.0.0-20190313033024-0bcc8e728cb5/go.mod h1:SZ9FTKibIotDtCrxAU/evccoyu1yhKST6hgBvwTB5Eg= -github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= -github.com/gophercloud/utils v0.0.0-20200918191848-da0e919a012a/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= +github.com/gophercloud/utils v0.0.0-20200423144003-7c72efc7435d/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= +github.com/gophercloud/utils v0.0.0-20201101202656-8677e053dcf1/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= +github.com/gophercloud/utils v0.0.0-20201212031956-9dc30e126fea/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= github.com/gophercloud/utils v0.0.0-20210113034859-6f548432055a h1:mHU4E3kfxVUhfqjgxrWv4g0mjRF7qA4o5dkMRfS8gd8= github.com/gophercloud/utils v0.0.0-20210113034859-6f548432055a/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -780,21 +875,32 @@ github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3 h1:JVnpOZS+qxli+rgVl98ILOXVNbW+kb5wcxeGx8ShUIw= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.2.1 h1:OfNeM+FV1AOdvwfQY8Iuq2XTQrsc2isCVXw+l3SftP0= +github.com/gostaticanalysis/analysisutil v0.2.1/go.mod h1:18U/DLpRgIUd459wGxVHE0fRgmo1UgHDcbw7F5idXu0= +github.com/gostaticanalysis/comment v1.4.1 h1:xHopR5L2lRz6OsjH4R2HG5wRhW9ySl3FsHIvi5pcXwc= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= +github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.4.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -805,6 +911,7 @@ github.com/grpc-ecosystem/grpc-health-probe v0.2.1-0.20181220223928-2bf0a5b182db github.com/h2non/filetype v1.0.12/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= +github.com/hashicorp/aws-sdk-go-base v0.6.0/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= github.com/hashicorp/consul-template v0.22.0/go.mod h1:lHrykBIcPobCuEcIMLJryKxDyk2lUMnQWmffOEONH0k= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -816,9 +923,11 @@ github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FK github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-azure-helpers v0.4.1/go.mod h1:lu62V//auUow6k0IykxLK2DCNW8qTmpm8KqhYVWattA= github.com/hashicorp/go-azure-helpers v0.10.0/go.mod h1:YuAtHxm2v74s+IjQwUG88dHBJPd5jL+cXr5BGVzSKhE= +github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-gatedio v0.5.0/go.mod h1:Lr3t8L6IyxD3DAeaUxGcgl2JnRUpWMCsmBl4Omu/2t4= github.com/hashicorp/go-gcp-common v0.5.0/go.mod h1:IDGUI2N/OS3PiU4qZcXJeWKPI6O/9Y8hOrbSiMcqyYw= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= @@ -830,6 +939,7 @@ github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.13.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -841,10 +951,6 @@ github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1: github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-plugin v1.0.0/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.2.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.2.2/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a/go.mod h1:xbXnmKqX9/+RhPkJ4zrEx4738HacP72aaUPlT2RZ4sU= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -861,10 +967,12 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-tfe v0.3.27/go.mod h1:DVPSW2ogH+M9W1/i50ASgMht8cHP7NxxK0nrY9aFikQ= +github.com/hashicorp/go-tfe v0.8.1/go.mod h1:XAV72S4O1iP8BDaqiaPLmL2B4EE6almocnOn8E8stHc= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2-0.20191001231223-f32f5fe8d6a8/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -883,6 +991,7 @@ github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV github.com/hashicorp/hcl/v2 v2.1.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl/v2 v2.5.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= +github.com/hashicorp/hcl/v2 v2.6.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= @@ -902,28 +1011,41 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= github.com/hashicorp/terraform v0.12.21/go.mod h1:eJcloDEx5ywM4a1tetIuVrlqklM0bUVRYJBYAh4CYzA= +github.com/hashicorp/terraform v0.13.4/go.mod h1:1H1qcnppNc/bBGc7poOfnmmBeQMlF0stEN3haY3emCU= github.com/hashicorp/terraform-config-inspect v0.0.0-20190821133035-82a99dc22ef4/go.mod h1:JDmizlhaP5P0rYTTZB0reDMefAiJyfWPEtugV4in1oI= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191121111010-e9629612a215/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-config-inspect v0.0.0-20200806211835-c481b8bfa41e/go.mod h1:Z0Nnk4+3Cy89smEbrq+sl1bxc9198gIP4I7wcQF6Kqs= github.com/hashicorp/terraform-exec v0.1.1/go.mod h1:yKWvMPtkTaHpeAmllw+1qdHZ7E5u+pAZ+x8e2jQF6gM= +github.com/hashicorp/terraform-exec v0.3.0/go.mod h1:yKWvMPtkTaHpeAmllw+1qdHZ7E5u+pAZ+x8e2jQF6gM= +github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-json v0.6.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-plugin-sdk v1.0.0/go.mod h1:NuwtLpEpPsFaKJPJNGtMcn9vlhe6Ofe+Y6NqXhJgV2M= github.com/hashicorp/terraform-plugin-sdk v1.4.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= github.com/hashicorp/terraform-plugin-sdk v1.6.0/go.mod h1:H5QLx/uhwfxBZ59Bc5SqT19M4i+fYt7LZjHTpbLZiAg= github.com/hashicorp/terraform-plugin-sdk v1.7.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY= github.com/hashicorp/terraform-plugin-sdk v1.8.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY= +github.com/hashicorp/terraform-plugin-sdk v1.9.0/go.mod h1:C/AXwmDHqbc3h6URiHpIsVKrwV4PS0Sh0+VTaeEkShw= github.com/hashicorp/terraform-plugin-sdk v1.11.0/go.mod h1:HiWIPD/T9HixIhQUwaSoDQxo4BLFdmiBi/Qz5gjB8Q0= github.com/hashicorp/terraform-plugin-sdk v1.12.0/go.mod h1:HiWIPD/T9HixIhQUwaSoDQxo4BLFdmiBi/Qz5gjB8Q0= github.com/hashicorp/terraform-plugin-sdk v1.13.1/go.mod h1:HiWIPD/T9HixIhQUwaSoDQxo4BLFdmiBi/Qz5gjB8Q0= github.com/hashicorp/terraform-plugin-sdk v1.14.0/go.mod h1:t62Xy+m7Zjq5tA2vrs8Wuo/TQ0sc9Mx9MjXL3+7MHBQ= github.com/hashicorp/terraform-plugin-sdk v1.15.0/go.mod h1:PuFTln8urDmRM6mV0II6apOTsyG/iHkxp+5W11eJE58= +github.com/hashicorp/terraform-plugin-sdk v1.16.0/go.mod h1:5sVxrwW6/xzFhZyql+Q9zXCUEJaGWcBIxBbZFLpVXOI= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.0/go.mod h1:xOf85UtHJ0/9/EF3eKgZFlJ6feN8sDtjQRWRHhimCUw= github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= github.com/hashicorp/terraform-plugin-test v1.3.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= github.com/hashicorp/terraform-plugin-test v1.4.3/go.mod h1:UA7z/02pgqsRLut4DJIPm0Hjnj27uOvhi19c8kTqIfM= +github.com/hashicorp/terraform-plugin-test/v2 v2.0.0-20200724200815-faa9931ac59e/go.mod h1:C6VALgUlvaif+PnHyRGKWPTdQkMJK4NQ20VJolxZLI0= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.2/go.mod h1:jerO5mrd+jVNALy8aiq+VZOg/CR8T2T1QR3jd6JKGOI= +github.com/hashicorp/terraform-provider-google v1.20.1-0.20200824213103-e32ba28ec398/go.mod h1:qc51ZGlewTr4W9ho2SxvlPETQmDyeN/kC27b1mTQuQw= +github.com/hashicorp/terraform-provider-kubernetes v1.13.3/go.mod h1:XSLp2+OcV4wZQ6VhgHswDwz4LJwiwO1/vbJYKt+gqWg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= github.com/hashicorp/vault v1.3.0/go.mod h1:b06flBzBl5H4rWbHg/Hcbvos1vlklo50J05XqIS79Co= github.com/hashicorp/vault-plugin-auth-alicloud v0.5.2-0.20190814210027-93970f08f2ec/go.mod h1:TYFfVFgKF9x92T7uXouI9rLPkNnyXo/KkNcj5t+mjdM= @@ -960,6 +1082,7 @@ github.com/hashicorp/vault/sdk v0.1.14-0.20191112033314-390e96e22eb2/go.mod h1:P github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/helm/helm-2to3 v0.5.1/go.mod h1:AXFpQX2cSQpss+47ROPEeu7Sm4+CRJ1jKWCEQdHP3/c= github.com/heptio/velero v1.0.0 h1:5xFd2mieexakJiaxo5SgIAGXfgj+o+9QTIDm0vWpWVs= github.com/heptio/velero v1.0.0/go.mod h1:Q8aj4N9pmvDNp2hWmqWJ1Z1ybUjEI+iQOP3C9hx2njQ= @@ -972,12 +1095,16 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.0.0-20171009183408-7fe0c75c13ab/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/improbable-eng/thanos v0.3.2/go.mod h1:GZewVGILKuJVPNRn7L4Zw+7X96qzFOwj63b22xYGXBE= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v0.0.0-20190411212539-d24b7ba8c4c4/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= @@ -985,6 +1112,7 @@ github.com/influxdata/influxdb v1.7.7/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOpr github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jeffchao/backoff v0.0.0-20140404060208-9d7fd7aa17f2/go.mod h1:xkfESuHriIekR+4RoV+fu91j/CfnYM29Zi2tMFw5iD4= github.com/jefferai/isbadcipher v0.0.0-20190226160619-51d2077c035f/go.mod h1:3J2qVK16Lq8V+wfiL2lPeDZ7UWMxk5LemerHa1p6N00= github.com/jefferai/jsonx v1.0.0/go.mod h1:OGmqmi2tTeI/PS+qQfBDToLHHJIy/RMp24fPo8vFvoQ= @@ -995,8 +1123,11 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a h1:GmsqmapfzSJkm28dhRoHz2tLRbJmqhU86IPgBtN3mmk= github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= +github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s= github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3 h1:jNYPNLe3d8smommaoQlK7LOA5ESyUJJ+Wf79ZtA7Vp4= github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -1009,6 +1140,8 @@ github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9 github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/joyent/triton-go v0.0.0-20190112182421-51ffac552869/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -1021,6 +1154,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jsonnet-bundler/jsonnet-bundler v0.1.0/go.mod h1:YKsSFc9VFhhLITkJS3X2PrRqWG9u2Jq99udTdDjQLfM= github.com/jsonnet-bundler/jsonnet-bundler v0.2.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -1029,15 +1163,16 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20191119172530-79f836b90111/go.mod h1:MP2HbArq3QT+oVp8pmtHNZnSnkhdkHtDnc7h6nJXmBU= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/katbyte/terrafmt v0.2.1-0.20200303174203-e6a3e82cb21b/go.mod h1:WRq5tDmK04tcYbEr400zAUWtOK0jix54e8YeHP3IoQg= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/keybase/go-crypto v0.0.0-20190403132359-d65b6b94177f/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/keybase/go-crypto v0.0.0-20190828182435-a05457805304/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= +github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v0.0.0-20161130080628-0de1eaf82fa3/go.mod h1:jxZFDH7ILpTPQTk+E2s+z4CUas9lVNjIuKR4c5/zKgM= @@ -1045,6 +1180,8 @@ github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1055,20 +1192,23 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 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.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.0.0/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= 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/kshvakov/clickhouse v1.3.5/go.mod h1:DMzX7FxRymoNkVgizH0DWAL8Cur7wHLgx3MUnGwJqpE= +github.com/kubernetes-sigs/kube-storage-version-migrator v0.0.0-20191127225502-51849bc15f17/go.mod h1:enH0BVV+4+DAgWdwSlMefG8bBzTfVMTr1lApzdLZ/cc= github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/kyoh86/exportloopref v0.1.7 h1:u+iHuTbkbTS2D/JP7fCuZDo/t3rBVGo3Hf58Rc+lQVY= +github.com/kyoh86/exportloopref v0.1.7/go.mod h1:h1rDl2Kdj97+Kwh4gdz3ujE7XHmH51Q0lUiZ1z4NLj8= github.com/leanovate/gopter v0.2.4/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1098,6 +1238,8 @@ github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.2 h1:znVR8Q4g7/WlcvsxLBRWvo+vtFJUAbDn3w+Yak2xVMI= +github.com/magiconair/properties v1.8.2/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -1105,6 +1247,8 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maorfr/helm-plugin-utils v0.0.0-20200216074820-36d2fcf6ae86/go.mod h1:p3gwmRSFqbWw6plBpR0sKl3n3vpu8kX70gvCJKMvvCA= github.com/maratori/testpackage v1.0.1 h1:QtJ5ZjqapShm0w5DosRjg0PRlSdAdlx+W6cCKoALdbQ= github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= @@ -1116,14 +1260,20 @@ github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEb github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/masterzen/winrm v0.0.0-20190308153735-1d17eaf15943/go.mod h1:bsMsaiOA3CXjbJxW0a94G4PfPDj9zUmH5JoFuJ9P4o0= +github.com/masterzen/winrm v0.0.0-20200615185753-c42b5136ff88/go.mod h1:a2HXwefeat3evJHxFXSayvRHpYEPJYtErl4uIzfaUqY= github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb h1:RHba4YImhrUVQDHUCe2BNSOz4tVy2yGyXhvYDvxGgeE= github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matoous/godox v0.0.0-20200801072554-4fb83dc2941e h1:2U5rOmpaB96l35w+NDjMtmmrp2e6a6AJKoc4B5+7UwA= +github.com/matoous/godox v0.0.0-20200801072554-4fb83dc2941e/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20191113090002-7c0f6868bffe/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= @@ -1175,13 +1325,16 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= +github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -1191,6 +1344,8 @@ github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.0 h1:iDwIio/3gk2QtLLEsqU5lInaMzos0hDTz8a6lazSFVw= github.com/mitchellh/mapstructure v1.3.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/packer v1.3.2/go.mod h1:3TnGTkplC/koV8K6bCfCN1NB34Tye7lmUzo55/X5wqw= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= @@ -1200,6 +1355,8 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd h1:aY7OQNf2XqY/JQ6qREWamhI/81os/agb2BAGpcx5yWI= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2 h1:SPoLlS9qUUnXcIY4pvA4CTwYjk0Is5f4UPEkeESr53k= +github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ= 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= @@ -1211,6 +1368,7 @@ github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5 github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= github.com/mozilla/tls-observatory v0.0.0-20200220173314-aae45faa4006/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= +github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= github.com/mozillazg/go-cos v0.13.0/go.mod h1:Zp6DvvXn0RUOXGJ2chmWt2bLEqRAnJnS3DnAZsJsoaE= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -1231,6 +1389,9 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3/go.mod h1:FMugN9a6XOJm9mLFEV/+F4IJzdZmpLn/OaNRa8S/Ens= +github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0 h1:eMV1t2NQRc3r1k3guWiv/zEeqZZP6kPvpUfy6byfL1g= +github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= @@ -1243,7 +1404,6 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.4.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1253,9 +1413,12 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= +github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1265,6 +1428,8 @@ github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= +github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1275,23 +1440,30 @@ github.com/opencontainers/runc v0.0.0-20191031171055-b133feaeeb2e/go.mod h1:qT5X github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/openshift-metal3/terraform-provider-ironic v0.2.3/go.mod h1:ux2W6gsCIYsY/fX5N0V0ZgwFEBNN7P8g6RlH6ACi97k= +github.com/openshift-metal3/terraform-provider-ironic v0.2.4/go.mod h1:ux2W6gsCIYsY/fX5N0V0ZgwFEBNN7P8g6RlH6ACi97k= +github.com/openshift/api v0.0.0-20191219222812-2987a591a72c/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY= github.com/openshift/api v0.0.0-20200205133042-34f0ec8dab87/go.mod h1:fT6U/JfG8uZzemTRwZA2kBDJP5nWz7v05UHnty/D+pk= -github.com/openshift/api v0.0.0-20200320142426-0de0d539b0c3/go.mod h1:7k3+uZYOir97walbYUqApHUA2OPhkQpVJHt0n7GJ6P4= -github.com/openshift/api v0.0.0-20200323095748-e7041f8762a3/go.mod h1:7k3+uZYOir97walbYUqApHUA2OPhkQpVJHt0n7GJ6P4= +github.com/openshift/api v0.0.0-20200326152221-912866ddb162/go.mod h1:RKMJ5CBnljLfnej+BJ/xnOWc3kZDvJUaIAEq2oKSPtE= +github.com/openshift/api v0.0.0-20200424083944-0422dc17083e/go.mod h1:VnbEzX8SAaRj7Yfl836NykdQIlbEjfL6/CD+AaJQg5Q= github.com/openshift/api v0.0.0-20200827090112-c05698d102cf/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8= -github.com/openshift/api v3.9.1-0.20190517100836-d5b34b957e91+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY= +github.com/openshift/api v0.0.0-20200901182017-7ac89ba6b971/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8= +github.com/openshift/api v0.0.0-20201019163320-c6a5ec25f267/go.mod h1:RDvBcRQMGLa3aNuDuejVBbTEQj/2i14NXdpOLqbNBvM= github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible h1:AvJ2SgJ7ekSlEL/wyeVMffxDkbKohp4JLge9wMtT23o= github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY= github.com/openshift/baremetal-operator v0.0.0-20200715132148-0f91f62a41fe h1:bu99IMkaN6o/JcxpWEb1eT8gDdL9hLcwOmfiVIbXWj8= github.com/openshift/baremetal-operator v0.0.0-20200715132148-0f91f62a41fe/go.mod h1:DOgBIuBcXuTD8uub0jL7h6gBdIBt3CFrwz6K2FtfMBA= github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= +github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7 h1:mOq7Mg1Q9d7nIDxe1SJ6pluMBQsbVxa6olyAGmfYWTg= github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= -github.com/openshift/client-go v0.0.0-20190617165122-8892c0adc000/go.mod h1:6rzn+JTr7+WYS2E1TExP4gByoABxMznR6y2SnUIkmxk= +github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab h1:lBrojddP6C9C2p67EMs2vcdpC8eF+H0DDom+fgI2IF0= +github.com/openshift/build-machinery-go v0.0.0-20200917070002-f171684f77ab/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b/go.mod h1:6rzn+JTr7+WYS2E1TExP4gByoABxMznR6y2SnUIkmxk= -github.com/openshift/client-go v0.0.0-20200320150128-a906f3d8e723/go.mod h1:wNBSSt4RZTHhUWyhBE3gxTR32QpF9DB2SfS14u2IxuE= +github.com/openshift/client-go v0.0.0-20191125132246-f6563a70e19a/go.mod h1:6rzn+JTr7+WYS2E1TExP4gByoABxMznR6y2SnUIkmxk= +github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0/go.mod h1:uUQ4LClRO+fg5MF/P6QxjMCb1C9f7Oh4RKepftDnEJE= github.com/openshift/client-go v0.0.0-20200827190008-3062137373b5/go.mod h1:5rGmrkQ8DJEUXA+AR3rEjfH+HFyg4/apY9iCQFgvPfE= +github.com/openshift/client-go v0.0.0-20201020074620-f8fd44879f7c h1:NB9g4Y/aegId7fyNqYyGxEfyNOytYFT5dxWJtfOJFQs= +github.com/openshift/client-go v0.0.0-20201020074620-f8fd44879f7c/go.mod h1:yZ3u8vgWC19I9gbDMRk8//9JwG/0Sth6v7C+m6R8HXs= github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e h1:2gyl9UVyjHSWzdS56KUXxQwIhENbq2x2olqoMQSA/C8= github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e/go.mod h1:iPn+uhIe7nkP5BMHe2QnbLtg5m/AIQ1xvz9s3cig5ss= github.com/openshift/cluster-api v0.0.0-20190805113604-f8de78af80fc/go.mod h1:mNsD1dsD4T57kV4/C6zTHke/Ro166xgnyyRZqkamiEU= @@ -1299,32 +1471,43 @@ github.com/openshift/cluster-api v0.0.0-20191030113141-9a3a7bbe9258/go.mod h1:T1 github.com/openshift/cluster-api v0.0.0-20191129101638-b09907ac6668 h1:IDZyg/Kye98ptqpc9j9rzPjZJlijjEDe8g7TZ67CmLU= github.com/openshift/cluster-api v0.0.0-20191129101638-b09907ac6668/go.mod h1:T18COkr6nLh9RyZKPMP7YjnwBME7RX8P2ar1SQbBltM= github.com/openshift/cluster-api-actuator-pkg v0.0.0-20190614215203-42228d06a2ca/go.mod h1:KNPaA64x3Ok7z538kvS2acwC5fEwvPfF0RdTx2geQEE= -github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200506073438-9d49428ff837 h1:6qTilJ3hni/s6A/X7lyI7zGNNnMEzh0DzH6VBZzxprA= -github.com/openshift/cluster-api-provider-aws v0.2.1-0.20200506073438-9d49428ff837/go.mod h1:aXOt4gMtzXQxymPRm98vJAVmGjDhcTXsrQHauiNJK3o= -github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200120114645-8a9592f1f87b h1:xVFJ2MCv6QBBk49FEzMmdQF/21qr8x5UhW1NFqZ13oM= -github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20200120114645-8a9592f1f87b/go.mod h1:LPNjFna6F+ePHaXM/7QIyCF0sLsEtfuN16yY9sFZJ40= +github.com/openshift/cluster-api-provider-aws v0.2.1-0.20201022175424-d30c7a274820 h1:KcRhMsepLIShTZT3xVBPUWHfxckNfpPP068Pwpe3U8k= +github.com/openshift/cluster-api-provider-aws v0.2.1-0.20201022175424-d30c7a274820/go.mod h1:rDwmh/vpz6mUU/l9QLWeaoGpUeC+b3yyI34xnp3tIf8= +github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20201016155852-4090a6970205 h1:CIW1iJdHO6gz30wd+MPZAxrmCKfL/MsixgZeiSlDdRk= +github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20201016155852-4090a6970205/go.mod h1:oOG/TNSBse4brosfLCH/G2Q/42ye+DZQq8VslA5SxOs= github.com/openshift/cluster-api-provider-baremetal v0.0.0-20190821174549-a2a477909c1d/go.mod h1:S+wtA0Rm2FZ5ccC9zNQXUWUDesR6Jsdn5eb6HjAR+Gs= -github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200120152131-1b09fd9e7156 h1:FigvMhtTF7jCNkKvSwE3xP583ylW/CFcr0Jr6ZH698o= -github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200120152131-1b09fd9e7156/go.mod h1:KCyjaBfEkifs9bqV1HEXDJUyQylgeLSqiqt2QnMn7is= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200701112720-3a7d727c9a10/go.mod h1:wgkZrOlcIMWTzo8khB4Js2PoDJDlIUUdzCBm7BuDdqw= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200713133651-5c8a640669ac/go.mod h1:XVYX9JE339nKbDDa/W481XD+1GTeqeaBm8bDPr7WE7I= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20200901173901-9056dbc8c9b9/go.mod h1:rcwAydGZX+z4l91wtOdbq+fqDwuo6iu0YuFik3UUc+8= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201002065957-9854f7420570/go.mod h1:7NRECVE26rvP1/fs1CbhfY5gsgnnFQNhb9txTFzWmUw= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201027164920-70f2f92e64ab/go.mod h1:S38HjVtBmaX6PHq99updVereupkHcwcOEM5jq6rTILI= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201203141909-4dc702fd57a5 h1:75U75i/GfStAartlsP/F9v3Gv3MwzuLwqdLTjP1vPeE= +github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201203141909-4dc702fd57a5/go.mod h1:/XjFaKnqBc8K/jcRXHO7tau39CmzNinqmpxYaQGRvnE= +github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20201214114543-e5aed9c73f1f/go.mod h1:Moiq8vUJ4IdTaJBxIA756FFJ4GgVXZAiOds7lTpZ1kQ= github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603/go.mod h1:7pQ9Bzha+ug/5zd+0ufbDEcnn2OnNlPwRwYrzhXk4NM= -github.com/openshift/cluster-api-provider-openstack v0.0.0-20200526112135-319a35b2e38e h1:qDiAnW8lxrOqt3iiC1Ph1W+2E1s05OGO4NlIs4YIcOc= -github.com/openshift/cluster-api-provider-openstack v0.0.0-20200526112135-319a35b2e38e/go.mod h1:1DDDZ7uXsauiUvCDUxq6XmsToaTh9WipPoW1qASkL9c= +github.com/openshift/cluster-api-provider-openstack v0.0.0-20201116051540-155384b859c5 h1:zTVx8b/+aN2y3IAhM+lmqALLPVeDg5Cr+kKO63o4Odg= +github.com/openshift/cluster-api-provider-openstack v0.0.0-20201116051540-155384b859c5/go.mod h1:vhv3G5oWIev2paJytOa57cXUYdzEyVgoUMwU3uuOB7Y= github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20200504092944-27473ea1ae43 h1:JO7t5tJcLiE0gk7VrdzKrJAcOv73GirpUxH/OvrOVms= github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20200504092944-27473ea1ae43/go.mod h1:Vl/bvZulLw6PdUADIFWGfoTWH1O4L1B80eN7BtLYEuo= github.com/openshift/cluster-autoscaler-operator v0.0.0-20190521201101-62768a6ba480 h1:iIrMvq8qRMfmuhw/TVB4usRN/BlH2huBKgtrRjucOU4= github.com/openshift/cluster-autoscaler-operator v0.0.0-20190521201101-62768a6ba480/go.mod h1:/XmV44Fh28Vo3Ye93qFrxAbcFJ/Uy+7LPD+jGjmfJYc= -github.com/openshift/cluster-version-operator v3.11.1-0.20190629164025-08cac1c02538+incompatible/go.mod h1:0BbpR1mrN0F2ZRae5N1XHcytmkvVPaeKgSQwRRBWugc= +github.com/openshift/custom-resource-status v0.0.0-20190822192428-e62f2f3b79f3/go.mod h1:GDjWl0tX6FNIj82vIxeudWeSx2Ff6nDZ8uJn0ohUFvo= github.com/openshift/generic-admission-server v1.14.1-0.20200903115324-4ddcdd976480 h1:y47BAJFepK8Xls1c+quIOyc46OXiT9LRiqGVjIaMlSA= github.com/openshift/generic-admission-server v1.14.1-0.20200903115324-4ddcdd976480/go.mod h1:OAHL5WnZphlhVEf5fTdeGLvNwMu1B2zCWpmxJpCA35o= -github.com/openshift/installer v0.9.0-master.0.20201103204150-888dc5bab60c h1:RIr+cL9CN4uHYaUTHn+uNNB0gxPtfJSYSuKJxBhFn0k= -github.com/openshift/installer v0.9.0-master.0.20201103204150-888dc5bab60c/go.mod h1:FsTPqP4aUu5/bcxbtRyWFF7n/YXR/d/VRe7+hTNldGA= -github.com/openshift/library-go v0.0.0-20200918101923-1e4c94603efe h1:MJqGN0NVONnTLDYPVIEH4uo6i3gAK7LAkhLnyFO8Je0= -github.com/openshift/library-go v0.0.0-20200918101923-1e4c94603efe/go.mod h1:NI6xOQGuTnLXeHW8Z2glKSFhF7X+YxlAlqlBMaK0zEM= +github.com/openshift/installer v0.9.0-master.0.20210201172249-df32ad26dd6f h1:rGjLYHjRyFIg9ML2E6AaBzlJOHS+C+VeQyV+GzmF/ro= +github.com/openshift/installer v0.9.0-master.0.20210201172249-df32ad26dd6f/go.mod h1:VP/n+gtvbedYFkHkbGYYg0fbjAOMSoQLwgzpINtjN4c= +github.com/openshift/library-go v0.0.0-20200512120242-21a1ff978534/go.mod h1:2kWwXTkpoQJUN3jZ3QW88EIY1hdRMqxgRs2hheEW/pg= +github.com/openshift/library-go v0.0.0-20200909173121-1d055d971916/go.mod h1:6vwp+YhYOIlj8MpkQKkebTTSn2TuYyvgiAFQ206jIEQ= +github.com/openshift/library-go v0.0.0-20201109112824-093ad3cf6600 h1:BjzxCCiWcRwOq3LAKZxZWmY6wD85D5462KpG1p7zMRw= +github.com/openshift/library-go v0.0.0-20201109112824-093ad3cf6600/go.mod h1:1xYaYQcQsn+AyCRsvOU+Qn5z6GGiCmcblXkT/RZLVfo= github.com/openshift/machine-api-operator v0.0.0-20190312153711-9650e16c9880/go.mod h1:7HeAh0v04zQn1L+4ItUjvpBQYsm2Nf81WaZLiXTcnkc= -github.com/openshift/machine-api-operator v0.2.1-0.20191128180243-986b771e661d/go.mod h1:9qQPF00anuIsc6RiHYfHE0+cZZImbvFNLln0NRBVVMg= -github.com/openshift/machine-api-operator v0.2.1-0.20200402110321-4f3602b96da3/go.mod h1:46g2eLjzAcaNURYDvhGu0GhyjKzOlCPqixEo68lFBLs= -github.com/openshift/machine-api-operator v0.2.1-0.20200429102619-d36974451290 h1:0QnZvWW2X/4fCmIlOWsm3FmHZnsh2sCBfsQE/ujGhsw= -github.com/openshift/machine-api-operator v0.2.1-0.20200429102619-d36974451290/go.mod h1:QkhH+/6BXabl+4HmiLwx9/bmW1ieCGF9km7xz22Ozl0= +github.com/openshift/machine-api-operator v0.2.1-0.20200611014855-9a69f85c32dd/go.mod h1:6vMi+R3xqznBdq5rgeal9N3ak3sOpy50t0fdRCcQXjE= +github.com/openshift/machine-api-operator v0.2.1-0.20200701225707-950912b03628/go.mod h1:cxjy/RUzv5C2T5FNl1KKXUgtakWsezWQ642B/CD9VQA= +github.com/openshift/machine-api-operator v0.2.1-0.20200722104429-f4f9b84df9b7/go.mod h1:XDsNRAVEJtkI00e51SAZ/PnqNJl1zv0rHXSdl9L1oOY= +github.com/openshift/machine-api-operator v0.2.1-0.20200926044412-b7d860f8074c/go.mod h1:cp/wPVzxHZeLUjOLkNPNqrk4wyyW6HuHd3Kz9+hl5xw= +github.com/openshift/machine-api-operator v0.2.1-0.20201002104344-6abfb5440597/go.mod h1:+oAfoCl+TUd2TM79/6NdqLpFUHIJpmqkKdmiHe2O7mw= +github.com/openshift/machine-api-operator v0.2.1-0.20201111151924-77300d0c997a h1:luJTCno3mFZ1gGugbbVes1C0oquKP+67eY12kOi/jKM= +github.com/openshift/machine-api-operator v0.2.1-0.20201111151924-77300d0c997a/go.mod h1:XQN83eD5YoXEkla3di+exKIpLYx/ApLAOe0EE66Q+hw= github.com/openshift/machine-config-operator v0.0.0/go.mod h1:4IzikyGmUVQwlohScKeaAr5n2YzcWXkZvTMGGxDcU2Q= github.com/openshift/origin v0.0.0-20160503220234-8f127d736703/go.mod h1:0Rox5r9C8aQn6j1oAOQ0c1uC86mYbUFObzjBRvUKHII= github.com/openshift/prom-label-proxy v0.1.1-0.20191016113035-b8153a7f39f1/go.mod h1:p5MuxzsYP1JPsNGwtjtcgRHHlGziCJJfztff91nNixw= @@ -1335,7 +1518,6 @@ github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKw github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/operator-framework/api v0.1.1/go.mod h1:yzNYR7qyJqRGOOp+bT6Z/iYSbSPNxeh3Si93Gx/3OBY= github.com/operator-framework/operator-lifecycle-manager v0.0.0-20200321030439-57b580e57e88/go.mod h1:7Ut8p9jJ8C6RZyyhZfZypmlibCIJwK5Wcc+WZDgLkOA= @@ -1353,11 +1535,10 @@ github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776/go.mod h1:3HNVkVOU7vZ github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw= github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/ovirt/go-ovirt v0.0.0-20200313072907-d30f754823a6/go.mod h1:fLDxPk1Sf64DBYtwIYxrnx3gPZ1q0xPdWdI1y9vxUaw= github.com/ovirt/go-ovirt v0.0.0-20200428093010-9bcc4fd4e6c0/go.mod h1:fLDxPk1Sf64DBYtwIYxrnx3gPZ1q0xPdWdI1y9vxUaw= -github.com/ovirt/go-ovirt v0.0.0-20200613023950-320a86f9df27 h1:jHcZg49imi3zydtFqly5vniMnFX7HxW27L9M095eLhI= -github.com/ovirt/go-ovirt v0.0.0-20200613023950-320a86f9df27/go.mod h1:fLDxPk1Sf64DBYtwIYxrnx3gPZ1q0xPdWdI1y9vxUaw= -github.com/ovirt/terraform-provider-ovirt v0.4.3-0.20200914080915-c4444fb5c201/go.mod h1:XFDLN/srNA1s2Dq+gp4zBvql6nRnfNJzDGzI5vtK85g= +github.com/ovirt/go-ovirt v0.0.0-20210112072624-e4d3b104de71 h1:rMPlu5YNQomOQ9hXQDcYTfcmFy8rlYgeDJPPl1qgqz8= +github.com/ovirt/go-ovirt v0.0.0-20210112072624-e4d3b104de71/go.mod h1:fLDxPk1Sf64DBYtwIYxrnx3gPZ1q0xPdWdI1y9vxUaw= +github.com/ovirt/terraform-provider-ovirt v0.4.3-0.20210118101701-cc657a8c6634/go.mod h1:LDHfgu36xGyr0tUPZpL+a7HRovpRzlcNiu0CmPcxcUI= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= @@ -1371,14 +1552,16 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= +github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d h1:CdDQnGF8Nq9ocOS/xlSptM1N3BbrA6/kmaep5ggwaIA= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.2.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.3.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pin/tftp v2.1.0+incompatible/go.mod h1:xVpZOMCXTy+A5QMjEVN0Glwa1sUvaJhFXbr/aAxuxGY= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1457,7 +1640,13 @@ github.com/prometheus/prometheus v0.0.0-20180315085919-58e2a31db8de/go.mod h1:oA github.com/prometheus/prometheus v1.8.2-0.20200110114423-1e64d757f711/go.mod h1:7U90zPoLkWjEIQcy/rweQla82OCTUzxVHE51G3OhJbI= github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/tsdb v0.8.0/go.mod h1:fSI0j+IUQrDd7+ZtR9WKIGtoYAYAJUKcKhYLG25tN4g= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= +github.com/quasilyte/go-ruleguard v0.2.0 h1:UOVMyH2EKkxIfzrULvA9n/tO+HtEhqD9mrLSWMr5FwU= +github.com/quasilyte/go-ruleguard v0.2.0/go.mod h1:2RT/tf0Ce0UDj5y243iWKosQogJd8+1G3Rs2fxmlYnw= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/regex/syntax v0.0.0-20200805063351-8f842688393c h1:+gtJ/Pwj2dgUGlZgTrNFqajGYKZQc7Piqus/S6DK9CE= +github.com/quasilyte/regex/syntax v0.0.0-20200805063351-8f842688393c/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9/go.mod h1:L8WrssTzvgYw34/Ppa0JpJfI7KKXZ2cVGI6Djt0brUU= @@ -1470,6 +1659,9 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.5.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.6.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rubenv/sql-migrate v0.0.0-20191025130928-9355dd04f4b3/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= @@ -1477,6 +1669,10 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.0.4 h1:oCreMAt9GuFXDe9jW4HBpc3GjdX3R/sUEcLAGh1zPx8= github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE= +github.com/ryancurrah/gomodguard v1.1.0 h1:DWbye9KyMgytn8uYpuHkwf0RHqAYO6Ay/D0TbCpPtVU= +github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= +github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= +github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= @@ -1489,12 +1685,17 @@ github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0 github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/uuid v0.0.0-20160927100844-b061729afc07/go.mod h1:B8HLsPLik/YNn6KKWVMDJ8nzCL8RP5WyfsnmvnAEwIU= github.com/satori/uuid v1.2.0/go.mod h1:B8HLsPLik/YNn6KKWVMDJ8nzCL8RP5WyfsnmvnAEwIU= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd h1:qB+l4fYZsH78xORC1aqVS0zNmgkQp4rkj2rvfxQMtzc= github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd/go.mod h1:NurAFZsWJAEZjogSwdVPlHkOZB3DOAU7gsPP8VFZCHc= +github.com/securego/gosec/v2 v2.4.0 h1:ivAoWcY5DMs9n04Abc1VkqZBO0FL0h4ShTcVsC53lCE= +github.com/securego/gosec/v2 v2.4.0/go.mod h1:0/Q4cjmlFDfDUj1+Fib61sc+U5IQb2w+Iv9/C3wPVko= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= github.com/shirou/gopsutil v2.19.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -1547,11 +1748,16 @@ github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2 github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sonatard/noctx v0.0.1 h1:VC1Qhl6Oxx9vvWo3UDgrGXYCeKCe3Wbw7qAWL6FrmTY= +github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/go-diff v0.5.1 h1:gO6i5zugwzo1RVTvgvfwCOSVegNuvnNi6bAD1QCmkHs= github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= +github.com/sourcegraph/go-diff v0.6.0 h1:WbN9e/jD8ujU+o0vd9IFN5AEwtfB0rn/zM/AANaClqQ= +github.com/sourcegraph/go-diff v0.6.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1560,10 +1766,13 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.3.5 h1:AWZ/w4lcfxuh52NVL78p9Eh8j6r1mCTEGSRFBJyIHAE= +github.com/spf13/afero v1.3.5/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -1571,9 +1780,13 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= +github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -1586,15 +1799,19 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk= github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= -github.com/staebler/apiserver v0.19.1-0.20201005174924-a3ef0d1e45df h1:tOLmJyPkBiNtX5vm5bMRIsCwjEljkNeeoB0IBi5V6VU= -github.com/staebler/apiserver v0.19.1-0.20201005174924-a3ef0d1e45df/go.mod h1:XvzqavYj73931x7FLtyagh8WibHpePJ1QwWrSJs2CLk= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/ssgreg/nlreturn/v2 v2.1.0 h1:6/s4Rc49L6Uo6RLjhWZGBpWWjfzk2yrf1nIW8m4wgVA= +github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stoewer/go-strcase v1.0.2/go.mod h1:eLfe5bL3qbL7ep/KafHzthxejrOF5J3xmt03uL5tzek= -github.com/stoewer/go-strcase v1.1.0/go.mod h1:G7YglbHPK5jX3JcWljxVXRXPh90/dtxfy6xWqxu5b90= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= +github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -1611,9 +1828,11 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ= github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b h1:HxLVTlqcHhFAz3nWUcuvpH7WuOMv8LQoCWmruLfFH2U= +github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= -github.com/terraform-provider-openstack/terraform-provider-openstack v1.32.0/go.mod h1:Xm/accuOkyS8NkNp9HwqNMPu5rAFnHP7g/2uNRZbO8c= +github.com/terraform-provider-openstack/terraform-provider-openstack v1.33.0/go.mod h1:NA2Iaq+p8yIzeHAY9DHEedL/SqrT0AInYP9GTqVLe1k= github.com/terraform-providers/terraform-provider-azuread v0.9.0/go.mod h1:sSDzB/8CD639+yWo5lZf+NJvGSYQBSS6z+GoET9IrzE= github.com/terraform-providers/terraform-provider-google v1.20.1-0.20200623174414-27107f2ee160/go.mod h1:QxehqxV8Swl+O2JXJUdS6orHYJXWUEr4HFfYH5JV9ew= github.com/terraform-providers/terraform-provider-ignition v1.2.1/go.mod h1:tUlGVBhkz+z79iffnt7vKISS199MdPd85+l6SNpoS/s= @@ -1626,23 +1845,22 @@ github.com/terraform-providers/terraform-provider-template v1.0.0/go.mod h1:/J+B github.com/terraform-providers/terraform-provider-vsphere v1.16.2/go.mod h1:yTPDOvhy5A/PX5z/sKq0FthWz1m38QKRW+P+SJDYbeo= github.com/tetafro/godot v0.3.3 h1:uJjg8N+Ee10rAnaqJGet1WeI0YW4fiX9pKbwqnsqH6k= github.com/tetafro/godot v0.3.3/go.mod h1:pT6/T8+h6//L/LwQcFc4C0xpfy1euZwzS1sHdrFCms0= +github.com/tetafro/godot v0.4.8 h1:h61+hQraWhdI6WYqMwAwZYCE5yxL6a9/Orw4REbabSU= +github.com/tetafro/godot v0.4.8/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= github.com/thanos-io/thanos v0.11.0/go.mod h1:N/Yes7J68KqvmY+xM6J5CJqEvWIvKSR5sqGtmuD6wDc= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q= github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 h1:ig99OeTyDwQWhPe2iw9lwfQVF1KB3Q4fpP3X7/2VBG8= +github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tombuildsstuff/giovanni v0.10.0/go.mod h1:WwPhFP2+WnhJzvPYDnsyBab2wOIksMX6xm+Tg+jVvKw= -github.com/tombuildsstuff/go-autorest v14.0.1-0.20200416184303-d4e299a3c04a+incompatible h1:9645FYqYopS+TFknygW7EC9PCbIC5T4WvWUpktyE2JA= -github.com/tombuildsstuff/go-autorest v14.0.1-0.20200416184303-d4e299a3c04a+incompatible/go.mod h1:OVwh0+NZeL2RTqclVEX+p20Qys7Ihpd52PD0eqFDXtY= -github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200416184303-d4e299a3c04a h1:F/4zKpn8ra3rhPMBzrVc7LYL1GB1ucl/va4I+4ubUWg= -github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200416184303-d4e299a3c04a/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/tombuildsstuff/go-autorest/autorest/azure/auth v0.4.3-0.20200416184303-d4e299a3c04a h1:vf5kIgZ4D0DtEpUmUsHyggbtWZgfeDhD2xA7NY8yzlo= -github.com/tombuildsstuff/go-autorest/autorest/azure/auth v0.4.3-0.20200416184303-d4e299a3c04a/go.mod h1:jyL63IJfcs2j+2n9xmyFz6yUnXex+c/ZfelxDwSbkdc= +github.com/tombuildsstuff/giovanni v0.12.0/go.mod h1:qJ5dpiYWkRsuOSXO8wHbee7+wElkLNfWVolcf59N84E= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa h1:RC4maTWLKKwb7p1cnoygsbKIgNlJqSYBeAFON3Ar8As= github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -1653,12 +1871,12 @@ github.com/ugorji/go v1.1.2/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43/go.mod h1:iT03XoTwV7xq/+UGwKO3UbC1nNNlopQiY61beSdrtOA= -github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ultraware/funlen v0.0.1/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/funlen v0.0.2 h1:Av96YVBwwNSe4MLR7iI/BIa3VyI7/djnto/pK3Uxbdo= github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= +github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= github.com/ultraware/whitespace v0.0.4 h1:If7Va4cM03mpgrNH9k49/VOicWpGoG70XPBFFODYDsg= github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -1667,8 +1885,10 @@ github.com/uudashr/gocognit v1.0.1 h1:MoG2fZ0b/Eo7NXoIwCVFLG5JED3qgQz5/NEE+rOsjP github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= +github.com/valyala/fasthttp v1.15.1/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= github.com/valyala/quicktemplate v1.1.1/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= +github.com/valyala/quicktemplate v1.6.2/go.mod h1:mtEJpQtUiBV0SHhMX6RtiJtqxncgrfmjcUy5T68X8TM= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9CvnvxyvZy6I1MrG/U= @@ -1678,6 +1898,8 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17 github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmware/govmomi v0.22.1/go.mod h1:Y+Wq4lst78L85Ge/F8+ORXIWiKYqaro1vhAulACy9Lc= github.com/vmware/govmomi v0.22.2 h1:hmLv4f+RMTTseqtJRijjOWzwELiaLMIoHv2D6H3bF4I= github.com/vmware/govmomi v0.22.2/go.mod h1:Y+Wq4lst78L85Ge/F8+ORXIWiKYqaro1vhAulACy9Lc= @@ -1702,6 +1924,8 @@ github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6Ut github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -1711,7 +1935,10 @@ github.com/zclconf/go-cty v1.1.1/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= +github.com/zclconf/go-cty v1.5.1/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= +github.com/zclconf/go-cty v1.6.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= go.elastic.co/apm v1.5.0/go.mod h1:OdB9sPtM6Vt7oz3VXt7+KR96i9li74qrxBGHTQygFvk= @@ -1731,7 +1958,6 @@ go.mongodb.org/mongo-driver v1.1.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1740,17 +1966,23 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU= +go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= @@ -1775,6 +2007,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1787,17 +2020,20 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1811,13 +2047,9 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -1836,19 +2068,18 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/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-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1864,7 +2095,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1876,6 +2106,7 @@ golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/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-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1890,11 +2121,23 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1907,6 +2150,8 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= 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= @@ -1916,11 +2161,12 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1929,9 +2175,7 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/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-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1948,6 +2192,7 @@ golang.org/x/sys v0.0.0-20190426135247-a129542de9ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1968,6 +2213,7 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190927073244-c990c680b611/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1975,7 +2221,6 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1997,44 +2242,56 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200409092240-59c9f1ba88fa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201202213521-69691e467435 h1:25AvDqqB9PrNqj1FLf2/70I4W0L19qqoaFq3gjNwbKk= +golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20171227012246-e19ae1496984/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20170915040203-e531a2a1c15f/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/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-20190118193359-16909d206f00/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190121143147-24cd39ecf745/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -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-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2043,11 +2300,9 @@ golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425222832-ad9eeb80039a/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -2064,12 +2319,14 @@ golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190918214516-5a1a30219888/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190930201159-7c411dea38b0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191030203535-5e247c9ad0a0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191111182352-50fa39b762bc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2081,6 +2338,7 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2093,56 +2351,53 @@ golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200228224639-71482053b885/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200327195553-82bb89366a1e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200409170454-77362c5149f0/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200430192856-2840dafb9ee1/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616195046-dc31b401abb5 h1:UaoXseXAWUJUcuJ2E2oczJdLxAJXL0lOmVaBl7kuk+I= golang.org/x/tools v0.0.0-20200616195046-dc31b401abb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200701041122-1837592efa10/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200721032237-77f530d86f9a/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200817023811-d00afeaade8f/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200827163409-021d7c6f1ec3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200911153331-7ad463ce66dd/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201020123448-f5c826d1900e/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201202200335-bef1c476418a h1:TYqOq/v+Ri5aADpldxXOj6PmvcPMOJbLjdALzZDQT2M= +golang.org/x/tools v0.0.0-20201202200335-bef1c476418a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v3 v3.0.1/go.mod h1:CBhndykehEwTOlEfnsfJwvkFQbSN8YZFr9M+cIHAJto= gomodules.xyz/orderedmap v0.1.0/go.mod h1:g9/TPUCm1t2gwD3j3zfV8uylyYhVdCNSi+xCEIu7yTU= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/gonum v0.0.0-20190915125329-975d99cd20a9/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= -google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU= -google.golang.org/api v0.3.0/go.mod h1:IuvZyQh8jgscv8qWfQ4ABd8m7hEudgBFM/EdhA3BnXw= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.21.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.23.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.25.0 h1:LodzhlzZEUfhXzNUMIfVlf9Gr6Ua5MMtoFWh7+f47qA= google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -2152,74 +2407,12 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.4/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180608181217-32ee49c4dd80/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190513181449-d00d292a067c/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191203220235-3fa9dbf08042/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200409111301-baae70f3302d/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200507105951-43844f6eee31/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -2232,6 +2425,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/AlecAivazis/survey.v1 v1.8.9-0.20200217094205-6773bdf39b7f h1:AQkMzsSzHWrgZWqGRpuRaRPDmyNibcXlpGcnQJ7HxZw= gopkg.in/AlecAivazis/survey.v1 v1.8.9-0.20200217094205-6773bdf39b7f/go.mod h1:CaHjv79TCgAvXMSFJSVgonHXYWxnhzI3eoHtnX5UgUo= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= @@ -2258,6 +2453,8 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= +gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= @@ -2272,7 +2469,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.0.0/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.1.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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= @@ -2283,6 +2479,8 @@ gopkg.in/yaml.v2 v2.2.7/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 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966 h1:B0J02caTR6tpSJozBJyiAzT6CtBzjclw4pgm9gg8Ys0= gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -2290,29 +2488,30 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= helm.sh/helm/v3 v3.1.0/go.mod h1:WYsFJuMASa/4XUqLyv54s0U/f3mlAaRErGmyy4z921g= helm.sh/helm/v3 v3.1.2/go.mod h1:WYsFJuMASa/4XUqLyv54s0U/f3mlAaRErGmyy4z921g= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= +honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= +k8s.io/api v0.0.0-20181115043458-b799cb063522/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190409092523-d687e77c8ae9/go.mod h1:FQEUn50aaytlU65qqBn/w+5ugllHwrBzKm7DzbnXdzE= k8s.io/api v0.0.0-20190620084959-7cf5895f2711/go.mod h1:TBhBqb1AWbBQbW3XRusr7n7E4v2+5ZY8r8sAMnyFC5A= +k8s.io/api v0.0.0-20190725062911-6607c48751ae/go.mod h1:1O0xzX/RAtnm7l+5VEUxZ1ysO2ghatfq/OZED4zM9kA= k8s.io/api v0.0.0-20190813020757-36bff7324fb7/go.mod h1:3Iy+myeAORNCLgjd/Xu9ebwN7Vh59Bw0vh9jhoX+V58= k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= -k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2/go.mod h1:AOxZTnaXR/xiarlQL0JUfwQPxjmKDvVYoRp58cA7lUo= -k8s.io/api v0.0.0-20191003000013-35e20aa79eb8/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.0.0-20191115095533-47f6de673b26/go.mod h1:iA/8arsvelvo4IDqIhX4IbjTEKBGgvsf2OraTuRtLFU= -k8s.io/api v0.0.0-20191121015604-11707872ac1c/go.mod h1:R/s4gKT0V/cWEnbQa9taNRJNbWUK57/Dx6cPj6MD3A0= +k8s.io/api v0.16.4/go.mod h1:AtzMnsR45tccQss5q8RnF+W8L81DH6XwXwo/joEx9u0= k8s.io/api v0.16.7/go.mod h1:oUAiGRgo4t+5yqcxjOu5LoHT3wJ8JSbgczkaFYS5L7I= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= k8s.io/api v0.17.1/go.mod h1:zxiAc5y8Ngn4fmhWUtSxuUlkfz1ixT7j9wESokELzOg= @@ -2326,29 +2525,39 @@ k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= k8s.io/api v0.19.0 h1:XyrFIJqTYZJ2DU7FBE/bSPz7b1HvbVBuBf07oeo6eTc= k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= +k8s.io/api v0.19.1/go.mod h1:+u/k4/K/7vp4vsfdT7dyl8Oxk1F26Md4g5F26Tu85PU= +k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= +k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= +k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= +k8s.io/api v0.19.5 h1:p0MRzyhokJ9Kn5jcJAHNup0s+COMBPfn1mTasls6mMg= +k8s.io/api v0.19.5/go.mod h1:yGZReuNa0vj56op6eT+NLrXJne0R0u9ktexZ8jdJzpc= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= -k8s.io/apiextensions-apiserver v0.0.0-20190918201827-3de75813f604/go.mod h1:7H8sjDlWQu89yWB3FhZfsLyRCRLuoXoCoY5qtwW1q6I= -k8s.io/apiextensions-apiserver v0.0.0-20191121021419-88daf26ec3b8/go.mod h1:NMIy5Wa/or8CsLhYRleOp9CWAHVdcWpzT6Ufx1SNVjA= +k8s.io/apiextensions-apiserver v0.16.4/go.mod h1:HYQwjujEkXmQNhap2C9YDdIVOSskGZ3et0Mvjcyjbto= k8s.io/apiextensions-apiserver v0.16.7/go.mod h1:6xYRp4trGp6eT5WZ6tPi/TB2nfWQCzwUvBlpg8iswe0= k8s.io/apiextensions-apiserver v0.17.0/go.mod h1:XiIFUakZywkUl54fVXa7QTEHcqQz9HG55nHd1DCoHj8= k8s.io/apiextensions-apiserver v0.17.2/go.mod h1:4KdMpjkEjjDI2pPfBA15OscyNldHWdBCfsWMDWAmSTs= k8s.io/apiextensions-apiserver v0.17.3/go.mod h1:CJbCyMfkKftAd/X/V6OTHYhVn7zXnDdnkUjS1h0GTeY= k8s.io/apiextensions-apiserver v0.17.4/go.mod h1:rCbbbaFS/s3Qau3/1HbPlHblrWpFivoaLYccCffvQGI= k8s.io/apiextensions-apiserver v0.18.0-beta.2/go.mod h1:Hnrg5jx8/PbxRbUoqDGxtQkULjwx8FDW4WYJaKNK+fk= -k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= k8s.io/apiextensions-apiserver v0.19.0 h1:jlY13lvZp+0p9fRX2khHFdiT9PYzT7zUrANz6R1NKtY= k8s.io/apiextensions-apiserver v0.19.0/go.mod h1:znfQxNpjqz/ZehvbfMg5N6fvBJW5Lqu5HVLTJQdP4Fs= +k8s.io/apiextensions-apiserver v0.19.2/go.mod h1:EYNjpqIAvNZe+svXVx9j4uBaVhTB4C94HkY3w058qcg= +k8s.io/apiextensions-apiserver v0.19.4 h1:D9ak9T012tb3vcGFWYmbQuj9SCC8YM4zhA4XZqsAQC4= +k8s.io/apiextensions-apiserver v0.19.4/go.mod h1:B9rpH/nu4JBCtuUp3zTTk8DEjZUupZTBEec7/2zNRYw= +k8s.io/apiextensions-apiserver v0.19.5 h1:LMlydaZH8UXo8Qi86IFXSQHdjb13uij7D6D+OubX5MU= +k8s.io/apiextensions-apiserver v0.19.5/go.mod h1:7jrSIYOYk22PnQv03LJrcSBS0WA0v1WsGJzd0Gv3BiQ= +k8s.io/apimachinery v0.0.0-20181110190943-2a7c93004028/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190409092423-760d1845f48b/go.mod h1:FW86P8YXVLsbuplGMZeb20J3jYHscrDqw4jELaFJvRU= k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719/go.mod h1:I4A+glKBHiTgiEjQiCCQfCAIcIMFGt291SmsvcrFzJA= +k8s.io/apimachinery v0.0.0-20190719140911-bfcf53abc9f8/go.mod h1:sBJWIJZfxLhp7mRsRyuAE/NfKTr3kXGR1iaqg8O0gJo= k8s.io/apimachinery v0.0.0-20190809020650-423f5d784010/go.mod h1:Waf/xTS2FGRrgXCkO5FP3XxTOWh0qLf2QhL1qFZZ/R8= -k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d/go.mod h1:3jediapYqJ2w1BFw7lAZPCx7scubsTfosqHkhXCWJKw= k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= k8s.io/apimachinery v0.0.0-20191115015347-3c7067801da2/go.mod h1:dXFS2zaQR8fyzuvRdJDHw2Aerij/yVGJSre0bZQSVJA= -k8s.io/apimachinery v0.0.0-20191121015412-41065c7a8c2a/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.16.4/go.mod h1:llRdnznGEAqC3DcNm6yEj472xaFVfLM7hnYofMb12tQ= k8s.io/apimachinery v0.16.7/go.mod h1:Xk2vD2TRRpuWYLQNM6lT9R7DSFZUYG03SarNkbGrnKE= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.1/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= @@ -2362,6 +2571,28 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.19.0 h1:gjKnAda/HZp5k4xQYjL0K/Yb66IvNqjthCb03QlKpaQ= k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apimachinery v0.19.1/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= +k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apimachinery v0.19.5 h1:Yvz6dOE0WbVE+FXBEFqc9lSvo87VPtq6mCSsrtC95HI= +k8s.io/apimachinery v0.19.5/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= +k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= +k8s.io/apiserver v0.16.4/go.mod h1:kbLJOak655g6W7C+muqu1F76u9wnEycfKMqbVaXIdAc= +k8s.io/apiserver v0.16.7/go.mod h1:/5zSatF30/L9zYfMTl55jzzOnx7r/gGv5a5wtRp8yAw= +k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= +k8s.io/apiserver v0.17.2/go.mod h1:lBmw/TtQdtxvrTk0e2cgtOxHizXI+d0mmGQURIHQZlo= +k8s.io/apiserver v0.17.3/go.mod h1:iJtsPpu1ZpEnHaNawpSV0nYTGBhhX2dUlnn7/QS7QiY= +k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I= +k8s.io/apiserver v0.18.0-beta.2/go.mod h1:bnblMkMoCFnIfVnVftd0SXJPzyvrk3RtaqSbblphF/A= +k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= +k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= +k8s.io/apiserver v0.19.0/go.mod h1:XvzqavYj73931x7FLtyagh8WibHpePJ1QwWrSJs2CLk= +k8s.io/apiserver v0.19.1/go.mod h1:iRxYIjA0X2XEyoW8KslN4gDhasfH4bWcjj6ckVeZX28= +k8s.io/apiserver v0.19.2/go.mod h1:FreAq0bJ2vtZFj9Ago/X0oNGC51GfubKK/ViOKfVAOA= +k8s.io/apiserver v0.19.4/go.mod h1:X8WRHCR1UGZDd7HpV0QDc1h/6VbbpAeAGyxSh8yzZXw= +k8s.io/apiserver v0.19.5 h1:RPvpOQn+U54XYt1H4/5q+03yFlsGh/w1DJl1vos/+L4= +k8s.io/apiserver v0.19.5/go.mod h1:CDH8gHbC/y1nhkkN9NTZ2Nr29BNA0OWCJDP0QcKwsuE= k8s.io/autoscaler v0.0.0-20190607113959-1b4f1855cb8e/go.mod h1:QEXezc9uKPT91dwqhSJq3GNI3B1HxFRQHiku9kmrsSA= k8s.io/cli-runtime v0.17.2/go.mod h1:aa8t9ziyQdbkuizkNLAw3qe3srSyWh9zlSB7zTqRNPI= k8s.io/cli-runtime v0.17.3/go.mod h1:X7idckYphH4SZflgNpOOViSxetiMj6xI0viMAjM81TA= @@ -2369,15 +2600,20 @@ k8s.io/cli-runtime v0.17.4/go.mod h1:IVW4zrKKx/8gBgNNkhiUIc7nZbVVNhc1+HcQh+PiNHc k8s.io/cli-runtime v0.18.0-rc.1/go.mod h1:yuKZYDG8raONmwjwIkT77lCfIuPwX+Bsp88MKYf1TlU= k8s.io/cli-runtime v0.19.0 h1:wLe+osHSqcItyS3MYQXVyGFa54fppORVA8Jn7DBGSWw= k8s.io/cli-runtime v0.19.0/go.mod h1:tun9l0eUklT8IHIM0jors17KmUjcrAxn0myoBYwuNuo= -k8s.io/client-go v0.19.0 h1:1+0E0zfWFIWeyRhQYWzimJOyAk2UT7TiARaLNwJCf7k= -k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= +k8s.io/cli-runtime v0.19.1 h1:OXC7ssdUQZ6LnHGWD16cMXECr8gKMrO5EPe3zhm211Q= +k8s.io/cli-runtime v0.19.1/go.mod h1:X6g8e4NBiG8GMsKewXsRpo36MO6xrvXa+0wCg7zO4aU= +k8s.io/cli-runtime v0.19.5 h1:MN7E+63URo9RQ4E40UMdz7j5L8Z7SEZJK1ftQzYxRVw= +k8s.io/cli-runtime v0.19.5/go.mod h1:42qB9sZHBH2RSxDhZWfM1uQ+IidymO6XQgPeFbnJYGA= +k8s.io/client-go v0.19.5 h1:Y7LsFwgbm9+5oVXER04KNCSPhY6TblYRgG1DQdVq+ig= +k8s.io/client-go v0.19.5/go.mod h1:BSG3iuxI40Bs0nNDLS1JRa/7ReBQDHzf0x8nZZrK0fo= k8s.io/cluster-bootstrap v0.0.0-20190202014938-c9acc0c1bea2/go.mod h1:iBSm2nwo3OaiuW8VDvc3ySDXK5SKfUrxwPvBloKG7zg= k8s.io/cluster-registry v0.0.6 h1:zSzuBlDybN72jty3veddOALhWyzeXfF80u8NZg3FMFM= k8s.io/cluster-registry v0.0.6/go.mod h1:/F+o1rvzjBdLbg782rR8eKrOb20hPy7us+Zu/pjBtAY= -k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b/go.mod h1:G8bQwmHm2eafm5bgtX67XDZQ8CWKSGu9DekI+yN4Y5I= +k8s.io/code-generator v0.0.0-20181114232248-ae218e241252/go.mod h1:IPqxl/YHk05nodzupwjke6ctMjyNRdV2zZ5/j3/F204= +k8s.io/code-generator v0.0.0-20190717022600-77f3a1fe56bb/go.mod h1:cDx5jQmWH25Ff74daM7NVYty9JWw9dvIS9zT9eIubCY= k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= k8s.io/code-generator v0.0.0-20191003035328-700b1226c0bd/go.mod h1:HC9p4y3SBN+txSs8x57qmNPXFZ/CxdCHiDTNnocCSEw= -k8s.io/code-generator v0.0.0-20191121015212-c4c8f8345c7e/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= +k8s.io/code-generator v0.16.4/go.mod h1:mJUgkl06XV4kstAnLHAIzJPVCOzVR+ZcfPIv4fUsFCY= k8s.io/code-generator v0.16.7/go.mod h1:wFdrXdVi/UC+xIfLi+4l9elsTT/uEF61IfcN2wOLULQ= k8s.io/code-generator v0.17.0/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= k8s.io/code-generator v0.17.1/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= @@ -2391,9 +2627,14 @@ k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRV k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.19.0 h1:r0BxYnttP/r8uyKd4+Njg0B57kKi8wLvwEzaaVy3iZ8= k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/code-generator v0.19.1/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/code-generator v0.19.4 h1:c8IL7RgTgJaYgr2bYMgjN0WikHnohbBhEgajfIkuP5I= +k8s.io/code-generator v0.19.4/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/code-generator v0.19.5 h1:0Mc1t7C2nzY4hvUZvrJHdR6rs5RR9zQZ2m+30be9hWI= +k8s.io/code-generator v0.19.5/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= -k8s.io/component-base v0.0.0-20190918200425-ed2f0867c778/go.mod h1:DFWQCXgXVLiWtzFaS17KxHdlUeUymP7FLxZSkmL9/jU= -k8s.io/component-base v0.0.0-20191121020327-771114ba3383/go.mod h1:tv9ITs6VEFWkF+kHwY4GiFvDr9vUGKJ4X/8+Z+oqVLk= +k8s.io/component-base v0.16.4/go.mod h1:GYQ+4hlkEwdlpAp59Ztc4gYuFhdoZqiAJD1unYDJ3FM= k8s.io/component-base v0.16.7/go.mod h1:ikdyfezOFMu5O0qJjy/Y9eXwj+fV3pVwdmt0ulVcIR0= k8s.io/component-base v0.17.0/go.mod h1:rKuRAokNMY2nn2A6LP/MiwpoaMRHpfRnrPaUJJj1Yoc= k8s.io/component-base v0.17.2/go.mod h1:zMPW3g5aH7cHJpKYQ/ZsGMcgbsA/VyhEugF3QT1awLs= @@ -2401,12 +2642,17 @@ k8s.io/component-base v0.17.3/go.mod h1:GeQf4BrgelWm64PXkIXiPh/XS0hnO42d9gx9BtbZ k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE= k8s.io/component-base v0.18.0-beta.2/go.mod h1:HVk5FpRnyzQ/MjBr9//e/yEBjTVa2qjGXCTuUzcD7ks= k8s.io/component-base v0.18.0-rc.1/go.mod h1:NNlRaxZEdLqTs2+6yXiU2SHl8gKsbcy19Ii+Sfq53RM= -k8s.io/component-base v0.18.0/go.mod h1:u3BCg0z1uskkzrnAKFzulmYaEpZF7XC9Pf/uFyb1v2c= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= k8s.io/component-base v0.19.0 h1:OueXf1q3RW7NlLlUCj2Dimwt7E1ys6ZqRnq53l2YuoE= k8s.io/component-base v0.19.0/go.mod h1:dKsY8BxkA+9dZIAh2aWJLL/UdASFDNtGYTCItL4LM7Y= -k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/component-base v0.19.1/go.mod h1:b0vDKYa8EdJJ8dHUA6fGPj4z8taqGks5mfZvp3p/jVo= +k8s.io/component-base v0.19.2/go.mod h1:g5LrsiTiabMLZ40AR6Hl45f088DevyGY+cCE2agEIVo= +k8s.io/component-base v0.19.4 h1:HobPRToQ8KJ9ubRju6PUAk9I5V1GNMJZ4PyWbiWA0uI= +k8s.io/component-base v0.19.4/go.mod h1:ZzuSLlsWhajIDEkKF73j64Gz/5o0AgON08FgRbEPI70= +k8s.io/component-base v0.19.5 h1:/euhsImY7iqkp+qDXljxBl5ZQAxJrLMNixpstjFzc3c= +k8s.io/component-base v0.19.5/go.mod h1:5N/uv5A7fyr0d+t/b1HynXKkUVPEhc8ljkMaBJv4Tp8= +k8s.io/gengo v0.0.0-20181106084056-51747d6e00da/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190907103519-ebc107f98eab/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -2428,13 +2674,20 @@ 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.3.0 h1:WmkrnW7fdrm0/DMClc+HIxtftvxVIPAhlVwMQo5yLco= k8s.io/klog/v2 v2.3.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-aggregator v0.0.0-20190404125450-f5e124c822d6/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU= +k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= +k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/kube-aggregator v0.17.3/go.mod h1:1dMwMFQbmH76RKF0614L7dNenMl3dwnUJuOOyZ3GMXA= k8s.io/kube-aggregator v0.18.0-beta.2/go.mod h1:O3Td9mheraINbLHH4pzoFP2gRzG0Wk1COqzdSL4rBPk= -k8s.io/kube-aggregator v0.18.0-rc.1/go.mod h1:35N7x/aAF8C5rEU78J+3pJ/k9v/8LypeWbzqBAEWA1I= +k8s.io/kube-aggregator v0.18.2/go.mod h1:ijq6FnNUoKinA6kKbkN6svdTacSoQVNtKqmQ1+XJEYQ= k8s.io/kube-aggregator v0.19.0 h1:rL4fsftMaqkKjaibArYDaBeqN41CHaJzgRJjUB9IrIg= k8s.io/kube-aggregator v0.19.0/go.mod h1:1Ln45PQggFAG8xOqWPIYMxUq8WNtpPnYsbUJ39DpF/A= +k8s.io/kube-aggregator v0.19.1 h1:Kx3Er84xvY8JFcjXywift0RTNjYPHckj9T7Ku4dVQ5k= +k8s.io/kube-aggregator v0.19.1/go.mod h1:oAj1kWeSDCh7sdzUOs6XXPn/jbzJY+yGGxDd0QyLJC8= +k8s.io/kube-aggregator v0.19.2/go.mod h1:wVsjy6OTeUrWkgG9WVsGftnjpm8JIY0vJV7LH2j4nhM= +k8s.io/kube-aggregator v0.19.5 h1:ym0AT77gdE8VdPg1QXBprRWxo3vkNz0eRvQvHYxDX8c= +k8s.io/kube-aggregator v0.19.5/go.mod h1:G35Y9+weAjwYlq555iaMZGPNzh00Zkbe3XkiMkyGHpE= k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190320154901-5e45bb682580/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= @@ -2444,6 +2697,8 @@ k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/kube-openapi v0.0.0-20200831175022-64514a1d5d59 h1:hlbT1c/UQK1Zf9lsxemrM7C/WnIPwGHgFUgpkVraHcs= +k8s.io/kube-openapi v0.0.0-20200831175022-64514a1d5d59/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-state-metrics v1.7.2/go.mod h1:U2Y6DRi07sS85rmVPmBFlmv+2peBcL8IWGjM+IjYA/E= k8s.io/kubectl v0.17.2/go.mod h1:y4rfLV0n6aPmvbRCqZQjvOp3ezxsFgpqL+zF5jH/lxk= k8s.io/kubectl v0.17.3/go.mod h1:NUn4IBY7f7yCMwSop2HCXlw/MVYP4HJBiUmOR3n9w28= @@ -2451,13 +2706,18 @@ k8s.io/kubectl v0.17.4/go.mod h1:im5QWmh6fvtmJkkNm4HToLe8z9aM3jihYK5X/wOybcY= k8s.io/kubectl v0.18.0-rc.1/go.mod h1:UpG1w7klD633nyMS73/29cNl2tMdEbXU0nWupttyha4= k8s.io/kubectl v0.19.0 h1:t9uxaZzGvqc2jY96mjnPSjFHtaKOxoUegeGZdaGT6aw= k8s.io/kubectl v0.19.0/go.mod h1:gPCjjsmE6unJzgaUNXIFGZGafiUp5jh0If3F/x7/rRg= +k8s.io/kubectl v0.19.1 h1:6HJboel+8auKqmYODpg8pd03BmusJrljHMVDzIIU8DU= +k8s.io/kubectl v0.19.1/go.mod h1:jZM7qucrDpQu05OAoSJk0yRRHRZNydya40dILYh8ODc= +k8s.io/kubectl v0.19.5 h1:7wbl0uRRxHZhi9u/YrxA7JwTBWWX9BVHMUsWU16Pwio= +k8s.io/kubectl v0.19.5/go.mod h1:Z3jbjhOehIE9IWbMIvkNKtX2QBYlKdR5gYbXYrGv7io= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/metrics v0.17.2/go.mod h1:3TkNHET4ROd+NfzNxkjoVfQ0Ob4iZnaHmSEA4vYpwLw= k8s.io/metrics v0.17.3/go.mod h1:HEJGy1fhHOjHggW9rMDBJBD3YuGroH3Y1pnIRw9FFaI= k8s.io/metrics v0.17.4/go.mod h1:6rylW2iD3M9VppnEAAtJASY1XS8Pt9tcYh+tHxBeV3I= k8s.io/metrics v0.18.0-rc.1/go.mod h1:ME3EkXCyiZ7mVFEiAYKBfuo3JkpgggeATG+DBUQby5o= k8s.io/metrics v0.19.0/go.mod h1:WykpW8B60OeAJx1imdwUgyOID2kDljr/Q+1zrPJ98Wo= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= +k8s.io/metrics v0.19.1/go.mod h1:O/ONCgXDITtJuMveKEDwZSfiqHOiMZTWmyLe/p1BoAA= +k8s.io/metrics v0.19.5/go.mod h1:Hq1ts35vUHWODMpG+ojJuD8jVvX0w8+D7GyEtDOIDrU= k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20190529001817-6999998975a7/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= @@ -2468,15 +2728,25 @@ k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20200229041039-0a110f9eb7ab/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200327001022-6496210b90e8/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200411171748-3d5a2fe318e4/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20200821003339-5e75c0163111/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +kubevirt.io/client-go v0.29.0/go.mod h1:JY7hQq+SUT0aLvleXrW/+28fDfZ6BPe4E6f8FyC8jkY= +kubevirt.io/containerized-data-importer v1.10.6/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= +kubevirt.io/containerized-data-importer v1.10.9/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= layeh.com/radius v0.0.0-20190322222518-890bc1058917/go.mod h1:fywZKyu//X7iRzaxLgPWsvc0L26IUpVvE/aeIL2JtIQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +mvdan.cc/gofumpt v0.0.0-20200709182408-4fd085cb6d5f/go.mod h1:9VQ397fNXEnF84t90W4r4TRCQK+pg9f8ugVfyj+S26w= +mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ= +mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d/go.mod h1:bzrjFmaD6+xqohD3KYP0H2FEuxknnBmyyOxdhLdaIws= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= @@ -2484,43 +2754,45 @@ mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jC mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY= mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f h1:Cq7MalBHYACRd6EesksG1Q8EoIAKOsiZviGKbOLIej4= mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= +mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7 h1:kAREL6MPwpsk1/PQPFD3Eg7WAQR5mPTWZJaBiG5LDbY= +mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9 h1:rusRLrDhjBp6aYtl9sGEvQJr6faoHoDLd0YcUBTZguI= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0= sigs.k8s.io/controller-runtime v0.0.0-20190520212815-96b67f231945/go.mod h1:TSH2R0nSz4WAlUUlNnOFcOR/VUhfwBLlmtq2X6AiQCA= sigs.k8s.io/controller-runtime v0.2.0-beta.2/go.mod h1:TSH2R0nSz4WAlUUlNnOFcOR/VUhfwBLlmtq2X6AiQCA= sigs.k8s.io/controller-runtime v0.2.0/go.mod h1:ZHqrRDZi3f6BzONcvlUxkqCKgwasGk5FZrnSv9TVZF4= -sigs.k8s.io/controller-runtime v0.3.1-0.20191016212439-2df793d02076/go.mod h1:p2vzQ3RuSVv9YR4AcM0y8TKHQA+0oLXazKFt6Z0OdS8= -sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= -sigs.k8s.io/controller-runtime v0.5.1-0.20200330174416-a11a908d91e0/go.mod h1:j4echH3Y/UPHRpXS65rxGXujda8iWOheMQvDh1uNgaY= sigs.k8s.io/controller-runtime v0.5.2/go.mod h1:JZUwSMVbxDupo0lTJSSFP5pimEyxGynROImSsqIOx1A= +sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA= sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= sigs.k8s.io/controller-tools v0.2.2-0.20190919191502-76a25b63325a/go.mod h1:8SNGuj163x/sMwydREj7ld5mIMJu1cDanIfnx6xsU70= -sigs.k8s.io/controller-tools v0.2.2-0.20190930215132-4752ed2de7d2/go.mod h1:8SNGuj163x/sMwydREj7ld5mIMJu1cDanIfnx6xsU70= sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= sigs.k8s.io/controller-tools v0.2.8/go.mod h1:9VKHPszmf2DHz/QmHkcfZoewO6BL7pPs9uAiBVsaJSE= -sigs.k8s.io/controller-tools v0.2.9-0.20200331153640-3c5446d407dd/go.mod h1:D2LzYpGDYjxaAALDVYAwaqaKp2fNuyO5yfOBoU/cbBE= sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= -sigs.k8s.io/controller-tools v0.3.1-0.20200617211605-651903477185/go.mod h1:JuPG+FXjAeZL7eGmTuXUJduEMlI2/kGqb0rUGlVi+Yo= -sigs.k8s.io/controller-tools v0.4.0 h1:9zIdrc6q9RKke8+DnVPVBVZ+cfF9L0TwM01cxNnklYo= -sigs.k8s.io/controller-tools v0.4.0/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU= +sigs.k8s.io/controller-tools v0.4.1 h1:VkuV0MxlRPmRu5iTgBZU4UxUX2LiR99n3sdQGRxZF4w= +sigs.k8s.io/controller-tools v0.4.1/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU= sigs.k8s.io/kube-storage-version-migrator v0.0.3/go.mod h1:mXfSLkx9xbJHQsgNDDUZK/iQTs2tMbx/hsJlWe6Fthw= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca h1:6dsH6AYQWbyZmtttJNe8Gq1cXOeS1BdV3eW37zHilAQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/structured-merge-diff v1.0.1/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= +sigs.k8s.io/structured-merge-diff v1.0.2 h1:WiMoyniAVAYm03w+ImfF9IE2G23GLR/SwDnQyaNZvPk= +sigs.k8s.io/structured-merge-diff v1.0.2/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= -sigs.k8s.io/testing_frameworks v0.1.2/go.mod h1:ToQrwSC3s8Xf/lADdZp3Mktcql9CG0UAmdJG9th5i0w= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/clusterresource/openstack.go b/pkg/clusterresource/openstack.go index 31588db0cf0..9f38adb7946 100644 --- a/pkg/clusterresource/openstack.go +++ b/pkg/clusterresource/openstack.go @@ -80,10 +80,10 @@ func (p *OpenStackCloudBuilder) addMachinePoolPlatform(o *Builder, mp *hivev1.Ma func (p *OpenStackCloudBuilder) addInstallConfigPlatform(o *Builder, ic *installertypes.InstallConfig) { ic.Platform = installertypes.Platform{ OpenStack: &installeropenstack.Platform{ - Cloud: p.Cloud, - ExternalNetwork: p.ExternalNetwork, - FlavorName: p.ComputeFlavor, - APIFloatingIP: p.APIFloatingIP, + Cloud: p.Cloud, + ExternalNetwork: p.ExternalNetwork, + DeprecatedFlavorName: p.ComputeFlavor, + APIFloatingIP: p.APIFloatingIP, }, } diff --git a/pkg/controller/hibernation/csr_helper.go b/pkg/controller/hibernation/csr_helper.go index d3854f7ceb4..1c1667ec8cc 100644 --- a/pkg/controller/hibernation/csr_helper.go +++ b/pkg/controller/hibernation/csr_helper.go @@ -6,7 +6,7 @@ import ( certsv1beta1 "k8s.io/api/certificates/v1beta1" kubeclient "k8s.io/client-go/kubernetes" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" ) //go:generate mockgen -source=./csr_helper.go -destination=./mock/csr_helper_generated.go -package=mock diff --git a/pkg/controller/hibernation/csr_utility.go b/pkg/controller/hibernation/csr_utility.go index 011f3c47ace..8e50179b736 100644 --- a/pkg/controller/hibernation/csr_utility.go +++ b/pkg/controller/hibernation/csr_utility.go @@ -8,7 +8,7 @@ import ( "reflect" "strings" - "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/controller/hibernation/hibernation_controller.go b/pkg/controller/hibernation/hibernation_controller.go index 7e66bb2c389..8a827bd60d6 100644 --- a/pkg/controller/hibernation/hibernation_controller.go +++ b/pkg/controller/hibernation/hibernation_controller.go @@ -23,7 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" hiveintv1alpha1 "github.com/openshift/hive/pkg/apis/hiveinternal/v1alpha1" diff --git a/pkg/controller/hibernation/hibernation_controller_test.go b/pkg/controller/hibernation/hibernation_controller_test.go index 676bb5091e6..736ced4b66e 100644 --- a/pkg/controller/hibernation/hibernation_controller_test.go +++ b/pkg/controller/hibernation/hibernation_controller_test.go @@ -22,7 +22,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" hiveintv1alpha1 "github.com/openshift/hive/pkg/apis/hiveinternal/v1alpha1" diff --git a/pkg/controller/hibernation/mock/csr_helper_generated.go b/pkg/controller/hibernation/mock/csr_helper_generated.go index dc0edf0bca9..39302330967 100644 --- a/pkg/controller/hibernation/mock/csr_helper_generated.go +++ b/pkg/controller/hibernation/mock/csr_helper_generated.go @@ -7,7 +7,7 @@ package mock import ( x509 "crypto/x509" gomock "github.com/golang/mock/gomock" - v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" v1beta10 "k8s.io/api/certificates/v1beta1" kubernetes "k8s.io/client-go/kubernetes" reflect "reflect" diff --git a/pkg/controller/remotemachineset/actuator.go b/pkg/controller/remotemachineset/actuator.go index 226f4a487ac..278682f6b96 100644 --- a/pkg/controller/remotemachineset/actuator.go +++ b/pkg/controller/remotemachineset/actuator.go @@ -3,7 +3,7 @@ package remotemachineset import ( log "github.com/sirupsen/logrus" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" ) diff --git a/pkg/controller/remotemachineset/awsactuator.go b/pkg/controller/remotemachineset/awsactuator.go index 47ff2dced1b..e7c4b5be44e 100644 --- a/pkg/controller/remotemachineset/awsactuator.go +++ b/pkg/controller/remotemachineset/awsactuator.go @@ -20,9 +20,9 @@ import ( awsproviderv1beta1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" installaws "github.com/openshift/installer/pkg/asset/machines/aws" installertypesaws "github.com/openshift/installer/pkg/types/aws" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" "github.com/openshift/hive/pkg/awsclient" diff --git a/pkg/controller/remotemachineset/awsactuator_test.go b/pkg/controller/remotemachineset/awsactuator_test.go index 5621ae43731..388f7a59402 100644 --- a/pkg/controller/remotemachineset/awsactuator_test.go +++ b/pkg/controller/remotemachineset/awsactuator_test.go @@ -22,7 +22,7 @@ import ( awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/openshift/hive/pkg/apis" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" diff --git a/pkg/controller/remotemachineset/azureactuator.go b/pkg/controller/remotemachineset/azureactuator.go index 3302867f4bb..a4e3356c281 100644 --- a/pkg/controller/remotemachineset/azureactuator.go +++ b/pkg/controller/remotemachineset/azureactuator.go @@ -7,7 +7,7 @@ import ( "time" "github.com/Azure/go-autorest/autorest/to" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/pkg/errors" log "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" diff --git a/pkg/controller/remotemachineset/azureactuator_test.go b/pkg/controller/remotemachineset/azureactuator_test.go index 1536bff3bdb..a0e2fe5467c 100644 --- a/pkg/controller/remotemachineset/azureactuator_test.go +++ b/pkg/controller/remotemachineset/azureactuator_test.go @@ -11,7 +11,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" azureprovider "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" diff --git a/pkg/controller/remotemachineset/gcpactuator.go b/pkg/controller/remotemachineset/gcpactuator.go index 892f04f13aa..2438f53814b 100644 --- a/pkg/controller/remotemachineset/gcpactuator.go +++ b/pkg/controller/remotemachineset/gcpactuator.go @@ -20,10 +20,10 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" installgcp "github.com/openshift/installer/pkg/asset/machines/gcp" installertypes "github.com/openshift/installer/pkg/types" installertypesgcp "github.com/openshift/installer/pkg/types/gcp" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" "github.com/openshift/hive/pkg/constants" diff --git a/pkg/controller/remotemachineset/gcpactuator_test.go b/pkg/controller/remotemachineset/gcpactuator_test.go index ad016b97eb5..a2cdc2a5e8f 100644 --- a/pkg/controller/remotemachineset/gcpactuator_test.go +++ b/pkg/controller/remotemachineset/gcpactuator_test.go @@ -18,7 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" gcpprovider "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/openshift/hive/pkg/apis" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" diff --git a/pkg/controller/remotemachineset/mock/actuator_generated.go b/pkg/controller/remotemachineset/mock/actuator_generated.go index 3cdec745dcf..e7b19e569f5 100644 --- a/pkg/controller/remotemachineset/mock/actuator_generated.go +++ b/pkg/controller/remotemachineset/mock/actuator_generated.go @@ -6,8 +6,8 @@ package mock import ( gomock "github.com/golang/mock/gomock" - v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" v1 "github.com/openshift/hive/pkg/apis/hive/v1" + v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" logrus "github.com/sirupsen/logrus" reflect "reflect" ) diff --git a/pkg/controller/remotemachineset/openstackactuator.go b/pkg/controller/remotemachineset/openstackactuator.go index c471f33e7db..03e087009b5 100644 --- a/pkg/controller/remotemachineset/openstackactuator.go +++ b/pkg/controller/remotemachineset/openstackactuator.go @@ -18,10 +18,10 @@ import ( openstackproviderv1alpha1 "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" installosp "github.com/openshift/installer/pkg/asset/machines/openstack" installertypes "github.com/openshift/installer/pkg/types" installertypesosp "github.com/openshift/installer/pkg/types/openstack" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" "github.com/openshift/hive/pkg/constants" @@ -132,7 +132,6 @@ func (a *OpenStackActuator) GenerateMachineSets(cd *hivev1.ClusterDeployment, po a.osImage, workerRole, workerUserDataName, - clientOptions, ) if err != nil { return nil, false, errors.Wrap(err, "failed to generate machinesets") diff --git a/pkg/controller/remotemachineset/openstackactuator_test.go b/pkg/controller/remotemachineset/openstackactuator_test.go index fbfacecb66d..08645542a8e 100644 --- a/pkg/controller/remotemachineset/openstackactuator_test.go +++ b/pkg/controller/remotemachineset/openstackactuator_test.go @@ -12,7 +12,7 @@ import ( corev1 "k8s.io/api/core/v1" ospprovider "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" hivev1osp "github.com/openshift/hive/pkg/apis/hive/v1/openstack" diff --git a/pkg/controller/remotemachineset/ovirt.go b/pkg/controller/remotemachineset/ovirt.go index 7dcc8f3a777..5e6ac0bd178 100644 --- a/pkg/controller/remotemachineset/ovirt.go +++ b/pkg/controller/remotemachineset/ovirt.go @@ -11,10 +11,10 @@ import ( ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" ovirtproviderv1beta1 "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" installovirt "github.com/openshift/installer/pkg/asset/machines/ovirt" installertypes "github.com/openshift/installer/pkg/types" installertypesovirt "github.com/openshift/installer/pkg/types/ovirt" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" ) diff --git a/pkg/controller/remotemachineset/ovirt_test.go b/pkg/controller/remotemachineset/ovirt_test.go index f7713761679..28f7ebfb4d5 100644 --- a/pkg/controller/remotemachineset/ovirt_test.go +++ b/pkg/controller/remotemachineset/ovirt_test.go @@ -12,7 +12,7 @@ import ( corev1 "k8s.io/api/core/v1" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" hivev1ovirt "github.com/openshift/hive/pkg/apis/hive/v1/ovirt" diff --git a/pkg/controller/remotemachineset/remotemachineset_controller.go b/pkg/controller/remotemachineset/remotemachineset_controller.go index b3c7f975876..70cac38fd66 100644 --- a/pkg/controller/remotemachineset/remotemachineset_controller.go +++ b/pkg/controller/remotemachineset/remotemachineset_controller.go @@ -21,11 +21,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" autoscalingv1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1" autoscalingv1beta1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1beta1" installertypes "github.com/openshift/installer/pkg/types" "github.com/openshift/library-go/pkg/operator/resource/resourcemerge" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" "github.com/openshift/hive/pkg/constants" diff --git a/pkg/controller/remotemachineset/remotemachineset_controller_test.go b/pkg/controller/remotemachineset/remotemachineset_controller_test.go index 22312da308d..e8c9b1aac0c 100644 --- a/pkg/controller/remotemachineset/remotemachineset_controller_test.go +++ b/pkg/controller/remotemachineset/remotemachineset_controller_test.go @@ -26,9 +26,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" autoscalingv1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1" autoscalingv1beta1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/openshift/hive/pkg/apis" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" @@ -816,7 +816,7 @@ func testMachineSpec(machineType string) machineapi.MachineSpec { log.WithError(err).Fatal("error encoding AWS machine provider spec") } return machineapi.MachineSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: machineapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-cluster": testInfraID, "machine.openshift.io/cluster-api-machine-role": machineType, diff --git a/pkg/controller/remotemachineset/vsphereactuator.go b/pkg/controller/remotemachineset/vsphereactuator.go index 3fd34bad853..2158cb33dd3 100644 --- a/pkg/controller/remotemachineset/vsphereactuator.go +++ b/pkg/controller/remotemachineset/vsphereactuator.go @@ -9,10 +9,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" installvsphere "github.com/openshift/installer/pkg/asset/machines/vsphere" installertypes "github.com/openshift/installer/pkg/types" installertypesvsphere "github.com/openshift/installer/pkg/types/vsphere" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" vsphereprovider "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider" vsphereproviderv1beta1 "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" diff --git a/pkg/controller/remotemachineset/vsphereactuator_test.go b/pkg/controller/remotemachineset/vsphereactuator_test.go index 38291440fd3..f06f3c3dc80 100644 --- a/pkg/controller/remotemachineset/vsphereactuator_test.go +++ b/pkg/controller/remotemachineset/vsphereactuator_test.go @@ -11,7 +11,7 @@ import ( corev1 "k8s.io/api/core/v1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" vsphereprovider "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" diff --git a/pkg/remoteclient/remoteclient.go b/pkg/remoteclient/remoteclient.go index b4c97b6dce4..e51d7067138 100644 --- a/pkg/remoteclient/remoteclient.go +++ b/pkg/remoteclient/remoteclient.go @@ -19,9 +19,9 @@ import ( openshiftapiv1 "github.com/openshift/api/config/v1" routev1 "github.com/openshift/api/route/v1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" autoscalingv1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1" autoscalingv1beta1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" "github.com/openshift/hive/pkg/constants" diff --git a/test/e2e/common/machine.go b/test/e2e/common/machine.go index 223399c2160..b6998eab1ec 100644 --- a/test/e2e/common/machine.go +++ b/test/e2e/common/machine.go @@ -7,12 +7,13 @@ import ( log "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" clientcache "k8s.io/client-go/tools/cache" "sigs.k8s.io/controller-runtime/pkg/cache" - machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machinev1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" ) func WaitForMachines(cfg *rest.Config, testFunc func([]*machinev1.Machine) bool, timeOut time.Duration) error { @@ -20,7 +21,8 @@ func WaitForMachines(cfg *rest.Config, testFunc func([]*machinev1.Machine) bool, logger.Infof("Waiting for Machine") stop := make(chan struct{}) done := make(chan struct{}) - scheme, err := machinev1.SchemeBuilder.Build() + scheme := runtime.NewScheme() + err := machinev1.SchemeBuilder.AddToScheme(scheme) if err != nil { return err } diff --git a/test/e2e/common/machineset.go b/test/e2e/common/machineset.go index 96778ec6584..211faee17f3 100644 --- a/test/e2e/common/machineset.go +++ b/test/e2e/common/machineset.go @@ -7,12 +7,13 @@ import ( log "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" clientcache "k8s.io/client-go/tools/cache" "sigs.k8s.io/controller-runtime/pkg/cache" - machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machinev1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" ) func WaitForMachineSets(cfg *rest.Config, testFunc func([]*machinev1.MachineSet) bool, timeOut time.Duration) error { @@ -20,7 +21,8 @@ func WaitForMachineSets(cfg *rest.Config, testFunc func([]*machinev1.MachineSet) logger.Infof("Waiting for MachineSet") stop := make(chan struct{}) done := make(chan struct{}) - scheme, err := machinev1.SchemeBuilder.Build() + scheme := runtime.NewScheme() + err := machinev1.SchemeBuilder.AddToScheme(scheme) if err != nil { return err } diff --git a/test/e2e/postinstall/machinesets/infra_test.go b/test/e2e/postinstall/machinesets/infra_test.go index 534ea4f61b7..d57f5dfdb5f 100644 --- a/test/e2e/postinstall/machinesets/infra_test.go +++ b/test/e2e/postinstall/machinesets/infra_test.go @@ -20,8 +20,8 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" autoscalingv1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1" + machinev1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" hivev1 "github.com/openshift/hive/pkg/apis/hive/v1" hivev1aws "github.com/openshift/hive/pkg/apis/hive/v1/aws" diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go index 1a7a4c7e57b..545bd9d379c 100644 --- a/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ b/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -140,7 +140,7 @@ func testOnGCE() bool { }() go func() { - addrs, err := net.LookupHost("metadata.google.internal") + addrs, err := net.DefaultResolver.LookupHost(ctx, "metadata.google.internal") if err != nil || len(addrs) == 0 { resc <- false return @@ -296,6 +296,7 @@ func (c *Client) getETag(suffix string) (value, etag string, err error) { // being stable anyway. host = metadataIP } + suffix = strings.TrimLeft(suffix, "/") u := "http://" + host + "/computeMetadata/v1/" + suffix req, err := http.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go index 3db159a879f..196610acdd9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go @@ -113,7 +113,6 @@ func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*h func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Resp func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Respons func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,6 +301,9 @@ func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -339,7 +339,6 @@ func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Respon func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -453,7 +452,6 @@ func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -463,7 +461,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp // ListBySubscription lists all availability sets in a subscription. // Parameters: -// expand - the expand expression to apply to the operation. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") @@ -493,6 +491,9 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, exp if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -530,7 +531,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -646,7 +646,6 @@ func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Resp func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go index 0d0f705daba..92208281f44 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go @@ -146,7 +146,6 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -225,7 +224,6 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -302,7 +300,6 @@ func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Respon func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -341,6 +338,9 @@ func (client ContainerServicesClient) List(ctx context.Context) (result Containe if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -375,7 +375,6 @@ func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Respo func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -454,6 +453,9 @@ func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, r if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -489,7 +491,6 @@ func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Reques func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go index a3b9d96017f..9a38365c577 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go @@ -137,7 +137,6 @@ func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksC func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -215,7 +214,6 @@ func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFut func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -292,7 +290,6 @@ func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -379,7 +376,6 @@ func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGran func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +413,9 @@ func (client DisksClient) List(ctx context.Context) (result DiskListPage, err er if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -451,7 +450,6 @@ func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -528,6 +526,9 @@ func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -563,7 +564,6 @@ func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Re func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -678,7 +678,6 @@ func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRev func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -758,7 +757,6 @@ func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFut func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/enums.go new file mode 100644 index 00000000000..93b13fac844 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/enums.go @@ -0,0 +1,1159 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessLevel enumerates the values for access level. +type AccessLevel string + +const ( + // None ... + None AccessLevel = "None" + // Read ... + Read AccessLevel = "Read" +) + +// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. +func PossibleAccessLevelValues() []AccessLevel { + return []AccessLevel{None, Read} +} + +// AggregatedReplicationState enumerates the values for aggregated replication state. +type AggregatedReplicationState string + +const ( + // Completed ... + Completed AggregatedReplicationState = "Completed" + // Failed ... + Failed AggregatedReplicationState = "Failed" + // InProgress ... + InProgress AggregatedReplicationState = "InProgress" + // Unknown ... + Unknown AggregatedReplicationState = "Unknown" +) + +// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. +func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { + return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} +} + +// AvailabilitySetSkuTypes enumerates the values for availability set sku types. +type AvailabilitySetSkuTypes string + +const ( + // Aligned ... + Aligned AvailabilitySetSkuTypes = "Aligned" + // Classic ... + Classic AvailabilitySetSkuTypes = "Classic" +) + +// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. +func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { + return []AvailabilitySetSkuTypes{Aligned, Classic} +} + +// CachingTypes enumerates the values for caching types. +type CachingTypes string + +const ( + // CachingTypesNone ... + CachingTypesNone CachingTypes = "None" + // CachingTypesReadOnly ... + CachingTypesReadOnly CachingTypes = "ReadOnly" + // CachingTypesReadWrite ... + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. +func PossibleCachingTypesValues() []CachingTypes { + return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} +} + +// ComponentNames enumerates the values for component names. +type ComponentNames string + +const ( + // MicrosoftWindowsShellSetup ... + MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. +func PossibleComponentNamesValues() []ComponentNames { + return []ComponentNames{MicrosoftWindowsShellSetup} +} + +// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. +type ContainerServiceOrchestratorTypes string + +const ( + // Custom ... + Custom ContainerServiceOrchestratorTypes = "Custom" + // DCOS ... + DCOS ContainerServiceOrchestratorTypes = "DCOS" + // Kubernetes ... + Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm ContainerServiceOrchestratorTypes = "Swarm" +) + +// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. +func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { + return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} +} + +// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. +type ContainerServiceVMSizeTypes string + +const ( + // StandardA0 ... + StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" + // StandardA1 ... + StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" + // StandardA10 ... + StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" + // StandardA11 ... + StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" + // StandardA2 ... + StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" + // StandardA3 ... + StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" + // StandardA4 ... + StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" + // StandardA5 ... + StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" + // StandardA6 ... + StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" + // StandardA7 ... + StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" + // StandardA8 ... + StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" + // StandardA9 ... + StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" + // StandardD1 ... + StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" + // StandardD11 ... + StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" + // StandardD11V2 ... + StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" + // StandardD12 ... + StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" + // StandardD12V2 ... + StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" + // StandardD13 ... + StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" + // StandardD13V2 ... + StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" + // StandardD14 ... + StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" + // StandardD14V2 ... + StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" + // StandardD1V2 ... + StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" + // StandardD2 ... + StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" + // StandardD2V2 ... + StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" + // StandardD3 ... + StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" + // StandardD3V2 ... + StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" + // StandardD4 ... + StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" + // StandardD4V2 ... + StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" + // StandardD5V2 ... + StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" + // StandardDS1 ... + StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" + // StandardDS11 ... + StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" + // StandardDS12 ... + StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" + // StandardDS13 ... + StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" + // StandardDS14 ... + StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" + // StandardDS2 ... + StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" + // StandardDS3 ... + StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" + // StandardDS4 ... + StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" + // StandardG1 ... + StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" + // StandardG2 ... + StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" + // StandardG3 ... + StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" + // StandardG4 ... + StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" + // StandardG5 ... + StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" + // StandardGS1 ... + StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" + // StandardGS2 ... + StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" + // StandardGS3 ... + StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" + // StandardGS4 ... + StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" + // StandardGS5 ... + StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" +) + +// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. +func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { + return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} +} + +// DiffDiskOptions enumerates the values for diff disk options. +type DiffDiskOptions string + +const ( + // Local ... + Local DiffDiskOptions = "Local" +) + +// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. +func PossibleDiffDiskOptionsValues() []DiffDiskOptions { + return []DiffDiskOptions{Local} +} + +// DiskCreateOption enumerates the values for disk create option. +type DiskCreateOption string + +const ( + // Attach ... + Attach DiskCreateOption = "Attach" + // Copy ... + Copy DiskCreateOption = "Copy" + // Empty ... + Empty DiskCreateOption = "Empty" + // FromImage ... + FromImage DiskCreateOption = "FromImage" + // Import ... + Import DiskCreateOption = "Import" + // Restore ... + Restore DiskCreateOption = "Restore" +) + +// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. +func PossibleDiskCreateOptionValues() []DiskCreateOption { + return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore} +} + +// DiskCreateOptionTypes enumerates the values for disk create option types. +type DiskCreateOptionTypes string + +const ( + // DiskCreateOptionTypesAttach ... + DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" + // DiskCreateOptionTypesEmpty ... + DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" + // DiskCreateOptionTypesFromImage ... + DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" +) + +// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. +func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { + return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} +} + +// DiskStorageAccountTypes enumerates the values for disk storage account types. +type DiskStorageAccountTypes string + +const ( + // PremiumLRS ... + PremiumLRS DiskStorageAccountTypes = "Premium_LRS" + // StandardLRS ... + StandardLRS DiskStorageAccountTypes = "Standard_LRS" + // StandardSSDLRS ... + StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" + // UltraSSDLRS ... + UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. +func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { + return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} +} + +// HostCaching enumerates the values for host caching. +type HostCaching string + +const ( + // HostCachingNone ... + HostCachingNone HostCaching = "None" + // HostCachingReadOnly ... + HostCachingReadOnly HostCaching = "ReadOnly" + // HostCachingReadWrite ... + HostCachingReadWrite HostCaching = "ReadWrite" +) + +// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. +func PossibleHostCachingValues() []HostCaching { + return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} +} + +// InstanceViewTypes enumerates the values for instance view types. +type InstanceViewTypes string + +const ( + // InstanceView ... + InstanceView InstanceViewTypes = "instanceView" +) + +// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{InstanceView} +} + +// IntervalInMins enumerates the values for interval in mins. +type IntervalInMins string + +const ( + // FiveMins ... + FiveMins IntervalInMins = "FiveMins" + // SixtyMins ... + SixtyMins IntervalInMins = "SixtyMins" + // ThirtyMins ... + ThirtyMins IntervalInMins = "ThirtyMins" + // ThreeMins ... + ThreeMins IntervalInMins = "ThreeMins" +) + +// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. +func PossibleIntervalInMinsValues() []IntervalInMins { + return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} +} + +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPv4 ... + IPv4 IPVersion = "IPv4" + // IPv6 ... + IPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + +// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. +type MaintenanceOperationResultCodeTypes string + +const ( + // MaintenanceOperationResultCodeTypesMaintenanceAborted ... + MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" + // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... + MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" + // MaintenanceOperationResultCodeTypesNone ... + MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" + // MaintenanceOperationResultCodeTypesRetryLater ... + MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" +) + +// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. +func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { + return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} +} + +// OperatingSystemStateTypes enumerates the values for operating system state types. +type OperatingSystemStateTypes string + +const ( + // Generalized ... + Generalized OperatingSystemStateTypes = "Generalized" + // Specialized ... + Specialized OperatingSystemStateTypes = "Specialized" +) + +// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. +func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { + return []OperatingSystemStateTypes{Generalized, Specialized} +} + +// OperatingSystemTypes enumerates the values for operating system types. +type OperatingSystemTypes string + +const ( + // Linux ... + Linux OperatingSystemTypes = "Linux" + // Windows ... + Windows OperatingSystemTypes = "Windows" +) + +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{Linux, Windows} +} + +// PassNames enumerates the values for pass names. +type PassNames string + +const ( + // OobeSystem ... + OobeSystem PassNames = "OobeSystem" +) + +// PossiblePassNamesValues returns an array of possible values for the PassNames const type. +func PossiblePassNamesValues() []PassNames { + return []PassNames{OobeSystem} +} + +// ProtocolTypes enumerates the values for protocol types. +type ProtocolTypes string + +const ( + // HTTP ... + HTTP ProtocolTypes = "Http" + // HTTPS ... + HTTPS ProtocolTypes = "Https" +) + +// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. +func PossibleProtocolTypesValues() []ProtocolTypes { + return []ProtocolTypes{HTTP, HTTPS} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateMigrating ... + ProvisioningStateMigrating ProvisioningState = "Migrating" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// ProvisioningState1 enumerates the values for provisioning state 1. +type ProvisioningState1 string + +const ( + // ProvisioningState1Creating ... + ProvisioningState1Creating ProvisioningState1 = "Creating" + // ProvisioningState1Deleting ... + ProvisioningState1Deleting ProvisioningState1 = "Deleting" + // ProvisioningState1Failed ... + ProvisioningState1Failed ProvisioningState1 = "Failed" + // ProvisioningState1Migrating ... + ProvisioningState1Migrating ProvisioningState1 = "Migrating" + // ProvisioningState1Succeeded ... + ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" + // ProvisioningState1Updating ... + ProvisioningState1Updating ProvisioningState1 = "Updating" +) + +// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. +func PossibleProvisioningState1Values() []ProvisioningState1 { + return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} +} + +// ProvisioningState2 enumerates the values for provisioning state 2. +type ProvisioningState2 string + +const ( + // ProvisioningState2Creating ... + ProvisioningState2Creating ProvisioningState2 = "Creating" + // ProvisioningState2Deleting ... + ProvisioningState2Deleting ProvisioningState2 = "Deleting" + // ProvisioningState2Failed ... + ProvisioningState2Failed ProvisioningState2 = "Failed" + // ProvisioningState2Migrating ... + ProvisioningState2Migrating ProvisioningState2 = "Migrating" + // ProvisioningState2Succeeded ... + ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" + // ProvisioningState2Updating ... + ProvisioningState2Updating ProvisioningState2 = "Updating" +) + +// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. +func PossibleProvisioningState2Values() []ProvisioningState2 { + return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} +} + +// ProximityPlacementGroupType enumerates the values for proximity placement group type. +type ProximityPlacementGroupType string + +const ( + // Standard ... + Standard ProximityPlacementGroupType = "Standard" + // Ultra ... + Ultra ProximityPlacementGroupType = "Ultra" +) + +// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. +func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { + return []ProximityPlacementGroupType{Standard, Ultra} +} + +// ReplicationState enumerates the values for replication state. +type ReplicationState string + +const ( + // ReplicationStateCompleted ... + ReplicationStateCompleted ReplicationState = "Completed" + // ReplicationStateFailed ... + ReplicationStateFailed ReplicationState = "Failed" + // ReplicationStateReplicating ... + ReplicationStateReplicating ReplicationState = "Replicating" + // ReplicationStateUnknown ... + ReplicationStateUnknown ReplicationState = "Unknown" +) + +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} +} + +// ReplicationStatusTypes enumerates the values for replication status types. +type ReplicationStatusTypes string + +const ( + // ReplicationStatusTypesReplicationStatus ... + ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" +) + +// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. +func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { + return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. +type ResourceSkuCapacityScaleType string + +const ( + // ResourceSkuCapacityScaleTypeAutomatic ... + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + // ResourceSkuCapacityScaleTypeManual ... + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + // ResourceSkuCapacityScaleTypeNone ... + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. +func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} +} + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // Location ... + Location ResourceSkuRestrictionsType = "Location" + // Zone ... + Zone ResourceSkuRestrictionsType = "Zone" +) + +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{Location, Zone} +} + +// RollingUpgradeActionType enumerates the values for rolling upgrade action type. +type RollingUpgradeActionType string + +const ( + // Cancel ... + Cancel RollingUpgradeActionType = "Cancel" + // Start ... + Start RollingUpgradeActionType = "Start" +) + +// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. +func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { + return []RollingUpgradeActionType{Cancel, Start} +} + +// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. +type RollingUpgradeStatusCode string + +const ( + // RollingUpgradeStatusCodeCancelled ... + RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" + // RollingUpgradeStatusCodeCompleted ... + RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" + // RollingUpgradeStatusCodeFaulted ... + RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" + // RollingUpgradeStatusCodeRollingForward ... + RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" +) + +// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. +func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { + return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} +} + +// SettingNames enumerates the values for setting names. +type SettingNames string + +const ( + // AutoLogon ... + AutoLogon SettingNames = "AutoLogon" + // FirstLogonCommands ... + FirstLogonCommands SettingNames = "FirstLogonCommands" +) + +// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. +func PossibleSettingNamesValues() []SettingNames { + return []SettingNames{AutoLogon, FirstLogonCommands} +} + +// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. +type SnapshotStorageAccountTypes string + +const ( + // SnapshotStorageAccountTypesPremiumLRS ... + SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" + // SnapshotStorageAccountTypesStandardLRS ... + SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" + // SnapshotStorageAccountTypesStandardZRS ... + SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" +) + +// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. +func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { + return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} +} + +// StatusLevelTypes enumerates the values for status level types. +type StatusLevelTypes string + +const ( + // Error ... + Error StatusLevelTypes = "Error" + // Info ... + Info StatusLevelTypes = "Info" + // Warning ... + Warning StatusLevelTypes = "Warning" +) + +// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. +func PossibleStatusLevelTypesValues() []StatusLevelTypes { + return []StatusLevelTypes{Error, Info, Warning} +} + +// StorageAccountTypes enumerates the values for storage account types. +type StorageAccountTypes string + +const ( + // StorageAccountTypesPremiumLRS ... + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + // StorageAccountTypesStandardLRS ... + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + // StorageAccountTypesStandardSSDLRS ... + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + // StorageAccountTypesUltraSSDLRS ... + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. +func PossibleStorageAccountTypesValues() []StorageAccountTypes { + return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} +} + +// UpgradeMode enumerates the values for upgrade mode. +type UpgradeMode string + +const ( + // Automatic ... + Automatic UpgradeMode = "Automatic" + // Manual ... + Manual UpgradeMode = "Manual" + // Rolling ... + Rolling UpgradeMode = "Rolling" +) + +// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. +func PossibleUpgradeModeValues() []UpgradeMode { + return []UpgradeMode{Automatic, Manual, Rolling} +} + +// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. +type UpgradeOperationInvoker string + +const ( + // UpgradeOperationInvokerPlatform ... + UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" + // UpgradeOperationInvokerUnknown ... + UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" + // UpgradeOperationInvokerUser ... + UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" +) + +// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. +func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { + return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} +} + +// UpgradeState enumerates the values for upgrade state. +type UpgradeState string + +const ( + // UpgradeStateCancelled ... + UpgradeStateCancelled UpgradeState = "Cancelled" + // UpgradeStateCompleted ... + UpgradeStateCompleted UpgradeState = "Completed" + // UpgradeStateFaulted ... + UpgradeStateFaulted UpgradeState = "Faulted" + // UpgradeStateRollingForward ... + UpgradeStateRollingForward UpgradeState = "RollingForward" +) + +// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. +func PossibleUpgradeStateValues() []UpgradeState { + return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} +} + +// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. +type VirtualMachineEvictionPolicyTypes string + +const ( + // Deallocate ... + Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" + // Delete ... + Delete VirtualMachineEvictionPolicyTypes = "Delete" +) + +// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. +func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { + return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} +} + +// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. +type VirtualMachinePriorityTypes string + +const ( + // Low ... + Low VirtualMachinePriorityTypes = "Low" + // Regular ... + Regular VirtualMachinePriorityTypes = "Regular" +) + +// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. +func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { + return []VirtualMachinePriorityTypes{Low, Regular} +} + +// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. +type VirtualMachineScaleSetSkuScaleType string + +const ( + // VirtualMachineScaleSetSkuScaleTypeAutomatic ... + VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" + // VirtualMachineScaleSetSkuScaleTypeNone ... + VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" +) + +// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. +func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { + return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} +} + +// VirtualMachineSizeTypes enumerates the values for virtual machine size types. +type VirtualMachineSizeTypes string + +const ( + // VirtualMachineSizeTypesBasicA0 ... + VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" + // VirtualMachineSizeTypesBasicA1 ... + VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" + // VirtualMachineSizeTypesBasicA2 ... + VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" + // VirtualMachineSizeTypesBasicA3 ... + VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" + // VirtualMachineSizeTypesBasicA4 ... + VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" + // VirtualMachineSizeTypesStandardA0 ... + VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" + // VirtualMachineSizeTypesStandardA1 ... + VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" + // VirtualMachineSizeTypesStandardA10 ... + VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" + // VirtualMachineSizeTypesStandardA11 ... + VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" + // VirtualMachineSizeTypesStandardA1V2 ... + VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" + // VirtualMachineSizeTypesStandardA2 ... + VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" + // VirtualMachineSizeTypesStandardA2mV2 ... + VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" + // VirtualMachineSizeTypesStandardA2V2 ... + VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" + // VirtualMachineSizeTypesStandardA3 ... + VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" + // VirtualMachineSizeTypesStandardA4 ... + VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" + // VirtualMachineSizeTypesStandardA4mV2 ... + VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" + // VirtualMachineSizeTypesStandardA4V2 ... + VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" + // VirtualMachineSizeTypesStandardA5 ... + VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" + // VirtualMachineSizeTypesStandardA6 ... + VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" + // VirtualMachineSizeTypesStandardA7 ... + VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" + // VirtualMachineSizeTypesStandardA8 ... + VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" + // VirtualMachineSizeTypesStandardA8mV2 ... + VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" + // VirtualMachineSizeTypesStandardA8V2 ... + VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" + // VirtualMachineSizeTypesStandardA9 ... + VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" + // VirtualMachineSizeTypesStandardB1ms ... + VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" + // VirtualMachineSizeTypesStandardB1s ... + VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" + // VirtualMachineSizeTypesStandardB2ms ... + VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" + // VirtualMachineSizeTypesStandardB2s ... + VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" + // VirtualMachineSizeTypesStandardB4ms ... + VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" + // VirtualMachineSizeTypesStandardB8ms ... + VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" + // VirtualMachineSizeTypesStandardD1 ... + VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" + // VirtualMachineSizeTypesStandardD11 ... + VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" + // VirtualMachineSizeTypesStandardD11V2 ... + VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" + // VirtualMachineSizeTypesStandardD12 ... + VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" + // VirtualMachineSizeTypesStandardD12V2 ... + VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" + // VirtualMachineSizeTypesStandardD13 ... + VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" + // VirtualMachineSizeTypesStandardD13V2 ... + VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" + // VirtualMachineSizeTypesStandardD14 ... + VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" + // VirtualMachineSizeTypesStandardD14V2 ... + VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" + // VirtualMachineSizeTypesStandardD15V2 ... + VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" + // VirtualMachineSizeTypesStandardD16sV3 ... + VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" + // VirtualMachineSizeTypesStandardD16V3 ... + VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" + // VirtualMachineSizeTypesStandardD1V2 ... + VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" + // VirtualMachineSizeTypesStandardD2 ... + VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" + // VirtualMachineSizeTypesStandardD2sV3 ... + VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" + // VirtualMachineSizeTypesStandardD2V2 ... + VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" + // VirtualMachineSizeTypesStandardD2V3 ... + VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" + // VirtualMachineSizeTypesStandardD3 ... + VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" + // VirtualMachineSizeTypesStandardD32sV3 ... + VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" + // VirtualMachineSizeTypesStandardD32V3 ... + VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" + // VirtualMachineSizeTypesStandardD3V2 ... + VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" + // VirtualMachineSizeTypesStandardD4 ... + VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" + // VirtualMachineSizeTypesStandardD4sV3 ... + VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" + // VirtualMachineSizeTypesStandardD4V2 ... + VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" + // VirtualMachineSizeTypesStandardD4V3 ... + VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" + // VirtualMachineSizeTypesStandardD5V2 ... + VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" + // VirtualMachineSizeTypesStandardD64sV3 ... + VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" + // VirtualMachineSizeTypesStandardD64V3 ... + VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" + // VirtualMachineSizeTypesStandardD8sV3 ... + VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" + // VirtualMachineSizeTypesStandardD8V3 ... + VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" + // VirtualMachineSizeTypesStandardDS1 ... + VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" + // VirtualMachineSizeTypesStandardDS11 ... + VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" + // VirtualMachineSizeTypesStandardDS11V2 ... + VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" + // VirtualMachineSizeTypesStandardDS12 ... + VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" + // VirtualMachineSizeTypesStandardDS12V2 ... + VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" + // VirtualMachineSizeTypesStandardDS13 ... + VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" + // VirtualMachineSizeTypesStandardDS132V2 ... + VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" + // VirtualMachineSizeTypesStandardDS134V2 ... + VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" + // VirtualMachineSizeTypesStandardDS13V2 ... + VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" + // VirtualMachineSizeTypesStandardDS14 ... + VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" + // VirtualMachineSizeTypesStandardDS144V2 ... + VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" + // VirtualMachineSizeTypesStandardDS148V2 ... + VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" + // VirtualMachineSizeTypesStandardDS14V2 ... + VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" + // VirtualMachineSizeTypesStandardDS15V2 ... + VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" + // VirtualMachineSizeTypesStandardDS1V2 ... + VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" + // VirtualMachineSizeTypesStandardDS2 ... + VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" + // VirtualMachineSizeTypesStandardDS2V2 ... + VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" + // VirtualMachineSizeTypesStandardDS3 ... + VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" + // VirtualMachineSizeTypesStandardDS3V2 ... + VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" + // VirtualMachineSizeTypesStandardDS4 ... + VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" + // VirtualMachineSizeTypesStandardDS4V2 ... + VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" + // VirtualMachineSizeTypesStandardDS5V2 ... + VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" + // VirtualMachineSizeTypesStandardE16sV3 ... + VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" + // VirtualMachineSizeTypesStandardE16V3 ... + VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" + // VirtualMachineSizeTypesStandardE2sV3 ... + VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" + // VirtualMachineSizeTypesStandardE2V3 ... + VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" + // VirtualMachineSizeTypesStandardE3216V3 ... + VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" + // VirtualMachineSizeTypesStandardE328sV3 ... + VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" + // VirtualMachineSizeTypesStandardE32sV3 ... + VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" + // VirtualMachineSizeTypesStandardE32V3 ... + VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" + // VirtualMachineSizeTypesStandardE4sV3 ... + VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" + // VirtualMachineSizeTypesStandardE4V3 ... + VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" + // VirtualMachineSizeTypesStandardE6416sV3 ... + VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" + // VirtualMachineSizeTypesStandardE6432sV3 ... + VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" + // VirtualMachineSizeTypesStandardE64sV3 ... + VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" + // VirtualMachineSizeTypesStandardE64V3 ... + VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" + // VirtualMachineSizeTypesStandardE8sV3 ... + VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" + // VirtualMachineSizeTypesStandardE8V3 ... + VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" + // VirtualMachineSizeTypesStandardF1 ... + VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" + // VirtualMachineSizeTypesStandardF16 ... + VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" + // VirtualMachineSizeTypesStandardF16s ... + VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" + // VirtualMachineSizeTypesStandardF16sV2 ... + VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" + // VirtualMachineSizeTypesStandardF1s ... + VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" + // VirtualMachineSizeTypesStandardF2 ... + VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" + // VirtualMachineSizeTypesStandardF2s ... + VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" + // VirtualMachineSizeTypesStandardF2sV2 ... + VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" + // VirtualMachineSizeTypesStandardF32sV2 ... + VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" + // VirtualMachineSizeTypesStandardF4 ... + VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" + // VirtualMachineSizeTypesStandardF4s ... + VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" + // VirtualMachineSizeTypesStandardF4sV2 ... + VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" + // VirtualMachineSizeTypesStandardF64sV2 ... + VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" + // VirtualMachineSizeTypesStandardF72sV2 ... + VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" + // VirtualMachineSizeTypesStandardF8 ... + VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" + // VirtualMachineSizeTypesStandardF8s ... + VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" + // VirtualMachineSizeTypesStandardF8sV2 ... + VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" + // VirtualMachineSizeTypesStandardG1 ... + VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" + // VirtualMachineSizeTypesStandardG2 ... + VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" + // VirtualMachineSizeTypesStandardG3 ... + VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" + // VirtualMachineSizeTypesStandardG4 ... + VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" + // VirtualMachineSizeTypesStandardG5 ... + VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" + // VirtualMachineSizeTypesStandardGS1 ... + VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" + // VirtualMachineSizeTypesStandardGS2 ... + VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" + // VirtualMachineSizeTypesStandardGS3 ... + VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" + // VirtualMachineSizeTypesStandardGS4 ... + VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" + // VirtualMachineSizeTypesStandardGS44 ... + VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" + // VirtualMachineSizeTypesStandardGS48 ... + VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" + // VirtualMachineSizeTypesStandardGS5 ... + VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" + // VirtualMachineSizeTypesStandardGS516 ... + VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" + // VirtualMachineSizeTypesStandardGS58 ... + VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" + // VirtualMachineSizeTypesStandardH16 ... + VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" + // VirtualMachineSizeTypesStandardH16m ... + VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" + // VirtualMachineSizeTypesStandardH16mr ... + VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" + // VirtualMachineSizeTypesStandardH16r ... + VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" + // VirtualMachineSizeTypesStandardH8 ... + VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" + // VirtualMachineSizeTypesStandardH8m ... + VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" + // VirtualMachineSizeTypesStandardL16s ... + VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" + // VirtualMachineSizeTypesStandardL32s ... + VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" + // VirtualMachineSizeTypesStandardL4s ... + VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" + // VirtualMachineSizeTypesStandardL8s ... + VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" + // VirtualMachineSizeTypesStandardM12832ms ... + VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" + // VirtualMachineSizeTypesStandardM12864ms ... + VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" + // VirtualMachineSizeTypesStandardM128ms ... + VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" + // VirtualMachineSizeTypesStandardM128s ... + VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" + // VirtualMachineSizeTypesStandardM6416ms ... + VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" + // VirtualMachineSizeTypesStandardM6432ms ... + VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" + // VirtualMachineSizeTypesStandardM64ms ... + VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" + // VirtualMachineSizeTypesStandardM64s ... + VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" + // VirtualMachineSizeTypesStandardNC12 ... + VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" + // VirtualMachineSizeTypesStandardNC12sV2 ... + VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" + // VirtualMachineSizeTypesStandardNC12sV3 ... + VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" + // VirtualMachineSizeTypesStandardNC24 ... + VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" + // VirtualMachineSizeTypesStandardNC24r ... + VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" + // VirtualMachineSizeTypesStandardNC24rsV2 ... + VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" + // VirtualMachineSizeTypesStandardNC24rsV3 ... + VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" + // VirtualMachineSizeTypesStandardNC24sV2 ... + VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" + // VirtualMachineSizeTypesStandardNC24sV3 ... + VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" + // VirtualMachineSizeTypesStandardNC6 ... + VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" + // VirtualMachineSizeTypesStandardNC6sV2 ... + VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" + // VirtualMachineSizeTypesStandardNC6sV3 ... + VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" + // VirtualMachineSizeTypesStandardND12s ... + VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" + // VirtualMachineSizeTypesStandardND24rs ... + VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" + // VirtualMachineSizeTypesStandardND24s ... + VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" + // VirtualMachineSizeTypesStandardND6s ... + VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" + // VirtualMachineSizeTypesStandardNV12 ... + VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" + // VirtualMachineSizeTypesStandardNV24 ... + VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" + // VirtualMachineSizeTypesStandardNV6 ... + VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" +) + +// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. +func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { + return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go index 33655abcb7b..52fb83882cb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go @@ -113,7 +113,6 @@ func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future Ga func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesD func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client GalleriesClient) GetSender(req *http.Request) (*http.Response, erro func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +299,9 @@ func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -336,7 +336,6 @@ func (client GalleriesClient) ListSender(req *http.Request) (*http.Response, err func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +412,9 @@ func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceG if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client GalleriesClient) ListByResourceGroupSender(req *http.Request) (*htt func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go index 2f98bc4ab33..f3b5c266048 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go @@ -129,7 +129,6 @@ func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (futur func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client GalleryImagesClient) DeleteSender(req *http.Request) (future Galler func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -284,7 +282,6 @@ func (client GalleryImagesClient) GetSender(req *http.Request) (*http.Response, func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -325,6 +322,9 @@ func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") } + if result.gil.hasNextLink() && result.gil.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -361,7 +361,6 @@ func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http. func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go index 714e4b0eaa0..c9179e2ad0a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go @@ -127,7 +127,6 @@ func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -290,7 +288,6 @@ func (client GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Res func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -333,6 +330,9 @@ func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") } + if result.givl.hasNextLink() && result.givl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -370,7 +370,6 @@ func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Requ func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go index 0749531ee32..6262e21c10e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go @@ -112,7 +112,6 @@ func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future Image func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteF func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +303,9 @@ func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -340,7 +340,6 @@ func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGrou if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.R func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,7 +569,6 @@ func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateF func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go index 4647dffdb6a..126ee7a3b78 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go @@ -118,7 +118,6 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Req func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,7 +201,6 @@ func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go index 9c22f2c8e78..84f3f4c6bff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go @@ -31,1147 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} -} - -// ComponentNames enumerates the values for component names. -type ComponentNames string - -const ( - // MicrosoftWindowsShellSetup ... - MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" -) - -// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. -func PossibleComponentNamesValues() []ComponentNames { - return []ComponentNames{MicrosoftWindowsShellSetup} -} - -// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. -type ContainerServiceOrchestratorTypes string - -const ( - // Custom ... - Custom ContainerServiceOrchestratorTypes = "Custom" - // DCOS ... - DCOS ContainerServiceOrchestratorTypes = "DCOS" - // Kubernetes ... - Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" - // Swarm ... - Swarm ContainerServiceOrchestratorTypes = "Swarm" -) - -// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. -func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { - return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} -} - -// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. -type ContainerServiceVMSizeTypes string - -const ( - // StandardA0 ... - StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" - // StandardA2 ... - StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" - // StandardA3 ... - StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" - // StandardA5 ... - StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" - // StandardA9 ... - StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" - // StandardD1 ... - StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" - // StandardD1V2 ... - StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" - // StandardD2V2 ... - StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" - // StandardD3 ... - StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" - // StandardD3V2 ... - StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" - // StandardD4V2 ... - StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" - // StandardD5V2 ... - StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" - // StandardDS1 ... - StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" - // StandardDS12 ... - StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" - // StandardDS13 ... - StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" - // StandardDS14 ... - StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" - // StandardDS2 ... - StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" - // StandardDS3 ... - StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" - // StandardDS4 ... - StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" - // StandardG1 ... - StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" - // StandardGS5 ... - StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" -) - -// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. -func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { - return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach ... - Attach DiskCreateOption = "Attach" - // Copy ... - Copy DiskCreateOption = "Copy" - // Empty ... - Empty DiskCreateOption = "Empty" - // FromImage ... - FromImage DiskCreateOption = "FromImage" - // Import ... - Import DiskCreateOption = "Import" - // Restore ... - Restore DiskCreateOption = "Restore" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS ... - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // StandardLRS ... - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS ... - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // UltraSSDLRS ... - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceView ... - InstanceView InstanceViewTypes = "instanceView" -) - -// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{InstanceView} -} - -// IntervalInMins enumerates the values for interval in mins. -type IntervalInMins string - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - ThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. -type MaintenanceOperationResultCodeTypes string - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} -} - -// OperatingSystemStateTypes enumerates the values for operating system state types. -type OperatingSystemStateTypes string - -const ( - // Generalized ... - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized ... - Specialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{Generalized, Specialized} -} - -// OperatingSystemTypes enumerates the values for operating system types. -type OperatingSystemTypes string - -const ( - // Linux ... - Linux OperatingSystemTypes = "Linux" - // Windows ... - Windows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{Linux, Windows} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - OobeSystem PassNames = "OobeSystem" -) - -// PossiblePassNamesValues returns an array of possible values for the PassNames const type. -func PossiblePassNamesValues() []PassNames { - return []PassNames{OobeSystem} -} - -// ProtocolTypes enumerates the values for protocol types. -type ProtocolTypes string - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCreating ... - ProvisioningStateCreating ProvisioningState = "Creating" - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateMigrating ... - ProvisioningStateMigrating ProvisioningState = "Migrating" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} -} - -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1Creating ... - ProvisioningState1Creating ProvisioningState1 = "Creating" - // ProvisioningState1Deleting ... - ProvisioningState1Deleting ProvisioningState1 = "Deleting" - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Migrating ... - ProvisioningState1Migrating ProvisioningState1 = "Migrating" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" - // ProvisioningState1Updating ... - ProvisioningState1Updating ProvisioningState1 = "Updating" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} -} - -// ProvisioningState2 enumerates the values for provisioning state 2. -type ProvisioningState2 string - -const ( - // ProvisioningState2Creating ... - ProvisioningState2Creating ProvisioningState2 = "Creating" - // ProvisioningState2Deleting ... - ProvisioningState2Deleting ProvisioningState2 = "Deleting" - // ProvisioningState2Failed ... - ProvisioningState2Failed ProvisioningState2 = "Failed" - // ProvisioningState2Migrating ... - ProvisioningState2Migrating ProvisioningState2 = "Migrating" - // ProvisioningState2Succeeded ... - ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" - // ProvisioningState2Updating ... - ProvisioningState2Updating ProvisioningState2 = "Updating" -) - -// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. -func PossibleProvisioningState2Values() []ProvisioningState2 { - return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. -type ResourceSkuCapacityScaleType string - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" -) - -// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. -func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} -} - -// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. -type ResourceSkuRestrictionsReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. -func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { - return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} -} - -// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. -type ResourceSkuRestrictionsType string - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - Zone ResourceSkuRestrictionsType = "Zone" -) - -// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return []ResourceSkuRestrictionsType{Location, Zone} -} - -// RollingUpgradeActionType enumerates the values for rolling upgrade action type. -type RollingUpgradeActionType string - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - Start RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{Cancel, Start} -} - -// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. -type RollingUpgradeStatusCode string - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS ... - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS ... - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS ... - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // Automatic ... - Automatic UpgradeMode = "Automatic" - // Manual ... - Manual UpgradeMode = "Manual" - // Rolling ... - Rolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{Automatic, Manual, Rolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // Deallocate ... - Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // Delete ... - Delete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. -func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { - return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} -} - -// VirtualMachineSizeTypes enumerates the values for virtual machine size types. -type VirtualMachineSizeTypes string - -const ( - // VirtualMachineSizeTypesBasicA0 ... - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - // VirtualMachineSizeTypesBasicA1 ... - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - // VirtualMachineSizeTypesBasicA2 ... - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - // VirtualMachineSizeTypesBasicA3 ... - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - // VirtualMachineSizeTypesBasicA4 ... - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - // VirtualMachineSizeTypesStandardA0 ... - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - // VirtualMachineSizeTypesStandardA1 ... - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - // VirtualMachineSizeTypesStandardA10 ... - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - // VirtualMachineSizeTypesStandardA11 ... - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - // VirtualMachineSizeTypesStandardA1V2 ... - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // VirtualMachineSizeTypesStandardA2 ... - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - // VirtualMachineSizeTypesStandardA2mV2 ... - VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // VirtualMachineSizeTypesStandardA2V2 ... - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // VirtualMachineSizeTypesStandardA3 ... - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - // VirtualMachineSizeTypesStandardA4 ... - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - // VirtualMachineSizeTypesStandardA4mV2 ... - VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // VirtualMachineSizeTypesStandardA4V2 ... - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // VirtualMachineSizeTypesStandardA5 ... - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - // VirtualMachineSizeTypesStandardA6 ... - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - // VirtualMachineSizeTypesStandardA7 ... - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - // VirtualMachineSizeTypesStandardA8 ... - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - // VirtualMachineSizeTypesStandardA8mV2 ... - VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // VirtualMachineSizeTypesStandardA8V2 ... - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // VirtualMachineSizeTypesStandardA9 ... - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - // VirtualMachineSizeTypesStandardB1ms ... - VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // VirtualMachineSizeTypesStandardB1s ... - VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // VirtualMachineSizeTypesStandardB2ms ... - VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // VirtualMachineSizeTypesStandardB2s ... - VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // VirtualMachineSizeTypesStandardB4ms ... - VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // VirtualMachineSizeTypesStandardB8ms ... - VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // VirtualMachineSizeTypesStandardD1 ... - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - // VirtualMachineSizeTypesStandardD11 ... - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - // VirtualMachineSizeTypesStandardD11V2 ... - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // VirtualMachineSizeTypesStandardD12 ... - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - // VirtualMachineSizeTypesStandardD12V2 ... - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // VirtualMachineSizeTypesStandardD13 ... - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - // VirtualMachineSizeTypesStandardD13V2 ... - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // VirtualMachineSizeTypesStandardD14 ... - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - // VirtualMachineSizeTypesStandardD14V2 ... - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // VirtualMachineSizeTypesStandardD15V2 ... - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // VirtualMachineSizeTypesStandardD16sV3 ... - VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // VirtualMachineSizeTypesStandardD16V3 ... - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // VirtualMachineSizeTypesStandardD1V2 ... - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // VirtualMachineSizeTypesStandardD2 ... - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - // VirtualMachineSizeTypesStandardD2sV3 ... - VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // VirtualMachineSizeTypesStandardD2V2 ... - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // VirtualMachineSizeTypesStandardD2V3 ... - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // VirtualMachineSizeTypesStandardD3 ... - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - // VirtualMachineSizeTypesStandardD32sV3 ... - VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // VirtualMachineSizeTypesStandardD32V3 ... - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // VirtualMachineSizeTypesStandardD3V2 ... - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // VirtualMachineSizeTypesStandardD4 ... - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - // VirtualMachineSizeTypesStandardD4sV3 ... - VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // VirtualMachineSizeTypesStandardD4V2 ... - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // VirtualMachineSizeTypesStandardD4V3 ... - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // VirtualMachineSizeTypesStandardD5V2 ... - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // VirtualMachineSizeTypesStandardD64sV3 ... - VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // VirtualMachineSizeTypesStandardD64V3 ... - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // VirtualMachineSizeTypesStandardD8sV3 ... - VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // VirtualMachineSizeTypesStandardD8V3 ... - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // VirtualMachineSizeTypesStandardDS1 ... - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // VirtualMachineSizeTypesStandardDS11 ... - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // VirtualMachineSizeTypesStandardDS11V2 ... - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // VirtualMachineSizeTypesStandardDS12 ... - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // VirtualMachineSizeTypesStandardDS12V2 ... - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // VirtualMachineSizeTypesStandardDS13 ... - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // VirtualMachineSizeTypesStandardDS132V2 ... - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // VirtualMachineSizeTypesStandardDS134V2 ... - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // VirtualMachineSizeTypesStandardDS13V2 ... - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // VirtualMachineSizeTypesStandardDS14 ... - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // VirtualMachineSizeTypesStandardDS144V2 ... - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // VirtualMachineSizeTypesStandardDS148V2 ... - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // VirtualMachineSizeTypesStandardDS14V2 ... - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // VirtualMachineSizeTypesStandardDS15V2 ... - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // VirtualMachineSizeTypesStandardDS1V2 ... - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // VirtualMachineSizeTypesStandardDS2 ... - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // VirtualMachineSizeTypesStandardDS2V2 ... - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // VirtualMachineSizeTypesStandardDS3 ... - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // VirtualMachineSizeTypesStandardDS3V2 ... - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // VirtualMachineSizeTypesStandardDS4 ... - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // VirtualMachineSizeTypesStandardDS4V2 ... - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // VirtualMachineSizeTypesStandardDS5V2 ... - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // VirtualMachineSizeTypesStandardE16sV3 ... - VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // VirtualMachineSizeTypesStandardE16V3 ... - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // VirtualMachineSizeTypesStandardE2sV3 ... - VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // VirtualMachineSizeTypesStandardE2V3 ... - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // VirtualMachineSizeTypesStandardE3216V3 ... - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // VirtualMachineSizeTypesStandardE328sV3 ... - VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // VirtualMachineSizeTypesStandardE32sV3 ... - VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // VirtualMachineSizeTypesStandardE32V3 ... - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // VirtualMachineSizeTypesStandardE4sV3 ... - VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // VirtualMachineSizeTypesStandardE4V3 ... - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // VirtualMachineSizeTypesStandardE6416sV3 ... - VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // VirtualMachineSizeTypesStandardE6432sV3 ... - VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // VirtualMachineSizeTypesStandardE64sV3 ... - VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // VirtualMachineSizeTypesStandardE64V3 ... - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // VirtualMachineSizeTypesStandardE8sV3 ... - VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // VirtualMachineSizeTypesStandardE8V3 ... - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // VirtualMachineSizeTypesStandardF1 ... - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - // VirtualMachineSizeTypesStandardF16 ... - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - // VirtualMachineSizeTypesStandardF16s ... - VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // VirtualMachineSizeTypesStandardF16sV2 ... - VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // VirtualMachineSizeTypesStandardF1s ... - VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // VirtualMachineSizeTypesStandardF2 ... - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - // VirtualMachineSizeTypesStandardF2s ... - VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // VirtualMachineSizeTypesStandardF2sV2 ... - VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // VirtualMachineSizeTypesStandardF32sV2 ... - VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // VirtualMachineSizeTypesStandardF4 ... - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - // VirtualMachineSizeTypesStandardF4s ... - VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // VirtualMachineSizeTypesStandardF4sV2 ... - VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // VirtualMachineSizeTypesStandardF64sV2 ... - VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // VirtualMachineSizeTypesStandardF72sV2 ... - VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // VirtualMachineSizeTypesStandardF8 ... - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - // VirtualMachineSizeTypesStandardF8s ... - VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // VirtualMachineSizeTypesStandardF8sV2 ... - VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // VirtualMachineSizeTypesStandardG1 ... - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - // VirtualMachineSizeTypesStandardG2 ... - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - // VirtualMachineSizeTypesStandardG3 ... - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - // VirtualMachineSizeTypesStandardG4 ... - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - // VirtualMachineSizeTypesStandardG5 ... - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - // VirtualMachineSizeTypesStandardGS1 ... - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // VirtualMachineSizeTypesStandardGS2 ... - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // VirtualMachineSizeTypesStandardGS3 ... - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // VirtualMachineSizeTypesStandardGS4 ... - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // VirtualMachineSizeTypesStandardGS44 ... - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // VirtualMachineSizeTypesStandardGS48 ... - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // VirtualMachineSizeTypesStandardGS5 ... - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // VirtualMachineSizeTypesStandardGS516 ... - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // VirtualMachineSizeTypesStandardGS58 ... - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // VirtualMachineSizeTypesStandardH16 ... - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - // VirtualMachineSizeTypesStandardH16m ... - VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // VirtualMachineSizeTypesStandardH16mr ... - VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // VirtualMachineSizeTypesStandardH16r ... - VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // VirtualMachineSizeTypesStandardH8 ... - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - // VirtualMachineSizeTypesStandardH8m ... - VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // VirtualMachineSizeTypesStandardL16s ... - VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // VirtualMachineSizeTypesStandardL32s ... - VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // VirtualMachineSizeTypesStandardL4s ... - VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // VirtualMachineSizeTypesStandardL8s ... - VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // VirtualMachineSizeTypesStandardM12832ms ... - VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // VirtualMachineSizeTypesStandardM12864ms ... - VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // VirtualMachineSizeTypesStandardM128ms ... - VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // VirtualMachineSizeTypesStandardM128s ... - VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // VirtualMachineSizeTypesStandardM6416ms ... - VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // VirtualMachineSizeTypesStandardM6432ms ... - VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // VirtualMachineSizeTypesStandardM64ms ... - VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // VirtualMachineSizeTypesStandardM64s ... - VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // VirtualMachineSizeTypesStandardNC12 ... - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // VirtualMachineSizeTypesStandardNC12sV2 ... - VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // VirtualMachineSizeTypesStandardNC12sV3 ... - VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // VirtualMachineSizeTypesStandardNC24 ... - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // VirtualMachineSizeTypesStandardNC24r ... - VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // VirtualMachineSizeTypesStandardNC24rsV2 ... - VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // VirtualMachineSizeTypesStandardNC24rsV3 ... - VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // VirtualMachineSizeTypesStandardNC24sV2 ... - VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // VirtualMachineSizeTypesStandardNC24sV3 ... - VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // VirtualMachineSizeTypesStandardNC6 ... - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // VirtualMachineSizeTypesStandardNC6sV2 ... - VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // VirtualMachineSizeTypesStandardNC6sV3 ... - VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // VirtualMachineSizeTypesStandardND12s ... - VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // VirtualMachineSizeTypesStandardND24rs ... - VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // VirtualMachineSizeTypesStandardND24s ... - VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // VirtualMachineSizeTypesStandardND6s ... - VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // VirtualMachineSizeTypesStandardNV12 ... - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // VirtualMachineSizeTypesStandardNV24 ... - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // VirtualMachineSizeTypesStandardNV6 ... - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} -} - // AccessURI a disk access SAS uri. type AccessURI struct { autorest.Response `json:"-"` @@ -1179,16 +38,15 @@ type AccessURI struct { AccessSAS *string `json:"accessSAS,omitempty"` } -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale -// set. +// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale set. type AdditionalCapabilities struct { // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` } // AdditionalUnattendContent specifies additional XML formatted information that can be included in the -// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, -// and the pass in which the content is applied. +// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and +// the pass in which the content is applied. type AdditionalUnattendContent struct { // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' PassName PassNames `json:"passName,omitempty"` @@ -1244,8 +102,8 @@ type AutomaticOSUpgradeProperties struct { AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` } -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual -// machine scale set. +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual machine +// scale set. type AutomaticRepairsPolicy struct { // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. Enabled *bool `json:"enabled,omitempty"` @@ -1253,16 +111,14 @@ type AutomaticRepairsPolicy struct { GracePeriod *string `json:"gracePeriod,omitempty"` } -// AvailabilitySet specifies information about the availability set that the virtual machine should be -// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to -// maximize availability. For more information about availability sets, see [Manage the availability of -// virtual +// AvailabilitySet specifies information about the availability set that the virtual machine should be assigned +// to. Virtual machines specified in the same availability set are allocated to different nodes to maximize +// availability. For more information about availability sets, see [Manage the availability of virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -//

For more information on Azure planned maintenance, see [Planned maintenance for virtual -// machines in +//

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

Currently, a VM can only be added to availability set at creation time. An existing VM cannot -// be added to an availability set. +//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be +// added to an availability set. type AvailabilitySet struct { autorest.Response `json:"-"` *AvailabilitySetProperties `json:"properties,omitempty"` @@ -1453,10 +309,15 @@ func (aslr AvailabilitySetListResult) IsEmpty() bool { return aslr.Value == nil || len(*aslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aslr AvailabilitySetListResult) hasNextLink() bool { + return aslr.NextLink != nil && len(*aslr.NextLink) != 0 +} + // availabilitySetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if aslr.NextLink == nil || len(to.String(aslr.NextLink)) < 1 { + if !aslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1484,11 +345,16 @@ func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aslr) + if err != nil { + return err + } + page.aslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aslr = next return nil } @@ -1536,8 +402,26 @@ type AvailabilitySetProperties struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should -// be assigned to. Only tags may be updated. +// MarshalJSON is the custom marshaler for AvailabilitySetProperties. +func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.PlatformUpdateDomainCount != nil { + objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount + } + if asp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount + } + if asp.VirtualMachines != nil { + objectMap["virtualMachines"] = asp.VirtualMachines + } + if asp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup + } + return json.Marshal(objectMap) +} + +// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should be +// assigned to. Only tags may be updated. type AvailabilitySetUpdate struct { *AvailabilitySetProperties `json:"properties,omitempty"` // Sku - Sku of the availability set @@ -1742,6 +626,24 @@ type ContainerServiceAgentPoolProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. +func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csapp.Name != nil { + objectMap["name"] = csapp.Name + } + if csapp.Count != nil { + objectMap["count"] = csapp.Count + } + if csapp.VMSize != "" { + objectMap["vmSize"] = csapp.VMSize + } + if csapp.DNSPrefix != nil { + objectMap["dnsPrefix"] = csapp.DNSPrefix + } + return json.Marshal(objectMap) +} + // ContainerServiceCustomProfile properties to configure a custom container service cluster. type ContainerServiceCustomProfile struct { // Orchestrator - The name of the custom orchestrator to use. @@ -1839,10 +741,15 @@ func (cslr ContainerServiceListResult) IsEmpty() bool { return cslr.Value == nil || len(*cslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (cslr ContainerServiceListResult) hasNextLink() bool { + return cslr.NextLink != nil && len(*cslr.NextLink) != 0 +} + // containerServiceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if cslr.NextLink == nil || len(to.String(cslr.NextLink)) < 1 { + if !cslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1870,11 +777,16 @@ func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.cslr) + if err != nil { + return err + } + page.cslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.cslr = next return nil } @@ -1918,6 +830,18 @@ type ContainerServiceMasterProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. +func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csmp.Count != nil { + objectMap["count"] = csmp.Count + } + if csmp.DNSPrefix != nil { + objectMap["dnsPrefix"] = csmp.DNSPrefix + } + return json.Marshal(objectMap) +} + // ContainerServiceOrchestratorProfile profile for the container service orchestrator. type ContainerServiceOrchestratorProfile struct { // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' @@ -1946,6 +870,36 @@ type ContainerServiceProperties struct { DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceProperties. +func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csp.OrchestratorProfile != nil { + objectMap["orchestratorProfile"] = csp.OrchestratorProfile + } + if csp.CustomProfile != nil { + objectMap["customProfile"] = csp.CustomProfile + } + if csp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile + } + if csp.MasterProfile != nil { + objectMap["masterProfile"] = csp.MasterProfile + } + if csp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles + } + if csp.WindowsProfile != nil { + objectMap["windowsProfile"] = csp.WindowsProfile + } + if csp.LinuxProfile != nil { + objectMap["linuxProfile"] = csp.LinuxProfile + } + if csp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile + } + return json.Marshal(objectMap) +} + // ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ContainerServicesCreateOrUpdateFuture struct { @@ -1998,8 +952,8 @@ func (future *ContainerServicesDeleteFuture) Result(client ContainerServicesClie return } -// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster -// to use for manipulating Azure APIs. +// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster to +// use for manipulating Azure APIs. type ContainerServiceServicePrincipalProfile struct { // ClientID - The ID for the service principal. ClientID *string `json:"clientId,omitempty"` @@ -2027,6 +981,15 @@ type ContainerServiceVMDiagnostics struct { StorageURI *string `json:"storageUri,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. +func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csvd.Enabled != nil { + objectMap["enabled"] = csvd.Enabled + } + return json.Marshal(objectMap) +} + // ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. type ContainerServiceWindowsProfile struct { // AdminUsername - The administrator username to use for Windows VMs. @@ -2077,8 +1040,7 @@ type DataDiskImage struct { Lun *int32 `json:"lun,omitempty"` } -// DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: -// 2015-06-15. +// DiagnosticsProfile specifies the boot diagnostic settings state.

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

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` @@ -2332,10 +1294,15 @@ func (dl DiskList) IsEmpty() bool { return dl.Value == nil || len(*dl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dl DiskList) hasNextLink() bool { + return dl.NextLink != nil && len(*dl.NextLink) != 0 +} + // diskListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 { + if !dl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2363,11 +1330,16 @@ func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dl) + if err != nil { + return err + } + page.dl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dl = next return nil } @@ -2421,6 +1393,30 @@ type DiskProperties struct { DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` } +// MarshalJSON is the custom marshaler for DiskProperties. +func (dp DiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.OsType != "" { + objectMap["osType"] = dp.OsType + } + if dp.CreationData != nil { + objectMap["creationData"] = dp.CreationData + } + if dp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dp.DiskSizeGB + } + if dp.EncryptionSettings != nil { + objectMap["encryptionSettings"] = dp.EncryptionSettings + } + if dp.DiskIOPSReadWrite != nil { + objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite + } + if dp.DiskMBpsReadWrite != nil { + objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite + } + return json.Marshal(objectMap) +} + // DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksCreateOrUpdateFuture struct { @@ -2472,8 +1468,7 @@ func (future *DisksDeleteFuture) Result(client DisksClient) (ar autorest.Respons return } -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DisksGrantAccessFuture struct { azure.Future } @@ -2509,6 +1504,15 @@ type DiskSku struct { Tier *string `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for DiskSku. +func (ds DiskSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.Name != "" { + objectMap["name"] = ds.Name + } + return json.Marshal(objectMap) +} + // DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksRevokeAccessFuture struct { @@ -2678,8 +1682,7 @@ func (future *GalleriesCreateOrUpdateFuture) Result(client GalleriesClient) (g G return } -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type GalleriesDeleteFuture struct { azure.Future } @@ -3024,10 +2027,15 @@ func (gil GalleryImageList) IsEmpty() bool { return gil.Value == nil || len(*gil.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gil GalleryImageList) hasNextLink() bool { + return gil.NextLink != nil && len(*gil.NextLink) != 0 +} + // galleryImageListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if gil.NextLink == nil || len(to.String(gil.NextLink)) < 1 { + if !gil.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3055,11 +2063,16 @@ func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gil) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gil) + if err != nil { + return err + } + page.gil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gil = next return nil } @@ -3117,8 +2130,47 @@ type GalleryImageProperties struct { ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` } -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// MarshalJSON is the custom marshaler for GalleryImageProperties. +func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gip.Description != nil { + objectMap["description"] = gip.Description + } + if gip.Eula != nil { + objectMap["eula"] = gip.Eula + } + if gip.PrivacyStatementURI != nil { + objectMap["privacyStatementUri"] = gip.PrivacyStatementURI + } + if gip.ReleaseNoteURI != nil { + objectMap["releaseNoteUri"] = gip.ReleaseNoteURI + } + if gip.OsType != "" { + objectMap["osType"] = gip.OsType + } + if gip.OsState != "" { + objectMap["osState"] = gip.OsState + } + if gip.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gip.EndOfLifeDate + } + if gip.Identifier != nil { + objectMap["identifier"] = gip.Identifier + } + if gip.Recommended != nil { + objectMap["recommended"] = gip.Recommended + } + if gip.Disallowed != nil { + objectMap["disallowed"] = gip.Disallowed + } + if gip.PurchasePlan != nil { + objectMap["purchasePlan"] = gip.PurchasePlan + } + return json.Marshal(objectMap) +} + +// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryImagesCreateOrUpdateFuture struct { azure.Future } @@ -3169,8 +2221,7 @@ func (future *GalleryImagesDeleteFuture) Result(client GalleryImagesClient) (ar return } -// GalleryImageVersion specifies information about the gallery Image Version that you want to create or -// update. +// GalleryImageVersion specifies information about the gallery Image Version that you want to create or update. type GalleryImageVersion struct { autorest.Response `json:"-"` *GalleryImageVersionProperties `json:"properties,omitempty"` @@ -3347,10 +2398,15 @@ func (givl GalleryImageVersionList) IsEmpty() bool { return givl.Value == nil || len(*givl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (givl GalleryImageVersionList) hasNextLink() bool { + return givl.NextLink != nil && len(*givl.NextLink) != 0 +} + // galleryImageVersionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if givl.NextLink == nil || len(to.String(givl.NextLink)) < 1 { + if !givl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3378,11 +2434,16 @@ func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.givl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.givl) + if err != nil { + return err + } + page.givl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.givl = next return nil } @@ -3427,6 +2488,15 @@ type GalleryImageVersionProperties struct { ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. +func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givp.PublishingProfile != nil { + objectMap["publishingProfile"] = givp.PublishingProfile + } + return json.Marshal(objectMap) +} + // GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. type GalleryImageVersionPublishingProfile struct { // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. @@ -3442,6 +2512,27 @@ type GalleryImageVersionPublishingProfile struct { Source *GalleryArtifactSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. +func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givpp.ReplicaCount != nil { + objectMap["replicaCount"] = givpp.ReplicaCount + } + if givpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest + } + if givpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = givpp.EndOfLifeDate + } + if givpp.TargetRegions != nil { + objectMap["targetRegions"] = givpp.TargetRegions + } + if givpp.Source != nil { + objectMap["source"] = givpp.Source + } + return json.Marshal(objectMap) +} + // GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryImageVersionsCreateOrUpdateFuture struct { @@ -3471,8 +2562,8 @@ func (future *GalleryImageVersionsCreateOrUpdateFuture) Result(client GalleryIma return } -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryImageVersionsDeleteFuture struct { azure.Future } @@ -3579,10 +2670,15 @@ func (gl GalleryList) IsEmpty() bool { return gl.Value == nil || len(*gl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gl GalleryList) hasNextLink() bool { + return gl.NextLink != nil && len(*gl.NextLink) != 0 +} + // galleryListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if gl.NextLink == nil || len(to.String(gl.NextLink)) < 1 { + if !gl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3610,11 +2706,16 @@ func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gl) + if err != nil { + return err + } + page.gl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gl = next return nil } @@ -3665,6 +2766,18 @@ type GalleryProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryProperties. +func (gp GalleryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gp.Description != nil { + objectMap["description"] = gp.Description + } + if gp.Identifier != nil { + objectMap["identifier"] = gp.Identifier + } + return json.Marshal(objectMap) +} + // GrantAccessData data used for requesting a SAS. type GrantAccessData struct { // Access - Possible values include: 'None', 'Read' @@ -3679,9 +2792,8 @@ type HardwareProfile struct { VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` } -// Image the source user image virtual hard disk. The virtual hard disk will be copied before being -// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not -// exist. +// Image the source user image virtual hard disk. The virtual hard disk will be copied before being attached to +// the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. type Image struct { autorest.Response `json:"-"` *ImageProperties `json:"properties,omitempty"` @@ -3884,10 +2996,15 @@ func (ilr ImageListResult) IsEmpty() bool { return ilr.Value == nil || len(*ilr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilr ImageListResult) hasNextLink() bool { + return ilr.NextLink != nil && len(*ilr.NextLink) != 0 +} + // imageListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + if !ilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3915,11 +3032,16 @@ func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilr = next return nil } @@ -3983,8 +3105,19 @@ type ImageProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace -// images. +// MarshalJSON is the custom marshaler for ImageProperties. +func (IP ImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.SourceVirtualMachine != nil { + objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine + } + if IP.StorageProfile != nil { + objectMap["storageProfile"] = IP.StorageProfile + } + return json.Marshal(objectMap) +} + +// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace images. type ImagePurchasePlan struct { // Name - The plan ID. Name *string `json:"name,omitempty"` @@ -3996,8 +3129,8 @@ type ImagePurchasePlan struct { // ImageReference specifies information about the image to use. You can specify information about platform // images, marketplace images, or virtual machine images. This element is required when you want to use a -// platform image, marketplace image, or virtual machine image, but is not used in other creation -// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. +// platform image, marketplace image, or virtual machine image, but is not used in other creation operations. +// NOTE: Image reference publisher and offer can only be set when you create the scale set. type ImageReference struct { // Publisher - The image publisher. Publisher *string `json:"publisher,omitempty"` @@ -4174,8 +3307,8 @@ type InstanceViewStatus struct { Time *date.Time `json:"time,omitempty"` } -// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used -// to unwrap the encryptionKey +// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to +// unwrap the encryptionKey type KeyVaultAndKeyReference struct { // SourceVault - Resource id of the KeyVault containing the key or secret SourceVault *SourceVault `json:"sourceVault,omitempty"` @@ -4207,8 +3340,8 @@ type KeyVaultSecretReference struct { SourceVault *SubResource `json:"sourceVault,omitempty"` } -// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

For a -// list of supported Linux distributions, see [Linux on Azure-Endorsed +// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

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

For running non-endorsed distributions, see [Information for Non-Endorsed // Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). @@ -4298,10 +3431,15 @@ func (lur ListUsagesResult) IsEmpty() bool { return lur.Value == nil || len(*lur.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lur ListUsagesResult) hasNextLink() bool { + return lur.NextLink != nil && len(*lur.NextLink) != 0 +} + // listUsagesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 { + if !lur.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -4329,11 +3467,16 @@ func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lur) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lur = next return nil } @@ -4379,8 +3522,8 @@ type ListVirtualMachineImageResource struct { Value *[]VirtualMachineImageResource `json:"value,omitempty"` } -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type LogAnalyticsExportRequestRateByIntervalFuture struct { azure.Future } @@ -4641,8 +3784,8 @@ type OperationValueDisplay struct { Provider *string `json:"provider,omitempty"` } -// OSDisk specifies information about the operating system disk used by the virtual machine.

For -// more information about disks, see [About disks and VHDs for Azure virtual +// OSDisk specifies information about the operating system disk used by the virtual machine.

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

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' @@ -4695,11 +3838,11 @@ type OSProfile struct { AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` } -// Plan specifies information about the marketplace image used to create the virtual machine. This element -// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable -// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use -// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and -// then click **Save**. +// Plan specifies information about the marketplace image used to create the virtual machine. This element is +// only used for marketplace images. Before you can use a marketplace image from an API, you must enable the +// image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then +// click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click +// **Save**. type Plan struct { // Name - The plan ID. Name *string `json:"name,omitempty"` @@ -4821,8 +3964,8 @@ type ProximityPlacementGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ProximityPlacementGroupListResultIterator provides access to a complete listing of -// ProximityPlacementGroup values. +// ProximityPlacementGroupListResultIterator provides access to a complete listing of ProximityPlacementGroup +// values. type ProximityPlacementGroupListResultIterator struct { i int page ProximityPlacementGroupListResultPage @@ -4890,10 +4033,15 @@ func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { return ppglr.Value == nil || len(*ppglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { + return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 +} + // proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if ppglr.NextLink == nil || len(to.String(ppglr.NextLink)) < 1 { + if !ppglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -4921,11 +4069,16 @@ func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.C tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ppglr) + if err != nil { + return err + } + page.ppglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ppglr = next return nil } @@ -4971,6 +4124,15 @@ type ProximityPlacementGroupProperties struct { AvailabilitySets *[]SubResource `json:"availabilitySets,omitempty"` } +// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. +func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppgp.ProximityPlacementGroupType != "" { + objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType + } + return json.Marshal(objectMap) +} + // ProximityPlacementGroupUpdate specifies information about the proximity placement group. type ProximityPlacementGroupUpdate struct { // Tags - Resource tags @@ -4996,8 +4158,8 @@ type PurchasePlan struct { Product *string `json:"product,omitempty"` } -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this -// Image Definition. These properties are updatable. +// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this Image +// Definition. These properties are updatable. type RecommendedMachineConfiguration struct { VCPUs *ResourceRange `json:"vCPUs,omitempty"` Memory *ResourceRange `json:"memory,omitempty"` @@ -5249,10 +4411,15 @@ func (rsr ResourceSkusResult) IsEmpty() bool { return rsr.Value == nil || len(*rsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rsr ResourceSkusResult) hasNextLink() bool { + return rsr.NextLink != nil && len(*rsr.NextLink) != 0 +} + // resourceSkusResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if rsr.NextLink == nil || len(to.String(rsr.NextLink)) < 1 { + if !rsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5280,11 +4447,16 @@ func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rsr) + if err != nil { + return err + } + page.rsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rsr = next return nil } @@ -5340,8 +4512,7 @@ type RollingUpgradePolicy struct { PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` } -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade -// state. +// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade state. type RollingUpgradeProgressInfo struct { // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` @@ -5605,10 +4776,15 @@ func (rclr RunCommandListResult) IsEmpty() bool { return rclr.Value == nil || len(*rclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rclr RunCommandListResult) hasNextLink() bool { + return rclr.NextLink != nil && len(*rclr.NextLink) != 0 +} + // runCommandListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if rclr.NextLink == nil || len(to.String(rclr.NextLink)) < 1 { + if !rclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5636,11 +4812,16 @@ func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rclr) + if err != nil { + return err + } + page.rclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rclr = next return nil } @@ -5693,9 +4874,8 @@ type RunCommandResult struct { Value *[]InstanceViewStatus `json:"value,omitempty"` } -// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware -// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU -// name. +// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the +// scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. type Sku struct { // Name - The sku name. Name *string `json:"name,omitempty"` @@ -5906,10 +5086,15 @@ func (sl SnapshotList) IsEmpty() bool { return sl.Value == nil || len(*sl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sl SnapshotList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + // snapshotListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { + if !sl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5937,11 +5122,16 @@ func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sl) + if err != nil { + return err + } + page.sl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sl = next return nil } @@ -5991,6 +5181,24 @@ type SnapshotProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.OsType != "" { + objectMap["osType"] = sp.OsType + } + if sp.CreationData != nil { + objectMap["creationData"] = sp.CreationData + } + if sp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = sp.DiskSizeGB + } + if sp.EncryptionSettings != nil { + objectMap["encryptionSettings"] = sp.EncryptionSettings + } + return json.Marshal(objectMap) +} + // SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsCreateOrUpdateFuture struct { @@ -6020,8 +5228,7 @@ func (future *SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s S return } -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type SnapshotsDeleteFuture struct { azure.Future } @@ -6080,6 +5287,15 @@ type SnapshotSku struct { Tier *string `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for SnapshotSku. +func (ss SnapshotSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.Name != "" { + objectMap["name"] = ss.Name + } + return json.Marshal(objectMap) +} + // SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsRevokeAccessFuture struct { @@ -6103,8 +5319,7 @@ func (future *SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (ar au return } -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type SnapshotsUpdateFuture struct { azure.Future } @@ -6220,8 +5435,8 @@ type SSHConfiguration struct { PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` } -// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where -// the public key is placed. +// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where the +// public key is placed. type SSHPublicKey struct { // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys Path *string `json:"path,omitempty"` @@ -6300,8 +5515,7 @@ type UpgradeOperationHistoricalStatusInfo struct { Location *string `json:"location,omitempty"` } -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale -// Set. +// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale Set. type UpgradeOperationHistoricalStatusInfoProperties struct { // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` @@ -6357,8 +5571,8 @@ type UsageName struct { LocalizedValue *string `json:"localizedValue,omitempty"` } -// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate -// should reside on the VM. +// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate should +// reside on the VM. type VaultCertificate struct { // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
} CertificateURL *string `json:"certificateUrl,omitempty"` @@ -6568,6 +5782,15 @@ type VirtualMachineCaptureResult struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. +func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcr.ID != nil { + objectMap["id"] = vmcr.ID + } + return json.Marshal(objectMap) +} + // VirtualMachineExtension describes a Virtual Machine Extension. type VirtualMachineExtension struct { autorest.Response `json:"-"` @@ -6828,8 +6051,38 @@ type VirtualMachineExtensionProperties struct { InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` } -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. +func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmep.ForceUpdateTag + } + if vmep.Publisher != nil { + objectMap["publisher"] = vmep.Publisher + } + if vmep.Type != nil { + objectMap["type"] = vmep.Type + } + if vmep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion + } + if vmep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion + } + if vmep.Settings != nil { + objectMap["settings"] = vmep.Settings + } + if vmep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmep.ProtectedSettings + } + if vmep.InstanceView != nil { + objectMap["instanceView"] = vmep.InstanceView + } + return json.Marshal(objectMap) +} + +// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineExtensionsCreateOrUpdateFuture struct { azure.Future } @@ -7263,10 +6516,15 @@ func (vmlr VirtualMachineListResult) IsEmpty() bool { return vmlr.Value == nil || len(*vmlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmlr VirtualMachineListResult) hasNextLink() bool { + return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 +} + // virtualMachineListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmlr.NextLink == nil || len(to.String(vmlr.NextLink)) < 1 { + if !vmlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7294,11 +6552,16 @@ func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmlr) + if err != nil { + return err + } + page.vmlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmlr = next return nil } @@ -7360,8 +6623,41 @@ type VirtualMachineProperties struct { VMID *string `json:"vmId,omitempty"` } -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk -// will always be reimaged +// MarshalJSON is the custom marshaler for VirtualMachineProperties. +func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmp.HardwareProfile + } + if vmp.StorageProfile != nil { + objectMap["storageProfile"] = vmp.StorageProfile + } + if vmp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities + } + if vmp.OsProfile != nil { + objectMap["osProfile"] = vmp.OsProfile + } + if vmp.NetworkProfile != nil { + objectMap["networkProfile"] = vmp.NetworkProfile + } + if vmp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile + } + if vmp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmp.AvailabilitySet + } + if vmp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup + } + if vmp.LicenseType != nil { + objectMap["licenseType"] = vmp.LicenseType + } + return json.Marshal(objectMap) +} + +// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will +// always be reimaged type VirtualMachineReimageParameters struct { // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. TempDisk *bool `json:"tempDisk,omitempty"` @@ -7683,10 +6979,15 @@ func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { return vmsselr.Value == nil || len(*vmsselr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { + return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 +} + // virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsselr.NextLink == nil || len(to.String(vmsselr.NextLink)) < 1 { + if !vmsselr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7714,11 +7015,16 @@ func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsselr) + if err != nil { + return err + } + page.vmsselr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsselr = next return nil } @@ -7758,8 +7064,7 @@ type VirtualMachineScaleSetExtensionProfile struct { Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` } -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set -// Extension. +// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set Extension. type VirtualMachineScaleSetExtensionProperties struct { // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` @@ -7781,6 +7086,36 @@ type VirtualMachineScaleSetExtensionProperties struct { ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. +func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag + } + if vmssep.Publisher != nil { + objectMap["publisher"] = vmssep.Publisher + } + if vmssep.Type != nil { + objectMap["type"] = vmssep.Type + } + if vmssep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion + } + if vmssep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion + } + if vmssep.Settings != nil { + objectMap["settings"] = vmssep.Settings + } + if vmssep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmssep.ProtectedSettings + } + if vmssep.ProvisionAfterExtensions != nil { + objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { @@ -7810,8 +7145,8 @@ func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(clien return } -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetExtensionsDeleteFuture struct { azure.Future } @@ -7876,8 +7211,17 @@ type VirtualMachineScaleSetInstanceView struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of -// a virtual machine scale set. +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. +func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssiv.Statuses != nil { + objectMap["statuses"] = vmssiv.Statuses + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of a +// virtual machine scale set. type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // StatusesSummary - READ-ONLY; The extensions information. StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` @@ -7950,8 +7294,8 @@ func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) return nil } -// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's -// IP configuration properties. +// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's IP +// configuration properties. type VirtualMachineScaleSetIPConfigurationProperties struct { // Subnet - Specifies the identifier of the subnet. Subnet *APIEntityReference `json:"subnet,omitempty"` @@ -7979,8 +7323,8 @@ type VirtualMachineScaleSetIPTag struct { Tag *string `json:"tag,omitempty"` } -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History -// operation response. +// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History operation +// response. type VirtualMachineScaleSetListOSUpgradeHistory struct { autorest.Response `json:"-"` // Value - The list of OS upgrades performed on the virtual machine scale set. @@ -8058,10 +7402,15 @@ func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { + return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 +} + // virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if vmsslouh.NextLink == nil || len(to.String(vmsslouh.NextLink)) < 1 { + if !vmsslouh.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8090,11 +7439,16 @@ func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslouh) + if err != nil { + return err + } + page.vmsslouh = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslouh = next return nil } @@ -8206,10 +7560,15 @@ func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { return vmsslr.Value == nil || len(*vmsslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { + return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 +} + // virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslr.NextLink == nil || len(to.String(vmsslr.NextLink)) < 1 { + if !vmsslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8237,11 +7596,16 @@ func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslr) + if err != nil { + return err + } + page.vmsslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslr = next return nil } @@ -8353,10 +7717,15 @@ func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { + return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 +} + // virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslsr.NextLink == nil || len(to.String(vmsslsr.NextLink)) < 1 { + if !vmsslsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8384,11 +7753,16 @@ func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslsr) + if err != nil { + return err + } + page.vmsslsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslsr = next return nil } @@ -8500,10 +7874,15 @@ func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { + return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 +} + // virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslwlr.NextLink == nil || len(to.String(vmsslwlr.NextLink)) < 1 { + if !vmsslwlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8531,11 +7910,16 @@ func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslwlr) + if err != nil { + return err + } + page.vmsslwlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslwlr = next return nil } @@ -8575,8 +7959,8 @@ type VirtualMachineScaleSetManagedDiskParameters struct { StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` } -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. +// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's network +// configurations. type VirtualMachineScaleSetNetworkConfiguration struct { // Name - The network configuration name. Name *string `json:"name,omitempty"` @@ -8649,8 +8033,8 @@ type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { DNSServers *[]string `json:"dnsServers,omitempty"` } -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration. +// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network profile's +// IP configuration. type VirtualMachineScaleSetNetworkConfigurationProperties struct { // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool `json:"primary,omitempty"` @@ -8742,8 +8126,41 @@ type VirtualMachineScaleSetProperties struct { ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` } -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. +func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssp.UpgradePolicy != nil { + objectMap["upgradePolicy"] = vmssp.UpgradePolicy + } + if vmssp.AutomaticRepairsPolicy != nil { + objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy + } + if vmssp.VirtualMachineProfile != nil { + objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile + } + if vmssp.Overprovision != nil { + objectMap["overprovision"] = vmssp.Overprovision + } + if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { + objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs + } + if vmssp.SinglePlacementGroup != nil { + objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup + } + if vmssp.ZoneBalance != nil { + objectMap["zoneBalance"] = vmssp.ZoneBalance + } + if vmssp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount + } + if vmssp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP Configuration's +// PublicIPAddress configuration type VirtualMachineScaleSetPublicIPAddressConfiguration struct { // Name - The publicIP address configuration name. Name *string `json:"name,omitempty"` @@ -8823,8 +8240,8 @@ type VirtualMachineScaleSetReimageParameters struct { TempDisk *bool `json:"tempDisk,omitempty"` } -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { azure.Future } @@ -8869,8 +8286,8 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) return } -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { azure.Future } @@ -8892,8 +8309,8 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result( return } -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsCreateOrUpdateFuture struct { azure.Future } @@ -8967,8 +8384,8 @@ func (future *VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineS return } -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsDeleteInstancesFuture struct { azure.Future } @@ -9012,8 +8429,8 @@ type VirtualMachineScaleSetSkuCapacity struct { ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` } -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetsPerformMaintenanceFuture struct { azure.Future } @@ -9212,8 +8629,8 @@ func (future *VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineS return } -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsUpdateInstancesFuture struct { azure.Future } @@ -9485,9 +8902,8 @@ func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(b return nil } -// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set -// updatable network profile's IP configuration.Use this object for updating network profile's IP -// Configuration. +// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set updatable +// network profile's IP configuration.Use this object for updating network profile's IP Configuration. type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { // Primary - Whether this is a primary NIC on a virtual machine. Primary *bool `json:"primary,omitempty"` @@ -9509,8 +8925,8 @@ type VirtualMachineScaleSetUpdateNetworkProfile struct { NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` } -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update -// Object. This should be used for Updating VMSS OS Disk. +// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update Object. +// This should be used for Updating VMSS OS Disk. type VirtualMachineScaleSetUpdateOSDisk struct { // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' Caching CachingTypes `json:"caching,omitempty"` @@ -9609,8 +9025,8 @@ func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) Unmar return nil } -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale -// set IP Configuration's PublicIPAddress configuration +// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { // IdleTimeoutInMinutes - The idle timeout of the public IP address. IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` @@ -9802,8 +9218,8 @@ func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { return nil } -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine -// scale set. +// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine scale +// set. type VirtualMachineScaleSetVMExtensionsSummary struct { // Name - READ-ONLY; The extension name. Name *string `json:"name,omitempty"` @@ -9811,8 +9227,7 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale -// set. +// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale set. type VirtualMachineScaleSetVMInstanceIDs struct { // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. InstanceIds *[]string `json:"instanceIds,omitempty"` @@ -9852,6 +9267,42 @@ type VirtualMachineScaleSetVMInstanceView struct { PlacementGroupID *string `json:"placementGroupId,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. +func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssviv.PlatformUpdateDomain != nil { + objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain + } + if vmssviv.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain + } + if vmssviv.RdpThumbPrint != nil { + objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint + } + if vmssviv.VMAgent != nil { + objectMap["vmAgent"] = vmssviv.VMAgent + } + if vmssviv.MaintenanceRedeployStatus != nil { + objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus + } + if vmssviv.Disks != nil { + objectMap["disks"] = vmssviv.Disks + } + if vmssviv.Extensions != nil { + objectMap["extensions"] = vmssviv.Extensions + } + if vmssviv.BootDiagnostics != nil { + objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics + } + if vmssviv.Statuses != nil { + objectMap["statuses"] = vmssviv.Statuses + } + if vmssviv.PlacementGroupID != nil { + objectMap["placementGroupId"] = vmssviv.PlacementGroupID + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. type VirtualMachineScaleSetVMListResult struct { autorest.Response `json:"-"` @@ -9861,8 +9312,8 @@ type VirtualMachineScaleSetVMListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetVM values. +// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of VirtualMachineScaleSetVM +// values. type VirtualMachineScaleSetVMListResultIterator struct { i int page VirtualMachineScaleSetVMListResultPage @@ -9930,10 +9381,15 @@ func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { + return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 +} + // virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmssvlr.NextLink == nil || len(to.String(vmssvlr.NextLink)) < 1 { + if !vmssvlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9961,11 +9417,16 @@ func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmssvlr) + if err != nil { + return err + } + page.vmssvlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmssvlr = next return nil } @@ -10021,8 +9482,7 @@ type VirtualMachineScaleSetVMProfile struct { EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` } -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual -// machine. +// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual machine. type VirtualMachineScaleSetVMProperties struct { // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. LatestModelApplied *bool `json:"latestModelApplied,omitempty"` @@ -10050,6 +9510,36 @@ type VirtualMachineScaleSetVMProperties struct { LicenseType *string `json:"licenseType,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. +func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssvp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmssvp.HardwareProfile + } + if vmssvp.StorageProfile != nil { + objectMap["storageProfile"] = vmssvp.StorageProfile + } + if vmssvp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities + } + if vmssvp.OsProfile != nil { + objectMap["osProfile"] = vmssvp.OsProfile + } + if vmssvp.NetworkProfile != nil { + objectMap["networkProfile"] = vmssvp.NetworkProfile + } + if vmssvp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile + } + if vmssvp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmssvp.AvailabilitySet + } + if vmssvp.LicenseType != nil { + objectMap["licenseType"] = vmssvp.LicenseType + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. type VirtualMachineScaleSetVMReimageParameters struct { // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. @@ -10102,8 +9592,8 @@ func (future *VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachin return } -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { azure.Future } @@ -10402,8 +9892,8 @@ func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachines return } -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesDeallocateFuture struct { azure.Future } @@ -10586,8 +10076,8 @@ func (future *VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) return } -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesRunCommandFuture struct { azure.Future } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go index 5a193d2f3dd..12d1ed0b165 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go @@ -100,7 +100,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/proximityplacementgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/proximityplacementgroups.go index 497a0e30965..2396bda59b6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/proximityplacementgroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/proximityplacementgroups.go @@ -113,7 +113,6 @@ func (client ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Requ func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*h func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,6 +301,9 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Con if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -339,7 +339,6 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -414,6 +413,9 @@ func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Cont if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http. func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -564,7 +565,6 @@ func (client ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*h func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/resourceskus.go index 1ccb8566105..61027f6ccde 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/resourceskus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/resourceskus.go @@ -71,6 +71,9 @@ func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusR if err != nil { err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") } + if result.rsr.hasNextLink() && result.rsr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -105,7 +108,6 @@ func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go index 7f06c545478..c11e93745bd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go @@ -136,7 +136,6 @@ func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future Sn func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -213,7 +212,6 @@ func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsD func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -289,7 +287,6 @@ func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, erro func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -375,7 +372,6 @@ func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future Snaps func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +409,9 @@ func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -447,7 +446,6 @@ func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, err func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -524,6 +522,9 @@ func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceG if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -559,7 +560,6 @@ func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*htt func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -673,7 +673,6 @@ func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future Snap func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -752,7 +751,6 @@ func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsU func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go index d311634e7d1..2658d2e0dc4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go @@ -81,6 +81,9 @@ func (client UsageClient) List(ctx context.Context, location string) (result Lis if err != nil { err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") } + if result.lur.hasNextLink() && result.lur.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -116,7 +119,6 @@ func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go index 808c01cceec..d1e24cac24f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go @@ -111,7 +111,6 @@ func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) ( func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -186,7 +185,6 @@ func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Requ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -272,7 +270,6 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.R func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go index 880a8b02a08..58814d0c3bc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go @@ -115,7 +115,6 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Requ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -193,7 +192,6 @@ func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (fu func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -274,7 +272,6 @@ func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -354,7 +351,6 @@ func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*htt func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -435,7 +431,6 @@ func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (fu func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go index 024bfba5e86..07a28904a26 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go @@ -116,7 +116,6 @@ func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Res func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,7 +205,6 @@ func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Re func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -282,7 +280,6 @@ func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*h func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -356,7 +353,6 @@ func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -434,7 +430,6 @@ func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*htt func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go index 0781c205e41..f919701d77d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go @@ -117,7 +117,6 @@ func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*htt func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -163,6 +162,9 @@ func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") } + if result.rclr.hasNextLink() && result.rclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -198,7 +200,6 @@ func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*ht func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go index 3f5703217aa..83be0841d67 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go @@ -122,7 +122,6 @@ func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future Vir func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,7 +198,6 @@ func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Reques func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -299,7 +297,6 @@ func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (fut func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -376,7 +373,6 @@ func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -451,7 +447,6 @@ func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future Virt func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -526,7 +521,6 @@ func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.R func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -605,7 +599,6 @@ func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -681,7 +674,6 @@ func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -722,6 +714,9 @@ func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -757,7 +752,6 @@ func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Respons func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -833,6 +827,9 @@ func (client VirtualMachinesClient) ListAll(ctx context.Context) (result Virtual if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -867,7 +864,6 @@ func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Resp func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -980,7 +976,6 @@ func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1026,6 +1021,9 @@ func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1061,7 +1059,6 @@ func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*ht func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1174,7 +1171,6 @@ func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1250,7 +1246,6 @@ func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future Vi func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1325,7 +1320,6 @@ func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future Vi func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1406,7 +1400,6 @@ func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future Vir func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1481,7 +1474,6 @@ func (client VirtualMachinesClient) RestartSender(req *http.Request) (future Vir func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1565,7 +1557,6 @@ func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1641,7 +1632,6 @@ func (client VirtualMachinesClient) StartSender(req *http.Request) (future Virtu func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1719,7 +1709,6 @@ func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future Virt func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go index f89ae6ce21b..5e35c286599 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go @@ -115,7 +115,6 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *h func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -193,7 +192,6 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Requ func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -274,7 +272,6 @@ func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -315,6 +312,9 @@ func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, r if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") } + if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -351,7 +351,6 @@ func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Reques func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go index 7120daffd84..d41790d19c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go @@ -111,7 +111,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -186,7 +185,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *h func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -264,7 +262,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeS func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -340,7 +337,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(r func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go index 7a36f08ab57..8ce53cbffc7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go @@ -137,7 +137,6 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Reque func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -220,7 +219,6 @@ func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -295,7 +293,6 @@ func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (fut func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -379,7 +376,6 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Requ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -457,7 +453,6 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -533,7 +528,6 @@ func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http. func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -609,7 +603,6 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Requ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -650,6 +643,9 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Cont if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") } + if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -686,7 +682,6 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -763,6 +758,9 @@ func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") } + if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -798,7 +796,6 @@ func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -875,6 +872,9 @@ func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") } + if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -909,7 +909,6 @@ func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*h func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -988,6 +987,9 @@ func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") } + if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1024,7 +1026,6 @@ func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (* func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1145,7 +1146,6 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.R func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1227,7 +1227,6 @@ func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (f func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1309,7 +1308,6 @@ func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (f func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1391,7 +1389,6 @@ func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (fu func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1473,7 +1470,6 @@ func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1554,7 +1550,6 @@ func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (fu func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1635,7 +1630,6 @@ func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (futu func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1713,7 +1707,6 @@ func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (fut func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1798,7 +1791,6 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Requ func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go index 74f8423d847..05f327f7309 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go @@ -115,7 +115,6 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -192,7 +191,6 @@ func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (f func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -269,7 +267,6 @@ func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*htt func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -347,7 +344,6 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Re func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -359,9 +355,10 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt // Parameters: // resourceGroupName - the name of the resource group. // virtualMachineScaleSetName - the name of the VM scale set. -// filter - the filter to apply to the operation. -// selectParameter - the list parameters. -// expand - the expand expression to apply to the operation. +// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, +// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. +// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") @@ -391,6 +388,9 @@ func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") } + if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -436,7 +436,6 @@ func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*ht func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -551,7 +550,6 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -629,7 +627,6 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -707,7 +704,6 @@ func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -790,7 +786,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) ( func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -868,7 +863,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -945,7 +939,6 @@ func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) ( func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1031,7 +1024,6 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1109,7 +1101,6 @@ func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (fu func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1214,7 +1205,6 @@ func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (f func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go index 8e64472e4d2..cc5424e324e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go @@ -116,7 +116,6 @@ func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Res func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go index fa23adc38c6..def48314528 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/availabilitysets.go @@ -113,7 +113,6 @@ func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*h func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Resp func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Respons func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,6 +301,9 @@ func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -339,7 +339,6 @@ func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Respon func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -453,7 +452,6 @@ func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -463,7 +461,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp // ListBySubscription lists all availability sets in a subscription. // Parameters: -// expand - the expand expression to apply to the operation. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") @@ -493,6 +491,9 @@ func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, exp if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -530,7 +531,6 @@ func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -646,7 +646,6 @@ func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Resp func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go index 0d0f705daba..92208281f44 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/containerservices.go @@ -146,7 +146,6 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -225,7 +224,6 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -302,7 +300,6 @@ func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Respon func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -341,6 +338,9 @@ func (client ContainerServicesClient) List(ctx context.Context) (result Containe if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -375,7 +375,6 @@ func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Respo func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -454,6 +453,9 @@ func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, r if err != nil { err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -489,7 +491,6 @@ func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Reques func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go index 2ae90747f6f..a4dbcd355a6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhostgroups.go @@ -126,7 +126,6 @@ func (client DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,7 +201,6 @@ func (client DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.R func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -277,7 +275,6 @@ func (client DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Resp func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -318,6 +315,9 @@ func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -353,7 +353,6 @@ func (client DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Requ func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -429,6 +428,9 @@ func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -463,7 +465,6 @@ func (client DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Reque func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -579,7 +580,6 @@ func (client DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.R func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go index 53126ca8424..104ac3cfe03 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/dedicatedhosts.go @@ -127,7 +127,6 @@ func (client DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (futu func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -205,7 +204,6 @@ func (client DedicatedHostsClient) DeleteSender(req *http.Request) (future Dedic func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -286,7 +284,6 @@ func (client DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -328,6 +325,9 @@ func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") } + if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -364,7 +364,6 @@ func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*ht func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -482,7 +481,6 @@ func (client DedicatedHostsClient) UpdateSender(req *http.Request) (future Dedic func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go index 12874d026a5..cd9fea1050f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/diskencryptionsets.go @@ -128,7 +128,6 @@ func (client DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) ( func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,7 +205,6 @@ func (client DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future D func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -283,7 +281,6 @@ func (client DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Respo func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -321,6 +318,9 @@ func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEnc if err != nil { err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") } + if result.desl.hasNextLink() && result.desl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -355,7 +355,6 @@ func (client DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Resp func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -432,6 +431,9 @@ func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.desl.hasNextLink() && result.desl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -467,7 +469,6 @@ func (client DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Reque func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -586,7 +587,6 @@ func (client DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future D func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go index 420deb65479..b214d782776 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/disks.go @@ -132,7 +132,6 @@ func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksC func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -210,7 +209,6 @@ func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFut func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -287,7 +285,6 @@ func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -374,7 +371,6 @@ func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGran func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,6 +408,9 @@ func (client DisksClient) List(ctx context.Context) (result DiskListPage, err er if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -446,7 +445,6 @@ func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -523,6 +521,9 @@ func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -558,7 +559,6 @@ func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Re func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -673,7 +673,6 @@ func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRev func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -753,7 +752,6 @@ func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFut func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go new file mode 100644 index 00000000000..168949b0bc7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/enums.go @@ -0,0 +1,1404 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessLevel enumerates the values for access level. +type AccessLevel string + +const ( + // None ... + None AccessLevel = "None" + // Read ... + Read AccessLevel = "Read" + // Write ... + Write AccessLevel = "Write" +) + +// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. +func PossibleAccessLevelValues() []AccessLevel { + return []AccessLevel{None, Read, Write} +} + +// AggregatedReplicationState enumerates the values for aggregated replication state. +type AggregatedReplicationState string + +const ( + // Completed ... + Completed AggregatedReplicationState = "Completed" + // Failed ... + Failed AggregatedReplicationState = "Failed" + // InProgress ... + InProgress AggregatedReplicationState = "InProgress" + // Unknown ... + Unknown AggregatedReplicationState = "Unknown" +) + +// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. +func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { + return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} +} + +// AvailabilitySetSkuTypes enumerates the values for availability set sku types. +type AvailabilitySetSkuTypes string + +const ( + // Aligned ... + Aligned AvailabilitySetSkuTypes = "Aligned" + // Classic ... + Classic AvailabilitySetSkuTypes = "Classic" +) + +// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. +func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { + return []AvailabilitySetSkuTypes{Aligned, Classic} +} + +// CachingTypes enumerates the values for caching types. +type CachingTypes string + +const ( + // CachingTypesNone ... + CachingTypesNone CachingTypes = "None" + // CachingTypesReadOnly ... + CachingTypesReadOnly CachingTypes = "ReadOnly" + // CachingTypesReadWrite ... + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. +func PossibleCachingTypesValues() []CachingTypes { + return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} +} + +// ComponentNames enumerates the values for component names. +type ComponentNames string + +const ( + // MicrosoftWindowsShellSetup ... + MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. +func PossibleComponentNamesValues() []ComponentNames { + return []ComponentNames{MicrosoftWindowsShellSetup} +} + +// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. +type ContainerServiceOrchestratorTypes string + +const ( + // Custom ... + Custom ContainerServiceOrchestratorTypes = "Custom" + // DCOS ... + DCOS ContainerServiceOrchestratorTypes = "DCOS" + // Kubernetes ... + Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm ContainerServiceOrchestratorTypes = "Swarm" +) + +// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. +func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { + return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} +} + +// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. +type ContainerServiceVMSizeTypes string + +const ( + // StandardA0 ... + StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" + // StandardA1 ... + StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" + // StandardA10 ... + StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" + // StandardA11 ... + StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" + // StandardA2 ... + StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" + // StandardA3 ... + StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" + // StandardA4 ... + StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" + // StandardA5 ... + StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" + // StandardA6 ... + StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" + // StandardA7 ... + StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" + // StandardA8 ... + StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" + // StandardA9 ... + StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" + // StandardD1 ... + StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" + // StandardD11 ... + StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" + // StandardD11V2 ... + StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" + // StandardD12 ... + StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" + // StandardD12V2 ... + StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" + // StandardD13 ... + StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" + // StandardD13V2 ... + StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" + // StandardD14 ... + StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" + // StandardD14V2 ... + StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" + // StandardD1V2 ... + StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" + // StandardD2 ... + StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" + // StandardD2V2 ... + StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" + // StandardD3 ... + StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" + // StandardD3V2 ... + StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" + // StandardD4 ... + StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" + // StandardD4V2 ... + StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" + // StandardD5V2 ... + StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" + // StandardDS1 ... + StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" + // StandardDS11 ... + StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" + // StandardDS12 ... + StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" + // StandardDS13 ... + StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" + // StandardDS14 ... + StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" + // StandardDS2 ... + StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" + // StandardDS3 ... + StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" + // StandardDS4 ... + StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" + // StandardG1 ... + StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" + // StandardG2 ... + StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" + // StandardG3 ... + StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" + // StandardG4 ... + StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" + // StandardG5 ... + StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" + // StandardGS1 ... + StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" + // StandardGS2 ... + StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" + // StandardGS3 ... + StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" + // StandardGS4 ... + StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" + // StandardGS5 ... + StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" +) + +// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. +func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { + return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} +} + +// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. +type DedicatedHostLicenseTypes string + +const ( + // DedicatedHostLicenseTypesNone ... + DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" + // DedicatedHostLicenseTypesWindowsServerHybrid ... + DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" + // DedicatedHostLicenseTypesWindowsServerPerpetual ... + DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" +) + +// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. +func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { + return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} +} + +// DiffDiskOptions enumerates the values for diff disk options. +type DiffDiskOptions string + +const ( + // Local ... + Local DiffDiskOptions = "Local" +) + +// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. +func PossibleDiffDiskOptionsValues() []DiffDiskOptions { + return []DiffDiskOptions{Local} +} + +// DiffDiskPlacement enumerates the values for diff disk placement. +type DiffDiskPlacement string + +const ( + // CacheDisk ... + CacheDisk DiffDiskPlacement = "CacheDisk" + // ResourceDisk ... + ResourceDisk DiffDiskPlacement = "ResourceDisk" +) + +// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. +func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { + return []DiffDiskPlacement{CacheDisk, ResourceDisk} +} + +// DiskCreateOption enumerates the values for disk create option. +type DiskCreateOption string + +const ( + // Attach Disk will be attached to a VM. + Attach DiskCreateOption = "Attach" + // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given + // sourceResourceId. + Copy DiskCreateOption = "Copy" + // Empty Create an empty data disk of a size given by diskSizeGB. + Empty DiskCreateOption = "Empty" + // FromImage Create a new disk from a platform image specified by the given imageReference or + // galleryImageReference. + FromImage DiskCreateOption = "FromImage" + // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by + // storageAccountId. + Import DiskCreateOption = "Import" + // Restore Create a new disk by copying from a backup recovery point. + Restore DiskCreateOption = "Restore" + // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the + // disk. + Upload DiskCreateOption = "Upload" +) + +// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. +func PossibleDiskCreateOptionValues() []DiskCreateOption { + return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} +} + +// DiskCreateOptionTypes enumerates the values for disk create option types. +type DiskCreateOptionTypes string + +const ( + // DiskCreateOptionTypesAttach ... + DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" + // DiskCreateOptionTypesEmpty ... + DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" + // DiskCreateOptionTypesFromImage ... + DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" +) + +// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. +func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { + return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} +} + +// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. +type DiskEncryptionSetIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" +) + +// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. +func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { + return []DiskEncryptionSetIdentityType{SystemAssigned} +} + +// DiskState enumerates the values for disk state. +type DiskState string + +const ( + // ActiveSAS The disk currently has an Active SAS Uri associated with it. + ActiveSAS DiskState = "ActiveSAS" + // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. + ActiveUpload DiskState = "ActiveUpload" + // Attached The disk is currently mounted to a running VM. + Attached DiskState = "Attached" + // ReadyToUpload A disk is ready to be created by upload by requesting a write token. + ReadyToUpload DiskState = "ReadyToUpload" + // Reserved The disk is mounted to a stopped-deallocated VM + Reserved DiskState = "Reserved" + // Unattached The disk is not being used and can be attached to a VM. + Unattached DiskState = "Unattached" +) + +// PossibleDiskStateValues returns an array of possible values for the DiskState const type. +func PossibleDiskStateValues() []DiskState { + return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} +} + +// DiskStorageAccountTypes enumerates the values for disk storage account types. +type DiskStorageAccountTypes string + +const ( + // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive + // workloads. + PremiumLRS DiskStorageAccountTypes = "Premium_LRS" + // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent + // access. + StandardLRS DiskStorageAccountTypes = "Standard_LRS" + // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise + // applications and dev/test. + StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" + // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top + // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. + UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. +func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { + return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} +} + +// EncryptionType enumerates the values for encryption type. +type EncryptionType string + +const ( + // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. + EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" + // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default + // encryption type. + EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" +) + +// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. +func PossibleEncryptionTypeValues() []EncryptionType { + return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} +} + +// HostCaching enumerates the values for host caching. +type HostCaching string + +const ( + // HostCachingNone ... + HostCachingNone HostCaching = "None" + // HostCachingReadOnly ... + HostCachingReadOnly HostCaching = "ReadOnly" + // HostCachingReadWrite ... + HostCachingReadWrite HostCaching = "ReadWrite" +) + +// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. +func PossibleHostCachingValues() []HostCaching { + return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} +} + +// HyperVGeneration enumerates the values for hyper v generation. +type HyperVGeneration string + +const ( + // V1 ... + V1 HyperVGeneration = "V1" + // V2 ... + V2 HyperVGeneration = "V2" +) + +// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. +func PossibleHyperVGenerationValues() []HyperVGeneration { + return []HyperVGeneration{V1, V2} +} + +// HyperVGenerationType enumerates the values for hyper v generation type. +type HyperVGenerationType string + +const ( + // HyperVGenerationTypeV1 ... + HyperVGenerationTypeV1 HyperVGenerationType = "V1" + // HyperVGenerationTypeV2 ... + HyperVGenerationTypeV2 HyperVGenerationType = "V2" +) + +// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. +func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { + return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} +} + +// HyperVGenerationTypes enumerates the values for hyper v generation types. +type HyperVGenerationTypes string + +const ( + // HyperVGenerationTypesV1 ... + HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" + // HyperVGenerationTypesV2 ... + HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" +) + +// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. +func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { + return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} +} + +// InstanceViewTypes enumerates the values for instance view types. +type InstanceViewTypes string + +const ( + // InstanceView ... + InstanceView InstanceViewTypes = "instanceView" +) + +// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{InstanceView} +} + +// IntervalInMins enumerates the values for interval in mins. +type IntervalInMins string + +const ( + // FiveMins ... + FiveMins IntervalInMins = "FiveMins" + // SixtyMins ... + SixtyMins IntervalInMins = "SixtyMins" + // ThirtyMins ... + ThirtyMins IntervalInMins = "ThirtyMins" + // ThreeMins ... + ThreeMins IntervalInMins = "ThreeMins" +) + +// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. +func PossibleIntervalInMinsValues() []IntervalInMins { + return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} +} + +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPv4 ... + IPv4 IPVersion = "IPv4" + // IPv6 ... + IPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + +// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. +type MaintenanceOperationResultCodeTypes string + +const ( + // MaintenanceOperationResultCodeTypesMaintenanceAborted ... + MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" + // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... + MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" + // MaintenanceOperationResultCodeTypesNone ... + MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" + // MaintenanceOperationResultCodeTypesRetryLater ... + MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" +) + +// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. +func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { + return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} +} + +// OperatingSystemStateTypes enumerates the values for operating system state types. +type OperatingSystemStateTypes string + +const ( + // Generalized Generalized image. Needs to be provisioned during deployment time. + Generalized OperatingSystemStateTypes = "Generalized" + // Specialized Specialized image. Contains already provisioned OS Disk. + Specialized OperatingSystemStateTypes = "Specialized" +) + +// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. +func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { + return []OperatingSystemStateTypes{Generalized, Specialized} +} + +// OperatingSystemTypes enumerates the values for operating system types. +type OperatingSystemTypes string + +const ( + // Linux ... + Linux OperatingSystemTypes = "Linux" + // Windows ... + Windows OperatingSystemTypes = "Windows" +) + +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{Linux, Windows} +} + +// OrchestrationServiceNames enumerates the values for orchestration service names. +type OrchestrationServiceNames string + +const ( + // AutomaticRepairs ... + AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" +) + +// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. +func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { + return []OrchestrationServiceNames{AutomaticRepairs} +} + +// OrchestrationServiceState enumerates the values for orchestration service state. +type OrchestrationServiceState string + +const ( + // NotRunning ... + NotRunning OrchestrationServiceState = "NotRunning" + // Running ... + Running OrchestrationServiceState = "Running" + // Suspended ... + Suspended OrchestrationServiceState = "Suspended" +) + +// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. +func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { + return []OrchestrationServiceState{NotRunning, Running, Suspended} +} + +// OrchestrationServiceStateAction enumerates the values for orchestration service state action. +type OrchestrationServiceStateAction string + +const ( + // Resume ... + Resume OrchestrationServiceStateAction = "Resume" + // Suspend ... + Suspend OrchestrationServiceStateAction = "Suspend" +) + +// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. +func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { + return []OrchestrationServiceStateAction{Resume, Suspend} +} + +// PassNames enumerates the values for pass names. +type PassNames string + +const ( + // OobeSystem ... + OobeSystem PassNames = "OobeSystem" +) + +// PossiblePassNamesValues returns an array of possible values for the PassNames const type. +func PossiblePassNamesValues() []PassNames { + return []PassNames{OobeSystem} +} + +// ProtocolTypes enumerates the values for protocol types. +type ProtocolTypes string + +const ( + // HTTP ... + HTTP ProtocolTypes = "Http" + // HTTPS ... + HTTPS ProtocolTypes = "Https" +) + +// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. +func PossibleProtocolTypesValues() []ProtocolTypes { + return []ProtocolTypes{HTTP, HTTPS} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateMigrating ... + ProvisioningStateMigrating ProvisioningState = "Migrating" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// ProvisioningState1 enumerates the values for provisioning state 1. +type ProvisioningState1 string + +const ( + // ProvisioningState1Creating ... + ProvisioningState1Creating ProvisioningState1 = "Creating" + // ProvisioningState1Deleting ... + ProvisioningState1Deleting ProvisioningState1 = "Deleting" + // ProvisioningState1Failed ... + ProvisioningState1Failed ProvisioningState1 = "Failed" + // ProvisioningState1Migrating ... + ProvisioningState1Migrating ProvisioningState1 = "Migrating" + // ProvisioningState1Succeeded ... + ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" + // ProvisioningState1Updating ... + ProvisioningState1Updating ProvisioningState1 = "Updating" +) + +// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. +func PossibleProvisioningState1Values() []ProvisioningState1 { + return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} +} + +// ProvisioningState2 enumerates the values for provisioning state 2. +type ProvisioningState2 string + +const ( + // ProvisioningState2Creating ... + ProvisioningState2Creating ProvisioningState2 = "Creating" + // ProvisioningState2Deleting ... + ProvisioningState2Deleting ProvisioningState2 = "Deleting" + // ProvisioningState2Failed ... + ProvisioningState2Failed ProvisioningState2 = "Failed" + // ProvisioningState2Migrating ... + ProvisioningState2Migrating ProvisioningState2 = "Migrating" + // ProvisioningState2Succeeded ... + ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" + // ProvisioningState2Updating ... + ProvisioningState2Updating ProvisioningState2 = "Updating" +) + +// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. +func PossibleProvisioningState2Values() []ProvisioningState2 { + return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} +} + +// ProvisioningState3 enumerates the values for provisioning state 3. +type ProvisioningState3 string + +const ( + // ProvisioningState3Creating ... + ProvisioningState3Creating ProvisioningState3 = "Creating" + // ProvisioningState3Deleting ... + ProvisioningState3Deleting ProvisioningState3 = "Deleting" + // ProvisioningState3Failed ... + ProvisioningState3Failed ProvisioningState3 = "Failed" + // ProvisioningState3Migrating ... + ProvisioningState3Migrating ProvisioningState3 = "Migrating" + // ProvisioningState3Succeeded ... + ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" + // ProvisioningState3Updating ... + ProvisioningState3Updating ProvisioningState3 = "Updating" +) + +// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. +func PossibleProvisioningState3Values() []ProvisioningState3 { + return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} +} + +// ProximityPlacementGroupType enumerates the values for proximity placement group type. +type ProximityPlacementGroupType string + +const ( + // Standard ... + Standard ProximityPlacementGroupType = "Standard" + // Ultra ... + Ultra ProximityPlacementGroupType = "Ultra" +) + +// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. +func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { + return []ProximityPlacementGroupType{Standard, Ultra} +} + +// ReplicationState enumerates the values for replication state. +type ReplicationState string + +const ( + // ReplicationStateCompleted ... + ReplicationStateCompleted ReplicationState = "Completed" + // ReplicationStateFailed ... + ReplicationStateFailed ReplicationState = "Failed" + // ReplicationStateReplicating ... + ReplicationStateReplicating ReplicationState = "Replicating" + // ReplicationStateUnknown ... + ReplicationStateUnknown ReplicationState = "Unknown" +) + +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} +} + +// ReplicationStatusTypes enumerates the values for replication status types. +type ReplicationStatusTypes string + +const ( + // ReplicationStatusTypesReplicationStatus ... + ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" +) + +// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. +func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { + return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. +type ResourceSkuCapacityScaleType string + +const ( + // ResourceSkuCapacityScaleTypeAutomatic ... + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + // ResourceSkuCapacityScaleTypeManual ... + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + // ResourceSkuCapacityScaleTypeNone ... + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. +func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} +} + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // Location ... + Location ResourceSkuRestrictionsType = "Location" + // Zone ... + Zone ResourceSkuRestrictionsType = "Zone" +) + +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{Location, Zone} +} + +// RollingUpgradeActionType enumerates the values for rolling upgrade action type. +type RollingUpgradeActionType string + +const ( + // Cancel ... + Cancel RollingUpgradeActionType = "Cancel" + // Start ... + Start RollingUpgradeActionType = "Start" +) + +// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. +func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { + return []RollingUpgradeActionType{Cancel, Start} +} + +// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. +type RollingUpgradeStatusCode string + +const ( + // RollingUpgradeStatusCodeCancelled ... + RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" + // RollingUpgradeStatusCodeCompleted ... + RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" + // RollingUpgradeStatusCodeFaulted ... + RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" + // RollingUpgradeStatusCodeRollingForward ... + RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" +) + +// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. +func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { + return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} +} + +// SettingNames enumerates the values for setting names. +type SettingNames string + +const ( + // AutoLogon ... + AutoLogon SettingNames = "AutoLogon" + // FirstLogonCommands ... + FirstLogonCommands SettingNames = "FirstLogonCommands" +) + +// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. +func PossibleSettingNamesValues() []SettingNames { + return []SettingNames{AutoLogon, FirstLogonCommands} +} + +// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. +type SnapshotStorageAccountTypes string + +const ( + // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage + SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" + // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage + SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" + // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage + SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" +) + +// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. +func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { + return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} +} + +// StatusLevelTypes enumerates the values for status level types. +type StatusLevelTypes string + +const ( + // Error ... + Error StatusLevelTypes = "Error" + // Info ... + Info StatusLevelTypes = "Info" + // Warning ... + Warning StatusLevelTypes = "Warning" +) + +// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. +func PossibleStatusLevelTypesValues() []StatusLevelTypes { + return []StatusLevelTypes{Error, Info, Warning} +} + +// StorageAccountType enumerates the values for storage account type. +type StorageAccountType string + +const ( + // StorageAccountTypePremiumLRS ... + StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" + // StorageAccountTypeStandardLRS ... + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" + // StorageAccountTypeStandardZRS ... + StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" +) + +// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} +} + +// StorageAccountTypes enumerates the values for storage account types. +type StorageAccountTypes string + +const ( + // StorageAccountTypesPremiumLRS ... + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + // StorageAccountTypesStandardLRS ... + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + // StorageAccountTypesStandardSSDLRS ... + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + // StorageAccountTypesUltraSSDLRS ... + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. +func PossibleStorageAccountTypesValues() []StorageAccountTypes { + return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} +} + +// UpgradeMode enumerates the values for upgrade mode. +type UpgradeMode string + +const ( + // Automatic ... + Automatic UpgradeMode = "Automatic" + // Manual ... + Manual UpgradeMode = "Manual" + // Rolling ... + Rolling UpgradeMode = "Rolling" +) + +// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. +func PossibleUpgradeModeValues() []UpgradeMode { + return []UpgradeMode{Automatic, Manual, Rolling} +} + +// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. +type UpgradeOperationInvoker string + +const ( + // UpgradeOperationInvokerPlatform ... + UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" + // UpgradeOperationInvokerUnknown ... + UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" + // UpgradeOperationInvokerUser ... + UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" +) + +// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. +func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { + return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} +} + +// UpgradeState enumerates the values for upgrade state. +type UpgradeState string + +const ( + // UpgradeStateCancelled ... + UpgradeStateCancelled UpgradeState = "Cancelled" + // UpgradeStateCompleted ... + UpgradeStateCompleted UpgradeState = "Completed" + // UpgradeStateFaulted ... + UpgradeStateFaulted UpgradeState = "Faulted" + // UpgradeStateRollingForward ... + UpgradeStateRollingForward UpgradeState = "RollingForward" +) + +// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. +func PossibleUpgradeStateValues() []UpgradeState { + return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} +} + +// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. +type VirtualMachineEvictionPolicyTypes string + +const ( + // Deallocate ... + Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" + // Delete ... + Delete VirtualMachineEvictionPolicyTypes = "Delete" +) + +// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. +func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { + return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} +} + +// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. +type VirtualMachinePriorityTypes string + +const ( + // Low ... + Low VirtualMachinePriorityTypes = "Low" + // Regular ... + Regular VirtualMachinePriorityTypes = "Regular" + // Spot ... + Spot VirtualMachinePriorityTypes = "Spot" +) + +// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. +func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { + return []VirtualMachinePriorityTypes{Low, Regular, Spot} +} + +// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. +type VirtualMachineScaleSetScaleInRules string + +const ( + // Default ... + Default VirtualMachineScaleSetScaleInRules = "Default" + // NewestVM ... + NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" + // OldestVM ... + OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" +) + +// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} +} + +// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. +type VirtualMachineScaleSetSkuScaleType string + +const ( + // VirtualMachineScaleSetSkuScaleTypeAutomatic ... + VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" + // VirtualMachineScaleSetSkuScaleTypeNone ... + VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" +) + +// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. +func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { + return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} +} + +// VirtualMachineSizeTypes enumerates the values for virtual machine size types. +type VirtualMachineSizeTypes string + +const ( + // VirtualMachineSizeTypesBasicA0 ... + VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" + // VirtualMachineSizeTypesBasicA1 ... + VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" + // VirtualMachineSizeTypesBasicA2 ... + VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" + // VirtualMachineSizeTypesBasicA3 ... + VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" + // VirtualMachineSizeTypesBasicA4 ... + VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" + // VirtualMachineSizeTypesStandardA0 ... + VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" + // VirtualMachineSizeTypesStandardA1 ... + VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" + // VirtualMachineSizeTypesStandardA10 ... + VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" + // VirtualMachineSizeTypesStandardA11 ... + VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" + // VirtualMachineSizeTypesStandardA1V2 ... + VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" + // VirtualMachineSizeTypesStandardA2 ... + VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" + // VirtualMachineSizeTypesStandardA2mV2 ... + VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" + // VirtualMachineSizeTypesStandardA2V2 ... + VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" + // VirtualMachineSizeTypesStandardA3 ... + VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" + // VirtualMachineSizeTypesStandardA4 ... + VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" + // VirtualMachineSizeTypesStandardA4mV2 ... + VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" + // VirtualMachineSizeTypesStandardA4V2 ... + VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" + // VirtualMachineSizeTypesStandardA5 ... + VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" + // VirtualMachineSizeTypesStandardA6 ... + VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" + // VirtualMachineSizeTypesStandardA7 ... + VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" + // VirtualMachineSizeTypesStandardA8 ... + VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" + // VirtualMachineSizeTypesStandardA8mV2 ... + VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" + // VirtualMachineSizeTypesStandardA8V2 ... + VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" + // VirtualMachineSizeTypesStandardA9 ... + VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" + // VirtualMachineSizeTypesStandardB1ms ... + VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" + // VirtualMachineSizeTypesStandardB1s ... + VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" + // VirtualMachineSizeTypesStandardB2ms ... + VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" + // VirtualMachineSizeTypesStandardB2s ... + VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" + // VirtualMachineSizeTypesStandardB4ms ... + VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" + // VirtualMachineSizeTypesStandardB8ms ... + VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" + // VirtualMachineSizeTypesStandardD1 ... + VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" + // VirtualMachineSizeTypesStandardD11 ... + VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" + // VirtualMachineSizeTypesStandardD11V2 ... + VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" + // VirtualMachineSizeTypesStandardD12 ... + VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" + // VirtualMachineSizeTypesStandardD12V2 ... + VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" + // VirtualMachineSizeTypesStandardD13 ... + VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" + // VirtualMachineSizeTypesStandardD13V2 ... + VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" + // VirtualMachineSizeTypesStandardD14 ... + VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" + // VirtualMachineSizeTypesStandardD14V2 ... + VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" + // VirtualMachineSizeTypesStandardD15V2 ... + VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" + // VirtualMachineSizeTypesStandardD16sV3 ... + VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" + // VirtualMachineSizeTypesStandardD16V3 ... + VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" + // VirtualMachineSizeTypesStandardD1V2 ... + VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" + // VirtualMachineSizeTypesStandardD2 ... + VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" + // VirtualMachineSizeTypesStandardD2sV3 ... + VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" + // VirtualMachineSizeTypesStandardD2V2 ... + VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" + // VirtualMachineSizeTypesStandardD2V3 ... + VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" + // VirtualMachineSizeTypesStandardD3 ... + VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" + // VirtualMachineSizeTypesStandardD32sV3 ... + VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" + // VirtualMachineSizeTypesStandardD32V3 ... + VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" + // VirtualMachineSizeTypesStandardD3V2 ... + VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" + // VirtualMachineSizeTypesStandardD4 ... + VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" + // VirtualMachineSizeTypesStandardD4sV3 ... + VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" + // VirtualMachineSizeTypesStandardD4V2 ... + VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" + // VirtualMachineSizeTypesStandardD4V3 ... + VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" + // VirtualMachineSizeTypesStandardD5V2 ... + VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" + // VirtualMachineSizeTypesStandardD64sV3 ... + VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" + // VirtualMachineSizeTypesStandardD64V3 ... + VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" + // VirtualMachineSizeTypesStandardD8sV3 ... + VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" + // VirtualMachineSizeTypesStandardD8V3 ... + VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" + // VirtualMachineSizeTypesStandardDS1 ... + VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" + // VirtualMachineSizeTypesStandardDS11 ... + VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" + // VirtualMachineSizeTypesStandardDS11V2 ... + VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" + // VirtualMachineSizeTypesStandardDS12 ... + VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" + // VirtualMachineSizeTypesStandardDS12V2 ... + VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" + // VirtualMachineSizeTypesStandardDS13 ... + VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" + // VirtualMachineSizeTypesStandardDS132V2 ... + VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" + // VirtualMachineSizeTypesStandardDS134V2 ... + VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" + // VirtualMachineSizeTypesStandardDS13V2 ... + VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" + // VirtualMachineSizeTypesStandardDS14 ... + VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" + // VirtualMachineSizeTypesStandardDS144V2 ... + VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" + // VirtualMachineSizeTypesStandardDS148V2 ... + VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" + // VirtualMachineSizeTypesStandardDS14V2 ... + VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" + // VirtualMachineSizeTypesStandardDS15V2 ... + VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" + // VirtualMachineSizeTypesStandardDS1V2 ... + VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" + // VirtualMachineSizeTypesStandardDS2 ... + VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" + // VirtualMachineSizeTypesStandardDS2V2 ... + VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" + // VirtualMachineSizeTypesStandardDS3 ... + VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" + // VirtualMachineSizeTypesStandardDS3V2 ... + VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" + // VirtualMachineSizeTypesStandardDS4 ... + VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" + // VirtualMachineSizeTypesStandardDS4V2 ... + VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" + // VirtualMachineSizeTypesStandardDS5V2 ... + VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" + // VirtualMachineSizeTypesStandardE16sV3 ... + VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" + // VirtualMachineSizeTypesStandardE16V3 ... + VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" + // VirtualMachineSizeTypesStandardE2sV3 ... + VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" + // VirtualMachineSizeTypesStandardE2V3 ... + VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" + // VirtualMachineSizeTypesStandardE3216V3 ... + VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" + // VirtualMachineSizeTypesStandardE328sV3 ... + VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" + // VirtualMachineSizeTypesStandardE32sV3 ... + VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" + // VirtualMachineSizeTypesStandardE32V3 ... + VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" + // VirtualMachineSizeTypesStandardE4sV3 ... + VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" + // VirtualMachineSizeTypesStandardE4V3 ... + VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" + // VirtualMachineSizeTypesStandardE6416sV3 ... + VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" + // VirtualMachineSizeTypesStandardE6432sV3 ... + VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" + // VirtualMachineSizeTypesStandardE64sV3 ... + VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" + // VirtualMachineSizeTypesStandardE64V3 ... + VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" + // VirtualMachineSizeTypesStandardE8sV3 ... + VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" + // VirtualMachineSizeTypesStandardE8V3 ... + VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" + // VirtualMachineSizeTypesStandardF1 ... + VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" + // VirtualMachineSizeTypesStandardF16 ... + VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" + // VirtualMachineSizeTypesStandardF16s ... + VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" + // VirtualMachineSizeTypesStandardF16sV2 ... + VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" + // VirtualMachineSizeTypesStandardF1s ... + VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" + // VirtualMachineSizeTypesStandardF2 ... + VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" + // VirtualMachineSizeTypesStandardF2s ... + VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" + // VirtualMachineSizeTypesStandardF2sV2 ... + VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" + // VirtualMachineSizeTypesStandardF32sV2 ... + VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" + // VirtualMachineSizeTypesStandardF4 ... + VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" + // VirtualMachineSizeTypesStandardF4s ... + VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" + // VirtualMachineSizeTypesStandardF4sV2 ... + VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" + // VirtualMachineSizeTypesStandardF64sV2 ... + VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" + // VirtualMachineSizeTypesStandardF72sV2 ... + VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" + // VirtualMachineSizeTypesStandardF8 ... + VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" + // VirtualMachineSizeTypesStandardF8s ... + VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" + // VirtualMachineSizeTypesStandardF8sV2 ... + VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" + // VirtualMachineSizeTypesStandardG1 ... + VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" + // VirtualMachineSizeTypesStandardG2 ... + VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" + // VirtualMachineSizeTypesStandardG3 ... + VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" + // VirtualMachineSizeTypesStandardG4 ... + VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" + // VirtualMachineSizeTypesStandardG5 ... + VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" + // VirtualMachineSizeTypesStandardGS1 ... + VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" + // VirtualMachineSizeTypesStandardGS2 ... + VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" + // VirtualMachineSizeTypesStandardGS3 ... + VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" + // VirtualMachineSizeTypesStandardGS4 ... + VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" + // VirtualMachineSizeTypesStandardGS44 ... + VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" + // VirtualMachineSizeTypesStandardGS48 ... + VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" + // VirtualMachineSizeTypesStandardGS5 ... + VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" + // VirtualMachineSizeTypesStandardGS516 ... + VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" + // VirtualMachineSizeTypesStandardGS58 ... + VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" + // VirtualMachineSizeTypesStandardH16 ... + VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" + // VirtualMachineSizeTypesStandardH16m ... + VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" + // VirtualMachineSizeTypesStandardH16mr ... + VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" + // VirtualMachineSizeTypesStandardH16r ... + VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" + // VirtualMachineSizeTypesStandardH8 ... + VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" + // VirtualMachineSizeTypesStandardH8m ... + VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" + // VirtualMachineSizeTypesStandardL16s ... + VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" + // VirtualMachineSizeTypesStandardL32s ... + VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" + // VirtualMachineSizeTypesStandardL4s ... + VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" + // VirtualMachineSizeTypesStandardL8s ... + VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" + // VirtualMachineSizeTypesStandardM12832ms ... + VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" + // VirtualMachineSizeTypesStandardM12864ms ... + VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" + // VirtualMachineSizeTypesStandardM128ms ... + VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" + // VirtualMachineSizeTypesStandardM128s ... + VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" + // VirtualMachineSizeTypesStandardM6416ms ... + VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" + // VirtualMachineSizeTypesStandardM6432ms ... + VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" + // VirtualMachineSizeTypesStandardM64ms ... + VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" + // VirtualMachineSizeTypesStandardM64s ... + VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" + // VirtualMachineSizeTypesStandardNC12 ... + VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" + // VirtualMachineSizeTypesStandardNC12sV2 ... + VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" + // VirtualMachineSizeTypesStandardNC12sV3 ... + VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" + // VirtualMachineSizeTypesStandardNC24 ... + VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" + // VirtualMachineSizeTypesStandardNC24r ... + VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" + // VirtualMachineSizeTypesStandardNC24rsV2 ... + VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" + // VirtualMachineSizeTypesStandardNC24rsV3 ... + VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" + // VirtualMachineSizeTypesStandardNC24sV2 ... + VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" + // VirtualMachineSizeTypesStandardNC24sV3 ... + VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" + // VirtualMachineSizeTypesStandardNC6 ... + VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" + // VirtualMachineSizeTypesStandardNC6sV2 ... + VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" + // VirtualMachineSizeTypesStandardNC6sV3 ... + VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" + // VirtualMachineSizeTypesStandardND12s ... + VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" + // VirtualMachineSizeTypesStandardND24rs ... + VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" + // VirtualMachineSizeTypesStandardND24s ... + VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" + // VirtualMachineSizeTypesStandardND6s ... + VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" + // VirtualMachineSizeTypesStandardNV12 ... + VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" + // VirtualMachineSizeTypesStandardNV24 ... + VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" + // VirtualMachineSizeTypesStandardNV6 ... + VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" +) + +// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. +func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { + return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go index e4f6dad9233..8ff8463708a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleries.go @@ -113,7 +113,6 @@ func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future Ga func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesD func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client GalleriesClient) GetSender(req *http.Request) (*http.Response, erro func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +299,9 @@ func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -336,7 +336,6 @@ func (client GalleriesClient) ListSender(req *http.Request) (*http.Response, err func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +412,9 @@ func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceG if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client GalleriesClient) ListByResourceGroupSender(req *http.Request) (*htt func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -565,7 +566,6 @@ func (client GalleriesClient) UpdateSender(req *http.Request) (future GalleriesU func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go index 1968d2533b7..92f75e58c6b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplications.go @@ -118,7 +118,6 @@ func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -197,7 +196,6 @@ func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -275,7 +273,6 @@ func (client GalleryApplicationsClient) GetSender(req *http.Request) (*http.Resp func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -317,6 +314,9 @@ func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resou if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") } + if result.gal.hasNextLink() && result.gal.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -353,7 +353,6 @@ func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) ( func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -474,7 +473,6 @@ func (client GalleryApplicationsClient) UpdateSender(req *http.Request) (future func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go index 795f6c8e8a4..34c359c696f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryapplicationversions.go @@ -135,7 +135,6 @@ func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Re func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -216,7 +215,6 @@ func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) ( func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -300,7 +298,6 @@ func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*ht func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -343,6 +340,9 @@ func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx cont if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") } + if result.gavl.hasNextLink() && result.gavl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -380,7 +380,6 @@ func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(re func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -503,7 +502,6 @@ func (client GalleryApplicationVersionsClient) UpdateSender(req *http.Request) ( func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go index c88030f69ea..cee5e9bbee8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimages.go @@ -129,7 +129,6 @@ func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (futur func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client GalleryImagesClient) DeleteSender(req *http.Request) (future Galler func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -284,7 +282,6 @@ func (client GalleryImagesClient) GetSender(req *http.Request) (*http.Response, func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -325,6 +322,9 @@ func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") } + if result.gil.hasNextLink() && result.gil.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -361,7 +361,6 @@ func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http. func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -481,7 +480,6 @@ func (client GalleryImagesClient) UpdateSender(req *http.Request) (future Galler func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go index a81aa50e841..7d105a7475d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go @@ -127,7 +127,6 @@ func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -290,7 +288,6 @@ func (client GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Res func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -333,6 +330,9 @@ func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") } + if result.givl.hasNextLink() && result.givl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -370,7 +370,6 @@ func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Requ func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -492,7 +491,6 @@ func (client GalleryImageVersionsClient) UpdateSender(req *http.Request) (future func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go index aadeb452906..040c86ec2e7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/images.go @@ -112,7 +112,6 @@ func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future Image func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteF func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +303,9 @@ func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -340,7 +340,6 @@ func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGrou if err != nil { err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.R func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,7 +569,6 @@ func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateF func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go index e6e20676f0f..9bc1ca7f951 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/loganalytics.go @@ -118,7 +118,6 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Req func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,7 +201,6 @@ func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go index 6b5eb1bc647..9e6a01b4414 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/models.go @@ -31,1392 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute" -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" - // Write ... - Write AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read, Write} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} -} - -// ComponentNames enumerates the values for component names. -type ComponentNames string - -const ( - // MicrosoftWindowsShellSetup ... - MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" -) - -// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. -func PossibleComponentNamesValues() []ComponentNames { - return []ComponentNames{MicrosoftWindowsShellSetup} -} - -// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. -type ContainerServiceOrchestratorTypes string - -const ( - // Custom ... - Custom ContainerServiceOrchestratorTypes = "Custom" - // DCOS ... - DCOS ContainerServiceOrchestratorTypes = "DCOS" - // Kubernetes ... - Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" - // Swarm ... - Swarm ContainerServiceOrchestratorTypes = "Swarm" -) - -// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. -func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { - return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} -} - -// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. -type ContainerServiceVMSizeTypes string - -const ( - // StandardA0 ... - StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" - // StandardA2 ... - StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" - // StandardA3 ... - StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" - // StandardA5 ... - StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" - // StandardA9 ... - StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" - // StandardD1 ... - StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" - // StandardD1V2 ... - StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" - // StandardD2V2 ... - StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" - // StandardD3 ... - StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" - // StandardD3V2 ... - StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" - // StandardD4V2 ... - StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" - // StandardD5V2 ... - StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" - // StandardDS1 ... - StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" - // StandardDS12 ... - StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" - // StandardDS13 ... - StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" - // StandardDS14 ... - StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" - // StandardDS2 ... - StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" - // StandardDS3 ... - StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" - // StandardDS4 ... - StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" - // StandardG1 ... - StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" - // StandardGS5 ... - StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" -) - -// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. -func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { - return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} -} - -// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. -type DedicatedHostLicenseTypes string - -const ( - // DedicatedHostLicenseTypesNone ... - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - // DedicatedHostLicenseTypesWindowsServerHybrid ... - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - // DedicatedHostLicenseTypesWindowsServerPerpetual ... - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiffDiskPlacement enumerates the values for diff disk placement. -type DiffDiskPlacement string - -const ( - // CacheDisk ... - CacheDisk DiffDiskPlacement = "CacheDisk" - // ResourceDisk ... - ResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{CacheDisk, ResourceDisk} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach Disk will be attached to a VM. - Attach DiskCreateOption = "Attach" - // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given - // sourceResourceId. - Copy DiskCreateOption = "Copy" - // Empty Create an empty data disk of a size given by diskSizeGB. - Empty DiskCreateOption = "Empty" - // FromImage Create a new disk from a platform image specified by the given imageReference or - // galleryImageReference. - FromImage DiskCreateOption = "FromImage" - // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by - // storageAccountId. - Import DiskCreateOption = "Import" - // Restore Create a new disk by copying from a backup recovery point. - Restore DiskCreateOption = "Restore" - // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - Upload DiskCreateOption = "Upload" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. -type DiskEncryptionSetIdentityType string - -const ( - // SystemAssigned ... - SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{SystemAssigned} -} - -// DiskState enumerates the values for disk state. -type DiskState string - -const ( - // ActiveSAS The disk currently has an Active SAS Uri associated with it. - ActiveSAS DiskState = "ActiveSAS" - // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. - ActiveUpload DiskState = "ActiveUpload" - // Attached The disk is currently mounted to a running VM. - Attached DiskState = "Attached" - // ReadyToUpload A disk is ready to be created by upload by requesting a write token. - ReadyToUpload DiskState = "ReadyToUpload" - // Reserved The disk is mounted to a stopped-deallocated VM - Reserved DiskState = "Reserved" - // Unattached The disk is not being used and can be attached to a VM. - Unattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns an array of possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top - // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} -} - -// EncryptionType enumerates the values for encryption type. -type EncryptionType string - -const ( - // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. - EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default - // encryption type. - EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// HyperVGeneration enumerates the values for hyper v generation. -type HyperVGeneration string - -const ( - // V1 ... - V1 HyperVGeneration = "V1" - // V2 ... - V2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{V1, V2} -} - -// HyperVGenerationType enumerates the values for hyper v generation type. -type HyperVGenerationType string - -const ( - // HyperVGenerationTypeV1 ... - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - // HyperVGenerationTypeV2 ... - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} -} - -// HyperVGenerationTypes enumerates the values for hyper v generation types. -type HyperVGenerationTypes string - -const ( - // HyperVGenerationTypesV1 ... - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - // HyperVGenerationTypesV2 ... - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceView ... - InstanceView InstanceViewTypes = "instanceView" -) - -// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{InstanceView} -} - -// IntervalInMins enumerates the values for interval in mins. -type IntervalInMins string - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - ThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. -type MaintenanceOperationResultCodeTypes string - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} -} - -// OperatingSystemStateTypes enumerates the values for operating system state types. -type OperatingSystemStateTypes string - -const ( - // Generalized Generalized image. Needs to be provisioned during deployment time. - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized Specialized image. Contains already provisioned OS Disk. - Specialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{Generalized, Specialized} -} - -// OperatingSystemTypes enumerates the values for operating system types. -type OperatingSystemTypes string - -const ( - // Linux ... - Linux OperatingSystemTypes = "Linux" - // Windows ... - Windows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{Linux, Windows} -} - -// OrchestrationServiceNames enumerates the values for orchestration service names. -type OrchestrationServiceNames string - -const ( - // AutomaticRepairs ... - AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{AutomaticRepairs} -} - -// OrchestrationServiceState enumerates the values for orchestration service state. -type OrchestrationServiceState string - -const ( - // NotRunning ... - NotRunning OrchestrationServiceState = "NotRunning" - // Running ... - Running OrchestrationServiceState = "Running" - // Suspended ... - Suspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{NotRunning, Running, Suspended} -} - -// OrchestrationServiceStateAction enumerates the values for orchestration service state action. -type OrchestrationServiceStateAction string - -const ( - // Resume ... - Resume OrchestrationServiceStateAction = "Resume" - // Suspend ... - Suspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{Resume, Suspend} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - OobeSystem PassNames = "OobeSystem" -) - -// PossiblePassNamesValues returns an array of possible values for the PassNames const type. -func PossiblePassNamesValues() []PassNames { - return []PassNames{OobeSystem} -} - -// ProtocolTypes enumerates the values for protocol types. -type ProtocolTypes string - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCreating ... - ProvisioningStateCreating ProvisioningState = "Creating" - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateMigrating ... - ProvisioningStateMigrating ProvisioningState = "Migrating" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} -} - -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1Creating ... - ProvisioningState1Creating ProvisioningState1 = "Creating" - // ProvisioningState1Deleting ... - ProvisioningState1Deleting ProvisioningState1 = "Deleting" - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Migrating ... - ProvisioningState1Migrating ProvisioningState1 = "Migrating" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" - // ProvisioningState1Updating ... - ProvisioningState1Updating ProvisioningState1 = "Updating" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} -} - -// ProvisioningState2 enumerates the values for provisioning state 2. -type ProvisioningState2 string - -const ( - // ProvisioningState2Creating ... - ProvisioningState2Creating ProvisioningState2 = "Creating" - // ProvisioningState2Deleting ... - ProvisioningState2Deleting ProvisioningState2 = "Deleting" - // ProvisioningState2Failed ... - ProvisioningState2Failed ProvisioningState2 = "Failed" - // ProvisioningState2Migrating ... - ProvisioningState2Migrating ProvisioningState2 = "Migrating" - // ProvisioningState2Succeeded ... - ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" - // ProvisioningState2Updating ... - ProvisioningState2Updating ProvisioningState2 = "Updating" -) - -// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. -func PossibleProvisioningState2Values() []ProvisioningState2 { - return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} -} - -// ProvisioningState3 enumerates the values for provisioning state 3. -type ProvisioningState3 string - -const ( - // ProvisioningState3Creating ... - ProvisioningState3Creating ProvisioningState3 = "Creating" - // ProvisioningState3Deleting ... - ProvisioningState3Deleting ProvisioningState3 = "Deleting" - // ProvisioningState3Failed ... - ProvisioningState3Failed ProvisioningState3 = "Failed" - // ProvisioningState3Migrating ... - ProvisioningState3Migrating ProvisioningState3 = "Migrating" - // ProvisioningState3Succeeded ... - ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" - // ProvisioningState3Updating ... - ProvisioningState3Updating ProvisioningState3 = "Updating" -) - -// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. -func PossibleProvisioningState3Values() []ProvisioningState3 { - return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. -type ResourceSkuCapacityScaleType string - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" -) - -// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. -func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} -} - -// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. -type ResourceSkuRestrictionsReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. -func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { - return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} -} - -// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. -type ResourceSkuRestrictionsType string - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - Zone ResourceSkuRestrictionsType = "Zone" -) - -// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return []ResourceSkuRestrictionsType{Location, Zone} -} - -// RollingUpgradeActionType enumerates the values for rolling upgrade action type. -type RollingUpgradeActionType string - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - Start RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{Cancel, Start} -} - -// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. -type RollingUpgradeStatusCode string - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // StorageAccountTypePremiumLRS ... - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - // StorageAccountTypeStandardLRS ... - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - // StorageAccountTypeStandardZRS ... - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // Automatic ... - Automatic UpgradeMode = "Automatic" - // Manual ... - Manual UpgradeMode = "Manual" - // Rolling ... - Rolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{Automatic, Manual, Rolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // Deallocate ... - Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // Delete ... - Delete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" - // Spot ... - Spot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular, Spot} -} - -// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. -type VirtualMachineScaleSetScaleInRules string - -const ( - // Default ... - Default VirtualMachineScaleSetScaleInRules = "Default" - // NewestVM ... - NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - // OldestVM ... - OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. -func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { - return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} -} - -// VirtualMachineSizeTypes enumerates the values for virtual machine size types. -type VirtualMachineSizeTypes string - -const ( - // VirtualMachineSizeTypesBasicA0 ... - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - // VirtualMachineSizeTypesBasicA1 ... - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - // VirtualMachineSizeTypesBasicA2 ... - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - // VirtualMachineSizeTypesBasicA3 ... - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - // VirtualMachineSizeTypesBasicA4 ... - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - // VirtualMachineSizeTypesStandardA0 ... - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - // VirtualMachineSizeTypesStandardA1 ... - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - // VirtualMachineSizeTypesStandardA10 ... - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - // VirtualMachineSizeTypesStandardA11 ... - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - // VirtualMachineSizeTypesStandardA1V2 ... - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // VirtualMachineSizeTypesStandardA2 ... - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - // VirtualMachineSizeTypesStandardA2mV2 ... - VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // VirtualMachineSizeTypesStandardA2V2 ... - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // VirtualMachineSizeTypesStandardA3 ... - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - // VirtualMachineSizeTypesStandardA4 ... - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - // VirtualMachineSizeTypesStandardA4mV2 ... - VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // VirtualMachineSizeTypesStandardA4V2 ... - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // VirtualMachineSizeTypesStandardA5 ... - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - // VirtualMachineSizeTypesStandardA6 ... - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - // VirtualMachineSizeTypesStandardA7 ... - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - // VirtualMachineSizeTypesStandardA8 ... - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - // VirtualMachineSizeTypesStandardA8mV2 ... - VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // VirtualMachineSizeTypesStandardA8V2 ... - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // VirtualMachineSizeTypesStandardA9 ... - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - // VirtualMachineSizeTypesStandardB1ms ... - VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // VirtualMachineSizeTypesStandardB1s ... - VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // VirtualMachineSizeTypesStandardB2ms ... - VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // VirtualMachineSizeTypesStandardB2s ... - VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // VirtualMachineSizeTypesStandardB4ms ... - VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // VirtualMachineSizeTypesStandardB8ms ... - VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // VirtualMachineSizeTypesStandardD1 ... - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - // VirtualMachineSizeTypesStandardD11 ... - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - // VirtualMachineSizeTypesStandardD11V2 ... - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // VirtualMachineSizeTypesStandardD12 ... - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - // VirtualMachineSizeTypesStandardD12V2 ... - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // VirtualMachineSizeTypesStandardD13 ... - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - // VirtualMachineSizeTypesStandardD13V2 ... - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // VirtualMachineSizeTypesStandardD14 ... - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - // VirtualMachineSizeTypesStandardD14V2 ... - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // VirtualMachineSizeTypesStandardD15V2 ... - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // VirtualMachineSizeTypesStandardD16sV3 ... - VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // VirtualMachineSizeTypesStandardD16V3 ... - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // VirtualMachineSizeTypesStandardD1V2 ... - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // VirtualMachineSizeTypesStandardD2 ... - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - // VirtualMachineSizeTypesStandardD2sV3 ... - VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // VirtualMachineSizeTypesStandardD2V2 ... - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // VirtualMachineSizeTypesStandardD2V3 ... - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // VirtualMachineSizeTypesStandardD3 ... - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - // VirtualMachineSizeTypesStandardD32sV3 ... - VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // VirtualMachineSizeTypesStandardD32V3 ... - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // VirtualMachineSizeTypesStandardD3V2 ... - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // VirtualMachineSizeTypesStandardD4 ... - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - // VirtualMachineSizeTypesStandardD4sV3 ... - VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // VirtualMachineSizeTypesStandardD4V2 ... - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // VirtualMachineSizeTypesStandardD4V3 ... - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // VirtualMachineSizeTypesStandardD5V2 ... - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // VirtualMachineSizeTypesStandardD64sV3 ... - VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // VirtualMachineSizeTypesStandardD64V3 ... - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // VirtualMachineSizeTypesStandardD8sV3 ... - VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // VirtualMachineSizeTypesStandardD8V3 ... - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // VirtualMachineSizeTypesStandardDS1 ... - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // VirtualMachineSizeTypesStandardDS11 ... - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // VirtualMachineSizeTypesStandardDS11V2 ... - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // VirtualMachineSizeTypesStandardDS12 ... - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // VirtualMachineSizeTypesStandardDS12V2 ... - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // VirtualMachineSizeTypesStandardDS13 ... - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // VirtualMachineSizeTypesStandardDS132V2 ... - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // VirtualMachineSizeTypesStandardDS134V2 ... - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // VirtualMachineSizeTypesStandardDS13V2 ... - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // VirtualMachineSizeTypesStandardDS14 ... - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // VirtualMachineSizeTypesStandardDS144V2 ... - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // VirtualMachineSizeTypesStandardDS148V2 ... - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // VirtualMachineSizeTypesStandardDS14V2 ... - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // VirtualMachineSizeTypesStandardDS15V2 ... - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // VirtualMachineSizeTypesStandardDS1V2 ... - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // VirtualMachineSizeTypesStandardDS2 ... - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // VirtualMachineSizeTypesStandardDS2V2 ... - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // VirtualMachineSizeTypesStandardDS3 ... - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // VirtualMachineSizeTypesStandardDS3V2 ... - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // VirtualMachineSizeTypesStandardDS4 ... - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // VirtualMachineSizeTypesStandardDS4V2 ... - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // VirtualMachineSizeTypesStandardDS5V2 ... - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // VirtualMachineSizeTypesStandardE16sV3 ... - VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // VirtualMachineSizeTypesStandardE16V3 ... - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // VirtualMachineSizeTypesStandardE2sV3 ... - VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // VirtualMachineSizeTypesStandardE2V3 ... - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // VirtualMachineSizeTypesStandardE3216V3 ... - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // VirtualMachineSizeTypesStandardE328sV3 ... - VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // VirtualMachineSizeTypesStandardE32sV3 ... - VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // VirtualMachineSizeTypesStandardE32V3 ... - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // VirtualMachineSizeTypesStandardE4sV3 ... - VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // VirtualMachineSizeTypesStandardE4V3 ... - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // VirtualMachineSizeTypesStandardE6416sV3 ... - VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // VirtualMachineSizeTypesStandardE6432sV3 ... - VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // VirtualMachineSizeTypesStandardE64sV3 ... - VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // VirtualMachineSizeTypesStandardE64V3 ... - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // VirtualMachineSizeTypesStandardE8sV3 ... - VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // VirtualMachineSizeTypesStandardE8V3 ... - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // VirtualMachineSizeTypesStandardF1 ... - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - // VirtualMachineSizeTypesStandardF16 ... - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - // VirtualMachineSizeTypesStandardF16s ... - VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // VirtualMachineSizeTypesStandardF16sV2 ... - VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // VirtualMachineSizeTypesStandardF1s ... - VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // VirtualMachineSizeTypesStandardF2 ... - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - // VirtualMachineSizeTypesStandardF2s ... - VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // VirtualMachineSizeTypesStandardF2sV2 ... - VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // VirtualMachineSizeTypesStandardF32sV2 ... - VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // VirtualMachineSizeTypesStandardF4 ... - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - // VirtualMachineSizeTypesStandardF4s ... - VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // VirtualMachineSizeTypesStandardF4sV2 ... - VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // VirtualMachineSizeTypesStandardF64sV2 ... - VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // VirtualMachineSizeTypesStandardF72sV2 ... - VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // VirtualMachineSizeTypesStandardF8 ... - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - // VirtualMachineSizeTypesStandardF8s ... - VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // VirtualMachineSizeTypesStandardF8sV2 ... - VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // VirtualMachineSizeTypesStandardG1 ... - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - // VirtualMachineSizeTypesStandardG2 ... - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - // VirtualMachineSizeTypesStandardG3 ... - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - // VirtualMachineSizeTypesStandardG4 ... - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - // VirtualMachineSizeTypesStandardG5 ... - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - // VirtualMachineSizeTypesStandardGS1 ... - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // VirtualMachineSizeTypesStandardGS2 ... - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // VirtualMachineSizeTypesStandardGS3 ... - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // VirtualMachineSizeTypesStandardGS4 ... - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // VirtualMachineSizeTypesStandardGS44 ... - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // VirtualMachineSizeTypesStandardGS48 ... - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // VirtualMachineSizeTypesStandardGS5 ... - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // VirtualMachineSizeTypesStandardGS516 ... - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // VirtualMachineSizeTypesStandardGS58 ... - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // VirtualMachineSizeTypesStandardH16 ... - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - // VirtualMachineSizeTypesStandardH16m ... - VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // VirtualMachineSizeTypesStandardH16mr ... - VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // VirtualMachineSizeTypesStandardH16r ... - VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // VirtualMachineSizeTypesStandardH8 ... - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - // VirtualMachineSizeTypesStandardH8m ... - VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // VirtualMachineSizeTypesStandardL16s ... - VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // VirtualMachineSizeTypesStandardL32s ... - VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // VirtualMachineSizeTypesStandardL4s ... - VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // VirtualMachineSizeTypesStandardL8s ... - VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // VirtualMachineSizeTypesStandardM12832ms ... - VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // VirtualMachineSizeTypesStandardM12864ms ... - VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // VirtualMachineSizeTypesStandardM128ms ... - VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // VirtualMachineSizeTypesStandardM128s ... - VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // VirtualMachineSizeTypesStandardM6416ms ... - VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // VirtualMachineSizeTypesStandardM6432ms ... - VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // VirtualMachineSizeTypesStandardM64ms ... - VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // VirtualMachineSizeTypesStandardM64s ... - VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // VirtualMachineSizeTypesStandardNC12 ... - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // VirtualMachineSizeTypesStandardNC12sV2 ... - VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // VirtualMachineSizeTypesStandardNC12sV3 ... - VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // VirtualMachineSizeTypesStandardNC24 ... - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // VirtualMachineSizeTypesStandardNC24r ... - VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // VirtualMachineSizeTypesStandardNC24rsV2 ... - VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // VirtualMachineSizeTypesStandardNC24rsV3 ... - VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // VirtualMachineSizeTypesStandardNC24sV2 ... - VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // VirtualMachineSizeTypesStandardNC24sV3 ... - VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // VirtualMachineSizeTypesStandardNC6 ... - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // VirtualMachineSizeTypesStandardNC6sV2 ... - VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // VirtualMachineSizeTypesStandardNC6sV3 ... - VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // VirtualMachineSizeTypesStandardND12s ... - VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // VirtualMachineSizeTypesStandardND24rs ... - VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // VirtualMachineSizeTypesStandardND24s ... - VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // VirtualMachineSizeTypesStandardND6s ... - VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // VirtualMachineSizeTypesStandardNV12 ... - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // VirtualMachineSizeTypesStandardNV24 ... - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // VirtualMachineSizeTypesStandardNV6 ... - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} -} - // AccessURI a disk access SAS uri. type AccessURI struct { autorest.Response `json:"-"` @@ -1424,16 +38,15 @@ type AccessURI struct { AccessSAS *string `json:"accessSAS,omitempty"` } -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale -// set. +// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale set. type AdditionalCapabilities struct { // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` } // AdditionalUnattendContent specifies additional XML formatted information that can be included in the -// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, -// and the pass in which the content is applied. +// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and +// the pass in which the content is applied. type AdditionalUnattendContent struct { // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' PassName PassNames `json:"passName,omitempty"` @@ -1489,8 +102,8 @@ type AutomaticOSUpgradeProperties struct { AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` } -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual -// machine scale set. +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual machine +// scale set. type AutomaticRepairsPolicy struct { // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. Enabled *bool `json:"enabled,omitempty"` @@ -1498,16 +111,14 @@ type AutomaticRepairsPolicy struct { GracePeriod *string `json:"gracePeriod,omitempty"` } -// AvailabilitySet specifies information about the availability set that the virtual machine should be -// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to -// maximize availability. For more information about availability sets, see [Manage the availability of -// virtual +// AvailabilitySet specifies information about the availability set that the virtual machine should be assigned +// to. Virtual machines specified in the same availability set are allocated to different nodes to maximize +// availability. For more information about availability sets, see [Manage the availability of virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -//

For more information on Azure planned maintenance, see [Planned maintenance for virtual -// machines in +//

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

Currently, a VM can only be added to availability set at creation time. An existing VM cannot -// be added to an availability set. +//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be +// added to an availability set. type AvailabilitySet struct { autorest.Response `json:"-"` *AvailabilitySetProperties `json:"properties,omitempty"` @@ -1698,10 +309,15 @@ func (aslr AvailabilitySetListResult) IsEmpty() bool { return aslr.Value == nil || len(*aslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aslr AvailabilitySetListResult) hasNextLink() bool { + return aslr.NextLink != nil && len(*aslr.NextLink) != 0 +} + // availabilitySetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if aslr.NextLink == nil || len(to.String(aslr.NextLink)) < 1 { + if !aslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1729,11 +345,16 @@ func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aslr) + if err != nil { + return err + } + page.aslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aslr = next return nil } @@ -1781,8 +402,26 @@ type AvailabilitySetProperties struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should -// be assigned to. Only tags may be updated. +// MarshalJSON is the custom marshaler for AvailabilitySetProperties. +func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.PlatformUpdateDomainCount != nil { + objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount + } + if asp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount + } + if asp.VirtualMachines != nil { + objectMap["virtualMachines"] = asp.VirtualMachines + } + if asp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup + } + return json.Marshal(objectMap) +} + +// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should be +// assigned to. Only tags may be updated. type AvailabilitySetUpdate struct { *AvailabilitySetProperties `json:"properties,omitempty"` // Sku - Sku of the availability set @@ -1994,6 +633,24 @@ type ContainerServiceAgentPoolProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. +func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csapp.Name != nil { + objectMap["name"] = csapp.Name + } + if csapp.Count != nil { + objectMap["count"] = csapp.Count + } + if csapp.VMSize != "" { + objectMap["vmSize"] = csapp.VMSize + } + if csapp.DNSPrefix != nil { + objectMap["dnsPrefix"] = csapp.DNSPrefix + } + return json.Marshal(objectMap) +} + // ContainerServiceCustomProfile properties to configure a custom container service cluster. type ContainerServiceCustomProfile struct { // Orchestrator - The name of the custom orchestrator to use. @@ -2091,10 +748,15 @@ func (cslr ContainerServiceListResult) IsEmpty() bool { return cslr.Value == nil || len(*cslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (cslr ContainerServiceListResult) hasNextLink() bool { + return cslr.NextLink != nil && len(*cslr.NextLink) != 0 +} + // containerServiceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if cslr.NextLink == nil || len(to.String(cslr.NextLink)) < 1 { + if !cslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2122,11 +784,16 @@ func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.cslr) + if err != nil { + return err + } + page.cslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.cslr = next return nil } @@ -2170,6 +837,18 @@ type ContainerServiceMasterProfile struct { Fqdn *string `json:"fqdn,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. +func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csmp.Count != nil { + objectMap["count"] = csmp.Count + } + if csmp.DNSPrefix != nil { + objectMap["dnsPrefix"] = csmp.DNSPrefix + } + return json.Marshal(objectMap) +} + // ContainerServiceOrchestratorProfile profile for the container service orchestrator. type ContainerServiceOrchestratorProfile struct { // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' @@ -2198,6 +877,36 @@ type ContainerServiceProperties struct { DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceProperties. +func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csp.OrchestratorProfile != nil { + objectMap["orchestratorProfile"] = csp.OrchestratorProfile + } + if csp.CustomProfile != nil { + objectMap["customProfile"] = csp.CustomProfile + } + if csp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile + } + if csp.MasterProfile != nil { + objectMap["masterProfile"] = csp.MasterProfile + } + if csp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles + } + if csp.WindowsProfile != nil { + objectMap["windowsProfile"] = csp.WindowsProfile + } + if csp.LinuxProfile != nil { + objectMap["linuxProfile"] = csp.LinuxProfile + } + if csp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile + } + return json.Marshal(objectMap) +} + // ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ContainerServicesCreateOrUpdateFuture struct { @@ -2250,8 +959,8 @@ func (future *ContainerServicesDeleteFuture) Result(client ContainerServicesClie return } -// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster -// to use for manipulating Azure APIs. +// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster to +// use for manipulating Azure APIs. type ContainerServiceServicePrincipalProfile struct { // ClientID - The ID for the service principal. ClientID *string `json:"clientId,omitempty"` @@ -2279,6 +988,15 @@ type ContainerServiceVMDiagnostics struct { StorageURI *string `json:"storageUri,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. +func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csvd.Enabled != nil { + objectMap["enabled"] = csvd.Enabled + } + return json.Marshal(objectMap) +} + // ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. type ContainerServiceWindowsProfile struct { // AdminUsername - The administrator username to use for Windows VMs. @@ -2307,6 +1025,33 @@ type CreationData struct { UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` } +// MarshalJSON is the custom marshaler for CreationData. +func (cd CreationData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.CreateOption != "" { + objectMap["createOption"] = cd.CreateOption + } + if cd.StorageAccountID != nil { + objectMap["storageAccountId"] = cd.StorageAccountID + } + if cd.ImageReference != nil { + objectMap["imageReference"] = cd.ImageReference + } + if cd.GalleryImageReference != nil { + objectMap["galleryImageReference"] = cd.GalleryImageReference + } + if cd.SourceURI != nil { + objectMap["sourceUri"] = cd.SourceURI + } + if cd.SourceResourceID != nil { + objectMap["sourceResourceId"] = cd.SourceResourceID + } + if cd.UploadSizeBytes != nil { + objectMap["uploadSizeBytes"] = cd.UploadSizeBytes + } + return json.Marshal(objectMap) +} + // DataDisk describes a data disk. type DataDisk struct { // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. @@ -2335,6 +1080,42 @@ type DataDisk struct { DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` } +// MarshalJSON is the custom marshaler for DataDisk. +func (dd DataDisk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dd.Lun != nil { + objectMap["lun"] = dd.Lun + } + if dd.Name != nil { + objectMap["name"] = dd.Name + } + if dd.Vhd != nil { + objectMap["vhd"] = dd.Vhd + } + if dd.Image != nil { + objectMap["image"] = dd.Image + } + if dd.Caching != "" { + objectMap["caching"] = dd.Caching + } + if dd.WriteAcceleratorEnabled != nil { + objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled + } + if dd.CreateOption != "" { + objectMap["createOption"] = dd.CreateOption + } + if dd.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dd.DiskSizeGB + } + if dd.ManagedDisk != nil { + objectMap["managedDisk"] = dd.ManagedDisk + } + if dd.ToBeDetached != nil { + objectMap["toBeDetached"] = dd.ToBeDetached + } + return json.Marshal(objectMap) +} + // DataDiskImage contains the data disk images information. type DataDiskImage struct { // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. @@ -2463,8 +1244,7 @@ func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { return nil } -// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM -// size. +// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM size. type DedicatedHostAllocatableVM struct { // VMSize - VM size in terms of which the unutilized capacity is represented. VMSize *string `json:"vmSize,omitempty"` @@ -2478,9 +1258,9 @@ type DedicatedHostAvailableCapacity struct { AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` } -// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should -// be assigned to.

Currently, a dedicated host can only be added to a dedicated host group at -// creation time. An existing dedicated host cannot be added to another dedicated host group. +// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should be +// assigned to.

Currently, a dedicated host can only be added to a dedicated host group at creation +// time. An existing dedicated host cannot be added to another dedicated host group. type DedicatedHostGroup struct { autorest.Response `json:"-"` *DedicatedHostGroupProperties `json:"properties,omitempty"` @@ -2671,10 +1451,15 @@ func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { return dhglr.Value == nil || len(*dhglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { + return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 +} + // dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if dhglr.NextLink == nil || len(to.String(dhglr.NextLink)) < 1 { + if !dhglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2702,11 +1487,16 @@ func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dhglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dhglr) + if err != nil { + return err + } + page.dhglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dhglr = next return nil } @@ -2748,8 +1538,17 @@ type DedicatedHostGroupProperties struct { Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` } -// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host -// should be assigned to. Only tags may be updated. +// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. +func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhgp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount + } + return json.Marshal(objectMap) +} + +// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host should +// be assigned to. Only tags may be updated. type DedicatedHostGroupUpdate struct { *DedicatedHostGroupProperties `json:"properties,omitempty"` // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. @@ -2825,6 +1624,18 @@ type DedicatedHostInstanceView struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } +// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. +func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhiv.AvailableCapacity != nil { + objectMap["availableCapacity"] = dhiv.AvailableCapacity + } + if dhiv.Statuses != nil { + objectMap["statuses"] = dhiv.Statuses + } + return json.Marshal(objectMap) +} + // DedicatedHostListResult the list dedicated host operation response. type DedicatedHostListResult struct { autorest.Response `json:"-"` @@ -2902,10 +1713,15 @@ func (dhlr DedicatedHostListResult) IsEmpty() bool { return dhlr.Value == nil || len(*dhlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dhlr DedicatedHostListResult) hasNextLink() bool { + return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 +} + // dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if dhlr.NextLink == nil || len(to.String(dhlr.NextLink)) < 1 { + if !dhlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2933,11 +1749,16 @@ func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dhlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dhlr) + if err != nil { + return err + } + page.dhlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dhlr = next return nil } @@ -2991,6 +1812,21 @@ type DedicatedHostProperties struct { InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` } +// MarshalJSON is the custom marshaler for DedicatedHostProperties. +func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhp.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain + } + if dhp.AutoReplaceOnFailure != nil { + objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure + } + if dhp.LicenseType != "" { + objectMap["licenseType"] = dhp.LicenseType + } + return json.Marshal(objectMap) +} + // DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DedicatedHostsCreateOrUpdateFuture struct { @@ -3125,8 +1961,7 @@ func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { return nil } -// DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: -// 2015-06-15. +// DiagnosticsProfile specifies the boot diagnostic settings state.

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

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` @@ -3486,10 +2321,15 @@ func (desl DiskEncryptionSetList) IsEmpty() bool { return desl.Value == nil || len(*desl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (desl DiskEncryptionSetList) hasNextLink() bool { + return desl.NextLink != nil && len(*desl.NextLink) != 0 +} + // diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { - if desl.NextLink == nil || len(to.String(desl.NextLink)) < 1 { + if !desl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3517,11 +2357,16 @@ func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.desl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.desl) + if err != nil { + return err + } + page.desl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.desl = next return nil } @@ -3555,9 +2400,9 @@ func NewDiskEncryptionSetListPage(getNextPage func(context.Context, DiskEncrypti return DiskEncryptionSetListPage{fn: getNextPage} } -// 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. +// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id that +// can be specified for disk.

NOTE: The disk encryption set resource id can only be specified for +// managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. type DiskEncryptionSetParameters struct { // ID - Resource Id ID *string `json:"id,omitempty"` @@ -3592,8 +2437,8 @@ func (future *DiskEncryptionSetsCreateOrUpdateFuture) Result(client DiskEncrypti return } -// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DiskEncryptionSetsDeleteFuture struct { azure.Future } @@ -3615,8 +2460,8 @@ func (future *DiskEncryptionSetsDeleteFuture) Result(client DiskEncryptionSetsCl return } -// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DiskEncryptionSetsUpdateFuture struct { azure.Future } @@ -3804,10 +2649,15 @@ func (dl DiskList) IsEmpty() bool { return dl.Value == nil || len(*dl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dl DiskList) hasNextLink() bool { + return dl.NextLink != nil && len(*dl.NextLink) != 0 +} + // diskListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 { + if !dl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3835,11 +2685,16 @@ func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dl) + if err != nil { + return err + } + page.dl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dl = next return nil } @@ -3911,6 +2766,45 @@ type DiskProperties struct { ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` } +// MarshalJSON is the custom marshaler for DiskProperties. +func (dp DiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.OsType != "" { + objectMap["osType"] = dp.OsType + } + if dp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = dp.HyperVGeneration + } + if dp.CreationData != nil { + objectMap["creationData"] = dp.CreationData + } + if dp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dp.DiskSizeGB + } + if dp.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection + } + if dp.DiskIOPSReadWrite != nil { + objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite + } + if dp.DiskMBpsReadWrite != nil { + objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite + } + if dp.DiskIOPSReadOnly != nil { + objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly + } + if dp.DiskMBpsReadOnly != nil { + objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly + } + if dp.Encryption != nil { + objectMap["encryption"] = dp.Encryption + } + if dp.MaxShares != nil { + objectMap["maxShares"] = dp.MaxShares + } + return json.Marshal(objectMap) +} + // DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksCreateOrUpdateFuture struct { @@ -3962,8 +2856,7 @@ func (future *DisksDeleteFuture) Result(client DisksClient) (ar autorest.Respons return } -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DisksGrantAccessFuture struct { azure.Future } @@ -3999,6 +2892,15 @@ type DiskSku struct { Tier *string `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for DiskSku. +func (ds DiskSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.Name != "" { + objectMap["name"] = ds.Name + } + return json.Marshal(objectMap) +} + // DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type DisksRevokeAccessFuture struct { @@ -4153,8 +3055,8 @@ type EncryptionImages struct { DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` } -// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on -// the key vault before it can be used to encrypt disks. +// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on the +// key vault before it can be used to encrypt disks. type EncryptionSetIdentity struct { // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' Type DiskEncryptionSetIdentityType `json:"type,omitempty"` @@ -4164,6 +3066,15 @@ type EncryptionSetIdentity struct { TenantID *string `json:"tenantId,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionSetIdentity. +func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esi.Type != "" { + objectMap["type"] = esi.Type + } + return json.Marshal(objectMap) +} + // EncryptionSetProperties ... type EncryptionSetProperties struct { // ActiveKey - The key vault key which is currently used by this disk encryption set. @@ -4174,6 +3085,15 @@ type EncryptionSetProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for EncryptionSetProperties. +func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esp.ActiveKey != nil { + objectMap["activeKey"] = esp.ActiveKey + } + return json.Marshal(objectMap) +} + // EncryptionSettingsCollection encryption settings for disk or snapshot type EncryptionSettingsCollection struct { // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. @@ -4221,8 +3141,7 @@ func (future *GalleriesCreateOrUpdateFuture) Result(client GalleriesClient) (g G return } -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type GalleriesDeleteFuture struct { azure.Future } @@ -4244,8 +3163,7 @@ func (future *GalleriesDeleteFuture) Result(client GalleriesClient) (ar autorest return } -// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type GalleriesUpdateFuture struct { azure.Future } @@ -4373,8 +3291,8 @@ func (g *Gallery) UnmarshalJSON(body []byte) error { return nil } -// GalleryApplication specifies information about the gallery Application Definition that you want to -// create or update. +// GalleryApplication specifies information about the gallery Application Definition that you want to create or +// update. type GalleryApplication struct { autorest.Response `json:"-"` *GalleryApplicationProperties `json:"properties,omitempty"` @@ -4551,10 +3469,15 @@ func (gal GalleryApplicationList) IsEmpty() bool { return gal.Value == nil || len(*gal.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gal GalleryApplicationList) hasNextLink() bool { + return gal.NextLink != nil && len(*gal.NextLink) != 0 +} + // galleryApplicationListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { - if gal.NextLink == nil || len(to.String(gal.NextLink)) < 1 { + if !gal.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -4582,11 +3505,16 @@ func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gal) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gal) + if err != nil { + return err + } + page.gal = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gal = next return nil } @@ -4665,8 +3593,8 @@ func (future *GalleryApplicationsCreateOrUpdateFuture) Result(client GalleryAppl return } -// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryApplicationsDeleteFuture struct { azure.Future } @@ -4688,8 +3616,8 @@ func (future *GalleryApplicationsDeleteFuture) Result(client GalleryApplications return } -// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryApplicationsUpdateFuture struct { azure.Future } @@ -4982,10 +3910,15 @@ func (gavl GalleryApplicationVersionList) IsEmpty() bool { return gavl.Value == nil || len(*gavl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gavl GalleryApplicationVersionList) hasNextLink() bool { + return gavl.NextLink != nil && len(*gavl.NextLink) != 0 +} + // galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { - if gavl.NextLink == nil || len(to.String(gavl.NextLink)) < 1 { + if !gavl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5013,11 +3946,16 @@ func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gavl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gavl) + if err != nil { + return err + } + page.gavl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gavl = next return nil } @@ -5060,6 +3998,15 @@ type GalleryApplicationVersionProperties struct { ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. +func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavp.PublishingProfile != nil { + objectMap["publishingProfile"] = gavp.PublishingProfile + } + return json.Marshal(objectMap) +} + // GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. type GalleryApplicationVersionPublishingProfile struct { Source *UserArtifactSource `json:"source,omitempty"` @@ -5081,8 +4028,38 @@ type GalleryApplicationVersionPublishingProfile struct { StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } -// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. +func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavpp.Source != nil { + objectMap["source"] = gavpp.Source + } + if gavpp.ContentType != nil { + objectMap["contentType"] = gavpp.ContentType + } + if gavpp.EnableHealthCheck != nil { + objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck + } + if gavpp.TargetRegions != nil { + objectMap["targetRegions"] = gavpp.TargetRegions + } + if gavpp.ReplicaCount != nil { + objectMap["replicaCount"] = gavpp.ReplicaCount + } + if gavpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest + } + if gavpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate + } + if gavpp.StorageAccountType != "" { + objectMap["storageAccountType"] = gavpp.StorageAccountType + } + return json.Marshal(objectMap) +} + +// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type GalleryApplicationVersionsCreateOrUpdateFuture struct { azure.Future } @@ -5162,8 +4139,8 @@ func (future *GalleryApplicationVersionsUpdateFuture) Result(client GalleryAppli return } -// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you -// want to update. +// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you want to +// update. type GalleryApplicationVersionUpdate struct { *GalleryApplicationVersionProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id @@ -5264,6 +4241,27 @@ type GalleryArtifactPublishingProfileBase struct { StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. +func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gappb.TargetRegions != nil { + objectMap["targetRegions"] = gappb.TargetRegions + } + if gappb.ReplicaCount != nil { + objectMap["replicaCount"] = gappb.ReplicaCount + } + if gappb.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest + } + if gappb.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gappb.EndOfLifeDate + } + if gappb.StorageAccountType != "" { + objectMap["storageAccountType"] = gappb.StorageAccountType + } + return json.Marshal(objectMap) +} + // GalleryArtifactSource the source image from which the Image Version is going to be created. type GalleryArtifactSource struct { ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` @@ -5286,6 +4284,21 @@ type GalleryDataDiskImage struct { Source *GalleryArtifactVersionSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryDataDiskImage. +func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gddi.Lun != nil { + objectMap["lun"] = gddi.Lun + } + if gddi.HostCaching != "" { + objectMap["hostCaching"] = gddi.HostCaching + } + if gddi.Source != nil { + objectMap["source"] = gddi.Source + } + return json.Marshal(objectMap) +} + // GalleryDiskImage this is the disk image base class. type GalleryDiskImage struct { // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. @@ -5295,6 +4308,18 @@ type GalleryDiskImage struct { Source *GalleryArtifactVersionSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryDiskImage. +func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdi.HostCaching != "" { + objectMap["hostCaching"] = gdi.HostCaching + } + if gdi.Source != nil { + objectMap["source"] = gdi.Source + } + return json.Marshal(objectMap) +} + // GalleryIdentifier describes the gallery unique name. type GalleryIdentifier struct { // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. @@ -5488,10 +4513,15 @@ func (gil GalleryImageList) IsEmpty() bool { return gil.Value == nil || len(*gil.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gil GalleryImageList) hasNextLink() bool { + return gil.NextLink != nil && len(*gil.NextLink) != 0 +} + // galleryImageListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if gil.NextLink == nil || len(to.String(gil.NextLink)) < 1 { + if !gil.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5519,11 +4549,16 @@ func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gil) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gil) + if err != nil { + return err + } + page.gil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gil = next return nil } @@ -5583,8 +4618,50 @@ type GalleryImageProperties struct { ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` } -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// MarshalJSON is the custom marshaler for GalleryImageProperties. +func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gip.Description != nil { + objectMap["description"] = gip.Description + } + if gip.Eula != nil { + objectMap["eula"] = gip.Eula + } + if gip.PrivacyStatementURI != nil { + objectMap["privacyStatementUri"] = gip.PrivacyStatementURI + } + if gip.ReleaseNoteURI != nil { + objectMap["releaseNoteUri"] = gip.ReleaseNoteURI + } + if gip.OsType != "" { + objectMap["osType"] = gip.OsType + } + if gip.OsState != "" { + objectMap["osState"] = gip.OsState + } + if gip.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = gip.HyperVGeneration + } + if gip.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gip.EndOfLifeDate + } + if gip.Identifier != nil { + objectMap["identifier"] = gip.Identifier + } + if gip.Recommended != nil { + objectMap["recommended"] = gip.Recommended + } + if gip.Disallowed != nil { + objectMap["disallowed"] = gip.Disallowed + } + if gip.PurchasePlan != nil { + objectMap["purchasePlan"] = gip.PurchasePlan + } + return json.Marshal(objectMap) +} + +// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryImagesCreateOrUpdateFuture struct { azure.Future } @@ -5749,8 +4826,7 @@ func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { return nil } -// GalleryImageVersion specifies information about the gallery Image Version that you want to create or -// update. +// GalleryImageVersion specifies information about the gallery Image Version that you want to create or update. type GalleryImageVersion struct { autorest.Response `json:"-"` *GalleryImageVersionProperties `json:"properties,omitempty"` @@ -5927,10 +5003,15 @@ func (givl GalleryImageVersionList) IsEmpty() bool { return givl.Value == nil || len(*givl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (givl GalleryImageVersionList) hasNextLink() bool { + return givl.NextLink != nil && len(*givl.NextLink) != 0 +} + // galleryImageVersionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if givl.NextLink == nil || len(to.String(givl.NextLink)) < 1 { + if !givl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5958,11 +5039,16 @@ func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.givl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.givl) + if err != nil { + return err + } + page.givl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.givl = next return nil } @@ -6006,6 +5092,18 @@ type GalleryImageVersionProperties struct { ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. +func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givp.PublishingProfile != nil { + objectMap["publishingProfile"] = givp.PublishingProfile + } + if givp.StorageProfile != nil { + objectMap["storageProfile"] = givp.StorageProfile + } + return json.Marshal(objectMap) +} + // GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. type GalleryImageVersionPublishingProfile struct { // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. @@ -6022,6 +5120,27 @@ type GalleryImageVersionPublishingProfile struct { StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. +func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givpp.TargetRegions != nil { + objectMap["targetRegions"] = givpp.TargetRegions + } + if givpp.ReplicaCount != nil { + objectMap["replicaCount"] = givpp.ReplicaCount + } + if givpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest + } + if givpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = givpp.EndOfLifeDate + } + if givpp.StorageAccountType != "" { + objectMap["storageAccountType"] = givpp.StorageAccountType + } + return json.Marshal(objectMap) +} + // GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type GalleryImageVersionsCreateOrUpdateFuture struct { @@ -6051,8 +5170,8 @@ func (future *GalleryImageVersionsCreateOrUpdateFuture) Result(client GalleryIma return } -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryImageVersionsDeleteFuture struct { azure.Future } @@ -6082,8 +5201,8 @@ type GalleryImageVersionStorageProfile struct { DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` } -// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type GalleryImageVersionsUpdateFuture struct { azure.Future } @@ -6273,10 +5392,15 @@ func (gl GalleryList) IsEmpty() bool { return gl.Value == nil || len(*gl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gl GalleryList) hasNextLink() bool { + return gl.NextLink != nil && len(*gl.NextLink) != 0 +} + // galleryListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if gl.NextLink == nil || len(to.String(gl.NextLink)) < 1 { + if !gl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6304,11 +5428,16 @@ func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gl) + if err != nil { + return err + } + page.gl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gl = next return nil } @@ -6351,6 +5480,18 @@ type GalleryOSDiskImage struct { Source *GalleryArtifactVersionSource `json:"source,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryOSDiskImage. +func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if godi.HostCaching != "" { + objectMap["hostCaching"] = godi.HostCaching + } + if godi.Source != nil { + objectMap["source"] = godi.Source + } + return json.Marshal(objectMap) +} + // GalleryProperties describes the properties of a Shared Image Gallery. type GalleryProperties struct { // Description - The description of this Shared Image Gallery resource. This property is updatable. @@ -6360,6 +5501,18 @@ type GalleryProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for GalleryProperties. +func (gp GalleryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gp.Description != nil { + objectMap["description"] = gp.Description + } + if gp.Identifier != nil { + objectMap["identifier"] = gp.Identifier + } + return json.Marshal(objectMap) +} + // GalleryUpdate specifies information about the Shared Image Gallery that you want to update. type GalleryUpdate struct { *GalleryProperties `json:"properties,omitempty"` @@ -6459,9 +5612,8 @@ type HardwareProfile struct { VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` } -// Image the source user image virtual hard disk. The virtual hard disk will be copied before being -// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not -// exist. +// Image the source user image virtual hard disk. The virtual hard disk will be copied before being attached to +// the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. type Image struct { autorest.Response `json:"-"` *ImageProperties `json:"properties,omitempty"` @@ -6684,10 +5836,15 @@ func (ilr ImageListResult) IsEmpty() bool { return ilr.Value == nil || len(*ilr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilr ImageListResult) hasNextLink() bool { + return ilr.NextLink != nil && len(*ilr.NextLink) != 0 +} + // imageListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + if !ilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6715,11 +5872,16 @@ func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilr = next return nil } @@ -6787,8 +5949,22 @@ type ImageProperties struct { HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` } -// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace -// images. +// MarshalJSON is the custom marshaler for ImageProperties. +func (IP ImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.SourceVirtualMachine != nil { + objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine + } + if IP.StorageProfile != nil { + objectMap["storageProfile"] = IP.StorageProfile + } + if IP.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = IP.HyperVGeneration + } + return json.Marshal(objectMap) +} + +// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace images. type ImagePurchasePlan struct { // Name - The plan ID. Name *string `json:"name,omitempty"` @@ -6800,8 +5976,8 @@ type ImagePurchasePlan struct { // ImageReference specifies information about the image to use. You can specify information about platform // images, marketplace images, or virtual machine images. This element is required when you want to use a -// platform image, marketplace image, or virtual machine image, but is not used in other creation -// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. +// platform image, marketplace image, or virtual machine image, but is not used in other creation operations. +// NOTE: Image reference publisher and offer can only be set when you create the scale set. type ImageReference struct { // Publisher - The image publisher. Publisher *string `json:"publisher,omitempty"` @@ -6817,6 +5993,27 @@ type ImageReference struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for ImageReference. +func (ir ImageReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ir.Publisher != nil { + objectMap["publisher"] = ir.Publisher + } + if ir.Offer != nil { + objectMap["offer"] = ir.Offer + } + if ir.Sku != nil { + objectMap["sku"] = ir.Sku + } + if ir.Version != nil { + objectMap["version"] = ir.Version + } + if ir.ID != nil { + objectMap["id"] = ir.ID + } + return json.Marshal(objectMap) +} + // ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ImagesCreateOrUpdateFuture struct { @@ -6980,8 +6177,8 @@ type InstanceViewStatus struct { Time *date.Time `json:"time,omitempty"` } -// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used -// to unwrap the encryptionKey +// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to +// unwrap the encryptionKey type KeyVaultAndKeyReference struct { // SourceVault - Resource id of the KeyVault containing the key or secret SourceVault *SourceVault `json:"sourceVault,omitempty"` @@ -7013,8 +6210,8 @@ type KeyVaultSecretReference struct { SourceVault *SubResource `json:"sourceVault,omitempty"` } -// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

For a -// list of supported Linux distributions, see [Linux on Azure-Endorsed +// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

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

For running non-endorsed distributions, see [Information for Non-Endorsed // Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). @@ -7104,10 +6301,15 @@ func (lur ListUsagesResult) IsEmpty() bool { return lur.Value == nil || len(*lur.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lur ListUsagesResult) hasNextLink() bool { + return lur.NextLink != nil && len(*lur.NextLink) != 0 +} + // listUsagesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 { + if !lur.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7135,11 +6337,16 @@ func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lur) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lur = next return nil } @@ -7185,8 +6392,8 @@ type ListVirtualMachineImageResource struct { Value *[]VirtualMachineImageResource `json:"value,omitempty"` } -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type LogAnalyticsExportRequestRateByIntervalFuture struct { azure.Future } @@ -7465,8 +6672,8 @@ type OrchestrationServiceSummary struct { ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` } -// OSDisk specifies information about the operating system disk used by the virtual machine.

For -// more information about disks, see [About disks and VHDs for Azure virtual +// OSDisk specifies information about the operating system disk used by the virtual machine.

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

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' @@ -7505,8 +6712,8 @@ type OSDiskImageEncryption struct { DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` } -// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot -// be changed once VM is provisioned. +// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot be +// changed once VM is provisioned. type OSProfile struct { // ComputerName - Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

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

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

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). ComputerName *string `json:"computerName,omitempty"` @@ -7528,11 +6735,11 @@ type OSProfile struct { RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` } -// Plan specifies information about the marketplace image used to create the virtual machine. This element -// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable -// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use -// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and -// then click **Save**. +// Plan specifies information about the marketplace image used to create the virtual machine. This element is +// only used for marketplace images. Before you can use a marketplace image from an API, you must enable the +// image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then +// click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click +// **Save**. type Plan struct { // Name - The plan ID. Name *string `json:"name,omitempty"` @@ -7654,8 +6861,8 @@ type ProximityPlacementGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ProximityPlacementGroupListResultIterator provides access to a complete listing of -// ProximityPlacementGroup values. +// ProximityPlacementGroupListResultIterator provides access to a complete listing of ProximityPlacementGroup +// values. type ProximityPlacementGroupListResultIterator struct { i int page ProximityPlacementGroupListResultPage @@ -7723,10 +6930,15 @@ func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { return ppglr.Value == nil || len(*ppglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { + return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 +} + // proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if ppglr.NextLink == nil || len(to.String(ppglr.NextLink)) < 1 { + if !ppglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -7754,11 +6966,16 @@ func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.C tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ppglr) + if err != nil { + return err + } + page.ppglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ppglr = next return nil } @@ -7806,6 +7023,18 @@ type ProximityPlacementGroupProperties struct { ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` } +// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. +func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppgp.ProximityPlacementGroupType != "" { + objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType + } + if ppgp.ColocationStatus != nil { + objectMap["colocationStatus"] = ppgp.ColocationStatus + } + return json.Marshal(objectMap) +} + // ProximityPlacementGroupUpdate specifies information about the proximity placement group. type ProximityPlacementGroupUpdate struct { // Tags - Resource tags @@ -7831,8 +7060,8 @@ type PurchasePlan struct { Product *string `json:"product,omitempty"` } -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this -// Image Definition. These properties are updatable. +// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this Image +// Definition. These properties are updatable. type RecommendedMachineConfiguration struct { VCPUs *ResourceRange `json:"vCPUs,omitempty"` Memory *ResourceRange `json:"memory,omitempty"` @@ -8086,10 +7315,15 @@ func (rsr ResourceSkusResult) IsEmpty() bool { return rsr.Value == nil || len(*rsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rsr ResourceSkusResult) hasNextLink() bool { + return rsr.NextLink != nil && len(*rsr.NextLink) != 0 +} + // resourceSkusResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if rsr.NextLink == nil || len(to.String(rsr.NextLink)) < 1 { + if !rsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8117,11 +7351,16 @@ func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rsr) + if err != nil { + return err + } + page.rsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rsr = next return nil } @@ -8185,8 +7424,7 @@ type RollingUpgradePolicy struct { PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` } -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade -// state. +// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade state. type RollingUpgradeProgressInfo struct { // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` @@ -8450,10 +7688,15 @@ func (rclr RunCommandListResult) IsEmpty() bool { return rclr.Value == nil || len(*rclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rclr RunCommandListResult) hasNextLink() bool { + return rclr.NextLink != nil && len(*rclr.NextLink) != 0 +} + // runCommandListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if rclr.NextLink == nil || len(to.String(rclr.NextLink)) < 1 { + if !rclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8481,11 +7724,16 @@ func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rclr) + if err != nil { + return err + } + page.rclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rclr = next return nil } @@ -8556,9 +7804,8 @@ type ShareInfoElement struct { VMURI *string `json:"vmUri,omitempty"` } -// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware -// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU -// name. +// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the +// scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name. type Sku struct { // Name - The sku name. Name *string `json:"name,omitempty"` @@ -8769,10 +8016,15 @@ func (sl SnapshotList) IsEmpty() bool { return sl.Value == nil || len(*sl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sl SnapshotList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + // snapshotListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { + if !sl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8800,11 +8052,16 @@ func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sl) + if err != nil { + return err + } + page.sl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sl = next return nil } @@ -8864,6 +8121,33 @@ type SnapshotProperties struct { Encryption *Encryption `json:"encryption,omitempty"` } +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.OsType != "" { + objectMap["osType"] = sp.OsType + } + if sp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = sp.HyperVGeneration + } + if sp.CreationData != nil { + objectMap["creationData"] = sp.CreationData + } + if sp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = sp.DiskSizeGB + } + if sp.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection + } + if sp.Incremental != nil { + objectMap["incremental"] = sp.Incremental + } + if sp.Encryption != nil { + objectMap["encryption"] = sp.Encryption + } + return json.Marshal(objectMap) +} + // SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsCreateOrUpdateFuture struct { @@ -8893,8 +8177,7 @@ func (future *SnapshotsCreateOrUpdateFuture) Result(client SnapshotsClient) (s S return } -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type SnapshotsDeleteFuture struct { azure.Future } @@ -8953,6 +8236,15 @@ type SnapshotSku struct { Tier *string `json:"tier,omitempty"` } +// MarshalJSON is the custom marshaler for SnapshotSku. +func (ss SnapshotSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.Name != "" { + objectMap["name"] = ss.Name + } + return json.Marshal(objectMap) +} + // SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SnapshotsRevokeAccessFuture struct { @@ -8976,8 +8268,7 @@ func (future *SnapshotsRevokeAccessFuture) Result(client SnapshotsClient) (ar au return } -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type SnapshotsUpdateFuture struct { azure.Future } @@ -9095,8 +8386,8 @@ type SSHConfiguration struct { PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` } -// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where -// the public key is placed. +// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where the +// public key is placed. type SSHPublicKey struct { // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys Path *string `json:"path,omitempty"` @@ -9231,8 +8522,7 @@ type SSHPublicKeysGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource -// values. +// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource values. type SSHPublicKeysGroupListResultIterator struct { i int page SSHPublicKeysGroupListResultPage @@ -9300,10 +8590,15 @@ func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { return spkglr.Value == nil || len(*spkglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { + return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 +} + // sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if spkglr.NextLink == nil || len(to.String(spkglr.NextLink)) < 1 { + if !spkglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9331,11 +8626,16 @@ func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.spkglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.spkglr) + if err != nil { + return err + } + page.spkglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.spkglr = next return nil } @@ -9533,8 +8833,7 @@ type UpgradeOperationHistoricalStatusInfo struct { Location *string `json:"location,omitempty"` } -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale -// Set. +// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale Set. type UpgradeOperationHistoricalStatusInfoProperties struct { // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` @@ -9598,8 +8897,8 @@ type UserArtifactSource struct { MediaLink *string `json:"mediaLink,omitempty"` } -// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate -// should reside on the VM. +// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate should +// reside on the VM. type VaultCertificate struct { // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
} CertificateURL *string `json:"certificateUrl,omitempty"` @@ -9809,6 +9108,15 @@ type VirtualMachineCaptureResult struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. +func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcr.ID != nil { + objectMap["id"] = vmcr.ID + } + return json.Marshal(objectMap) +} + // VirtualMachineExtension describes a Virtual Machine Extension. type VirtualMachineExtension struct { autorest.Response `json:"-"` @@ -10069,8 +9377,38 @@ type VirtualMachineExtensionProperties struct { InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` } -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. +func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmep.ForceUpdateTag + } + if vmep.Publisher != nil { + objectMap["publisher"] = vmep.Publisher + } + if vmep.Type != nil { + objectMap["type"] = vmep.Type + } + if vmep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion + } + if vmep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion + } + if vmep.Settings != nil { + objectMap["settings"] = vmep.Settings + } + if vmep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmep.ProtectedSettings + } + if vmep.InstanceView != nil { + objectMap["instanceView"] = vmep.InstanceView + } + return json.Marshal(objectMap) +} + +// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineExtensionsCreateOrUpdateFuture struct { azure.Future } @@ -10508,10 +9846,15 @@ func (vmlr VirtualMachineListResult) IsEmpty() bool { return vmlr.Value == nil || len(*vmlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmlr VirtualMachineListResult) hasNextLink() bool { + return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 +} + // virtualMachineListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmlr.NextLink == nil || len(to.String(vmlr.NextLink)) < 1 { + if !vmlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10539,11 +9882,16 @@ func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmlr) + if err != nil { + return err + } + page.vmlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmlr = next return nil } @@ -10599,7 +9947,7 @@ type VirtualMachineProperties struct { ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` // Priority - Specifies the priority for the virtual machine.

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

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

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

Minimum api-version: 2019-03-01. BillingProfile *BillingProfile `json:"billingProfile,omitempty"` @@ -10615,8 +9963,56 @@ type VirtualMachineProperties struct { VMID *string `json:"vmId,omitempty"` } -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk -// will always be reimaged +// MarshalJSON is the custom marshaler for VirtualMachineProperties. +func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmp.HardwareProfile + } + if vmp.StorageProfile != nil { + objectMap["storageProfile"] = vmp.StorageProfile + } + if vmp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities + } + if vmp.OsProfile != nil { + objectMap["osProfile"] = vmp.OsProfile + } + if vmp.NetworkProfile != nil { + objectMap["networkProfile"] = vmp.NetworkProfile + } + if vmp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile + } + if vmp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmp.AvailabilitySet + } + if vmp.VirtualMachineScaleSet != nil { + objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet + } + if vmp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup + } + if vmp.Priority != "" { + objectMap["priority"] = vmp.Priority + } + if vmp.EvictionPolicy != "" { + objectMap["evictionPolicy"] = vmp.EvictionPolicy + } + if vmp.BillingProfile != nil { + objectMap["billingProfile"] = vmp.BillingProfile + } + if vmp.Host != nil { + objectMap["host"] = vmp.Host + } + if vmp.LicenseType != nil { + objectMap["licenseType"] = vmp.LicenseType + } + return json.Marshal(objectMap) +} + +// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will +// always be reimaged type VirtualMachineReimageParameters struct { // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. TempDisk *bool `json:"tempDisk,omitempty"` @@ -10953,10 +10349,15 @@ func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { return vmsselr.Value == nil || len(*vmsselr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { + return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 +} + // virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsselr.NextLink == nil || len(to.String(vmsselr.NextLink)) < 1 { + if !vmsselr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10984,11 +10385,16 @@ func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsselr) + if err != nil { + return err + } + page.vmsselr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsselr = next return nil } @@ -11028,8 +10434,7 @@ type VirtualMachineScaleSetExtensionProfile struct { Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` } -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set -// Extension. +// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set Extension. type VirtualMachineScaleSetExtensionProperties struct { // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` @@ -11051,6 +10456,36 @@ type VirtualMachineScaleSetExtensionProperties struct { ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. +func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag + } + if vmssep.Publisher != nil { + objectMap["publisher"] = vmssep.Publisher + } + if vmssep.Type != nil { + objectMap["type"] = vmssep.Type + } + if vmssep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion + } + if vmssep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion + } + if vmssep.Settings != nil { + objectMap["settings"] = vmssep.Settings + } + if vmssep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmssep.ProtectedSettings + } + if vmssep.ProvisionAfterExtensions != nil { + objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { @@ -11080,8 +10515,8 @@ func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) Result(clien return } -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetExtensionsDeleteFuture struct { azure.Future } @@ -11103,8 +10538,8 @@ func (future *VirtualMachineScaleSetExtensionsDeleteFuture) Result(client Virtua return } -// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetExtensionsUpdateFuture struct { azure.Future } @@ -11248,8 +10683,17 @@ type VirtualMachineScaleSetInstanceView struct { OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` } -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of -// a virtual machine scale set. +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. +func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssiv.Statuses != nil { + objectMap["statuses"] = vmssiv.Statuses + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of a +// virtual machine scale set. type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // StatusesSummary - READ-ONLY; The extensions information. StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` @@ -11322,8 +10766,8 @@ func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) return nil } -// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's -// IP configuration properties. +// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's IP +// configuration properties. type VirtualMachineScaleSetIPConfigurationProperties struct { // Subnet - Specifies the identifier of the subnet. Subnet *APIEntityReference `json:"subnet,omitempty"` @@ -11337,9 +10781,9 @@ type VirtualMachineScaleSetIPConfigurationProperties struct { ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` // ApplicationSecurityGroups - Specifies an array of references to application security group. ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. + // LoadBalancerBackendAddressPools - 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 `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer + // LoadBalancerInboundNatPools - 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 `json:"loadBalancerInboundNatPools,omitempty"` } @@ -11351,8 +10795,8 @@ type VirtualMachineScaleSetIPTag struct { Tag *string `json:"tag,omitempty"` } -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History -// operation response. +// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History operation +// response. type VirtualMachineScaleSetListOSUpgradeHistory struct { autorest.Response `json:"-"` // Value - The list of OS upgrades performed on the virtual machine scale set. @@ -11430,10 +10874,15 @@ func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { + return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 +} + // virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if vmsslouh.NextLink == nil || len(to.String(vmsslouh.NextLink)) < 1 { + if !vmsslouh.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11462,11 +10911,16 @@ func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslouh) + if err != nil { + return err + } + page.vmsslouh = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslouh = next return nil } @@ -11578,10 +11032,15 @@ func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { return vmsslr.Value == nil || len(*vmsslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { + return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 +} + // virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslr.NextLink == nil || len(to.String(vmsslr.NextLink)) < 1 { + if !vmsslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11609,11 +11068,16 @@ func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslr) + if err != nil { + return err + } + page.vmsslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslr = next return nil } @@ -11725,10 +11189,15 @@ func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { + return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 +} + // virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslsr.NextLink == nil || len(to.String(vmsslsr.NextLink)) < 1 { + if !vmsslsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11756,11 +11225,16 @@ func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslsr) + if err != nil { + return err + } + page.vmsslsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslsr = next return nil } @@ -11872,10 +11346,15 @@ func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { + return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 +} + // virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if vmsslwlr.NextLink == nil || len(to.String(vmsslwlr.NextLink)) < 1 { + if !vmsslwlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11903,11 +11382,16 @@ func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmsslwlr) + if err != nil { + return err + } + page.vmsslwlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmsslwlr = next return nil } @@ -11949,8 +11433,8 @@ type VirtualMachineScaleSetManagedDiskParameters struct { DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` } -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. +// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's network +// configurations. type VirtualMachineScaleSetNetworkConfiguration struct { // Name - The network configuration name. Name *string `json:"name,omitempty"` @@ -12023,8 +11507,8 @@ type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { DNSServers *[]string `json:"dnsServers,omitempty"` } -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration. +// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network profile's +// IP configuration. type VirtualMachineScaleSetNetworkConfigurationProperties struct { // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool `json:"primary,omitempty"` @@ -12120,8 +11604,47 @@ type VirtualMachineScaleSetProperties struct { ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` } -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. +func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssp.UpgradePolicy != nil { + objectMap["upgradePolicy"] = vmssp.UpgradePolicy + } + if vmssp.AutomaticRepairsPolicy != nil { + objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy + } + if vmssp.VirtualMachineProfile != nil { + objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile + } + if vmssp.Overprovision != nil { + objectMap["overprovision"] = vmssp.Overprovision + } + if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { + objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs + } + if vmssp.SinglePlacementGroup != nil { + objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup + } + if vmssp.ZoneBalance != nil { + objectMap["zoneBalance"] = vmssp.ZoneBalance + } + if vmssp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount + } + if vmssp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup + } + if vmssp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities + } + if vmssp.ScaleInPolicy != nil { + objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP Configuration's +// PublicIPAddress configuration type VirtualMachineScaleSetPublicIPAddressConfiguration struct { // Name - The publicIP address configuration name. Name *string `json:"name,omitempty"` @@ -12203,8 +11726,8 @@ type VirtualMachineScaleSetReimageParameters struct { TempDisk *bool `json:"tempDisk,omitempty"` } -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { azure.Future } @@ -12249,8 +11772,8 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) return } -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. +// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { azure.Future } @@ -12272,8 +11795,8 @@ func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) Result( return } -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsCreateOrUpdateFuture struct { azure.Future } @@ -12347,8 +11870,8 @@ func (future *VirtualMachineScaleSetsDeleteFuture) Result(client VirtualMachineS return } -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsDeleteInstancesFuture struct { azure.Future } @@ -12392,8 +11915,8 @@ type VirtualMachineScaleSetSkuCapacity struct { ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` } -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualMachineScaleSetsPerformMaintenanceFuture struct { azure.Future } @@ -12530,8 +12053,8 @@ func (future *VirtualMachineScaleSetsRestartFuture) Result(client VirtualMachine return } -// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. +// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { azure.Future } @@ -12615,8 +12138,8 @@ func (future *VirtualMachineScaleSetsUpdateFuture) Result(client VirtualMachineS return } -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetsUpdateInstancesFuture struct { azure.Future } @@ -12733,8 +12256,8 @@ func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { } // 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 +// 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 { // Name - The IP configuration name. Name *string `json:"name,omitempty"` @@ -12888,9 +12411,8 @@ func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(b return nil } -// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set -// updatable network profile's IP configuration.Use this object for updating network profile's IP -// Configuration. +// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set updatable +// network profile's IP configuration.Use this object for updating network profile's IP Configuration. type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { // Primary - Whether this is a primary NIC on a virtual machine. Primary *bool `json:"primary,omitempty"` @@ -12914,8 +12436,8 @@ type VirtualMachineScaleSetUpdateNetworkProfile struct { NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` } -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update -// Object. This should be used for Updating VMSS OS Disk. +// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update Object. +// This should be used for Updating VMSS OS Disk. type VirtualMachineScaleSetUpdateOSDisk struct { // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' Caching CachingTypes `json:"caching,omitempty"` @@ -13018,8 +12540,8 @@ func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) Unmar return nil } -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale -// set IP Configuration's PublicIPAddress configuration +// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { // IdleTimeoutInMinutes - The idle timeout of the public IP address. IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` @@ -13244,8 +12766,8 @@ func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) Result(cli return } -// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { azure.Future } @@ -13267,8 +12789,8 @@ func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) Result(client Virt return } -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine -// scale set. +// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine scale +// set. type VirtualMachineScaleSetVMExtensionsSummary struct { // Name - READ-ONLY; The extension name. Name *string `json:"name,omitempty"` @@ -13276,8 +12798,8 @@ type VirtualMachineScaleSetVMExtensionsSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } -// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { azure.Future } @@ -13305,8 +12827,7 @@ func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) Result(client Virt return } -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale -// set. +// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale set. type VirtualMachineScaleSetVMInstanceIDs struct { // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. InstanceIds *[]string `json:"instanceIds,omitempty"` @@ -13346,6 +12867,42 @@ type VirtualMachineScaleSetVMInstanceView struct { PlacementGroupID *string `json:"placementGroupId,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. +func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssviv.PlatformUpdateDomain != nil { + objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain + } + if vmssviv.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain + } + if vmssviv.RdpThumbPrint != nil { + objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint + } + if vmssviv.VMAgent != nil { + objectMap["vmAgent"] = vmssviv.VMAgent + } + if vmssviv.MaintenanceRedeployStatus != nil { + objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus + } + if vmssviv.Disks != nil { + objectMap["disks"] = vmssviv.Disks + } + if vmssviv.Extensions != nil { + objectMap["extensions"] = vmssviv.Extensions + } + if vmssviv.BootDiagnostics != nil { + objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics + } + if vmssviv.Statuses != nil { + objectMap["statuses"] = vmssviv.Statuses + } + if vmssviv.PlacementGroupID != nil { + objectMap["placementGroupId"] = vmssviv.PlacementGroupID + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. type VirtualMachineScaleSetVMListResult struct { autorest.Response `json:"-"` @@ -13355,8 +12912,8 @@ type VirtualMachineScaleSetVMListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetVM values. +// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of VirtualMachineScaleSetVM +// values. type VirtualMachineScaleSetVMListResultIterator struct { i int page VirtualMachineScaleSetVMListResultPage @@ -13424,10 +12981,15 @@ func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { + return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 +} + // virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if vmssvlr.NextLink == nil || len(to.String(vmssvlr.NextLink)) < 1 { + if !vmssvlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13455,11 +13017,16 @@ func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vmssvlr) + if err != nil { + return err + } + page.vmssvlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vmssvlr = next return nil } @@ -13516,7 +13083,7 @@ type VirtualMachineScaleSetVMProfile struct { LicenseType *string `json:"licenseType,omitempty"` // Priority - Specifies the priority for the virtual machines in the scale set.

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

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

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

Minimum api-version: 2019-03-01. BillingProfile *BillingProfile `json:"billingProfile,omitempty"` @@ -13524,8 +13091,7 @@ type VirtualMachineScaleSetVMProfile struct { ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` } -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual -// machine. +// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual machine. type VirtualMachineScaleSetVMProperties struct { // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. LatestModelApplied *bool `json:"latestModelApplied,omitempty"` @@ -13559,6 +13125,42 @@ type VirtualMachineScaleSetVMProperties struct { ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. +func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssvp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmssvp.HardwareProfile + } + if vmssvp.StorageProfile != nil { + objectMap["storageProfile"] = vmssvp.StorageProfile + } + if vmssvp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities + } + if vmssvp.OsProfile != nil { + objectMap["osProfile"] = vmssvp.OsProfile + } + if vmssvp.NetworkProfile != nil { + objectMap["networkProfile"] = vmssvp.NetworkProfile + } + if vmssvp.NetworkProfileConfiguration != nil { + objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration + } + if vmssvp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile + } + if vmssvp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmssvp.AvailabilitySet + } + if vmssvp.LicenseType != nil { + objectMap["licenseType"] = vmssvp.LicenseType + } + if vmssvp.ProtectionPolicy != nil { + objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy + } + return json.Marshal(objectMap) +} + // VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. type VirtualMachineScaleSetVMProtectionPolicy struct { // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. @@ -13619,8 +13221,8 @@ func (future *VirtualMachineScaleSetVMsDeleteFuture) Result(client VirtualMachin return } -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { azure.Future } @@ -13919,8 +13521,8 @@ func (future *VirtualMachinesCreateOrUpdateFuture) Result(client VirtualMachines return } -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesDeallocateFuture struct { azure.Future } @@ -14126,8 +13728,8 @@ func (future *VirtualMachinesRestartFuture) Result(client VirtualMachinesClient) return } -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualMachinesRunCommandFuture struct { azure.Future } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go index 891fba0f646..fb3c693230d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/operations.go @@ -100,7 +100,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go index 3abf4a32b0c..56e136a1257 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/proximityplacementgroups.go @@ -113,7 +113,6 @@ func (client ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Requ func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*h func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -269,7 +267,6 @@ func (client ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -309,6 +306,9 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Con if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -344,7 +344,6 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -419,6 +418,9 @@ func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Cont if err != nil { err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -453,7 +455,6 @@ func (client ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http. func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -569,7 +570,6 @@ func (client ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*h func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go index e71328f0c6c..d389561d3c7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/resourceskus.go @@ -73,6 +73,9 @@ func (client ResourceSkusClient) List(ctx context.Context, filter string) (resul if err != nil { err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") } + if result.rsr.hasNextLink() && result.rsr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -110,7 +113,6 @@ func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go index e3f4980da29..c96a8a29096 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/snapshots.go @@ -130,7 +130,6 @@ func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future Sn func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsD func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -283,7 +281,6 @@ func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, erro func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -369,7 +366,6 @@ func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future Snaps func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -407,6 +403,9 @@ func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -441,7 +440,6 @@ func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, err func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -518,6 +516,9 @@ func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceG if err != nil { err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -553,7 +554,6 @@ func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*htt func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -667,7 +667,6 @@ func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future Snap func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -746,7 +745,6 @@ func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsU func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go index d12c7d86766..284e5d6c838 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/sshpublickeys.go @@ -112,7 +112,6 @@ func (client SSHPublicKeysClient) CreateSender(req *http.Request) (*http.Respons func (client SSHPublicKeysClient) CreateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client SSHPublicKeysClient) DeleteSender(req *http.Request) (*http.Respons func (client SSHPublicKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -265,7 +263,6 @@ func (client SSHPublicKeysClient) GenerateKeyPairSender(req *http.Request) (*htt func (client SSHPublicKeysClient) GenerateKeyPairResponder(resp *http.Response) (result SSHPublicKeyGenerateKeyPairResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -341,7 +338,6 @@ func (client SSHPublicKeysClient) GetSender(req *http.Request) (*http.Response, func (client SSHPublicKeysClient) GetResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -382,6 +378,9 @@ func (client SSHPublicKeysClient) ListByResourceGroup(ctx context.Context, resou if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -417,7 +416,6 @@ func (client SSHPublicKeysClient) ListByResourceGroupSender(req *http.Request) ( func (client SSHPublicKeysClient) ListByResourceGroupResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -493,6 +491,9 @@ func (client SSHPublicKeysClient) ListBySubscription(ctx context.Context) (resul if err != nil { err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure responding to request") } + if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -527,7 +528,6 @@ func (client SSHPublicKeysClient) ListBySubscriptionSender(req *http.Request) (* func (client SSHPublicKeysClient) ListBySubscriptionResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -643,7 +643,6 @@ func (client SSHPublicKeysClient) UpdateSender(req *http.Request) (*http.Respons func (client SSHPublicKeysClient) UpdateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go index 7ec1c40267e..d0b7b4b6c83 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/usage.go @@ -81,6 +81,9 @@ func (client UsageClient) List(ctx context.Context, location string) (result Lis if err != nil { err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") } + if result.lur.hasNextLink() && result.lur.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -116,7 +119,6 @@ func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go index 62d2dfefdf2..2eb81718a5d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensionimages.go @@ -111,7 +111,6 @@ func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) ( func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -186,7 +185,6 @@ func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Requ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -272,7 +270,6 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.R func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go index 545d45a63bf..78fdde3cff1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineextensions.go @@ -115,7 +115,6 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Requ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -193,7 +192,6 @@ func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (fu func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -274,7 +272,6 @@ func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -354,7 +351,6 @@ func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*htt func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -435,7 +431,6 @@ func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (fu func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go index 431ac3ae3c2..2b894fda4cf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineimages.go @@ -116,7 +116,6 @@ func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Res func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,7 +205,6 @@ func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Re func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -282,7 +280,6 @@ func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*h func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -356,7 +353,6 @@ func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -434,7 +430,6 @@ func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*htt func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go index 9a670358b39..e0754a0655b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachineruncommands.go @@ -117,7 +117,6 @@ func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*htt func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -163,6 +162,9 @@ func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") } + if result.rclr.hasNextLink() && result.rclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -198,7 +200,6 @@ func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*ht func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go index b73c77f8477..d150a378900 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachines.go @@ -122,7 +122,6 @@ func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future Vir func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,7 +198,6 @@ func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Reques func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -300,7 +298,6 @@ func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (fut func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -377,7 +374,6 @@ func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -452,7 +448,6 @@ func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future Virt func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -531,7 +526,6 @@ func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.R func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -610,7 +604,6 @@ func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -686,7 +679,6 @@ func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -727,6 +719,9 @@ func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -762,7 +757,6 @@ func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Respons func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -840,6 +834,9 @@ func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly stri if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -877,7 +874,6 @@ func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Resp func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -990,7 +986,6 @@ func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1036,6 +1031,9 @@ func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1071,7 +1069,6 @@ func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*ht func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1184,7 +1181,6 @@ func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1268,7 +1264,6 @@ func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future Vi func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1343,7 +1338,6 @@ func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future Vir func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1418,7 +1412,6 @@ func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future Vi func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1499,7 +1492,6 @@ func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future Vir func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1574,7 +1566,6 @@ func (client VirtualMachinesClient) RestartSender(req *http.Request) (future Vir func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1658,7 +1649,6 @@ func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1735,7 +1725,6 @@ func (client VirtualMachinesClient) SimulateEvictionSender(req *http.Request) (* func (client VirtualMachinesClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1810,7 +1799,6 @@ func (client VirtualMachinesClient) StartSender(req *http.Request) (future Virtu func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1888,7 +1876,6 @@ func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future Virt func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go index 97605bcbf05..4ed8a6fd4e6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetextensions.go @@ -116,7 +116,6 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *h func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -194,7 +193,6 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Requ func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -275,7 +273,6 @@ func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -316,6 +313,9 @@ func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, r if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") } + if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -352,7 +352,6 @@ func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Reques func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -472,7 +471,6 @@ func (client VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Requ func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go index e5653cbc262..66187cd5829 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetrollingupgrades.go @@ -111,7 +111,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -186,7 +185,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *h func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -264,7 +262,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeS func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -340,7 +337,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(r func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go index c95a9756695..8839ada2da2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go @@ -115,7 +115,6 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender( func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -216,7 +215,6 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Reque func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -299,7 +297,6 @@ func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -374,7 +371,6 @@ func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (fut func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -458,7 +454,6 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Requ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -536,7 +531,6 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -612,7 +606,6 @@ func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http. func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -688,7 +681,6 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Requ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -729,6 +721,9 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Cont if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") } + if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -765,7 +760,6 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http. func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -842,6 +836,9 @@ func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") } + if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -877,7 +874,6 @@ func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -954,6 +950,9 @@ func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") } + if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -988,7 +987,6 @@ func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*h func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1067,6 +1065,9 @@ func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") } + if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1103,7 +1104,6 @@ func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (* func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1224,7 +1224,6 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.R func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1314,7 +1313,6 @@ func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (f func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1396,7 +1394,6 @@ func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (f func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1478,7 +1475,6 @@ func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (fu func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1560,7 +1556,6 @@ func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1641,7 +1636,6 @@ func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (fu func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1719,7 +1713,6 @@ func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(r func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1800,7 +1793,6 @@ func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (futu func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1878,7 +1870,6 @@ func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (fut func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1963,7 +1954,6 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Requ func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go index bf1427b1066..f877eb6cd0f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvmextensions.go @@ -118,7 +118,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -198,7 +197,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Re func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -281,7 +279,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Reque func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,7 +360,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Requ func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -446,7 +442,6 @@ func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Re func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go index 7e611cfb12b..7b1ac02c1b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesetvms.go @@ -115,7 +115,6 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -192,7 +191,6 @@ func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (f func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -273,7 +271,6 @@ func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*htt func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,7 +348,6 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Re func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,9 +359,10 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt // Parameters: // resourceGroupName - the name of the resource group. // virtualMachineScaleSetName - the name of the VM scale set. -// filter - the filter to apply to the operation. -// selectParameter - the list parameters. -// expand - the expand expression to apply to the operation. +// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, +// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. +// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") @@ -395,6 +392,9 @@ func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") } + if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -440,7 +440,6 @@ func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*ht func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -555,7 +554,6 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -641,7 +639,6 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -719,7 +716,6 @@ func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -802,7 +798,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) ( func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -880,7 +875,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -957,7 +951,6 @@ func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) ( func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1043,7 +1036,6 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1122,7 +1114,6 @@ func (client VirtualMachineScaleSetVMsClient) SimulateEvictionSender(req *http.R func (client VirtualMachineScaleSetVMsClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1199,7 +1190,6 @@ func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (fu func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1304,7 +1294,6 @@ func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (f func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go index 0eb7702a3b4..4ec90e055a9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/virtualmachinesizes.go @@ -116,7 +116,6 @@ func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Res func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/enums.go new file mode 100644 index 00000000000..b5ab94cc3e6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/enums.go @@ -0,0 +1,64 @@ +package dns + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RecordType enumerates the values for record type. +type RecordType string + +const ( + // A ... + A RecordType = "A" + // AAAA ... + AAAA RecordType = "AAAA" + // CAA ... + CAA RecordType = "CAA" + // CNAME ... + CNAME RecordType = "CNAME" + // MX ... + MX RecordType = "MX" + // NS ... + NS RecordType = "NS" + // PTR ... + PTR RecordType = "PTR" + // SOA ... + SOA RecordType = "SOA" + // SRV ... + SRV RecordType = "SRV" + // TXT ... + TXT RecordType = "TXT" +) + +// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. +func PossibleRecordTypeValues() []RecordType { + return []RecordType{A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT} +} + +// ZoneType enumerates the values for zone type. +type ZoneType string + +const ( + // Private ... + Private ZoneType = "Private" + // Public ... + Public ZoneType = "Public" +) + +// PossibleZoneTypeValues returns an array of possible values for the ZoneType const type. +func PossibleZoneTypeValues() []ZoneType { + return []ZoneType{Private, Public} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/models.go index b9b4c627c0a..dbf877d4dd7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/models.go @@ -30,52 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns" -// RecordType enumerates the values for record type. -type RecordType string - -const ( - // A ... - A RecordType = "A" - // AAAA ... - AAAA RecordType = "AAAA" - // CAA ... - CAA RecordType = "CAA" - // CNAME ... - CNAME RecordType = "CNAME" - // MX ... - MX RecordType = "MX" - // NS ... - NS RecordType = "NS" - // PTR ... - PTR RecordType = "PTR" - // SOA ... - SOA RecordType = "SOA" - // SRV ... - SRV RecordType = "SRV" - // TXT ... - TXT RecordType = "TXT" -) - -// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. -func PossibleRecordTypeValues() []RecordType { - return []RecordType{A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT} -} - -// ZoneType enumerates the values for zone type. -type ZoneType string - -const ( - // Private ... - Private ZoneType = "Private" - // Public ... - Public ZoneType = "Public" -) - -// PossibleZoneTypeValues returns an array of possible values for the ZoneType const type. -func PossibleZoneTypeValues() []ZoneType { - return []ZoneType{Private, Public} -} - // AaaaRecord an AAAA record. type AaaaRecord struct { // Ipv6Address - The IPv6 address of this AAAA record. @@ -238,6 +192,15 @@ type RecordSetListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for RecordSetListResult. +func (rslr RecordSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rslr.Value != nil { + objectMap["value"] = rslr.Value + } + return json.Marshal(objectMap) +} + // RecordSetListResultIterator provides access to a complete listing of RecordSet values. type RecordSetListResultIterator struct { i int @@ -306,10 +269,15 @@ func (rslr RecordSetListResult) IsEmpty() bool { return rslr.Value == nil || len(*rslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rslr RecordSetListResult) hasNextLink() bool { + return rslr.NextLink != nil && len(*rslr.NextLink) != 0 +} + // recordSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rslr RecordSetListResult) recordSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if rslr.NextLink == nil || len(to.String(rslr.NextLink)) < 1 { + if !rslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -337,11 +305,16 @@ func (page *RecordSetListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rslr) + if err != nil { + return err + } + page.rslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rslr = next return nil } @@ -752,6 +725,15 @@ type ZoneListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ZoneListResult. +func (zlr ZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if zlr.Value != nil { + objectMap["value"] = zlr.Value + } + return json.Marshal(objectMap) +} + // ZoneListResultIterator provides access to a complete listing of Zone values. type ZoneListResultIterator struct { i int @@ -820,10 +802,15 @@ func (zlr ZoneListResult) IsEmpty() bool { return zlr.Value == nil || len(*zlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (zlr ZoneListResult) hasNextLink() bool { + return zlr.NextLink != nil && len(*zlr.NextLink) != 0 +} + // zoneListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (zlr ZoneListResult) zoneListResultPreparer(ctx context.Context) (*http.Request, error) { - if zlr.NextLink == nil || len(to.String(zlr.NextLink)) < 1 { + if !zlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -851,11 +838,16 @@ func (page *ZoneListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.zlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.zlr) + if err != nil { + return err + } + page.zlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.zlr = next return nil } @@ -905,6 +897,21 @@ type ZoneProperties struct { ResolutionVirtualNetworks *[]SubResource `json:"resolutionVirtualNetworks,omitempty"` } +// MarshalJSON is the custom marshaler for ZoneProperties. +func (zp ZoneProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if zp.ZoneType != "" { + objectMap["zoneType"] = zp.ZoneType + } + if zp.RegistrationVirtualNetworks != nil { + objectMap["registrationVirtualNetworks"] = zp.RegistrationVirtualNetworks + } + if zp.ResolutionVirtualNetworks != nil { + objectMap["resolutionVirtualNetworks"] = zp.ResolutionVirtualNetworks + } + return json.Marshal(objectMap) +} + // ZonesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ZonesDeleteFuture struct { azure.Future diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/recordsets.go index 5e0052ba3a6..7a77cf6d51f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/recordsets.go @@ -132,7 +132,6 @@ func (client RecordSetsClient) CreateOrUpdateSender(req *http.Request) (*http.Re func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -219,7 +218,6 @@ func (client RecordSetsClient) DeleteSender(req *http.Request) (*http.Response, func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -298,7 +296,6 @@ func (client RecordSetsClient) GetSender(req *http.Request) (*http.Response, err func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -343,6 +340,9 @@ func (client RecordSetsClient) ListAllByDNSZone(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllByDNSZone", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -385,7 +385,6 @@ func (client RecordSetsClient) ListAllByDNSZoneSender(req *http.Request) (*http. func (client RecordSetsClient) ListAllByDNSZoneResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -467,6 +466,9 @@ func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupN if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByDNSZone", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -509,7 +511,6 @@ func (client RecordSetsClient) ListByDNSZoneSender(req *http.Request) (*http.Res func (client RecordSetsClient) ListByDNSZoneResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -592,6 +593,9 @@ func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -635,7 +639,6 @@ func (client RecordSetsClient) ListByTypeSender(req *http.Request) (*http.Respon func (client RecordSetsClient) ListByTypeResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -764,7 +767,6 @@ func (client RecordSetsClient) UpdateSender(req *http.Request) (*http.Response, func (client RecordSetsClient) UpdateResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/resourcereference.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/resourcereference.go index 96bc7afc98a..9f0ded44e97 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/resourcereference.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/resourcereference.go @@ -109,7 +109,6 @@ func (client ResourceReferenceClient) GetByTargetResourcesSender(req *http.Reque func (client ResourceReferenceClient) GetByTargetResourcesResponder(resp *http.Response) (result ResourceReferenceResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/zones.go index f1ee5a6e70b..17a65d23c72 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns/zones.go @@ -124,7 +124,6 @@ func (client ZonesClient) CreateOrUpdateSender(req *http.Request) (*http.Respons func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Zone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,7 +206,6 @@ func (client ZonesClient) DeleteSender(req *http.Request) (future ZonesDeleteFut func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -282,7 +280,6 @@ func (client ZonesClient) GetSender(req *http.Request) (*http.Response, error) { func (client ZonesClient) GetResponder(resp *http.Response) (result Zone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -322,6 +319,9 @@ func (client ZonesClient) List(ctx context.Context, top *int32) (result ZoneList if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "List", resp, "Failure responding to request") } + if result.zlr.hasNextLink() && result.zlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -359,7 +359,6 @@ func (client ZonesClient) ListSender(req *http.Request) (*http.Response, error) func (client ZonesClient) ListResponder(resp *http.Response) (result ZoneListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -437,6 +436,9 @@ func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.zlr.hasNextLink() && result.zlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -475,7 +477,6 @@ func (client ZonesClient) ListByResourceGroupSender(req *http.Request) (*http.Re func (client ZonesClient) ListByResourceGroupResponder(resp *http.Response) (result ZoneListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -597,7 +598,6 @@ func (client ZonesClient) UpdateSender(req *http.Request) (*http.Response, error func (client ZonesClient) UpdateResponder(resp *http.Response) (result Zone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go index 9796e9e7f35..1b0a3f42c79 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/applications.go @@ -119,7 +119,6 @@ func (client ApplicationsClient) AddOwnerSender(req *http.Request) (*http.Respon func (client ApplicationsClient) AddOwnerResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -199,7 +198,6 @@ func (client ApplicationsClient) CreateSender(req *http.Request) (*http.Response func (client ApplicationsClient) CreateResponder(resp *http.Response) (result Application, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -273,7 +271,6 @@ func (client ApplicationsClient) DeleteSender(req *http.Request) (*http.Response func (client ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -346,7 +343,6 @@ func (client ApplicationsClient) GetSender(req *http.Request) (*http.Response, e func (client ApplicationsClient) GetResponder(resp *http.Response) (result Application, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -420,7 +416,6 @@ func (client ApplicationsClient) GetServicePrincipalsIDByAppIDSender(req *http.R func (client ApplicationsClient) GetServicePrincipalsIDByAppIDResponder(resp *http.Response) (result ServicePrincipalObjectResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -465,6 +460,9 @@ func (client ApplicationsClient) List(ctx context.Context, filter string) (resul if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "List", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -502,7 +500,6 @@ func (client ApplicationsClient) ListSender(req *http.Request) (*http.Response, func (client ApplicationsClient) ListResponder(resp *http.Response) (result ApplicationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -592,7 +589,6 @@ func (client ApplicationsClient) ListKeyCredentialsSender(req *http.Request) (*h func (client ApplicationsClient) ListKeyCredentialsResponder(resp *http.Response) (result KeyCredentialListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -666,7 +662,6 @@ func (client ApplicationsClient) ListNextSender(req *http.Request) (*http.Respon func (client ApplicationsClient) ListNextResponder(resp *http.Response) (result ApplicationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -706,6 +701,9 @@ func (client ApplicationsClient) ListOwners(ctx context.Context, applicationObje if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ApplicationsClient", "ListOwners", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -741,7 +739,6 @@ func (client ApplicationsClient) ListOwnersSender(req *http.Request) (*http.Resp func (client ApplicationsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -852,7 +849,6 @@ func (client ApplicationsClient) ListPasswordCredentialsSender(req *http.Request func (client ApplicationsClient) ListPasswordCredentialsResponder(resp *http.Response) (result PasswordCredentialListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -929,7 +925,6 @@ func (client ApplicationsClient) PatchSender(req *http.Request) (*http.Response, func (client ApplicationsClient) PatchResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1004,7 +999,6 @@ func (client ApplicationsClient) RemoveOwnerSender(req *http.Request) (*http.Res func (client ApplicationsClient) RemoveOwnerResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1080,7 +1074,6 @@ func (client ApplicationsClient) UpdateKeyCredentialsSender(req *http.Request) ( func (client ApplicationsClient) UpdateKeyCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1156,7 +1149,6 @@ func (client ApplicationsClient) UpdatePasswordCredentialsSender(req *http.Reque func (client ApplicationsClient) UpdatePasswordCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go index bd85fb340bd..cb2dd07d73c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/deletedapplications.go @@ -109,7 +109,6 @@ func (client DeletedApplicationsClient) HardDeleteSender(req *http.Request) (*ht func (client DeletedApplicationsClient) HardDeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -153,6 +152,9 @@ func (client DeletedApplicationsClient) List(ctx context.Context, filter string) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.DeletedApplicationsClient", "List", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -190,7 +192,6 @@ func (client DeletedApplicationsClient) ListSender(req *http.Request) (*http.Res func (client DeletedApplicationsClient) ListResponder(resp *http.Response) (result ApplicationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -280,7 +281,6 @@ func (client DeletedApplicationsClient) ListNextSender(req *http.Request) (*http func (client DeletedApplicationsClient) ListNextResponder(resp *http.Response) (result ApplicationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -354,7 +354,6 @@ func (client DeletedApplicationsClient) RestoreSender(req *http.Request) (*http. func (client DeletedApplicationsClient) RestoreResponder(resp *http.Response) (result Application, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go index 924975dc39d..ace3959ac60 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/domains.go @@ -107,7 +107,6 @@ func (client DomainsClient) GetSender(req *http.Request) (*http.Response, error) func (client DomainsClient) GetResponder(resp *http.Response) (result Domain, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -183,7 +182,6 @@ func (client DomainsClient) ListSender(req *http.Request) (*http.Response, error func (client DomainsClient) ListResponder(resp *http.Response) (result DomainListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/enums.go new file mode 100644 index 00000000000..2e9cbd70f6a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/enums.go @@ -0,0 +1,86 @@ +package graphrbac + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ConsentType enumerates the values for consent type. +type ConsentType string + +const ( + // AllPrincipals ... + AllPrincipals ConsentType = "AllPrincipals" + // Principal ... + Principal ConsentType = "Principal" +) + +// PossibleConsentTypeValues returns an array of possible values for the ConsentType const type. +func PossibleConsentTypeValues() []ConsentType { + return []ConsentType{AllPrincipals, Principal} +} + +// GroupMembershipClaimTypes enumerates the values for group membership claim types. +type GroupMembershipClaimTypes string + +const ( + // All ... + All GroupMembershipClaimTypes = "All" + // None ... + None GroupMembershipClaimTypes = "None" + // SecurityGroup ... + SecurityGroup GroupMembershipClaimTypes = "SecurityGroup" +) + +// PossibleGroupMembershipClaimTypesValues returns an array of possible values for the GroupMembershipClaimTypes const type. +func PossibleGroupMembershipClaimTypesValues() []GroupMembershipClaimTypes { + return []GroupMembershipClaimTypes{All, None, SecurityGroup} +} + +// ObjectType enumerates the values for object type. +type ObjectType string + +const ( + // ObjectTypeApplication ... + ObjectTypeApplication ObjectType = "Application" + // ObjectTypeDirectoryObject ... + ObjectTypeDirectoryObject ObjectType = "DirectoryObject" + // ObjectTypeGroup ... + ObjectTypeGroup ObjectType = "Group" + // ObjectTypeServicePrincipal ... + ObjectTypeServicePrincipal ObjectType = "ServicePrincipal" + // ObjectTypeUser ... + ObjectTypeUser ObjectType = "User" +) + +// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. +func PossibleObjectTypeValues() []ObjectType { + return []ObjectType{ObjectTypeApplication, ObjectTypeDirectoryObject, ObjectTypeGroup, ObjectTypeServicePrincipal, ObjectTypeUser} +} + +// UserType enumerates the values for user type. +type UserType string + +const ( + // Guest ... + Guest UserType = "Guest" + // Member ... + Member UserType = "Member" +) + +// PossibleUserTypeValues returns an array of possible values for the UserType const type. +func PossibleUserTypeValues() []UserType { + return []UserType{Guest, Member} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go index 0daef502bde..02b021e4d21 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/groups.go @@ -119,7 +119,6 @@ func (client GroupsClient) AddMemberSender(req *http.Request) (*http.Response, e func (client GroupsClient) AddMemberResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -202,7 +201,6 @@ func (client GroupsClient) AddOwnerSender(req *http.Request) (*http.Response, er func (client GroupsClient) AddOwnerResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,7 +283,6 @@ func (client GroupsClient) CreateSender(req *http.Request) (*http.Response, erro func (client GroupsClient) CreateResponder(resp *http.Response) (result ADGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -359,7 +356,6 @@ func (client GroupsClient) DeleteSender(req *http.Request) (*http.Response, erro func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -432,7 +428,6 @@ func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) func (client GroupsClient) GetResponder(resp *http.Response) (result ADGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -477,6 +472,9 @@ func (client GroupsClient) GetGroupMembers(ctx context.Context, objectID string) if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "GetGroupMembers", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -512,7 +510,6 @@ func (client GroupsClient) GetGroupMembersSender(req *http.Request) (*http.Respo func (client GroupsClient) GetGroupMembersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -602,7 +599,6 @@ func (client GroupsClient) GetGroupMembersNextSender(req *http.Request) (*http.R func (client GroupsClient) GetGroupMembersNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -685,7 +681,6 @@ func (client GroupsClient) GetMemberGroupsSender(req *http.Request) (*http.Respo func (client GroupsClient) GetMemberGroupsResponder(resp *http.Response) (result GroupGetMemberGroupsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -768,7 +763,6 @@ func (client GroupsClient) IsMemberOfSender(req *http.Request) (*http.Response, func (client GroupsClient) IsMemberOfResponder(resp *http.Response) (result CheckGroupMembershipResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -813,6 +807,9 @@ func (client GroupsClient) List(ctx context.Context, filter string) (result Grou if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "List", resp, "Failure responding to request") } + if result.glr.hasNextLink() && result.glr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -850,7 +847,6 @@ func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -940,7 +936,6 @@ func (client GroupsClient) ListNextSender(req *http.Request) (*http.Response, er func (client GroupsClient) ListNextResponder(resp *http.Response) (result GroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -980,6 +975,9 @@ func (client GroupsClient) ListOwners(ctx context.Context, objectID string) (res if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.GroupsClient", "ListOwners", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1015,7 +1013,6 @@ func (client GroupsClient) ListOwnersSender(req *http.Request) (*http.Response, func (client GroupsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1128,7 +1125,6 @@ func (client GroupsClient) RemoveMemberSender(req *http.Request) (*http.Response func (client GroupsClient) RemoveMemberResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1203,7 +1199,6 @@ func (client GroupsClient) RemoveOwnerSender(req *http.Request) (*http.Response, func (client GroupsClient) RemoveOwnerResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go index 73881629af3..be2bbcfcf45 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/models.go @@ -30,74 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac" -// ConsentType enumerates the values for consent type. -type ConsentType string - -const ( - // AllPrincipals ... - AllPrincipals ConsentType = "AllPrincipals" - // Principal ... - Principal ConsentType = "Principal" -) - -// PossibleConsentTypeValues returns an array of possible values for the ConsentType const type. -func PossibleConsentTypeValues() []ConsentType { - return []ConsentType{AllPrincipals, Principal} -} - -// GroupMembershipClaimTypes enumerates the values for group membership claim types. -type GroupMembershipClaimTypes string - -const ( - // All ... - All GroupMembershipClaimTypes = "All" - // None ... - None GroupMembershipClaimTypes = "None" - // SecurityGroup ... - SecurityGroup GroupMembershipClaimTypes = "SecurityGroup" -) - -// PossibleGroupMembershipClaimTypesValues returns an array of possible values for the GroupMembershipClaimTypes const type. -func PossibleGroupMembershipClaimTypesValues() []GroupMembershipClaimTypes { - return []GroupMembershipClaimTypes{All, None, SecurityGroup} -} - -// ObjectType enumerates the values for object type. -type ObjectType string - -const ( - // ObjectTypeApplication ... - ObjectTypeApplication ObjectType = "Application" - // ObjectTypeDirectoryObject ... - ObjectTypeDirectoryObject ObjectType = "DirectoryObject" - // ObjectTypeGroup ... - ObjectTypeGroup ObjectType = "Group" - // ObjectTypeServicePrincipal ... - ObjectTypeServicePrincipal ObjectType = "ServicePrincipal" - // ObjectTypeUser ... - ObjectTypeUser ObjectType = "User" -) - -// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type. -func PossibleObjectTypeValues() []ObjectType { - return []ObjectType{ObjectTypeApplication, ObjectTypeDirectoryObject, ObjectTypeGroup, ObjectTypeServicePrincipal, ObjectTypeUser} -} - -// UserType enumerates the values for user type. -type UserType string - -const ( - // Guest ... - Guest UserType = "Guest" - // Member ... - Member UserType = "Member" -) - -// PossibleUserTypeValues returns an array of possible values for the UserType const type. -func PossibleUserTypeValues() []UserType { - return []UserType{Guest, Member} -} - // AddOwnerParameters request parameters for adding a owner to an application. type AddOwnerParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -1094,6 +1026,11 @@ func (alr ApplicationListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (alr ApplicationListResult) hasNextLink() bool { + return alr.OdataNextLink != nil && len(*alr.OdataNextLink) != 0 +} + // ApplicationListResultPage contains a page of Application values. type ApplicationListResultPage struct { fn func(context.Context, ApplicationListResult) (ApplicationListResult, error) @@ -1113,11 +1050,16 @@ func (page *ApplicationListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.alr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.alr = next return nil } @@ -1635,10 +1577,15 @@ func (dolr DirectoryObjectListResult) IsEmpty() bool { return dolr.Value == nil || len(*dolr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dolr DirectoryObjectListResult) hasNextLink() bool { + return dolr.OdataNextLink != nil && len(*dolr.OdataNextLink) != 0 +} + // directoryObjectListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dolr DirectoryObjectListResult) directoryObjectListResultPreparer(ctx context.Context) (*http.Request, error) { - if dolr.OdataNextLink == nil || len(to.String(dolr.OdataNextLink)) < 1 { + if !dolr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1666,11 +1613,16 @@ func (page *DirectoryObjectListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dolr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dolr = next return nil } @@ -2224,6 +2176,11 @@ func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (glr GroupListResult) hasNextLink() bool { + return glr.OdataNextLink != nil && len(*glr.OdataNextLink) != 0 +} + // GroupListResultPage contains a page of ADGroup values. type GroupListResultPage struct { fn func(context.Context, GroupListResult) (GroupListResult, error) @@ -2243,11 +2200,16 @@ func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.glr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.glr = next return nil } @@ -2281,8 +2243,8 @@ func NewGroupListResultPage(getNextPage func(context.Context, GroupListResult) ( return GroupListResultPage{fn: getNextPage} } -// InformationalURL represents a group of URIs that provide terms of service, marketing, support and -// privacy policy information about an application. The default value for each string is null. +// InformationalURL represents a group of URIs that provide terms of service, marketing, support and privacy +// policy information about an application. The default value for each string is null. type InformationalURL struct { // TermsOfService - The terms of service URI TermsOfService *string `json:"termsOfService,omitempty"` @@ -2448,8 +2410,8 @@ type KeyCredentialsUpdateParameters struct { } // OAuth2Permission represents an OAuth 2.0 delegated permission scope. The specified OAuth 2.0 delegated -// permission scopes may be requested by client applications (through the requiredResourceAccess collection -// on the Application object) when calling a resource application. The oauth2Permissions property of the +// permission scopes may be requested by client applications (through the requiredResourceAccess collection on +// the Application object) when calling a resource application. The oauth2Permissions property of the // ServicePrincipal entity and of the Application entity is a collection of OAuth2Permission. type OAuth2Permission struct { // AdminConsentDescription - Permission help text that appears in the admin consent and app assignment experiences. @@ -2571,6 +2533,11 @@ func (oa2pglr OAuth2PermissionGrantListResult) IsEmpty() bool { return oa2pglr.Value == nil || len(*oa2pglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (oa2pglr OAuth2PermissionGrantListResult) hasNextLink() bool { + return oa2pglr.OdataNextLink != nil && len(*oa2pglr.OdataNextLink) != 0 +} + // OAuth2PermissionGrantListResultPage contains a page of OAuth2PermissionGrant values. type OAuth2PermissionGrantListResultPage struct { fn func(context.Context, OAuth2PermissionGrantListResult) (OAuth2PermissionGrantListResult, error) @@ -2590,11 +2557,16 @@ func (page *OAuth2PermissionGrantListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.oa2pglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.oa2pglr) + if err != nil { + return err + } + page.oa2pglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.oa2pglr = next return nil } @@ -2907,8 +2879,8 @@ type PreAuthorizedApplication struct { Extensions *[]PreAuthorizedApplicationExtension `json:"extensions,omitempty"` } -// PreAuthorizedApplicationExtension representation of an app PreAuthorizedApplicationExtension required by -// a pre authorized client app. +// PreAuthorizedApplicationExtension representation of an app PreAuthorizedApplicationExtension required by a +// pre authorized client app. type PreAuthorizedApplicationExtension struct { // Conditions - The extension's conditions. Conditions *[]string `json:"conditions,omitempty"` @@ -2922,11 +2894,10 @@ type PreAuthorizedApplicationPermission struct { AccessGrants *[]string `json:"accessGrants,omitempty"` } -// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the -// specified resource that an application requires access to. The specified OAuth 2.0 permission scopes may -// be requested by client applications (through the requiredResourceAccess collection) when calling a -// resource application. The requiredResourceAccess property of the Application entity is a collection of -// RequiredResourceAccess. +// RequiredResourceAccess specifies the set of OAuth 2.0 permission scopes and app roles under the specified +// resource that an application requires access to. The specified OAuth 2.0 permission scopes may be requested +// by client applications (through the requiredResourceAccess collection) when calling a resource application. +// The requiredResourceAccess property of the Application entity is a collection of RequiredResourceAccess. type RequiredResourceAccess struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -3462,8 +3433,7 @@ func (sp *ServicePrincipal) UnmarshalJSON(body []byte) error { return nil } -// ServicePrincipalBase active Directory service principal common properties shared among GET, POST and -// PATCH +// ServicePrincipalBase active Directory service principal common properties shared among GET, POST and PATCH type ServicePrincipalBase struct { // AccountEnabled - whether or not the service principal account is enabled AccountEnabled *bool `json:"accountEnabled,omitempty"` @@ -3574,6 +3544,11 @@ func (splr ServicePrincipalListResult) IsEmpty() bool { return splr.Value == nil || len(*splr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (splr ServicePrincipalListResult) hasNextLink() bool { + return splr.OdataNextLink != nil && len(*splr.OdataNextLink) != 0 +} + // ServicePrincipalListResultPage contains a page of ServicePrincipal values. type ServicePrincipalListResultPage struct { fn func(context.Context, ServicePrincipalListResult) (ServicePrincipalListResult, error) @@ -3593,11 +3568,16 @@ func (page *ServicePrincipalListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.splr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.splr) + if err != nil { + return err + } + page.splr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.splr = next return nil } @@ -3656,8 +3636,8 @@ type ServicePrincipalUpdateParameters struct { Tags *[]string `json:"tags,omitempty"` } -// SignInName contains information about a sign-in name of a local account user in an Azure Active -// Directory B2C tenant. +// SignInName contains information about a sign-in name of a local account user in an Azure Active Directory +// B2C tenant. type SignInName struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -4439,6 +4419,11 @@ func (ulr UserListResult) IsEmpty() bool { return ulr.Value == nil || len(*ulr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ulr UserListResult) hasNextLink() bool { + return ulr.OdataNextLink != nil && len(*ulr.OdataNextLink) != 0 +} + // UserListResultPage contains a page of User values. type UserListResultPage struct { fn func(context.Context, UserListResult) (UserListResult, error) @@ -4458,11 +4443,16 @@ func (page *UserListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ulr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ulr) + if err != nil { + return err + } + page.ulr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ulr = next return nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2permissiongrant.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2permissiongrant.go index 89dea96bb57..963bb9a5a1f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2permissiongrant.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/oauth2permissiongrant.go @@ -113,7 +113,6 @@ func (client OAuth2PermissionGrantClient) CreateSender(req *http.Request) (*http func (client OAuth2PermissionGrantClient) CreateResponder(resp *http.Response) (result OAuth2PermissionGrant, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -187,7 +186,6 @@ func (client OAuth2PermissionGrantClient) DeleteSender(req *http.Request) (*http func (client OAuth2PermissionGrantClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -231,6 +229,9 @@ func (client OAuth2PermissionGrantClient) List(ctx context.Context, filter strin if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.OAuth2PermissionGrantClient", "List", resp, "Failure responding to request") } + if result.oa2pglr.hasNextLink() && result.oa2pglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -268,7 +269,6 @@ func (client OAuth2PermissionGrantClient) ListSender(req *http.Request) (*http.R func (client OAuth2PermissionGrantClient) ListResponder(resp *http.Response) (result OAuth2PermissionGrantListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -358,7 +358,6 @@ func (client OAuth2PermissionGrantClient) ListNextSender(req *http.Request) (*ht func (client OAuth2PermissionGrantClient) ListNextResponder(resp *http.Response) (result OAuth2PermissionGrantListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go index 2e5afd471f9..62b103255d8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/objects.go @@ -80,6 +80,9 @@ func (client ObjectsClient) GetObjectsByObjectIds(ctx context.Context, parameter if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ObjectsClient", "GetObjectsByObjectIds", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -116,7 +119,6 @@ func (client ObjectsClient) GetObjectsByObjectIdsSender(req *http.Request) (*htt func (client ObjectsClient) GetObjectsByObjectIdsResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,7 +208,6 @@ func (client ObjectsClient) GetObjectsByObjectIdsNextSender(req *http.Request) ( func (client ObjectsClient) GetObjectsByObjectIdsNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go index 24cd7315a77..3bfdfe9d53d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/serviceprincipals.go @@ -117,7 +117,6 @@ func (client ServicePrincipalsClient) CreateSender(req *http.Request) (*http.Res func (client ServicePrincipalsClient) CreateResponder(resp *http.Response) (result ServicePrincipal, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -191,7 +190,6 @@ func (client ServicePrincipalsClient) DeleteSender(req *http.Request) (*http.Res func (client ServicePrincipalsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client ServicePrincipalsClient) GetSender(req *http.Request) (*http.Respon func (client ServicePrincipalsClient) GetResponder(resp *http.Response) (result ServicePrincipal, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -309,6 +306,9 @@ func (client ServicePrincipalsClient) List(ctx context.Context, filter string) ( if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "List", resp, "Failure responding to request") } + if result.splr.hasNextLink() && result.splr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -346,7 +346,6 @@ func (client ServicePrincipalsClient) ListSender(req *http.Request) (*http.Respo func (client ServicePrincipalsClient) ListResponder(resp *http.Response) (result ServicePrincipalListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -436,7 +435,6 @@ func (client ServicePrincipalsClient) ListKeyCredentialsSender(req *http.Request func (client ServicePrincipalsClient) ListKeyCredentialsResponder(resp *http.Response) (result KeyCredentialListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -510,7 +508,6 @@ func (client ServicePrincipalsClient) ListNextSender(req *http.Request) (*http.R func (client ServicePrincipalsClient) ListNextResponder(resp *http.Response) (result ServicePrincipalListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -550,6 +547,9 @@ func (client ServicePrincipalsClient) ListOwners(ctx context.Context, objectID s if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.ServicePrincipalsClient", "ListOwners", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -585,7 +585,6 @@ func (client ServicePrincipalsClient) ListOwnersSender(req *http.Request) (*http func (client ServicePrincipalsClient) ListOwnersResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -696,7 +695,6 @@ func (client ServicePrincipalsClient) ListPasswordCredentialsSender(req *http.Re func (client ServicePrincipalsClient) ListPasswordCredentialsResponder(resp *http.Response) (result PasswordCredentialListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -773,7 +771,6 @@ func (client ServicePrincipalsClient) UpdateSender(req *http.Request) (*http.Res func (client ServicePrincipalsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -849,7 +846,6 @@ func (client ServicePrincipalsClient) UpdateKeyCredentialsSender(req *http.Reque func (client ServicePrincipalsClient) UpdateKeyCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -925,7 +921,6 @@ func (client ServicePrincipalsClient) UpdatePasswordCredentialsSender(req *http. func (client ServicePrincipalsClient) UpdatePasswordCredentialsResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go index 677692590f3..e6004b3e099 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/signedinuser.go @@ -105,7 +105,6 @@ func (client SignedInUserClient) GetSender(req *http.Request) (*http.Response, e func (client SignedInUserClient) GetResponder(resp *http.Response) (result User, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -148,6 +147,9 @@ func (client SignedInUserClient) ListOwnedObjects(ctx context.Context) (result D if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.SignedInUserClient", "ListOwnedObjects", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -182,7 +184,6 @@ func (client SignedInUserClient) ListOwnedObjectsSender(req *http.Request) (*htt func (client SignedInUserClient) ListOwnedObjectsResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -272,7 +273,6 @@ func (client SignedInUserClient) ListOwnedObjectsNextSender(req *http.Request) ( func (client SignedInUserClient) ListOwnedObjectsNextResponder(resp *http.Response) (result DirectoryObjectListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go index e9325843b47..480295e248a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac/users.go @@ -121,7 +121,6 @@ func (client UsersClient) CreateSender(req *http.Request) (*http.Response, error func (client UsersClient) CreateResponder(resp *http.Response) (result User, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -195,7 +194,6 @@ func (client UsersClient) DeleteSender(req *http.Request) (*http.Response, error func (client UsersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,7 +266,6 @@ func (client UsersClient) GetSender(req *http.Request) (*http.Response, error) { func (client UsersClient) GetResponder(resp *http.Response) (result User, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,7 +348,6 @@ func (client UsersClient) GetMemberGroupsSender(req *http.Request) (*http.Respon func (client UsersClient) GetMemberGroupsResponder(resp *http.Response) (result UserGetMemberGroupsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -397,6 +393,9 @@ func (client UsersClient) List(ctx context.Context, filter string, expand string if err != nil { err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", resp, "Failure responding to request") } + if result.ulr.hasNextLink() && result.ulr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -437,7 +436,6 @@ func (client UsersClient) ListSender(req *http.Request) (*http.Response, error) func (client UsersClient) ListResponder(resp *http.Response) (result UserListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -527,7 +525,6 @@ func (client UsersClient) ListNextSender(req *http.Request) (*http.Response, err func (client UsersClient) ListNextResponder(resp *http.Response) (result UserListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -604,7 +601,6 @@ func (client UsersClient) UpdateSender(req *http.Request) (*http.Response, error func (client UsersClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationgateways.go index 4116b29a0e8..5287713bd2a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationgateways.go @@ -115,7 +115,6 @@ func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) ( func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Response) (result ApplicationGatewayBackendHealth, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -224,7 +223,6 @@ func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -300,7 +298,6 @@ func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (future func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -375,7 +372,6 @@ func (client ApplicationGatewaysClient) GetSender(req *http.Request) (*http.Resp func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (result ApplicationGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -449,7 +445,6 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicySender(req *http.R func (client ApplicationGatewaysClient) GetSslPredefinedPolicyResponder(resp *http.Response) (result ApplicationGatewaySslPredefinedPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -489,6 +484,9 @@ func (client ApplicationGatewaysClient) List(ctx context.Context, resourceGroupN if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to request") } + if result.aglr.hasNextLink() && result.aglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -524,7 +522,6 @@ func (client ApplicationGatewaysClient) ListSender(req *http.Request) (*http.Res func (client ApplicationGatewaysClient) ListResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -599,6 +596,9 @@ func (client ApplicationGatewaysClient) ListAll(ctx context.Context) (result App if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to request") } + if result.aglr.hasNextLink() && result.aglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -633,7 +633,6 @@ func (client ApplicationGatewaysClient) ListAllSender(req *http.Request) (*http. func (client ApplicationGatewaysClient) ListAllResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -741,7 +740,6 @@ func (client ApplicationGatewaysClient) ListAvailableRequestHeadersSender(req *h func (client ApplicationGatewaysClient) ListAvailableRequestHeadersResponder(resp *http.Response) (result ListString, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -812,7 +810,6 @@ func (client ApplicationGatewaysClient) ListAvailableResponseHeadersSender(req * func (client ApplicationGatewaysClient) ListAvailableResponseHeadersResponder(resp *http.Response) (result ListString, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -883,7 +880,6 @@ func (client ApplicationGatewaysClient) ListAvailableServerVariablesSender(req * func (client ApplicationGatewaysClient) ListAvailableServerVariablesResponder(resp *http.Response) (result ListString, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -954,7 +950,6 @@ func (client ApplicationGatewaysClient) ListAvailableSslOptionsSender(req *http. func (client ApplicationGatewaysClient) ListAvailableSslOptionsResponder(resp *http.Response) (result ApplicationGatewayAvailableSslOptions, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -992,6 +987,9 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies(ctx c if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure responding to request") } + if result.agaspp.hasNextLink() && result.agaspp.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1026,7 +1024,6 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesSender func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesResponder(resp *http.Response) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1134,7 +1131,6 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsSender(req *http func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp *http.Response) (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1210,7 +1206,6 @@ func (client ApplicationGatewaysClient) StartSender(req *http.Request) (future A func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1285,7 +1280,6 @@ func (client ApplicationGatewaysClient) StopSender(req *http.Request) (future Ap func (client ApplicationGatewaysClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1363,7 +1357,6 @@ func (client ApplicationGatewaysClient) UpdateTagsSender(req *http.Request) (fut func (client ApplicationGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ApplicationGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationsecuritygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationsecuritygroups.go index 5e95c3fe353..43a54190e4b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationsecuritygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/applicationsecuritygroups.go @@ -114,7 +114,6 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Req func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -190,7 +189,6 @@ func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (f func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -265,7 +263,6 @@ func (client ApplicationSecurityGroupsClient) GetSender(req *http.Request) (*htt func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -305,6 +302,9 @@ func (client ApplicationSecurityGroupsClient) List(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure responding to request") } + if result.asglr.hasNextLink() && result.asglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -340,7 +340,6 @@ func (client ApplicationSecurityGroupsClient) ListSender(req *http.Request) (*ht func (client ApplicationSecurityGroupsClient) ListResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -415,6 +414,9 @@ func (client ApplicationSecurityGroupsClient) ListAll(ctx context.Context) (resu if err != nil { err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure responding to request") } + if result.asglr.hasNextLink() && result.asglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -449,7 +451,6 @@ func (client ApplicationSecurityGroupsClient) ListAllSender(req *http.Request) ( func (client ApplicationSecurityGroupsClient) ListAllResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -565,7 +566,6 @@ func (client ApplicationSecurityGroupsClient) UpdateTagsSender(req *http.Request func (client ApplicationSecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availabledelegations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availabledelegations.go index 7efa4f27e91..0bee568fc1b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availabledelegations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availabledelegations.go @@ -74,6 +74,9 @@ func (client AvailableDelegationsClient) List(ctx context.Context, location stri if err != nil { err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", resp, "Failure responding to request") } + if result.adr.hasNextLink() && result.adr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -109,7 +112,6 @@ func (client AvailableDelegationsClient) ListSender(req *http.Request) (*http.Re func (client AvailableDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableendpointservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableendpointservices.go index d0f563d33e9..e2e24393ad3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableendpointservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableendpointservices.go @@ -74,6 +74,9 @@ func (client AvailableEndpointServicesClient) List(ctx context.Context, location if err != nil { err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure responding to request") } + if result.eslr.hasNextLink() && result.eslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -109,7 +112,6 @@ func (client AvailableEndpointServicesClient) ListSender(req *http.Request) (*ht func (client AvailableEndpointServicesClient) ListResponder(resp *http.Response) (result EndpointServicesListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableresourcegroupdelegations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableresourcegroupdelegations.go index fa10b41a6a3..6b9147d7a7d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableresourcegroupdelegations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/availableresourcegroupdelegations.go @@ -76,6 +76,9 @@ func (client AvailableResourceGroupDelegationsClient) List(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", resp, "Failure responding to request") } + if result.adr.hasNextLink() && result.adr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -112,7 +115,6 @@ func (client AvailableResourceGroupDelegationsClient) ListSender(req *http.Reque func (client AvailableResourceGroupDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewallfqdntags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewallfqdntags.go index a33e0c7a065..2e314381b92 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewallfqdntags.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewallfqdntags.go @@ -72,6 +72,9 @@ func (client AzureFirewallFqdnTagsClient) ListAll(ctx context.Context) (result A if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", resp, "Failure responding to request") } + if result.afftlr.hasNextLink() && result.afftlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -106,7 +109,6 @@ func (client AzureFirewallFqdnTagsClient) ListAllSender(req *http.Request) (*htt func (client AzureFirewallFqdnTagsClient) ListAllResponder(resp *http.Response) (result AzureFirewallFqdnTagListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewalls.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewalls.go index a2a8a2261d1..46fcd736352 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewalls.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/azurefirewalls.go @@ -113,7 +113,6 @@ func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (futu func (client AzureFirewallsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureFirewall, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future Azure func (client AzureFirewallsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client AzureFirewallsClient) GetSender(req *http.Request) (*http.Response, func (client AzureFirewallsClient) GetResponder(resp *http.Response) (result AzureFirewall, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,6 +301,9 @@ func (client AzureFirewallsClient) List(ctx context.Context, resourceGroupName s if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure responding to request") } + if result.aflr.hasNextLink() && result.aflr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -339,7 +339,6 @@ func (client AzureFirewallsClient) ListSender(req *http.Request) (*http.Response func (client AzureFirewallsClient) ListResponder(resp *http.Response) (result AzureFirewallListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -414,6 +413,9 @@ func (client AzureFirewallsClient) ListAll(ctx context.Context) (result AzureFir if err != nil { err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure responding to request") } + if result.aflr.hasNextLink() && result.aflr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client AzureFirewallsClient) ListAllSender(req *http.Request) (*http.Respo func (client AzureFirewallsClient) ListAllResponder(resp *http.Response) (result AzureFirewallListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/bgpservicecommunities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/bgpservicecommunities.go index f2a3d3eabb5..61ce92bbe3d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/bgpservicecommunities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/bgpservicecommunities.go @@ -72,6 +72,9 @@ func (client BgpServiceCommunitiesClient) List(ctx context.Context) (result BgpS if err != nil { err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", resp, "Failure responding to request") } + if result.bsclr.hasNextLink() && result.bsclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -106,7 +109,6 @@ func (client BgpServiceCommunitiesClient) ListSender(req *http.Request) (*http.R func (client BgpServiceCommunitiesClient) ListResponder(resp *http.Response) (result BgpServiceCommunityListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/client.go index 50a8e1eadfd..4e39651d3c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/client.go @@ -124,7 +124,6 @@ func (client BaseClient) CheckDNSNameAvailabilitySender(req *http.Request) (*htt func (client BaseClient) CheckDNSNameAvailabilityResponder(resp *http.Response) (result DNSNameAvailabilityResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -200,7 +199,6 @@ func (client BaseClient) SupportedSecurityProvidersSender(req *http.Request) (*h func (client BaseClient) SupportedSecurityProvidersResponder(resp *http.Response) (result VirtualWanSecurityProviders, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/connectionmonitors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/connectionmonitors.go index c0d26b0f32f..5cac711bcf1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/connectionmonitors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/connectionmonitors.go @@ -126,7 +126,6 @@ func (client ConnectionMonitorsClient) CreateOrUpdateSender(req *http.Request) ( func (client ConnectionMonitorsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -204,7 +203,6 @@ func (client ConnectionMonitorsClient) DeleteSender(req *http.Request) (future C func (client ConnectionMonitorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -281,7 +279,6 @@ func (client ConnectionMonitorsClient) GetSender(req *http.Request) (*http.Respo func (client ConnectionMonitorsClient) GetResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -357,7 +354,6 @@ func (client ConnectionMonitorsClient) ListSender(req *http.Request) (*http.Resp func (client ConnectionMonitorsClient) ListResponder(resp *http.Response) (result ConnectionMonitorListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -435,7 +431,6 @@ func (client ConnectionMonitorsClient) QuerySender(req *http.Request) (future Co func (client ConnectionMonitorsClient) QueryResponder(resp *http.Response) (result ConnectionMonitorQueryResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -513,7 +508,6 @@ func (client ConnectionMonitorsClient) StartSender(req *http.Request) (future Co func (client ConnectionMonitorsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -590,7 +584,6 @@ func (client ConnectionMonitorsClient) StopSender(req *http.Request) (future Con func (client ConnectionMonitorsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddoscustompolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddoscustompolicies.go index b566ab5c16e..7575d8e1b9a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddoscustompolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddoscustompolicies.go @@ -114,7 +114,6 @@ func (client DdosCustomPoliciesClient) CreateOrUpdateSender(req *http.Request) ( func (client DdosCustomPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DdosCustomPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -190,7 +189,6 @@ func (client DdosCustomPoliciesClient) DeleteSender(req *http.Request) (future D func (client DdosCustomPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -265,7 +263,6 @@ func (client DdosCustomPoliciesClient) GetSender(req *http.Request) (*http.Respo func (client DdosCustomPoliciesClient) GetResponder(resp *http.Response) (result DdosCustomPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -344,7 +341,6 @@ func (client DdosCustomPoliciesClient) UpdateTagsSender(req *http.Request) (futu func (client DdosCustomPoliciesClient) UpdateTagsResponder(resp *http.Response) (result DdosCustomPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddosprotectionplans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddosprotectionplans.go index 52fdbe54883..e087993d958 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddosprotectionplans.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/ddosprotectionplans.go @@ -117,7 +117,6 @@ func (client DdosProtectionPlansClient) CreateOrUpdateSender(req *http.Request) func (client DdosProtectionPlansClient) CreateOrUpdateResponder(resp *http.Response) (result DdosProtectionPlan, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -193,7 +192,6 @@ func (client DdosProtectionPlansClient) DeleteSender(req *http.Request) (future func (client DdosProtectionPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,7 +266,6 @@ func (client DdosProtectionPlansClient) GetSender(req *http.Request) (*http.Resp func (client DdosProtectionPlansClient) GetResponder(resp *http.Response) (result DdosProtectionPlan, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +303,9 @@ func (client DdosProtectionPlansClient) List(ctx context.Context) (result DdosPr if err != nil { err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure responding to request") } + if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -340,7 +340,6 @@ func (client DdosProtectionPlansClient) ListSender(req *http.Request) (*http.Res func (client DdosProtectionPlansClient) ListResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client DdosProtectionPlansClient) ListByResourceGroup(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client DdosProtectionPlansClient) ListByResourceGroupSender(req *http.Requ func (client DdosProtectionPlansClient) ListByResourceGroupResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,7 +569,6 @@ func (client DdosProtectionPlansClient) UpdateTagsSender(req *http.Request) (fut func (client DdosProtectionPlansClient) UpdateTagsResponder(resp *http.Response) (result DdosProtectionPlan, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/defaultsecurityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/defaultsecurityrules.go index f50873ae6eb..a286a126c93 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/defaultsecurityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/defaultsecurityrules.go @@ -112,7 +112,6 @@ func (client DefaultSecurityRulesClient) GetSender(req *http.Request) (*http.Res func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure responding to request") } + if result.srlr.hasNextLink() && result.srlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client DefaultSecurityRulesClient) ListSender(req *http.Request) (*http.Re func (client DefaultSecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/enums.go new file mode 100644 index 00000000000..879adc554fb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/enums.go @@ -0,0 +1,1970 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Access enumerates the values for access. +type Access string + +const ( + // Allow ... + Allow Access = "Allow" + // Deny ... + Deny Access = "Deny" +) + +// PossibleAccessValues returns an array of possible values for the Access const type. +func PossibleAccessValues() []Access { + return []Access{Allow, Deny} +} + +// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health +// server health. +type ApplicationGatewayBackendHealthServerHealth string + +const ( + // Down ... + Down ApplicationGatewayBackendHealthServerHealth = "Down" + // Draining ... + Draining ApplicationGatewayBackendHealthServerHealth = "Draining" + // Partial ... + Partial ApplicationGatewayBackendHealthServerHealth = "Partial" + // Unknown ... + Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + // Up ... + Up ApplicationGatewayBackendHealthServerHealth = "Up" +) + +// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. +func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { + return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} +} + +// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. +type ApplicationGatewayCookieBasedAffinity string + +const ( + // Disabled ... + Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" + // Enabled ... + Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" +) + +// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. +func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { + return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} +} + +// ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status +// code. +type ApplicationGatewayCustomErrorStatusCode string + +const ( + // HTTPStatus403 ... + HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" + // HTTPStatus502 ... + HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" +) + +// PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. +func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { + return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} +} + +// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. +type ApplicationGatewayFirewallMode string + +const ( + // Detection ... + Detection ApplicationGatewayFirewallMode = "Detection" + // Prevention ... + Prevention ApplicationGatewayFirewallMode = "Prevention" +) + +// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. +func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { + return []ApplicationGatewayFirewallMode{Detection, Prevention} +} + +// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. +type ApplicationGatewayOperationalState string + +const ( + // Running ... + Running ApplicationGatewayOperationalState = "Running" + // Starting ... + Starting ApplicationGatewayOperationalState = "Starting" + // Stopped ... + Stopped ApplicationGatewayOperationalState = "Stopped" + // Stopping ... + Stopping ApplicationGatewayOperationalState = "Stopping" +) + +// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. +func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { + return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} +} + +// ApplicationGatewayProtocol enumerates the values for application gateway protocol. +type ApplicationGatewayProtocol string + +const ( + // HTTP ... + HTTP ApplicationGatewayProtocol = "Http" + // HTTPS ... + HTTPS ApplicationGatewayProtocol = "Https" +) + +// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. +func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { + return []ApplicationGatewayProtocol{HTTP, HTTPS} +} + +// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. +type ApplicationGatewayRedirectType string + +const ( + // Found ... + Found ApplicationGatewayRedirectType = "Found" + // Permanent ... + Permanent ApplicationGatewayRedirectType = "Permanent" + // SeeOther ... + SeeOther ApplicationGatewayRedirectType = "SeeOther" + // Temporary ... + Temporary ApplicationGatewayRedirectType = "Temporary" +) + +// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. +func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { + return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} +} + +// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule +// type. +type ApplicationGatewayRequestRoutingRuleType string + +const ( + // Basic ... + Basic ApplicationGatewayRequestRoutingRuleType = "Basic" + // PathBasedRouting ... + PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" +) + +// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. +func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { + return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} +} + +// ApplicationGatewaySkuName enumerates the values for application gateway sku name. +type ApplicationGatewaySkuName string + +const ( + // StandardLarge ... + StandardLarge ApplicationGatewaySkuName = "Standard_Large" + // StandardMedium ... + StandardMedium ApplicationGatewaySkuName = "Standard_Medium" + // StandardSmall ... + StandardSmall ApplicationGatewaySkuName = "Standard_Small" + // StandardV2 ... + StandardV2 ApplicationGatewaySkuName = "Standard_v2" + // WAFLarge ... + WAFLarge ApplicationGatewaySkuName = "WAF_Large" + // WAFMedium ... + WAFMedium ApplicationGatewaySkuName = "WAF_Medium" + // WAFV2 ... + WAFV2 ApplicationGatewaySkuName = "WAF_v2" +) + +// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. +func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { + return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} +} + +// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. +type ApplicationGatewaySslCipherSuite string + +const ( + // TLSDHEDSSWITH3DESEDECBCSHA ... + TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA ... + TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA256 ... + TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + // TLSDHEDSSWITHAES256CBCSHA ... + TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + // TLSDHEDSSWITHAES256CBCSHA256 ... + TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + // TLSDHERSAWITHAES128CBCSHA ... + TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + // TLSDHERSAWITHAES128GCMSHA256 ... + TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSDHERSAWITHAES256CBCSHA ... + TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + // TLSDHERSAWITHAES256GCMSHA384 ... + TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSECDHEECDSAWITHAES128CBCSHA ... + TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // TLSECDHEECDSAWITHAES128CBCSHA256 ... + TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + // TLSECDHEECDSAWITHAES128GCMSHA256 ... + TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + // TLSECDHEECDSAWITHAES256CBCSHA ... + TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // TLSECDHEECDSAWITHAES256CBCSHA384 ... + TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + // TLSECDHEECDSAWITHAES256GCMSHA384 ... + TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + // TLSECDHERSAWITHAES128CBCSHA ... + TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + // TLSECDHERSAWITHAES128CBCSHA256 ... + TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + // TLSECDHERSAWITHAES128GCMSHA256 ... + TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSECDHERSAWITHAES256CBCSHA ... + TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + // TLSECDHERSAWITHAES256CBCSHA384 ... + TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + // TLSECDHERSAWITHAES256GCMSHA384 ... + TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSRSAWITH3DESEDECBCSHA ... + TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + // TLSRSAWITHAES128CBCSHA ... + TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + // TLSRSAWITHAES128CBCSHA256 ... + TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + // TLSRSAWITHAES128GCMSHA256 ... + TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + // TLSRSAWITHAES256CBCSHA ... + TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + // TLSRSAWITHAES256CBCSHA256 ... + TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + // TLSRSAWITHAES256GCMSHA384 ... + TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" +) + +// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. +func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { + return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} +} + +// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. +type ApplicationGatewaySslPolicyName string + +const ( + // AppGwSslPolicy20150501 ... + AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + // AppGwSslPolicy20170401 ... + AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + // AppGwSslPolicy20170401S ... + AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" +) + +// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. +func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { + return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} +} + +// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. +type ApplicationGatewaySslPolicyType string + +const ( + // Custom ... + Custom ApplicationGatewaySslPolicyType = "Custom" + // Predefined ... + Predefined ApplicationGatewaySslPolicyType = "Predefined" +) + +// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. +func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { + return []ApplicationGatewaySslPolicyType{Custom, Predefined} +} + +// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. +type ApplicationGatewaySslProtocol string + +const ( + // TLSv10 ... + TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" + // TLSv11 ... + TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" + // TLSv12 ... + TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" +) + +// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. +func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { + return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} +} + +// ApplicationGatewayTier enumerates the values for application gateway tier. +type ApplicationGatewayTier string + +const ( + // ApplicationGatewayTierStandard ... + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + // ApplicationGatewayTierStandardV2 ... + ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" + // ApplicationGatewayTierWAF ... + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + // ApplicationGatewayTierWAFV2 ... + ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" +) + +// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. +func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { + return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} +} + +// AssociationType enumerates the values for association type. +type AssociationType string + +const ( + // Associated ... + Associated AssociationType = "Associated" + // Contains ... + Contains AssociationType = "Contains" +) + +// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. +func PossibleAssociationTypeValues() []AssociationType { + return []AssociationType{Associated, Contains} +} + +// AuthenticationMethod enumerates the values for authentication method. +type AuthenticationMethod string + +const ( + // EAPMSCHAPv2 ... + EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" + // EAPTLS ... + EAPTLS AuthenticationMethod = "EAPTLS" +) + +// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. +func PossibleAuthenticationMethodValues() []AuthenticationMethod { + return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} +} + +// AuthorizationUseStatus enumerates the values for authorization use status. +type AuthorizationUseStatus string + +const ( + // Available ... + Available AuthorizationUseStatus = "Available" + // InUse ... + InUse AuthorizationUseStatus = "InUse" +) + +// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. +func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { + return []AuthorizationUseStatus{Available, InUse} +} + +// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol +// type. +type AzureFirewallApplicationRuleProtocolType string + +const ( + // AzureFirewallApplicationRuleProtocolTypeHTTP ... + AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + // AzureFirewallApplicationRuleProtocolTypeHTTPS ... + AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" +) + +// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. +func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { + return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS} +} + +// AzureFirewallNatRCActionType enumerates the values for azure firewall nat rc action type. +type AzureFirewallNatRCActionType string + +const ( + // Dnat ... + Dnat AzureFirewallNatRCActionType = "Dnat" + // Snat ... + Snat AzureFirewallNatRCActionType = "Snat" +) + +// PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. +func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { + return []AzureFirewallNatRCActionType{Dnat, Snat} +} + +// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. +type AzureFirewallNetworkRuleProtocol string + +const ( + // Any ... + Any AzureFirewallNetworkRuleProtocol = "Any" + // ICMP ... + ICMP AzureFirewallNetworkRuleProtocol = "ICMP" + // TCP ... + TCP AzureFirewallNetworkRuleProtocol = "TCP" + // UDP ... + UDP AzureFirewallNetworkRuleProtocol = "UDP" +) + +// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. +func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { + return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} +} + +// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. +type AzureFirewallRCActionType string + +const ( + // AzureFirewallRCActionTypeAlert ... + AzureFirewallRCActionTypeAlert AzureFirewallRCActionType = "Alert" + // AzureFirewallRCActionTypeAllow ... + AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" + // AzureFirewallRCActionTypeDeny ... + AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" +) + +// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. +func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { + return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAlert, AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} +} + +// AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. +type AzureFirewallThreatIntelMode string + +const ( + // AzureFirewallThreatIntelModeAlert ... + AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" + // AzureFirewallThreatIntelModeDeny ... + AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" + // AzureFirewallThreatIntelModeOff ... + AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" +) + +// PossibleAzureFirewallThreatIntelModeValues returns an array of possible values for the AzureFirewallThreatIntelMode const type. +func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { + return []AzureFirewallThreatIntelMode{AzureFirewallThreatIntelModeAlert, AzureFirewallThreatIntelModeDeny, AzureFirewallThreatIntelModeOff} +} + +// BgpPeerState enumerates the values for bgp peer state. +type BgpPeerState string + +const ( + // BgpPeerStateConnected ... + BgpPeerStateConnected BgpPeerState = "Connected" + // BgpPeerStateConnecting ... + BgpPeerStateConnecting BgpPeerState = "Connecting" + // BgpPeerStateIdle ... + BgpPeerStateIdle BgpPeerState = "Idle" + // BgpPeerStateStopped ... + BgpPeerStateStopped BgpPeerState = "Stopped" + // BgpPeerStateUnknown ... + BgpPeerStateUnknown BgpPeerState = "Unknown" +) + +// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. +func PossibleBgpPeerStateValues() []BgpPeerState { + return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} +} + +// CircuitConnectionStatus enumerates the values for circuit connection status. +type CircuitConnectionStatus string + +const ( + // Connected ... + Connected CircuitConnectionStatus = "Connected" + // Connecting ... + Connecting CircuitConnectionStatus = "Connecting" + // Disconnected ... + Disconnected CircuitConnectionStatus = "Disconnected" +) + +// PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. +func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { + return []CircuitConnectionStatus{Connected, Connecting, Disconnected} +} + +// ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. +type ConnectionMonitorSourceStatus string + +const ( + // ConnectionMonitorSourceStatusActive ... + ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" + // ConnectionMonitorSourceStatusInactive ... + ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" + // ConnectionMonitorSourceStatusUnknown ... + ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" +) + +// PossibleConnectionMonitorSourceStatusValues returns an array of possible values for the ConnectionMonitorSourceStatus const type. +func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { + return []ConnectionMonitorSourceStatus{ConnectionMonitorSourceStatusActive, ConnectionMonitorSourceStatusInactive, ConnectionMonitorSourceStatusUnknown} +} + +// ConnectionState enumerates the values for connection state. +type ConnectionState string + +const ( + // ConnectionStateReachable ... + ConnectionStateReachable ConnectionState = "Reachable" + // ConnectionStateUnknown ... + ConnectionStateUnknown ConnectionState = "Unknown" + // ConnectionStateUnreachable ... + ConnectionStateUnreachable ConnectionState = "Unreachable" +) + +// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. +func PossibleConnectionStateValues() []ConnectionState { + return []ConnectionState{ConnectionStateReachable, ConnectionStateUnknown, ConnectionStateUnreachable} +} + +// ConnectionStatus enumerates the values for connection status. +type ConnectionStatus string + +const ( + // ConnectionStatusConnected ... + ConnectionStatusConnected ConnectionStatus = "Connected" + // ConnectionStatusDegraded ... + ConnectionStatusDegraded ConnectionStatus = "Degraded" + // ConnectionStatusDisconnected ... + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + // ConnectionStatusUnknown ... + ConnectionStatusUnknown ConnectionStatus = "Unknown" +) + +// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} +} + +// DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. +type DdosCustomPolicyProtocol string + +const ( + // DdosCustomPolicyProtocolSyn ... + DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" + // DdosCustomPolicyProtocolTCP ... + DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" + // DdosCustomPolicyProtocolUDP ... + DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" +) + +// PossibleDdosCustomPolicyProtocolValues returns an array of possible values for the DdosCustomPolicyProtocol const type. +func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { + return []DdosCustomPolicyProtocol{DdosCustomPolicyProtocolSyn, DdosCustomPolicyProtocolTCP, DdosCustomPolicyProtocolUDP} +} + +// DdosCustomPolicyTriggerSensitivityOverride enumerates the values for ddos custom policy trigger sensitivity +// override. +type DdosCustomPolicyTriggerSensitivityOverride string + +const ( + // Default ... + Default DdosCustomPolicyTriggerSensitivityOverride = "Default" + // High ... + High DdosCustomPolicyTriggerSensitivityOverride = "High" + // Low ... + Low DdosCustomPolicyTriggerSensitivityOverride = "Low" + // Relaxed ... + Relaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" +) + +// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns an array of possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. +func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { + return []DdosCustomPolicyTriggerSensitivityOverride{Default, High, Low, Relaxed} +} + +// DhGroup enumerates the values for dh group. +type DhGroup string + +const ( + // DHGroup1 ... + DHGroup1 DhGroup = "DHGroup1" + // DHGroup14 ... + DHGroup14 DhGroup = "DHGroup14" + // DHGroup2 ... + DHGroup2 DhGroup = "DHGroup2" + // DHGroup2048 ... + DHGroup2048 DhGroup = "DHGroup2048" + // DHGroup24 ... + DHGroup24 DhGroup = "DHGroup24" + // ECP256 ... + ECP256 DhGroup = "ECP256" + // ECP384 ... + ECP384 DhGroup = "ECP384" + // None ... + None DhGroup = "None" +) + +// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. +func PossibleDhGroupValues() []DhGroup { + return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} +} + +// Direction enumerates the values for direction. +type Direction string + +const ( + // Inbound ... + Inbound Direction = "Inbound" + // Outbound ... + Outbound Direction = "Outbound" +) + +// PossibleDirectionValues returns an array of possible values for the Direction const type. +func PossibleDirectionValues() []Direction { + return []Direction{Inbound, Outbound} +} + +// EffectiveRouteSource enumerates the values for effective route source. +type EffectiveRouteSource string + +const ( + // EffectiveRouteSourceDefault ... + EffectiveRouteSourceDefault EffectiveRouteSource = "Default" + // EffectiveRouteSourceUnknown ... + EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" + // EffectiveRouteSourceUser ... + EffectiveRouteSourceUser EffectiveRouteSource = "User" + // EffectiveRouteSourceVirtualNetworkGateway ... + EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" +) + +// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. +func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { + return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} +} + +// EffectiveRouteState enumerates the values for effective route state. +type EffectiveRouteState string + +const ( + // Active ... + Active EffectiveRouteState = "Active" + // Invalid ... + Invalid EffectiveRouteState = "Invalid" +) + +// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. +func PossibleEffectiveRouteStateValues() []EffectiveRouteState { + return []EffectiveRouteState{Active, Invalid} +} + +// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. +type EffectiveSecurityRuleProtocol string + +const ( + // EffectiveSecurityRuleProtocolAll ... + EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" + // EffectiveSecurityRuleProtocolTCP ... + EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" + // EffectiveSecurityRuleProtocolUDP ... + EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" +) + +// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. +func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { + return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} +} + +// EvaluationState enumerates the values for evaluation state. +type EvaluationState string + +const ( + // Completed ... + Completed EvaluationState = "Completed" + // InProgress ... + InProgress EvaluationState = "InProgress" + // NotStarted ... + NotStarted EvaluationState = "NotStarted" +) + +// PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. +func PossibleEvaluationStateValues() []EvaluationState { + return []EvaluationState{Completed, InProgress, NotStarted} +} + +// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit +// peering advertised public prefix state. +type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string + +const ( + // Configured ... + Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + // Configuring ... + Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + // NotConfigured ... + NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + // ValidationNeeded ... + ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" +) + +// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. +func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { + return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} +} + +// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. +type ExpressRouteCircuitPeeringState string + +const ( + // ExpressRouteCircuitPeeringStateDisabled ... + ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" + // ExpressRouteCircuitPeeringStateEnabled ... + ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" +) + +// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. +func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { + return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} +} + +// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. +type ExpressRouteCircuitSkuFamily string + +const ( + // MeteredData ... + MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" + // UnlimitedData ... + UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" +) + +// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. +func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { + return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} +} + +// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. +type ExpressRouteCircuitSkuTier string + +const ( + // ExpressRouteCircuitSkuTierBasic ... + ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" + // ExpressRouteCircuitSkuTierLocal ... + ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" + // ExpressRouteCircuitSkuTierPremium ... + ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" + // ExpressRouteCircuitSkuTierStandard ... + ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" +) + +// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. +func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { + return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierBasic, ExpressRouteCircuitSkuTierLocal, ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} +} + +// ExpressRouteLinkAdminState enumerates the values for express route link admin state. +type ExpressRouteLinkAdminState string + +const ( + // ExpressRouteLinkAdminStateDisabled ... + ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" + // ExpressRouteLinkAdminStateEnabled ... + ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" +) + +// PossibleExpressRouteLinkAdminStateValues returns an array of possible values for the ExpressRouteLinkAdminState const type. +func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { + return []ExpressRouteLinkAdminState{ExpressRouteLinkAdminStateDisabled, ExpressRouteLinkAdminStateEnabled} +} + +// ExpressRouteLinkConnectorType enumerates the values for express route link connector type. +type ExpressRouteLinkConnectorType string + +const ( + // LC ... + LC ExpressRouteLinkConnectorType = "LC" + // SC ... + SC ExpressRouteLinkConnectorType = "SC" +) + +// PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. +func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { + return []ExpressRouteLinkConnectorType{LC, SC} +} + +// ExpressRoutePeeringState enumerates the values for express route peering state. +type ExpressRoutePeeringState string + +const ( + // ExpressRoutePeeringStateDisabled ... + ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" + // ExpressRoutePeeringStateEnabled ... + ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" +) + +// PossibleExpressRoutePeeringStateValues returns an array of possible values for the ExpressRoutePeeringState const type. +func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { + return []ExpressRoutePeeringState{ExpressRoutePeeringStateDisabled, ExpressRoutePeeringStateEnabled} +} + +// ExpressRoutePeeringType enumerates the values for express route peering type. +type ExpressRoutePeeringType string + +const ( + // AzurePrivatePeering ... + AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + // AzurePublicPeering ... + AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + // MicrosoftPeering ... + MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" +) + +// PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. +func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { + return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} +} + +// ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. +type ExpressRoutePortsEncapsulation string + +const ( + // Dot1Q ... + Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" + // QinQ ... + QinQ ExpressRoutePortsEncapsulation = "QinQ" +) + +// PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. +func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { + return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} +} + +// FlowLogFormatType enumerates the values for flow log format type. +type FlowLogFormatType string + +const ( + // JSON ... + JSON FlowLogFormatType = "JSON" +) + +// PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. +func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { + return []FlowLogFormatType{JSON} +} + +// HTTPMethod enumerates the values for http method. +type HTTPMethod string + +const ( + // Get ... + Get HTTPMethod = "Get" +) + +// PossibleHTTPMethodValues returns an array of possible values for the HTTPMethod const type. +func PossibleHTTPMethodValues() []HTTPMethod { + return []HTTPMethod{Get} +} + +// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. +type HubVirtualNetworkConnectionStatus string + +const ( + // HubVirtualNetworkConnectionStatusConnected ... + HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" + // HubVirtualNetworkConnectionStatusConnecting ... + HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" + // HubVirtualNetworkConnectionStatusNotConnected ... + HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" + // HubVirtualNetworkConnectionStatusUnknown ... + HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" +) + +// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. +func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { + return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} +} + +// IkeEncryption enumerates the values for ike encryption. +type IkeEncryption string + +const ( + // AES128 ... + AES128 IkeEncryption = "AES128" + // AES192 ... + AES192 IkeEncryption = "AES192" + // AES256 ... + AES256 IkeEncryption = "AES256" + // DES ... + DES IkeEncryption = "DES" + // DES3 ... + DES3 IkeEncryption = "DES3" + // GCMAES128 ... + GCMAES128 IkeEncryption = "GCMAES128" + // GCMAES256 ... + GCMAES256 IkeEncryption = "GCMAES256" +) + +// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. +func PossibleIkeEncryptionValues() []IkeEncryption { + return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} +} + +// IkeIntegrity enumerates the values for ike integrity. +type IkeIntegrity string + +const ( + // IkeIntegrityGCMAES128 ... + IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" + // IkeIntegrityGCMAES256 ... + IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" + // IkeIntegrityMD5 ... + IkeIntegrityMD5 IkeIntegrity = "MD5" + // IkeIntegritySHA1 ... + IkeIntegritySHA1 IkeIntegrity = "SHA1" + // IkeIntegritySHA256 ... + IkeIntegritySHA256 IkeIntegrity = "SHA256" + // IkeIntegritySHA384 ... + IkeIntegritySHA384 IkeIntegrity = "SHA384" +) + +// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. +func PossibleIkeIntegrityValues() []IkeIntegrity { + return []IkeIntegrity{IkeIntegrityGCMAES128, IkeIntegrityGCMAES256, IkeIntegrityMD5, IkeIntegritySHA1, IkeIntegritySHA256, IkeIntegritySHA384} +} + +// IPAllocationMethod enumerates the values for ip allocation method. +type IPAllocationMethod string + +const ( + // Dynamic ... + Dynamic IPAllocationMethod = "Dynamic" + // Static ... + Static IPAllocationMethod = "Static" +) + +// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. +func PossibleIPAllocationMethodValues() []IPAllocationMethod { + return []IPAllocationMethod{Dynamic, Static} +} + +// IPFlowProtocol enumerates the values for ip flow protocol. +type IPFlowProtocol string + +const ( + // IPFlowProtocolTCP ... + IPFlowProtocolTCP IPFlowProtocol = "TCP" + // IPFlowProtocolUDP ... + IPFlowProtocolUDP IPFlowProtocol = "UDP" +) + +// PossibleIPFlowProtocolValues returns an array of possible values for the IPFlowProtocol const type. +func PossibleIPFlowProtocolValues() []IPFlowProtocol { + return []IPFlowProtocol{IPFlowProtocolTCP, IPFlowProtocolUDP} +} + +// IpsecEncryption enumerates the values for ipsec encryption. +type IpsecEncryption string + +const ( + // IpsecEncryptionAES128 ... + IpsecEncryptionAES128 IpsecEncryption = "AES128" + // IpsecEncryptionAES192 ... + IpsecEncryptionAES192 IpsecEncryption = "AES192" + // IpsecEncryptionAES256 ... + IpsecEncryptionAES256 IpsecEncryption = "AES256" + // IpsecEncryptionDES ... + IpsecEncryptionDES IpsecEncryption = "DES" + // IpsecEncryptionDES3 ... + IpsecEncryptionDES3 IpsecEncryption = "DES3" + // IpsecEncryptionGCMAES128 ... + IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" + // IpsecEncryptionGCMAES192 ... + IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" + // IpsecEncryptionGCMAES256 ... + IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" + // IpsecEncryptionNone ... + IpsecEncryptionNone IpsecEncryption = "None" +) + +// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. +func PossibleIpsecEncryptionValues() []IpsecEncryption { + return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} +} + +// IpsecIntegrity enumerates the values for ipsec integrity. +type IpsecIntegrity string + +const ( + // IpsecIntegrityGCMAES128 ... + IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" + // IpsecIntegrityGCMAES192 ... + IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" + // IpsecIntegrityGCMAES256 ... + IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" + // IpsecIntegrityMD5 ... + IpsecIntegrityMD5 IpsecIntegrity = "MD5" + // IpsecIntegritySHA1 ... + IpsecIntegritySHA1 IpsecIntegrity = "SHA1" + // IpsecIntegritySHA256 ... + IpsecIntegritySHA256 IpsecIntegrity = "SHA256" +) + +// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. +func PossibleIpsecIntegrityValues() []IpsecIntegrity { + return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} +} + +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPv4 ... + IPv4 IPVersion = "IPv4" + // IPv6 ... + IPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPv4, IPv6} +} + +// IssueType enumerates the values for issue type. +type IssueType string + +const ( + // IssueTypeAgentStopped ... + IssueTypeAgentStopped IssueType = "AgentStopped" + // IssueTypeDNSResolution ... + IssueTypeDNSResolution IssueType = "DnsResolution" + // IssueTypeGuestFirewall ... + IssueTypeGuestFirewall IssueType = "GuestFirewall" + // IssueTypeNetworkSecurityRule ... + IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" + // IssueTypePlatform ... + IssueTypePlatform IssueType = "Platform" + // IssueTypePortThrottled ... + IssueTypePortThrottled IssueType = "PortThrottled" + // IssueTypeSocketBind ... + IssueTypeSocketBind IssueType = "SocketBind" + // IssueTypeUnknown ... + IssueTypeUnknown IssueType = "Unknown" + // IssueTypeUserDefinedRoute ... + IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" +) + +// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} +} + +// LoadBalancerSkuName enumerates the values for load balancer sku name. +type LoadBalancerSkuName string + +const ( + // LoadBalancerSkuNameBasic ... + LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" + // LoadBalancerSkuNameStandard ... + LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" +) + +// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. +func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { + return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameStandard} +} + +// LoadDistribution enumerates the values for load distribution. +type LoadDistribution string + +const ( + // LoadDistributionDefault ... + LoadDistributionDefault LoadDistribution = "Default" + // LoadDistributionSourceIP ... + LoadDistributionSourceIP LoadDistribution = "SourceIP" + // LoadDistributionSourceIPProtocol ... + LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" +) + +// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. +func PossibleLoadDistributionValues() []LoadDistribution { + return []LoadDistribution{LoadDistributionDefault, LoadDistributionSourceIP, LoadDistributionSourceIPProtocol} +} + +// NextHopType enumerates the values for next hop type. +type NextHopType string + +const ( + // NextHopTypeHyperNetGateway ... + NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" + // NextHopTypeInternet ... + NextHopTypeInternet NextHopType = "Internet" + // NextHopTypeNone ... + NextHopTypeNone NextHopType = "None" + // NextHopTypeVirtualAppliance ... + NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" + // NextHopTypeVirtualNetworkGateway ... + NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" + // NextHopTypeVnetLocal ... + NextHopTypeVnetLocal NextHopType = "VnetLocal" +) + +// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. +func PossibleNextHopTypeValues() []NextHopType { + return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} +} + +// OfficeTrafficCategory enumerates the values for office traffic category. +type OfficeTrafficCategory string + +const ( + // OfficeTrafficCategoryAll ... + OfficeTrafficCategoryAll OfficeTrafficCategory = "All" + // OfficeTrafficCategoryNone ... + OfficeTrafficCategoryNone OfficeTrafficCategory = "None" + // OfficeTrafficCategoryOptimize ... + OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" + // OfficeTrafficCategoryOptimizeAndAllow ... + OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" +) + +// PossibleOfficeTrafficCategoryValues returns an array of possible values for the OfficeTrafficCategory const type. +func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { + return []OfficeTrafficCategory{OfficeTrafficCategoryAll, OfficeTrafficCategoryNone, OfficeTrafficCategoryOptimize, OfficeTrafficCategoryOptimizeAndAllow} +} + +// OperationStatus enumerates the values for operation status. +type OperationStatus string + +const ( + // OperationStatusFailed ... + OperationStatusFailed OperationStatus = "Failed" + // OperationStatusInProgress ... + OperationStatusInProgress OperationStatus = "InProgress" + // OperationStatusSucceeded ... + OperationStatusSucceeded OperationStatus = "Succeeded" +) + +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginInbound ... + OriginInbound Origin = "Inbound" + // OriginLocal ... + OriginLocal Origin = "Local" + // OriginOutbound ... + OriginOutbound Origin = "Outbound" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginInbound, OriginLocal, OriginOutbound} +} + +// PcError enumerates the values for pc error. +type PcError string + +const ( + // AgentStopped ... + AgentStopped PcError = "AgentStopped" + // CaptureFailed ... + CaptureFailed PcError = "CaptureFailed" + // InternalError ... + InternalError PcError = "InternalError" + // LocalFileFailed ... + LocalFileFailed PcError = "LocalFileFailed" + // StorageFailed ... + StorageFailed PcError = "StorageFailed" +) + +// PossiblePcErrorValues returns an array of possible values for the PcError const type. +func PossiblePcErrorValues() []PcError { + return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} +} + +// PcProtocol enumerates the values for pc protocol. +type PcProtocol string + +const ( + // PcProtocolAny ... + PcProtocolAny PcProtocol = "Any" + // PcProtocolTCP ... + PcProtocolTCP PcProtocol = "TCP" + // PcProtocolUDP ... + PcProtocolUDP PcProtocol = "UDP" +) + +// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. +func PossiblePcProtocolValues() []PcProtocol { + return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} +} + +// PcStatus enumerates the values for pc status. +type PcStatus string + +const ( + // PcStatusError ... + PcStatusError PcStatus = "Error" + // PcStatusNotStarted ... + PcStatusNotStarted PcStatus = "NotStarted" + // PcStatusRunning ... + PcStatusRunning PcStatus = "Running" + // PcStatusStopped ... + PcStatusStopped PcStatus = "Stopped" + // PcStatusUnknown ... + PcStatusUnknown PcStatus = "Unknown" +) + +// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. +func PossiblePcStatusValues() []PcStatus { + return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} +} + +// PfsGroup enumerates the values for pfs group. +type PfsGroup string + +const ( + // PfsGroupECP256 ... + PfsGroupECP256 PfsGroup = "ECP256" + // PfsGroupECP384 ... + PfsGroupECP384 PfsGroup = "ECP384" + // PfsGroupNone ... + PfsGroupNone PfsGroup = "None" + // PfsGroupPFS1 ... + PfsGroupPFS1 PfsGroup = "PFS1" + // PfsGroupPFS14 ... + PfsGroupPFS14 PfsGroup = "PFS14" + // PfsGroupPFS2 ... + PfsGroupPFS2 PfsGroup = "PFS2" + // PfsGroupPFS2048 ... + PfsGroupPFS2048 PfsGroup = "PFS2048" + // PfsGroupPFS24 ... + PfsGroupPFS24 PfsGroup = "PFS24" + // PfsGroupPFSMM ... + PfsGroupPFSMM PfsGroup = "PFSMM" +) + +// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. +func PossiblePfsGroupValues() []PfsGroup { + return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS14, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24, PfsGroupPFSMM} +} + +// ProbeProtocol enumerates the values for probe protocol. +type ProbeProtocol string + +const ( + // ProbeProtocolHTTP ... + ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS ... + ProbeProtocolHTTPS ProbeProtocol = "Https" + // ProbeProtocolTCP ... + ProbeProtocolTCP ProbeProtocol = "Tcp" +) + +// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. +func PossibleProbeProtocolValues() []ProbeProtocol { + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} +} + +// ProcessorArchitecture enumerates the values for processor architecture. +type ProcessorArchitecture string + +const ( + // Amd64 ... + Amd64 ProcessorArchitecture = "Amd64" + // X86 ... + X86 ProcessorArchitecture = "X86" +) + +// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. +func PossibleProcessorArchitectureValues() []ProcessorArchitecture { + return []ProcessorArchitecture{Amd64, X86} +} + +// ProtectionCoverage enumerates the values for protection coverage. +type ProtectionCoverage string + +const ( + // ProtectionCoverageBasic ... + ProtectionCoverageBasic ProtectionCoverage = "Basic" + // ProtectionCoverageStandard ... + ProtectionCoverageStandard ProtectionCoverage = "Standard" +) + +// PossibleProtectionCoverageValues returns an array of possible values for the ProtectionCoverage const type. +func PossibleProtectionCoverageValues() []ProtectionCoverage { + return []ProtectionCoverage{ProtectionCoverageBasic, ProtectionCoverageStandard} +} + +// Protocol enumerates the values for protocol. +type Protocol string + +const ( + // ProtocolHTTP ... + ProtocolHTTP Protocol = "Http" + // ProtocolHTTPS ... + ProtocolHTTPS Protocol = "Https" + // ProtocolIcmp ... + ProtocolIcmp Protocol = "Icmp" + // ProtocolTCP ... + ProtocolTCP Protocol = "Tcp" +) + +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolIcmp, ProtocolTCP} +} + +// Protocol1 enumerates the values for protocol 1. +type Protocol1 string + +const ( + // Protocol1All ... + Protocol1All Protocol1 = "All" + // Protocol1TCP ... + Protocol1TCP Protocol1 = "Tcp" + // Protocol1UDP ... + Protocol1UDP Protocol1 = "Udp" +) + +// PossibleProtocol1Values returns an array of possible values for the Protocol1 const type. +func PossibleProtocol1Values() []Protocol1 { + return []Protocol1{Protocol1All, Protocol1TCP, Protocol1UDP} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Deleting, Failed, Succeeded, Updating} +} + +// PublicIPAddressSkuName enumerates the values for public ip address sku name. +type PublicIPAddressSkuName string + +const ( + // PublicIPAddressSkuNameBasic ... + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + // PublicIPAddressSkuNameStandard ... + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. +func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { + return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} +} + +// PublicIPPrefixSkuName enumerates the values for public ip prefix sku name. +type PublicIPPrefixSkuName string + +const ( + // Standard ... + Standard PublicIPPrefixSkuName = "Standard" +) + +// PossiblePublicIPPrefixSkuNameValues returns an array of possible values for the PublicIPPrefixSkuName const type. +func PossiblePublicIPPrefixSkuNameValues() []PublicIPPrefixSkuName { + return []PublicIPPrefixSkuName{Standard} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RouteNextHopType enumerates the values for route next hop type. +type RouteNextHopType string + +const ( + // RouteNextHopTypeInternet ... + RouteNextHopTypeInternet RouteNextHopType = "Internet" + // RouteNextHopTypeNone ... + RouteNextHopTypeNone RouteNextHopType = "None" + // RouteNextHopTypeVirtualAppliance ... + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + // RouteNextHopTypeVirtualNetworkGateway ... + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + // RouteNextHopTypeVnetLocal ... + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. +func PossibleRouteNextHopTypeValues() []RouteNextHopType { + return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} +} + +// SecurityRuleAccess enumerates the values for security rule access. +type SecurityRuleAccess string + +const ( + // SecurityRuleAccessAllow ... + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + // SecurityRuleAccessDeny ... + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. +func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { + return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} +} + +// SecurityRuleDirection enumerates the values for security rule direction. +type SecurityRuleDirection string + +const ( + // SecurityRuleDirectionInbound ... + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + // SecurityRuleDirectionOutbound ... + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. +func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { + return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} +} + +// SecurityRuleProtocol enumerates the values for security rule protocol. +type SecurityRuleProtocol string + +const ( + // SecurityRuleProtocolAsterisk ... + SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" + // SecurityRuleProtocolTCP ... + SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" + // SecurityRuleProtocolUDP ... + SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" +) + +// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. +func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { + return []SecurityRuleProtocol{SecurityRuleProtocolAsterisk, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} +} + +// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. +type ServiceProviderProvisioningState string + +const ( + // Deprovisioning ... + Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" + // NotProvisioned ... + NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" + // Provisioned ... + Provisioned ServiceProviderProvisioningState = "Provisioned" + // Provisioning ... + Provisioning ServiceProviderProvisioningState = "Provisioning" +) + +// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. +func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { + return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} +} + +// Severity enumerates the values for severity. +type Severity string + +const ( + // SeverityError ... + SeverityError Severity = "Error" + // SeverityWarning ... + SeverityWarning Severity = "Warning" +) + +// PossibleSeverityValues returns an array of possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{SeverityError, SeverityWarning} +} + +// TransportProtocol enumerates the values for transport protocol. +type TransportProtocol string + +const ( + // TransportProtocolAll ... + TransportProtocolAll TransportProtocol = "All" + // TransportProtocolTCP ... + TransportProtocolTCP TransportProtocol = "Tcp" + // TransportProtocolUDP ... + TransportProtocolUDP TransportProtocol = "Udp" +) + +// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. +func PossibleTransportProtocolValues() []TransportProtocol { + return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} +} + +// TunnelConnectionStatus enumerates the values for tunnel connection status. +type TunnelConnectionStatus string + +const ( + // TunnelConnectionStatusConnected ... + TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" + // TunnelConnectionStatusConnecting ... + TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" + // TunnelConnectionStatusNotConnected ... + TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" + // TunnelConnectionStatusUnknown ... + TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" +) + +// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. +func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { + return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} +} + +// VerbosityLevel enumerates the values for verbosity level. +type VerbosityLevel string + +const ( + // Full ... + Full VerbosityLevel = "Full" + // Minimum ... + Minimum VerbosityLevel = "Minimum" + // Normal ... + Normal VerbosityLevel = "Normal" +) + +// PossibleVerbosityLevelValues returns an array of possible values for the VerbosityLevel const type. +func PossibleVerbosityLevelValues() []VerbosityLevel { + return []VerbosityLevel{Full, Minimum, Normal} +} + +// VirtualNetworkGatewayConnectionProtocol enumerates the values for virtual network gateway connection +// protocol. +type VirtualNetworkGatewayConnectionProtocol string + +const ( + // IKEv1 ... + IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" + // IKEv2 ... + IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" +) + +// PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. +func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { + return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} +} + +// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. +type VirtualNetworkGatewayConnectionStatus string + +const ( + // VirtualNetworkGatewayConnectionStatusConnected ... + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + // VirtualNetworkGatewayConnectionStatusConnecting ... + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + // VirtualNetworkGatewayConnectionStatusNotConnected ... + VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" + // VirtualNetworkGatewayConnectionStatusUnknown ... + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" +) + +// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. +func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { + return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} +} + +// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. +type VirtualNetworkGatewayConnectionType string + +const ( + // ExpressRoute ... + ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + // IPsec ... + IPsec VirtualNetworkGatewayConnectionType = "IPsec" + // Vnet2Vnet ... + Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" + // VPNClient ... + VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" +) + +// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. +func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { + return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} +} + +// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. +type VirtualNetworkGatewaySkuName string + +const ( + // VirtualNetworkGatewaySkuNameBasic ... + VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" + // VirtualNetworkGatewaySkuNameErGw1AZ ... + VirtualNetworkGatewaySkuNameErGw1AZ VirtualNetworkGatewaySkuName = "ErGw1AZ" + // VirtualNetworkGatewaySkuNameErGw2AZ ... + VirtualNetworkGatewaySkuNameErGw2AZ VirtualNetworkGatewaySkuName = "ErGw2AZ" + // VirtualNetworkGatewaySkuNameErGw3AZ ... + VirtualNetworkGatewaySkuNameErGw3AZ VirtualNetworkGatewaySkuName = "ErGw3AZ" + // VirtualNetworkGatewaySkuNameHighPerformance ... + VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" + // VirtualNetworkGatewaySkuNameStandard ... + VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" + // VirtualNetworkGatewaySkuNameUltraPerformance ... + VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" + // VirtualNetworkGatewaySkuNameVpnGw1 ... + VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" + // VirtualNetworkGatewaySkuNameVpnGw1AZ ... + VirtualNetworkGatewaySkuNameVpnGw1AZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" + // VirtualNetworkGatewaySkuNameVpnGw2 ... + VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" + // VirtualNetworkGatewaySkuNameVpnGw2AZ ... + VirtualNetworkGatewaySkuNameVpnGw2AZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" + // VirtualNetworkGatewaySkuNameVpnGw3 ... + VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" + // VirtualNetworkGatewaySkuNameVpnGw3AZ ... + VirtualNetworkGatewaySkuNameVpnGw3AZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" +) + +// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. +func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { + return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameErGw1AZ, VirtualNetworkGatewaySkuNameErGw2AZ, VirtualNetworkGatewaySkuNameErGw3AZ, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw1AZ, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw2AZ, VirtualNetworkGatewaySkuNameVpnGw3, VirtualNetworkGatewaySkuNameVpnGw3AZ} +} + +// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. +type VirtualNetworkGatewaySkuTier string + +const ( + // VirtualNetworkGatewaySkuTierBasic ... + VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" + // VirtualNetworkGatewaySkuTierErGw1AZ ... + VirtualNetworkGatewaySkuTierErGw1AZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" + // VirtualNetworkGatewaySkuTierErGw2AZ ... + VirtualNetworkGatewaySkuTierErGw2AZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" + // VirtualNetworkGatewaySkuTierErGw3AZ ... + VirtualNetworkGatewaySkuTierErGw3AZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" + // VirtualNetworkGatewaySkuTierHighPerformance ... + VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" + // VirtualNetworkGatewaySkuTierStandard ... + VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" + // VirtualNetworkGatewaySkuTierUltraPerformance ... + VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" + // VirtualNetworkGatewaySkuTierVpnGw1 ... + VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" + // VirtualNetworkGatewaySkuTierVpnGw1AZ ... + VirtualNetworkGatewaySkuTierVpnGw1AZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" + // VirtualNetworkGatewaySkuTierVpnGw2 ... + VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" + // VirtualNetworkGatewaySkuTierVpnGw2AZ ... + VirtualNetworkGatewaySkuTierVpnGw2AZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" + // VirtualNetworkGatewaySkuTierVpnGw3 ... + VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" + // VirtualNetworkGatewaySkuTierVpnGw3AZ ... + VirtualNetworkGatewaySkuTierVpnGw3AZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" +) + +// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. +func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { + return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierErGw1AZ, VirtualNetworkGatewaySkuTierErGw2AZ, VirtualNetworkGatewaySkuTierErGw3AZ, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw1AZ, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw2AZ, VirtualNetworkGatewaySkuTierVpnGw3, VirtualNetworkGatewaySkuTierVpnGw3AZ} +} + +// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. +type VirtualNetworkGatewayType string + +const ( + // VirtualNetworkGatewayTypeExpressRoute ... + VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" + // VirtualNetworkGatewayTypeVpn ... + VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" +) + +// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. +func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { + return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} +} + +// VirtualNetworkPeeringState enumerates the values for virtual network peering state. +type VirtualNetworkPeeringState string + +const ( + // VirtualNetworkPeeringStateConnected ... + VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" + // VirtualNetworkPeeringStateDisconnected ... + VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" + // VirtualNetworkPeeringStateInitiated ... + VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" +) + +// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. +func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { + return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} +} + +// VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. +type VirtualWanSecurityProviderType string + +const ( + // External ... + External VirtualWanSecurityProviderType = "External" + // Native ... + Native VirtualWanSecurityProviderType = "Native" +) + +// PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. +func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { + return []VirtualWanSecurityProviderType{External, Native} +} + +// VpnClientProtocol enumerates the values for vpn client protocol. +type VpnClientProtocol string + +const ( + // IkeV2 ... + IkeV2 VpnClientProtocol = "IkeV2" + // OpenVPN ... + OpenVPN VpnClientProtocol = "OpenVPN" + // SSTP ... + SSTP VpnClientProtocol = "SSTP" +) + +// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. +func PossibleVpnClientProtocolValues() []VpnClientProtocol { + return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} +} + +// VpnConnectionStatus enumerates the values for vpn connection status. +type VpnConnectionStatus string + +const ( + // VpnConnectionStatusConnected ... + VpnConnectionStatusConnected VpnConnectionStatus = "Connected" + // VpnConnectionStatusConnecting ... + VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" + // VpnConnectionStatusNotConnected ... + VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" + // VpnConnectionStatusUnknown ... + VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" +) + +// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. +func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { + return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} +} + +// VpnGatewayTunnelingProtocol enumerates the values for vpn gateway tunneling protocol. +type VpnGatewayTunnelingProtocol string + +const ( + // VpnGatewayTunnelingProtocolIkeV2 ... + VpnGatewayTunnelingProtocolIkeV2 VpnGatewayTunnelingProtocol = "IkeV2" + // VpnGatewayTunnelingProtocolOpenVPN ... + VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" +) + +// PossibleVpnGatewayTunnelingProtocolValues returns an array of possible values for the VpnGatewayTunnelingProtocol const type. +func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { + return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} +} + +// VpnType enumerates the values for vpn type. +type VpnType string + +const ( + // PolicyBased ... + PolicyBased VpnType = "PolicyBased" + // RouteBased ... + RouteBased VpnType = "RouteBased" +) + +// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. +func PossibleVpnTypeValues() []VpnType { + return []VpnType{PolicyBased, RouteBased} +} + +// WebApplicationFirewallAction enumerates the values for web application firewall action. +type WebApplicationFirewallAction string + +const ( + // WebApplicationFirewallActionAllow ... + WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" + // WebApplicationFirewallActionBlock ... + WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" + // WebApplicationFirewallActionLog ... + WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" +) + +// PossibleWebApplicationFirewallActionValues returns an array of possible values for the WebApplicationFirewallAction const type. +func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { + return []WebApplicationFirewallAction{WebApplicationFirewallActionAllow, WebApplicationFirewallActionBlock, WebApplicationFirewallActionLog} +} + +// WebApplicationFirewallEnabledState enumerates the values for web application firewall enabled state. +type WebApplicationFirewallEnabledState string + +const ( + // WebApplicationFirewallEnabledStateDisabled ... + WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" + // WebApplicationFirewallEnabledStateEnabled ... + WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" +) + +// PossibleWebApplicationFirewallEnabledStateValues returns an array of possible values for the WebApplicationFirewallEnabledState const type. +func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { + return []WebApplicationFirewallEnabledState{WebApplicationFirewallEnabledStateDisabled, WebApplicationFirewallEnabledStateEnabled} +} + +// WebApplicationFirewallMatchVariable enumerates the values for web application firewall match variable. +type WebApplicationFirewallMatchVariable string + +const ( + // PostArgs ... + PostArgs WebApplicationFirewallMatchVariable = "PostArgs" + // QueryString ... + QueryString WebApplicationFirewallMatchVariable = "QueryString" + // RemoteAddr ... + RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + // RequestBody ... + RequestBody WebApplicationFirewallMatchVariable = "RequestBody" + // RequestCookies ... + RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + // RequestHeaders ... + RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" + // RequestMethod ... + RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + // RequestURI ... + RequestURI WebApplicationFirewallMatchVariable = "RequestUri" +) + +// PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. +func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { + return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} +} + +// WebApplicationFirewallMode enumerates the values for web application firewall mode. +type WebApplicationFirewallMode string + +const ( + // WebApplicationFirewallModeDetection ... + WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" + // WebApplicationFirewallModePrevention ... + WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" +) + +// PossibleWebApplicationFirewallModeValues returns an array of possible values for the WebApplicationFirewallMode const type. +func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { + return []WebApplicationFirewallMode{WebApplicationFirewallModeDetection, WebApplicationFirewallModePrevention} +} + +// WebApplicationFirewallOperator enumerates the values for web application firewall operator. +type WebApplicationFirewallOperator string + +const ( + // WebApplicationFirewallOperatorBeginsWith ... + WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" + // WebApplicationFirewallOperatorContains ... + WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" + // WebApplicationFirewallOperatorEndsWith ... + WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" + // WebApplicationFirewallOperatorEqual ... + WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" + // WebApplicationFirewallOperatorGreaterThan ... + WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" + // WebApplicationFirewallOperatorGreaterThanOrEqual ... + WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" + // WebApplicationFirewallOperatorIPMatch ... + WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" + // WebApplicationFirewallOperatorLessThan ... + WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" + // WebApplicationFirewallOperatorLessThanOrEqual ... + WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" + // WebApplicationFirewallOperatorRegex ... + WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" +) + +// PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. +func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { + return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} +} + +// WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource +// state. +type WebApplicationFirewallPolicyResourceState string + +const ( + // WebApplicationFirewallPolicyResourceStateCreating ... + WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" + // WebApplicationFirewallPolicyResourceStateDeleting ... + WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" + // WebApplicationFirewallPolicyResourceStateDisabled ... + WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" + // WebApplicationFirewallPolicyResourceStateDisabling ... + WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" + // WebApplicationFirewallPolicyResourceStateEnabled ... + WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" + // WebApplicationFirewallPolicyResourceStateEnabling ... + WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" +) + +// PossibleWebApplicationFirewallPolicyResourceStateValues returns an array of possible values for the WebApplicationFirewallPolicyResourceState const type. +func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { + return []WebApplicationFirewallPolicyResourceState{WebApplicationFirewallPolicyResourceStateCreating, WebApplicationFirewallPolicyResourceStateDeleting, WebApplicationFirewallPolicyResourceStateDisabled, WebApplicationFirewallPolicyResourceStateDisabling, WebApplicationFirewallPolicyResourceStateEnabled, WebApplicationFirewallPolicyResourceStateEnabling} +} + +// WebApplicationFirewallRuleType enumerates the values for web application firewall rule type. +type WebApplicationFirewallRuleType string + +const ( + // WebApplicationFirewallRuleTypeInvalid ... + WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" + // WebApplicationFirewallRuleTypeMatchRule ... + WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" +) + +// PossibleWebApplicationFirewallRuleTypeValues returns an array of possible values for the WebApplicationFirewallRuleType const type. +func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { + return []WebApplicationFirewallRuleType{WebApplicationFirewallRuleTypeInvalid, WebApplicationFirewallRuleTypeMatchRule} +} + +// WebApplicationFirewallTransform enumerates the values for web application firewall transform. +type WebApplicationFirewallTransform string + +const ( + // HTMLEntityDecode ... + HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" + // Lowercase ... + Lowercase WebApplicationFirewallTransform = "Lowercase" + // RemoveNulls ... + RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + // Trim ... + Trim WebApplicationFirewallTransform = "Trim" + // URLDecode ... + URLDecode WebApplicationFirewallTransform = "UrlDecode" + // URLEncode ... + URLEncode WebApplicationFirewallTransform = "UrlEncode" +) + +// PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. +func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { + return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, URLDecode, URLEncode} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitauthorizations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitauthorizations.go index c936f5c0a34..d52d0e69757 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitauthorizations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitauthorizations.go @@ -118,7 +118,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req * func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,7 +195,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Req func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -273,7 +271,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetSender(req *http.Reques func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,6 +311,9 @@ func (client ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -350,7 +350,6 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListSender(req *http.Reque func (client ExpressRouteCircuitAuthorizationsClient) ListResponder(resp *http.Response) (result AuthorizationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitconnections.go index 6c987acfcaa..40b7e10cadc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitconnections.go @@ -119,7 +119,6 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateSender(req *htt func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,7 +198,6 @@ func (client ExpressRouteCircuitConnectionsClient) DeleteSender(req *http.Reques func (client ExpressRouteCircuitConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -278,7 +276,6 @@ func (client ExpressRouteCircuitConnectionsClient) GetSender(req *http.Request) func (client ExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -320,6 +317,9 @@ func (client ExpressRouteCircuitConnectionsClient) List(ctx context.Context, res if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") } + if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -357,7 +357,6 @@ func (client ExpressRouteCircuitConnectionsClient) ListSender(req *http.Request) func (client ExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitpeerings.go index 672e2838bf7..27a5ca9c4f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuitpeerings.go @@ -128,7 +128,6 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.R func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,7 +205,6 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -283,7 +281,6 @@ func (client ExpressRouteCircuitPeeringsClient) GetSender(req *http.Request) (*h func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +321,9 @@ func (client ExpressRouteCircuitPeeringsClient) List(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to request") } + if result.ercplr.hasNextLink() && result.ercplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -360,7 +360,6 @@ func (client ExpressRouteCircuitPeeringsClient) ListSender(req *http.Request) (* func (client ExpressRouteCircuitPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitPeeringListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuits.go index c27e0bd2468..4ccaa2c9c6e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuits.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecircuits.go @@ -114,7 +114,6 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -190,7 +189,6 @@ func (client ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (future func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -265,7 +263,6 @@ func (client ExpressRouteCircuitsClient) GetSender(req *http.Request) (*http.Res func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -343,7 +340,6 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsSender(req *http.Request func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -419,7 +415,6 @@ func (client ExpressRouteCircuitsClient) GetStatsSender(req *http.Request) (*htt func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -459,6 +454,9 @@ func (client ExpressRouteCircuitsClient) List(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to request") } + if result.erclr.hasNextLink() && result.erclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -494,7 +492,6 @@ func (client ExpressRouteCircuitsClient) ListSender(req *http.Request) (*http.Re func (client ExpressRouteCircuitsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -569,6 +566,9 @@ func (client ExpressRouteCircuitsClient) ListAll(ctx context.Context) (result Ex if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to request") } + if result.erclr.hasNextLink() && result.erclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -603,7 +603,6 @@ func (client ExpressRouteCircuitsClient) ListAllSender(req *http.Request) (*http func (client ExpressRouteCircuitsClient) ListAllResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -720,7 +719,6 @@ func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) ( func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -801,7 +799,6 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -882,7 +879,6 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http. func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -961,7 +957,6 @@ func (client ExpressRouteCircuitsClient) UpdateTagsSender(req *http.Request) (fu func (client ExpressRouteCircuitsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteconnections.go index 6644ab62cb5..c8f1361b477 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteconnections.go @@ -124,7 +124,6 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdateSender(req *http.Reque func (client ExpressRouteConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,7 +201,6 @@ func (client ExpressRouteConnectionsClient) DeleteSender(req *http.Request) (fut func (client ExpressRouteConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -279,7 +277,6 @@ func (client ExpressRouteConnectionsClient) GetSender(req *http.Request) (*http. func (client ExpressRouteConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -355,7 +352,6 @@ func (client ExpressRouteConnectionsClient) ListSender(req *http.Request) (*http func (client ExpressRouteConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteConnectionList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnectionpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnectionpeerings.go index 16cdecc0eaf..433571e6666 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnectionpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnectionpeerings.go @@ -130,7 +130,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateSender(req func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -208,7 +207,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) DeleteSender(req *http.R func (client ExpressRouteCrossConnectionPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,7 +283,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) GetSender(req *http.Requ func (client ExpressRouteCrossConnectionPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -326,6 +323,9 @@ func (client ExpressRouteCrossConnectionPeeringsClient) List(ctx context.Context if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", resp, "Failure responding to request") } + if result.erccpl.hasNextLink() && result.erccpl.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -362,7 +362,6 @@ func (client ExpressRouteCrossConnectionPeeringsClient) ListSender(req *http.Req func (client ExpressRouteCrossConnectionPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeeringList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnections.go index ecee9e3ae83..c6a28140863 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutecrossconnections.go @@ -114,7 +114,6 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateSender(req *http. func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -190,7 +189,6 @@ func (client ExpressRouteCrossConnectionsClient) GetSender(req *http.Request) (* func (client ExpressRouteCrossConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -228,6 +226,9 @@ func (client ExpressRouteCrossConnectionsClient) List(ctx context.Context) (resu if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", resp, "Failure responding to request") } + if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -262,7 +263,6 @@ func (client ExpressRouteCrossConnectionsClient) ListSender(req *http.Request) ( func (client ExpressRouteCrossConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -380,7 +380,6 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTableSender(req *http.Re func (client ExpressRouteCrossConnectionsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -420,6 +419,9 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroup(ctx context if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -455,7 +457,6 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupSender(req * func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -573,7 +574,6 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSender(req *http func (client ExpressRouteCrossConnectionsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -654,7 +654,6 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummarySender(re func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -733,7 +732,6 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTagsSender(req *http.Requ func (client ExpressRouteCrossConnectionsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutegateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutegateways.go index efe21904b5b..a9f06365f0f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutegateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutegateways.go @@ -122,7 +122,6 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdateSender(req *http.Request) func (client ExpressRouteGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,7 +198,6 @@ func (client ExpressRouteGatewaysClient) DeleteSender(req *http.Request) (future func (client ExpressRouteGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -274,7 +272,6 @@ func (client ExpressRouteGatewaysClient) GetSender(req *http.Request) (*http.Res func (client ExpressRouteGatewaysClient) GetResponder(resp *http.Response) (result ExpressRouteGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -348,7 +345,6 @@ func (client ExpressRouteGatewaysClient) ListByResourceGroupSender(req *http.Req func (client ExpressRouteGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -419,7 +415,6 @@ func (client ExpressRouteGatewaysClient) ListBySubscriptionSender(req *http.Requ func (client ExpressRouteGatewaysClient) ListBySubscriptionResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutelinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutelinks.go index 3e5125b8843..03f4ea3492b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutelinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressroutelinks.go @@ -112,7 +112,6 @@ func (client ExpressRouteLinksClient) GetSender(req *http.Request) (*http.Respon func (client ExpressRouteLinksClient) GetResponder(resp *http.Response) (result ExpressRouteLink, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client ExpressRouteLinksClient) List(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", resp, "Failure responding to request") } + if result.erllr.hasNextLink() && result.erllr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client ExpressRouteLinksClient) ListSender(req *http.Request) (*http.Respo func (client ExpressRouteLinksClient) ListResponder(resp *http.Response) (result ExpressRouteLinkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteports.go index 05a53f32d32..b1b0c396615 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteports.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteports.go @@ -114,7 +114,6 @@ func (client ExpressRoutePortsClient) CreateOrUpdateSender(req *http.Request) (f func (client ExpressRoutePortsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRoutePort, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -190,7 +189,6 @@ func (client ExpressRoutePortsClient) DeleteSender(req *http.Request) (future Ex func (client ExpressRoutePortsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -265,7 +263,6 @@ func (client ExpressRoutePortsClient) GetSender(req *http.Request) (*http.Respon func (client ExpressRoutePortsClient) GetResponder(resp *http.Response) (result ExpressRoutePort, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -303,6 +300,9 @@ func (client ExpressRoutePortsClient) List(ctx context.Context) (result ExpressR if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", resp, "Failure responding to request") } + if result.erplr.hasNextLink() && result.erplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -337,7 +337,6 @@ func (client ExpressRoutePortsClient) ListSender(req *http.Request) (*http.Respo func (client ExpressRoutePortsClient) ListResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -414,6 +413,9 @@ func (client ExpressRoutePortsClient) ListByResourceGroup(ctx context.Context, r if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.erplr.hasNextLink() && result.erplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -449,7 +451,6 @@ func (client ExpressRoutePortsClient) ListByResourceGroupSender(req *http.Reques func (client ExpressRoutePortsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -565,7 +566,6 @@ func (client ExpressRoutePortsClient) UpdateTagsSender(req *http.Request) (futur func (client ExpressRoutePortsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRoutePort, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteportslocations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteportslocations.go index f018c09d9e7..4e7d07d85fb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteportslocations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteportslocations.go @@ -109,7 +109,6 @@ func (client ExpressRoutePortsLocationsClient) GetSender(req *http.Request) (*ht func (client ExpressRoutePortsLocationsClient) GetResponder(resp *http.Response) (result ExpressRoutePortsLocation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -148,6 +147,9 @@ func (client ExpressRoutePortsLocationsClient) List(ctx context.Context) (result if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", resp, "Failure responding to request") } + if result.erpllr.hasNextLink() && result.erpllr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -182,7 +184,6 @@ func (client ExpressRoutePortsLocationsClient) ListSender(req *http.Request) (*h func (client ExpressRoutePortsLocationsClient) ListResponder(resp *http.Response) (result ExpressRoutePortsLocationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteserviceproviders.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteserviceproviders.go index 75d0460dfe5..699e89ea5a2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteserviceproviders.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/expressrouteserviceproviders.go @@ -72,6 +72,9 @@ func (client ExpressRouteServiceProvidersClient) List(ctx context.Context) (resu if err != nil { err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to request") } + if result.ersplr.hasNextLink() && result.ersplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -106,7 +109,6 @@ func (client ExpressRouteServiceProvidersClient) ListSender(req *http.Request) ( func (client ExpressRouteServiceProvidersClient) ListResponder(resp *http.Response) (result ExpressRouteServiceProviderListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/hubvirtualnetworkconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/hubvirtualnetworkconnections.go index d05c6adbda0..57e30951f83 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/hubvirtualnetworkconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/hubvirtualnetworkconnections.go @@ -112,7 +112,6 @@ func (client HubVirtualNetworkConnectionsClient) GetSender(req *http.Request) (* func (client HubVirtualNetworkConnectionsClient) GetResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client HubVirtualNetworkConnectionsClient) List(ctx context.Context, resou if err != nil { err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure responding to request") } + if result.lhvncr.hasNextLink() && result.lhvncr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client HubVirtualNetworkConnectionsClient) ListSender(req *http.Request) ( func (client HubVirtualNetworkConnectionsClient) ListResponder(resp *http.Response) (result ListHubVirtualNetworkConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/inboundnatrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/inboundnatrules.go index 748cd06d4f1..41658151013 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/inboundnatrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/inboundnatrules.go @@ -134,7 +134,6 @@ func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (fut func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result InboundNatRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -212,7 +211,6 @@ func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future Inbo func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -293,7 +291,6 @@ func (client InboundNatRulesClient) GetSender(req *http.Request) (*http.Response func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result InboundNatRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -334,6 +331,9 @@ func (client InboundNatRulesClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure responding to request") } + if result.inrlr.hasNextLink() && result.inrlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -370,7 +370,6 @@ func (client InboundNatRulesClient) ListSender(req *http.Request) (*http.Respons func (client InboundNatRulesClient) ListResponder(resp *http.Response) (result InboundNatRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceendpoints.go index 15f79072738..76a813b0e12 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceendpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceendpoints.go @@ -113,7 +113,6 @@ func (client InterfaceEndpointsClient) CreateOrUpdateSender(req *http.Request) ( func (client InterfaceEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result InterfaceEndpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client InterfaceEndpointsClient) DeleteSender(req *http.Request) (future I func (client InterfaceEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,7 +266,6 @@ func (client InterfaceEndpointsClient) GetSender(req *http.Request) (*http.Respo func (client InterfaceEndpointsClient) GetResponder(resp *http.Response) (result InterfaceEndpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -308,6 +305,9 @@ func (client InterfaceEndpointsClient) List(ctx context.Context, resourceGroupNa if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceEndpointsClient", "List", resp, "Failure responding to request") } + if result.ielr.hasNextLink() && result.ielr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -343,7 +343,6 @@ func (client InterfaceEndpointsClient) ListSender(req *http.Request) (*http.Resp func (client InterfaceEndpointsClient) ListResponder(resp *http.Response) (result InterfaceEndpointListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -418,6 +417,9 @@ func (client InterfaceEndpointsClient) ListBySubscription(ctx context.Context) ( if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceEndpointsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.ielr.hasNextLink() && result.ielr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client InterfaceEndpointsClient) ListBySubscriptionSender(req *http.Reques func (client InterfaceEndpointsClient) ListBySubscriptionResponder(resp *http.Response) (result InterfaceEndpointListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceipconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceipconfigurations.go index 88993825fe7..e6810e847f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceipconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceipconfigurations.go @@ -112,7 +112,6 @@ func (client InterfaceIPConfigurationsClient) GetSender(req *http.Request) (*htt func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client InterfaceIPConfigurationsClient) List(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure responding to request") } + if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client InterfaceIPConfigurationsClient) ListSender(req *http.Request) (*ht func (client InterfaceIPConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceloadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceloadbalancers.go index 7b1c447edf4..01b3ce6883a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceloadbalancers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfaceloadbalancers.go @@ -75,6 +75,9 @@ func (client InterfaceLoadBalancersClient) List(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure responding to request") } + if result.ilblr.hasNextLink() && result.ilblr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -111,7 +114,6 @@ func (client InterfaceLoadBalancersClient) ListSender(req *http.Request) (*http. func (client InterfaceLoadBalancersClient) ListResponder(resp *http.Response) (result InterfaceLoadBalancerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacesgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacesgroup.go index 423c576c883..a5111482267 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacesgroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacesgroup.go @@ -112,7 +112,6 @@ func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (future I func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client InterfacesClient) DeleteSender(req *http.Request) (future Interface func (client InterfacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client InterfacesClient) GetSender(req *http.Request) (*http.Response, err func (client InterfacesClient) GetResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -343,7 +340,6 @@ func (client InterfacesClient) GetEffectiveRouteTableSender(req *http.Request) ( func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Response) (result EffectiveRouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -430,7 +426,6 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationSender(re func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -514,7 +509,6 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceSender(r func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -554,6 +548,9 @@ func (client InterfacesClient) List(ctx context.Context, resourceGroupName strin if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -589,7 +586,6 @@ func (client InterfacesClient) ListSender(req *http.Request) (*http.Response, er func (client InterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -664,6 +660,9 @@ func (client InterfacesClient) ListAll(ctx context.Context) (result InterfaceLis if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -698,7 +697,6 @@ func (client InterfacesClient) ListAllSender(req *http.Request) (*http.Response, func (client InterfacesClient) ListAllResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -811,7 +809,6 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsSender(req *htt func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp *http.Response) (result EffectiveNetworkSecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -856,6 +853,9 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx co if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", resp, "Failure responding to request") } + if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -897,7 +897,6 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsSender( func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -975,6 +974,9 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx c if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1011,7 +1013,6 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesSender func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1091,6 +1092,9 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx if err != nil { err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1128,7 +1132,6 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesSend func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1244,7 +1247,6 @@ func (client InterfacesClient) UpdateTagsSender(req *http.Request) (future Inter func (client InterfacesClient) UpdateTagsResponder(resp *http.Response) (result Interface, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacetapconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacetapconfigurations.go index f7d8864b1b5..04362f47a4f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacetapconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/interfacetapconfigurations.go @@ -152,7 +152,6 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdateSender(req *http.Re func (client InterfaceTapConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -230,7 +229,6 @@ func (client InterfaceTapConfigurationsClient) DeleteSender(req *http.Request) ( func (client InterfaceTapConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -307,7 +305,6 @@ func (client InterfaceTapConfigurationsClient) GetSender(req *http.Request) (*ht func (client InterfaceTapConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -348,6 +345,9 @@ func (client InterfaceTapConfigurationsClient) List(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", resp, "Failure responding to request") } + if result.itclr.hasNextLink() && result.itclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -384,7 +384,6 @@ func (client InterfaceTapConfigurationsClient) ListSender(req *http.Request) (*h func (client InterfaceTapConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceTapConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerbackendaddresspools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerbackendaddresspools.go index 68c6ee968ef..cfff1fc381b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerbackendaddresspools.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerbackendaddresspools.go @@ -112,7 +112,6 @@ func (client LoadBalancerBackendAddressPoolsClient) GetSender(req *http.Request) func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Response) (result BackendAddressPool, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client LoadBalancerBackendAddressPoolsClient) List(ctx context.Context, re if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure responding to request") } + if result.lbbaplr.hasNextLink() && result.lbbaplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client LoadBalancerBackendAddressPoolsClient) ListSender(req *http.Request func (client LoadBalancerBackendAddressPoolsClient) ListResponder(resp *http.Response) (result LoadBalancerBackendAddressPoolListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerfrontendipconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerfrontendipconfigurations.go index 16de7ddf11f..a3a9bbb6ac1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerfrontendipconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerfrontendipconfigurations.go @@ -113,7 +113,6 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetSender(req *http.Req func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http.Response) (result FrontendIPConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -154,6 +153,9 @@ func (client LoadBalancerFrontendIPConfigurationsClient) List(ctx context.Contex if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure responding to request") } + if result.lbficlr.hasNextLink() && result.lbficlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -190,7 +192,6 @@ func (client LoadBalancerFrontendIPConfigurationsClient) ListSender(req *http.Re func (client LoadBalancerFrontendIPConfigurationsClient) ListResponder(resp *http.Response) (result LoadBalancerFrontendIPConfigurationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerloadbalancingrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerloadbalancingrules.go index 14d5006722a..e7b91b10d90 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerloadbalancingrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerloadbalancingrules.go @@ -112,7 +112,6 @@ func (client LoadBalancerLoadBalancingRulesClient) GetSender(req *http.Request) func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Response) (result LoadBalancingRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client LoadBalancerLoadBalancingRulesClient) List(ctx context.Context, res if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure responding to request") } + if result.lblbrlr.hasNextLink() && result.lblbrlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client LoadBalancerLoadBalancingRulesClient) ListSender(req *http.Request) func (client LoadBalancerLoadBalancingRulesClient) ListResponder(resp *http.Response) (result LoadBalancerLoadBalancingRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancernetworkinterfaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancernetworkinterfaces.go index 3a84d2813b2..7aa11406a3a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancernetworkinterfaces.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancernetworkinterfaces.go @@ -75,6 +75,9 @@ func (client LoadBalancerNetworkInterfacesClient) List(ctx context.Context, reso if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure responding to request") } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -111,7 +114,6 @@ func (client LoadBalancerNetworkInterfacesClient) ListSender(req *http.Request) func (client LoadBalancerNetworkInterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalanceroutboundrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalanceroutboundrules.go index e7182fc44c0..77c6ebfcd00 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalanceroutboundrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalanceroutboundrules.go @@ -112,7 +112,6 @@ func (client LoadBalancerOutboundRulesClient) GetSender(req *http.Request) (*htt func (client LoadBalancerOutboundRulesClient) GetResponder(resp *http.Response) (result OutboundRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client LoadBalancerOutboundRulesClient) List(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", resp, "Failure responding to request") } + if result.lborlr.hasNextLink() && result.lborlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client LoadBalancerOutboundRulesClient) ListSender(req *http.Request) (*ht func (client LoadBalancerOutboundRulesClient) ListResponder(resp *http.Response) (result LoadBalancerOutboundRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerprobes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerprobes.go index 31db8f92614..7718c0fdef2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerprobes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancerprobes.go @@ -112,7 +112,6 @@ func (client LoadBalancerProbesClient) GetSender(req *http.Request) (*http.Respo func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result Probe, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -153,6 +152,9 @@ func (client LoadBalancerProbesClient) List(ctx context.Context, resourceGroupNa if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure responding to request") } + if result.lbplr.hasNextLink() && result.lbplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -189,7 +191,6 @@ func (client LoadBalancerProbesClient) ListSender(req *http.Request) (*http.Resp func (client LoadBalancerProbesClient) ListResponder(resp *http.Response) (result LoadBalancerProbeListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancers.go index 7dcdfeb77de..acae4fe6c04 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/loadbalancers.go @@ -112,7 +112,6 @@ func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (futur func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBa func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, func (client LoadBalancersClient) GetResponder(resp *http.Response) (result LoadBalancer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,6 +304,9 @@ func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName st if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request") } + if result.lblr.hasNextLink() && result.lblr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -342,7 +342,6 @@ func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, func (client LoadBalancersClient) ListResponder(resp *http.Response) (result LoadBalancerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client LoadBalancersClient) ListAll(ctx context.Context) (result LoadBalan if err != nil { err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request") } + if result.lblr.hasNextLink() && result.lblr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -451,7 +453,6 @@ func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Respon func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result LoadBalancerListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -567,7 +568,6 @@ func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (future Lo func (client LoadBalancersClient) UpdateTagsResponder(resp *http.Response) (result LoadBalancer, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/localnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/localnetworkgateways.go index 837f36d04b2..2c908f85e7d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/localnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/localnetworkgateways.go @@ -122,7 +122,6 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result LocalNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -204,7 +203,6 @@ func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,7 +283,6 @@ func (client LocalNetworkGatewaysClient) GetSender(req *http.Request) (*http.Res func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (result LocalNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -325,6 +322,9 @@ func (client LocalNetworkGatewaysClient) List(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to request") } + if result.lnglr.hasNextLink() && result.lnglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -360,7 +360,6 @@ func (client LocalNetworkGatewaysClient) ListSender(req *http.Request) (*http.Re func (client LocalNetworkGatewaysClient) ListResponder(resp *http.Response) (result LocalNetworkGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -482,7 +481,6 @@ func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (fu func (client LocalNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result LocalNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/models.go index 58a5955cd2a..429c7ccb546 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/models.go @@ -31,1960 +31,8 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network" -// Access enumerates the values for access. -type Access string - -const ( - // Allow ... - Allow Access = "Allow" - // Deny ... - Deny Access = "Deny" -) - -// PossibleAccessValues returns an array of possible values for the Access const type. -func PossibleAccessValues() []Access { - return []Access{Allow, Deny} -} - -// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health -// server health. -type ApplicationGatewayBackendHealthServerHealth string - -const ( - // Down ... - Down ApplicationGatewayBackendHealthServerHealth = "Down" - // Draining ... - Draining ApplicationGatewayBackendHealthServerHealth = "Draining" - // Partial ... - Partial ApplicationGatewayBackendHealthServerHealth = "Partial" - // Unknown ... - Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // Up ... - Up ApplicationGatewayBackendHealthServerHealth = "Up" -) - -// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. -func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} -} - -// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. -type ApplicationGatewayCookieBasedAffinity string - -const ( - // Disabled ... - Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // Enabled ... - Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. -func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} -} - -// ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status -// code. -type ApplicationGatewayCustomErrorStatusCode string - -const ( - // HTTPStatus403 ... - HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - // HTTPStatus502 ... - HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" -) - -// PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. -func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} -} - -// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. -type ApplicationGatewayFirewallMode string - -const ( - // Detection ... - Detection ApplicationGatewayFirewallMode = "Detection" - // Prevention ... - Prevention ApplicationGatewayFirewallMode = "Prevention" -) - -// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. -func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{Detection, Prevention} -} - -// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. -type ApplicationGatewayOperationalState string - -const ( - // Running ... - Running ApplicationGatewayOperationalState = "Running" - // Starting ... - Starting ApplicationGatewayOperationalState = "Starting" - // Stopped ... - Stopped ApplicationGatewayOperationalState = "Stopped" - // Stopping ... - Stopping ApplicationGatewayOperationalState = "Stopping" -) - -// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. -func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} -} - -// ApplicationGatewayProtocol enumerates the values for application gateway protocol. -type ApplicationGatewayProtocol string - -const ( - // HTTP ... - HTTP ApplicationGatewayProtocol = "Http" - // HTTPS ... - HTTPS ApplicationGatewayProtocol = "Https" -) - -// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. -func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{HTTP, HTTPS} -} - -// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. -type ApplicationGatewayRedirectType string - -const ( - // Found ... - Found ApplicationGatewayRedirectType = "Found" - // Permanent ... - Permanent ApplicationGatewayRedirectType = "Permanent" - // SeeOther ... - SeeOther ApplicationGatewayRedirectType = "SeeOther" - // Temporary ... - Temporary ApplicationGatewayRedirectType = "Temporary" -) - -// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. -func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} -} - -// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule -// type. -type ApplicationGatewayRequestRoutingRuleType string - -const ( - // Basic ... - Basic ApplicationGatewayRequestRoutingRuleType = "Basic" - // PathBasedRouting ... - PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. -func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} -} - -// ApplicationGatewaySkuName enumerates the values for application gateway sku name. -type ApplicationGatewaySkuName string - -const ( - // StandardLarge ... - StandardLarge ApplicationGatewaySkuName = "Standard_Large" - // StandardMedium ... - StandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // StandardSmall ... - StandardSmall ApplicationGatewaySkuName = "Standard_Small" - // StandardV2 ... - StandardV2 ApplicationGatewaySkuName = "Standard_v2" - // WAFLarge ... - WAFLarge ApplicationGatewaySkuName = "WAF_Large" - // WAFMedium ... - WAFMedium ApplicationGatewaySkuName = "WAF_Medium" - // WAFV2 ... - WAFV2 ApplicationGatewaySkuName = "WAF_v2" -) - -// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. -func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} -} - -// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. -type ApplicationGatewaySslCipherSuite string - -const ( - // TLSDHEDSSWITH3DESEDECBCSHA ... - TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA ... - TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA256 ... - TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - // TLSDHEDSSWITHAES256CBCSHA ... - TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - // TLSDHEDSSWITHAES256CBCSHA256 ... - TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - // TLSDHERSAWITHAES128CBCSHA ... - TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - // TLSDHERSAWITHAES128GCMSHA256 ... - TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSDHERSAWITHAES256CBCSHA ... - TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - // TLSDHERSAWITHAES256GCMSHA384 ... - TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSECDHEECDSAWITHAES128CBCSHA ... - TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - // TLSECDHEECDSAWITHAES128CBCSHA256 ... - TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - // TLSECDHEECDSAWITHAES128GCMSHA256 ... - TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - // TLSECDHEECDSAWITHAES256CBCSHA ... - TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - // TLSECDHEECDSAWITHAES256CBCSHA384 ... - TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - // TLSECDHEECDSAWITHAES256GCMSHA384 ... - TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - // TLSECDHERSAWITHAES128CBCSHA ... - TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - // TLSECDHERSAWITHAES128CBCSHA256 ... - TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // TLSECDHERSAWITHAES128GCMSHA256 ... - TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSECDHERSAWITHAES256CBCSHA ... - TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - // TLSECDHERSAWITHAES256CBCSHA384 ... - TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - // TLSECDHERSAWITHAES256GCMSHA384 ... - TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSRSAWITH3DESEDECBCSHA ... - TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - // TLSRSAWITHAES128CBCSHA ... - TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - // TLSRSAWITHAES128CBCSHA256 ... - TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - // TLSRSAWITHAES128GCMSHA256 ... - TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - // TLSRSAWITHAES256CBCSHA ... - TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - // TLSRSAWITHAES256CBCSHA256 ... - TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - // TLSRSAWITHAES256GCMSHA384 ... - TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" -) - -// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. -func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { - return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} -} - -// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. -type ApplicationGatewaySslPolicyName string - -const ( - // AppGwSslPolicy20150501 ... - AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - // AppGwSslPolicy20170401 ... - AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - // AppGwSslPolicy20170401S ... - AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" -) - -// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. -func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { - return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S} -} - -// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. -type ApplicationGatewaySslPolicyType string - -const ( - // Custom ... - Custom ApplicationGatewaySslPolicyType = "Custom" - // Predefined ... - Predefined ApplicationGatewaySslPolicyType = "Predefined" -) - -// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. -func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { - return []ApplicationGatewaySslPolicyType{Custom, Predefined} -} - -// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. -type ApplicationGatewaySslProtocol string - -const ( - // TLSv10 ... - TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // TLSv11 ... - TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // TLSv12 ... - TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" -) - -// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. -func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { - return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} -} - -// ApplicationGatewayTier enumerates the values for application gateway tier. -type ApplicationGatewayTier string - -const ( - // ApplicationGatewayTierStandard ... - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - // ApplicationGatewayTierStandardV2 ... - ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" - // ApplicationGatewayTierWAF ... - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - // ApplicationGatewayTierWAFV2 ... - ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" -) - -// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. -func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} -} - -// AssociationType enumerates the values for association type. -type AssociationType string - -const ( - // Associated ... - Associated AssociationType = "Associated" - // Contains ... - Contains AssociationType = "Contains" -) - -// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. -func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{Associated, Contains} -} - -// AuthenticationMethod enumerates the values for authentication method. -type AuthenticationMethod string - -const ( - // EAPMSCHAPv2 ... - EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - // EAPTLS ... - EAPTLS AuthenticationMethod = "EAPTLS" -) - -// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. -func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} -} - -// AuthorizationUseStatus enumerates the values for authorization use status. -type AuthorizationUseStatus string - -const ( - // Available ... - Available AuthorizationUseStatus = "Available" - // InUse ... - InUse AuthorizationUseStatus = "InUse" -) - -// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. -func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{Available, InUse} -} - -// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol -// type. -type AzureFirewallApplicationRuleProtocolType string - -const ( - // AzureFirewallApplicationRuleProtocolTypeHTTP ... - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - // AzureFirewallApplicationRuleProtocolTypeHTTPS ... - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" -) - -// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. -func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { - return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS} -} - -// AzureFirewallNatRCActionType enumerates the values for azure firewall nat rc action type. -type AzureFirewallNatRCActionType string - -const ( - // Dnat ... - Dnat AzureFirewallNatRCActionType = "Dnat" - // Snat ... - Snat AzureFirewallNatRCActionType = "Snat" -) - -// PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. -func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{Dnat, Snat} -} - -// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. -type AzureFirewallNetworkRuleProtocol string - -const ( - // Any ... - Any AzureFirewallNetworkRuleProtocol = "Any" - // ICMP ... - ICMP AzureFirewallNetworkRuleProtocol = "ICMP" - // TCP ... - TCP AzureFirewallNetworkRuleProtocol = "TCP" - // UDP ... - UDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. -func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { - return []AzureFirewallNetworkRuleProtocol{Any, ICMP, TCP, UDP} -} - -// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. -type AzureFirewallRCActionType string - -const ( - // AzureFirewallRCActionTypeAlert ... - AzureFirewallRCActionTypeAlert AzureFirewallRCActionType = "Alert" - // AzureFirewallRCActionTypeAllow ... - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - // AzureFirewallRCActionTypeDeny ... - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. -func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { - return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAlert, AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} -} - -// AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. -type AzureFirewallThreatIntelMode string - -const ( - // AzureFirewallThreatIntelModeAlert ... - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - // AzureFirewallThreatIntelModeDeny ... - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - // AzureFirewallThreatIntelModeOff ... - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -// PossibleAzureFirewallThreatIntelModeValues returns an array of possible values for the AzureFirewallThreatIntelMode const type. -func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { - return []AzureFirewallThreatIntelMode{AzureFirewallThreatIntelModeAlert, AzureFirewallThreatIntelModeDeny, AzureFirewallThreatIntelModeOff} -} - -// BgpPeerState enumerates the values for bgp peer state. -type BgpPeerState string - -const ( - // BgpPeerStateConnected ... - BgpPeerStateConnected BgpPeerState = "Connected" - // BgpPeerStateConnecting ... - BgpPeerStateConnecting BgpPeerState = "Connecting" - // BgpPeerStateIdle ... - BgpPeerStateIdle BgpPeerState = "Idle" - // BgpPeerStateStopped ... - BgpPeerStateStopped BgpPeerState = "Stopped" - // BgpPeerStateUnknown ... - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. -func PossibleBgpPeerStateValues() []BgpPeerState { - return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} -} - -// CircuitConnectionStatus enumerates the values for circuit connection status. -type CircuitConnectionStatus string - -const ( - // Connected ... - Connected CircuitConnectionStatus = "Connected" - // Connecting ... - Connecting CircuitConnectionStatus = "Connecting" - // Disconnected ... - Disconnected CircuitConnectionStatus = "Disconnected" -) - -// PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. -func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{Connected, Connecting, Disconnected} -} - -// ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. -type ConnectionMonitorSourceStatus string - -const ( - // ConnectionMonitorSourceStatusActive ... - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - // ConnectionMonitorSourceStatusInactive ... - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - // ConnectionMonitorSourceStatusUnknown ... - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -// PossibleConnectionMonitorSourceStatusValues returns an array of possible values for the ConnectionMonitorSourceStatus const type. -func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { - return []ConnectionMonitorSourceStatus{ConnectionMonitorSourceStatusActive, ConnectionMonitorSourceStatusInactive, ConnectionMonitorSourceStatusUnknown} -} - -// ConnectionState enumerates the values for connection state. -type ConnectionState string - -const ( - // ConnectionStateReachable ... - ConnectionStateReachable ConnectionState = "Reachable" - // ConnectionStateUnknown ... - ConnectionStateUnknown ConnectionState = "Unknown" - // ConnectionStateUnreachable ... - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. -func PossibleConnectionStateValues() []ConnectionState { - return []ConnectionState{ConnectionStateReachable, ConnectionStateUnknown, ConnectionStateUnreachable} -} - -// ConnectionStatus enumerates the values for connection status. -type ConnectionStatus string - -const ( - // ConnectionStatusConnected ... - ConnectionStatusConnected ConnectionStatus = "Connected" - // ConnectionStatusDegraded ... - ConnectionStatusDegraded ConnectionStatus = "Degraded" - // ConnectionStatusDisconnected ... - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - // ConnectionStatusUnknown ... - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. -func PossibleConnectionStatusValues() []ConnectionStatus { - return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} -} - -// DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. -type DdosCustomPolicyProtocol string - -const ( - // DdosCustomPolicyProtocolSyn ... - DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" - // DdosCustomPolicyProtocolTCP ... - DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" - // DdosCustomPolicyProtocolUDP ... - DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" -) - -// PossibleDdosCustomPolicyProtocolValues returns an array of possible values for the DdosCustomPolicyProtocol const type. -func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { - return []DdosCustomPolicyProtocol{DdosCustomPolicyProtocolSyn, DdosCustomPolicyProtocolTCP, DdosCustomPolicyProtocolUDP} -} - -// DdosCustomPolicyTriggerSensitivityOverride enumerates the values for ddos custom policy trigger sensitivity -// override. -type DdosCustomPolicyTriggerSensitivityOverride string - -const ( - // Default ... - Default DdosCustomPolicyTriggerSensitivityOverride = "Default" - // High ... - High DdosCustomPolicyTriggerSensitivityOverride = "High" - // Low ... - Low DdosCustomPolicyTriggerSensitivityOverride = "Low" - // Relaxed ... - Relaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" -) - -// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns an array of possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. -func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { - return []DdosCustomPolicyTriggerSensitivityOverride{Default, High, Low, Relaxed} -} - -// DhGroup enumerates the values for dh group. -type DhGroup string - -const ( - // DHGroup1 ... - DHGroup1 DhGroup = "DHGroup1" - // DHGroup14 ... - DHGroup14 DhGroup = "DHGroup14" - // DHGroup2 ... - DHGroup2 DhGroup = "DHGroup2" - // DHGroup2048 ... - DHGroup2048 DhGroup = "DHGroup2048" - // DHGroup24 ... - DHGroup24 DhGroup = "DHGroup24" - // ECP256 ... - ECP256 DhGroup = "ECP256" - // ECP384 ... - ECP384 DhGroup = "ECP384" - // None ... - None DhGroup = "None" -) - -// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. -func PossibleDhGroupValues() []DhGroup { - return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} -} - -// Direction enumerates the values for direction. -type Direction string - -const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} -} - -// EffectiveRouteSource enumerates the values for effective route source. -type EffectiveRouteSource string - -const ( - // EffectiveRouteSourceDefault ... - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - // EffectiveRouteSourceUnknown ... - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - // EffectiveRouteSourceUser ... - EffectiveRouteSourceUser EffectiveRouteSource = "User" - // EffectiveRouteSourceVirtualNetworkGateway ... - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. -func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { - return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} -} - -// EffectiveRouteState enumerates the values for effective route state. -type EffectiveRouteState string - -const ( - // Active ... - Active EffectiveRouteState = "Active" - // Invalid ... - Invalid EffectiveRouteState = "Invalid" -) - -// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. -func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{Active, Invalid} -} - -// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. -type EffectiveSecurityRuleProtocol string - -const ( - // EffectiveSecurityRuleProtocolAll ... - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - // EffectiveSecurityRuleProtocolTCP ... - EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" - // EffectiveSecurityRuleProtocolUDP ... - EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" -) - -// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. -func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { - return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} -} - -// EvaluationState enumerates the values for evaluation state. -type EvaluationState string - -const ( - // Completed ... - Completed EvaluationState = "Completed" - // InProgress ... - InProgress EvaluationState = "InProgress" - // NotStarted ... - NotStarted EvaluationState = "NotStarted" -) - -// PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. -func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{Completed, InProgress, NotStarted} -} - -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit -// peering advertised public prefix state. -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - // Configured ... - Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // Configuring ... - Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // NotConfigured ... - NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ValidationNeeded ... - ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. -func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} -} - -// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. -type ExpressRouteCircuitPeeringState string - -const ( - // ExpressRouteCircuitPeeringStateDisabled ... - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - // ExpressRouteCircuitPeeringStateEnabled ... - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. -func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { - return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} -} - -// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. -type ExpressRouteCircuitSkuFamily string - -const ( - // MeteredData ... - MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // UnlimitedData ... - UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" -) - -// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. -func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { - return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} -} - -// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. -type ExpressRouteCircuitSkuTier string - -const ( - // ExpressRouteCircuitSkuTierBasic ... - ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" - // ExpressRouteCircuitSkuTierLocal ... - ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" - // ExpressRouteCircuitSkuTierPremium ... - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - // ExpressRouteCircuitSkuTierStandard ... - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" -) - -// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. -func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { - return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierBasic, ExpressRouteCircuitSkuTierLocal, ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} -} - -// ExpressRouteLinkAdminState enumerates the values for express route link admin state. -type ExpressRouteLinkAdminState string - -const ( - // ExpressRouteLinkAdminStateDisabled ... - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - // ExpressRouteLinkAdminStateEnabled ... - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -// PossibleExpressRouteLinkAdminStateValues returns an array of possible values for the ExpressRouteLinkAdminState const type. -func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { - return []ExpressRouteLinkAdminState{ExpressRouteLinkAdminStateDisabled, ExpressRouteLinkAdminStateEnabled} -} - -// ExpressRouteLinkConnectorType enumerates the values for express route link connector type. -type ExpressRouteLinkConnectorType string - -const ( - // LC ... - LC ExpressRouteLinkConnectorType = "LC" - // SC ... - SC ExpressRouteLinkConnectorType = "SC" -) - -// PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. -func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{LC, SC} -} - -// ExpressRoutePeeringState enumerates the values for express route peering state. -type ExpressRoutePeeringState string - -const ( - // ExpressRoutePeeringStateDisabled ... - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - // ExpressRoutePeeringStateEnabled ... - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -// PossibleExpressRoutePeeringStateValues returns an array of possible values for the ExpressRoutePeeringState const type. -func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { - return []ExpressRoutePeeringState{ExpressRoutePeeringStateDisabled, ExpressRoutePeeringStateEnabled} -} - -// ExpressRoutePeeringType enumerates the values for express route peering type. -type ExpressRoutePeeringType string - -const ( - // AzurePrivatePeering ... - AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - // AzurePublicPeering ... - AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - // MicrosoftPeering ... - MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -// PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. -func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} -} - -// ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. -type ExpressRoutePortsEncapsulation string - -const ( - // Dot1Q ... - Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - // QinQ ... - QinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -// PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. -func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} -} - -// FlowLogFormatType enumerates the values for flow log format type. -type FlowLogFormatType string - -const ( - // JSON ... - JSON FlowLogFormatType = "JSON" -) - -// PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. -func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{JSON} -} - -// HTTPMethod enumerates the values for http method. -type HTTPMethod string - -const ( - // Get ... - Get HTTPMethod = "Get" -) - -// PossibleHTTPMethodValues returns an array of possible values for the HTTPMethod const type. -func PossibleHTTPMethodValues() []HTTPMethod { - return []HTTPMethod{Get} -} - -// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. -type HubVirtualNetworkConnectionStatus string - -const ( - // HubVirtualNetworkConnectionStatusConnected ... - HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" - // HubVirtualNetworkConnectionStatusConnecting ... - HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" - // HubVirtualNetworkConnectionStatusNotConnected ... - HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" - // HubVirtualNetworkConnectionStatusUnknown ... - HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" -) - -// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. -func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { - return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} -} - -// IkeEncryption enumerates the values for ike encryption. -type IkeEncryption string - -const ( - // AES128 ... - AES128 IkeEncryption = "AES128" - // AES192 ... - AES192 IkeEncryption = "AES192" - // AES256 ... - AES256 IkeEncryption = "AES256" - // DES ... - DES IkeEncryption = "DES" - // DES3 ... - DES3 IkeEncryption = "DES3" - // GCMAES128 ... - GCMAES128 IkeEncryption = "GCMAES128" - // GCMAES256 ... - GCMAES256 IkeEncryption = "GCMAES256" -) - -// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. -func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} -} - -// IkeIntegrity enumerates the values for ike integrity. -type IkeIntegrity string - -const ( - // IkeIntegrityGCMAES128 ... - IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" - // IkeIntegrityGCMAES256 ... - IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" - // IkeIntegrityMD5 ... - IkeIntegrityMD5 IkeIntegrity = "MD5" - // IkeIntegritySHA1 ... - IkeIntegritySHA1 IkeIntegrity = "SHA1" - // IkeIntegritySHA256 ... - IkeIntegritySHA256 IkeIntegrity = "SHA256" - // IkeIntegritySHA384 ... - IkeIntegritySHA384 IkeIntegrity = "SHA384" -) - -// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. -func PossibleIkeIntegrityValues() []IkeIntegrity { - return []IkeIntegrity{IkeIntegrityGCMAES128, IkeIntegrityGCMAES256, IkeIntegrityMD5, IkeIntegritySHA1, IkeIntegritySHA256, IkeIntegritySHA384} -} - -// IPAllocationMethod enumerates the values for ip allocation method. -type IPAllocationMethod string - -const ( - // Dynamic ... - Dynamic IPAllocationMethod = "Dynamic" - // Static ... - Static IPAllocationMethod = "Static" -) - -// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. -func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{Dynamic, Static} -} - -// IPFlowProtocol enumerates the values for ip flow protocol. -type IPFlowProtocol string - -const ( - // IPFlowProtocolTCP ... - IPFlowProtocolTCP IPFlowProtocol = "TCP" - // IPFlowProtocolUDP ... - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -// PossibleIPFlowProtocolValues returns an array of possible values for the IPFlowProtocol const type. -func PossibleIPFlowProtocolValues() []IPFlowProtocol { - return []IPFlowProtocol{IPFlowProtocolTCP, IPFlowProtocolUDP} -} - -// IpsecEncryption enumerates the values for ipsec encryption. -type IpsecEncryption string - -const ( - // IpsecEncryptionAES128 ... - IpsecEncryptionAES128 IpsecEncryption = "AES128" - // IpsecEncryptionAES192 ... - IpsecEncryptionAES192 IpsecEncryption = "AES192" - // IpsecEncryptionAES256 ... - IpsecEncryptionAES256 IpsecEncryption = "AES256" - // IpsecEncryptionDES ... - IpsecEncryptionDES IpsecEncryption = "DES" - // IpsecEncryptionDES3 ... - IpsecEncryptionDES3 IpsecEncryption = "DES3" - // IpsecEncryptionGCMAES128 ... - IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" - // IpsecEncryptionGCMAES192 ... - IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" - // IpsecEncryptionGCMAES256 ... - IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" - // IpsecEncryptionNone ... - IpsecEncryptionNone IpsecEncryption = "None" -) - -// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. -func PossibleIpsecEncryptionValues() []IpsecEncryption { - return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} -} - -// IpsecIntegrity enumerates the values for ipsec integrity. -type IpsecIntegrity string - -const ( - // IpsecIntegrityGCMAES128 ... - IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" - // IpsecIntegrityGCMAES192 ... - IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" - // IpsecIntegrityGCMAES256 ... - IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" - // IpsecIntegrityMD5 ... - IpsecIntegrityMD5 IpsecIntegrity = "MD5" - // IpsecIntegritySHA1 ... - IpsecIntegritySHA1 IpsecIntegrity = "SHA1" - // IpsecIntegritySHA256 ... - IpsecIntegritySHA256 IpsecIntegrity = "SHA256" -) - -// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. -func PossibleIpsecIntegrityValues() []IpsecIntegrity { - return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// IssueType enumerates the values for issue type. -type IssueType string - -const ( - // IssueTypeAgentStopped ... - IssueTypeAgentStopped IssueType = "AgentStopped" - // IssueTypeDNSResolution ... - IssueTypeDNSResolution IssueType = "DnsResolution" - // IssueTypeGuestFirewall ... - IssueTypeGuestFirewall IssueType = "GuestFirewall" - // IssueTypeNetworkSecurityRule ... - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - // IssueTypePlatform ... - IssueTypePlatform IssueType = "Platform" - // IssueTypePortThrottled ... - IssueTypePortThrottled IssueType = "PortThrottled" - // IssueTypeSocketBind ... - IssueTypeSocketBind IssueType = "SocketBind" - // IssueTypeUnknown ... - IssueTypeUnknown IssueType = "Unknown" - // IssueTypeUserDefinedRoute ... - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. -func PossibleIssueTypeValues() []IssueType { - return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} -} - -// LoadBalancerSkuName enumerates the values for load balancer sku name. -type LoadBalancerSkuName string - -const ( - // LoadBalancerSkuNameBasic ... - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - // LoadBalancerSkuNameStandard ... - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. -func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { - return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameStandard} -} - -// LoadDistribution enumerates the values for load distribution. -type LoadDistribution string - -const ( - // LoadDistributionDefault ... - LoadDistributionDefault LoadDistribution = "Default" - // LoadDistributionSourceIP ... - LoadDistributionSourceIP LoadDistribution = "SourceIP" - // LoadDistributionSourceIPProtocol ... - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. -func PossibleLoadDistributionValues() []LoadDistribution { - return []LoadDistribution{LoadDistributionDefault, LoadDistributionSourceIP, LoadDistributionSourceIPProtocol} -} - -// NextHopType enumerates the values for next hop type. -type NextHopType string - -const ( - // NextHopTypeHyperNetGateway ... - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - // NextHopTypeInternet ... - NextHopTypeInternet NextHopType = "Internet" - // NextHopTypeNone ... - NextHopTypeNone NextHopType = "None" - // NextHopTypeVirtualAppliance ... - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - // NextHopTypeVirtualNetworkGateway ... - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - // NextHopTypeVnetLocal ... - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. -func PossibleNextHopTypeValues() []NextHopType { - return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} -} - -// OfficeTrafficCategory enumerates the values for office traffic category. -type OfficeTrafficCategory string - -const ( - // OfficeTrafficCategoryAll ... - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - // OfficeTrafficCategoryNone ... - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - // OfficeTrafficCategoryOptimize ... - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - // OfficeTrafficCategoryOptimizeAndAllow ... - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -// PossibleOfficeTrafficCategoryValues returns an array of possible values for the OfficeTrafficCategory const type. -func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { - return []OfficeTrafficCategory{OfficeTrafficCategoryAll, OfficeTrafficCategoryNone, OfficeTrafficCategoryOptimize, OfficeTrafficCategoryOptimizeAndAllow} -} - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // OperationStatusFailed ... - OperationStatusFailed OperationStatus = "Failed" - // OperationStatusInProgress ... - OperationStatusInProgress OperationStatus = "InProgress" - // OperationStatusSucceeded ... - OperationStatusSucceeded OperationStatus = "Succeeded" -) - -// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. -func PossibleOperationStatusValues() []OperationStatus { - return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} -} - -// Origin enumerates the values for origin. -type Origin string - -const ( - // OriginInbound ... - OriginInbound Origin = "Inbound" - // OriginLocal ... - OriginLocal Origin = "Local" - // OriginOutbound ... - OriginOutbound Origin = "Outbound" -) - -// PossibleOriginValues returns an array of possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{OriginInbound, OriginLocal, OriginOutbound} -} - -// PcError enumerates the values for pc error. -type PcError string - -const ( - // AgentStopped ... - AgentStopped PcError = "AgentStopped" - // CaptureFailed ... - CaptureFailed PcError = "CaptureFailed" - // InternalError ... - InternalError PcError = "InternalError" - // LocalFileFailed ... - LocalFileFailed PcError = "LocalFileFailed" - // StorageFailed ... - StorageFailed PcError = "StorageFailed" -) - -// PossiblePcErrorValues returns an array of possible values for the PcError const type. -func PossiblePcErrorValues() []PcError { - return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} -} - -// PcProtocol enumerates the values for pc protocol. -type PcProtocol string - -const ( - // PcProtocolAny ... - PcProtocolAny PcProtocol = "Any" - // PcProtocolTCP ... - PcProtocolTCP PcProtocol = "TCP" - // PcProtocolUDP ... - PcProtocolUDP PcProtocol = "UDP" -) - -// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. -func PossiblePcProtocolValues() []PcProtocol { - return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} -} - -// PcStatus enumerates the values for pc status. -type PcStatus string - -const ( - // PcStatusError ... - PcStatusError PcStatus = "Error" - // PcStatusNotStarted ... - PcStatusNotStarted PcStatus = "NotStarted" - // PcStatusRunning ... - PcStatusRunning PcStatus = "Running" - // PcStatusStopped ... - PcStatusStopped PcStatus = "Stopped" - // PcStatusUnknown ... - PcStatusUnknown PcStatus = "Unknown" -) - -// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. -func PossiblePcStatusValues() []PcStatus { - return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} -} - -// PfsGroup enumerates the values for pfs group. -type PfsGroup string - -const ( - // PfsGroupECP256 ... - PfsGroupECP256 PfsGroup = "ECP256" - // PfsGroupECP384 ... - PfsGroupECP384 PfsGroup = "ECP384" - // PfsGroupNone ... - PfsGroupNone PfsGroup = "None" - // PfsGroupPFS1 ... - PfsGroupPFS1 PfsGroup = "PFS1" - // PfsGroupPFS14 ... - PfsGroupPFS14 PfsGroup = "PFS14" - // PfsGroupPFS2 ... - PfsGroupPFS2 PfsGroup = "PFS2" - // PfsGroupPFS2048 ... - PfsGroupPFS2048 PfsGroup = "PFS2048" - // PfsGroupPFS24 ... - PfsGroupPFS24 PfsGroup = "PFS24" - // PfsGroupPFSMM ... - PfsGroupPFSMM PfsGroup = "PFSMM" -) - -// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. -func PossiblePfsGroupValues() []PfsGroup { - return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS14, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24, PfsGroupPFSMM} -} - -// ProbeProtocol enumerates the values for probe protocol. -type ProbeProtocol string - -const ( - // ProbeProtocolHTTP ... - ProbeProtocolHTTP ProbeProtocol = "Http" - // ProbeProtocolHTTPS ... - ProbeProtocolHTTPS ProbeProtocol = "Https" - // ProbeProtocolTCP ... - ProbeProtocolTCP ProbeProtocol = "Tcp" -) - -// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. -func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} -} - -// ProcessorArchitecture enumerates the values for processor architecture. -type ProcessorArchitecture string - -const ( - // Amd64 ... - Amd64 ProcessorArchitecture = "Amd64" - // X86 ... - X86 ProcessorArchitecture = "X86" -) - -// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. -func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{Amd64, X86} -} - -// ProtectionCoverage enumerates the values for protection coverage. -type ProtectionCoverage string - -const ( - // ProtectionCoverageBasic ... - ProtectionCoverageBasic ProtectionCoverage = "Basic" - // ProtectionCoverageStandard ... - ProtectionCoverageStandard ProtectionCoverage = "Standard" -) - -// PossibleProtectionCoverageValues returns an array of possible values for the ProtectionCoverage const type. -func PossibleProtectionCoverageValues() []ProtectionCoverage { - return []ProtectionCoverage{ProtectionCoverageBasic, ProtectionCoverageStandard} -} - -// Protocol enumerates the values for protocol. -type Protocol string - -const ( - // ProtocolHTTP ... - ProtocolHTTP Protocol = "Http" - // ProtocolHTTPS ... - ProtocolHTTPS Protocol = "Https" - // ProtocolIcmp ... - ProtocolIcmp Protocol = "Icmp" - // ProtocolTCP ... - ProtocolTCP Protocol = "Tcp" -) - -// PossibleProtocolValues returns an array of possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolIcmp, ProtocolTCP} -} - -// Protocol1 enumerates the values for protocol 1. -type Protocol1 string - -const ( - // Protocol1All ... - Protocol1All Protocol1 = "All" - // Protocol1TCP ... - Protocol1TCP Protocol1 = "Tcp" - // Protocol1UDP ... - Protocol1UDP Protocol1 = "Udp" -) - -// PossibleProtocol1Values returns an array of possible values for the Protocol1 const type. -func PossibleProtocol1Values() []Protocol1 { - return []Protocol1{Protocol1All, Protocol1TCP, Protocol1UDP} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Deleting, Failed, Succeeded, Updating} -} - -// PublicIPAddressSkuName enumerates the values for public ip address sku name. -type PublicIPAddressSkuName string - -const ( - // PublicIPAddressSkuNameBasic ... - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - // PublicIPAddressSkuNameStandard ... - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. -func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { - return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} -} - -// PublicIPPrefixSkuName enumerates the values for public ip prefix sku name. -type PublicIPPrefixSkuName string - -const ( - // Standard ... - Standard PublicIPPrefixSkuName = "Standard" -) - -// PossiblePublicIPPrefixSkuNameValues returns an array of possible values for the PublicIPPrefixSkuName const type. -func PossiblePublicIPPrefixSkuNameValues() []PublicIPPrefixSkuName { - return []PublicIPPrefixSkuName{Standard} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// RouteNextHopType enumerates the values for route next hop type. -type RouteNextHopType string - -const ( - // RouteNextHopTypeInternet ... - RouteNextHopTypeInternet RouteNextHopType = "Internet" - // RouteNextHopTypeNone ... - RouteNextHopTypeNone RouteNextHopType = "None" - // RouteNextHopTypeVirtualAppliance ... - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - // RouteNextHopTypeVirtualNetworkGateway ... - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - // RouteNextHopTypeVnetLocal ... - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. -func PossibleRouteNextHopTypeValues() []RouteNextHopType { - return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} -} - -// SecurityRuleAccess enumerates the values for security rule access. -type SecurityRuleAccess string - -const ( - // SecurityRuleAccessAllow ... - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - // SecurityRuleAccessDeny ... - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. -func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { - return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} -} - -// SecurityRuleDirection enumerates the values for security rule direction. -type SecurityRuleDirection string - -const ( - // SecurityRuleDirectionInbound ... - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - // SecurityRuleDirectionOutbound ... - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. -func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { - return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} -} - -// SecurityRuleProtocol enumerates the values for security rule protocol. -type SecurityRuleProtocol string - -const ( - // SecurityRuleProtocolAsterisk ... - SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - // SecurityRuleProtocolTCP ... - SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - // SecurityRuleProtocolUDP ... - SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" -) - -// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. -func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { - return []SecurityRuleProtocol{SecurityRuleProtocolAsterisk, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} -} - -// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. -type ServiceProviderProvisioningState string - -const ( - // Deprovisioning ... - Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" - // NotProvisioned ... - NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - // Provisioned ... - Provisioned ServiceProviderProvisioningState = "Provisioned" - // Provisioning ... - Provisioning ServiceProviderProvisioningState = "Provisioning" -) - -// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. -func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { - return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} -} - -// Severity enumerates the values for severity. -type Severity string - -const ( - // SeverityError ... - SeverityError Severity = "Error" - // SeverityWarning ... - SeverityWarning Severity = "Warning" -) - -// PossibleSeverityValues returns an array of possible values for the Severity const type. -func PossibleSeverityValues() []Severity { - return []Severity{SeverityError, SeverityWarning} -} - -// TransportProtocol enumerates the values for transport protocol. -type TransportProtocol string - -const ( - // TransportProtocolAll ... - TransportProtocolAll TransportProtocol = "All" - // TransportProtocolTCP ... - TransportProtocolTCP TransportProtocol = "Tcp" - // TransportProtocolUDP ... - TransportProtocolUDP TransportProtocol = "Udp" -) - -// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} -} - -// TunnelConnectionStatus enumerates the values for tunnel connection status. -type TunnelConnectionStatus string - -const ( - // TunnelConnectionStatusConnected ... - TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" - // TunnelConnectionStatusConnecting ... - TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" - // TunnelConnectionStatusNotConnected ... - TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" - // TunnelConnectionStatusUnknown ... - TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" -) - -// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. -func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { - return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} -} - -// VerbosityLevel enumerates the values for verbosity level. -type VerbosityLevel string - -const ( - // Full ... - Full VerbosityLevel = "Full" - // Minimum ... - Minimum VerbosityLevel = "Minimum" - // Normal ... - Normal VerbosityLevel = "Normal" -) - -// PossibleVerbosityLevelValues returns an array of possible values for the VerbosityLevel const type. -func PossibleVerbosityLevelValues() []VerbosityLevel { - return []VerbosityLevel{Full, Minimum, Normal} -} - -// VirtualNetworkGatewayConnectionProtocol enumerates the values for virtual network gateway connection -// protocol. -type VirtualNetworkGatewayConnectionProtocol string - -const ( - // IKEv1 ... - IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - // IKEv2 ... - IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -// PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. -func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} -} - -// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. -type VirtualNetworkGatewayConnectionStatus string - -const ( - // VirtualNetworkGatewayConnectionStatusConnected ... - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - // VirtualNetworkGatewayConnectionStatusConnecting ... - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - // VirtualNetworkGatewayConnectionStatusNotConnected ... - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - // VirtualNetworkGatewayConnectionStatusUnknown ... - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. -func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { - return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} -} - -// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. -type VirtualNetworkGatewayConnectionType string - -const ( - // ExpressRoute ... - ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // IPsec ... - IPsec VirtualNetworkGatewayConnectionType = "IPsec" - // Vnet2Vnet ... - Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VPNClient ... - VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" -) - -// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. -func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} -} - -// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. -type VirtualNetworkGatewaySkuName string - -const ( - // VirtualNetworkGatewaySkuNameBasic ... - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - // VirtualNetworkGatewaySkuNameErGw1AZ ... - VirtualNetworkGatewaySkuNameErGw1AZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - // VirtualNetworkGatewaySkuNameErGw2AZ ... - VirtualNetworkGatewaySkuNameErGw2AZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - // VirtualNetworkGatewaySkuNameErGw3AZ ... - VirtualNetworkGatewaySkuNameErGw3AZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - // VirtualNetworkGatewaySkuNameHighPerformance ... - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - // VirtualNetworkGatewaySkuNameStandard ... - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - // VirtualNetworkGatewaySkuNameUltraPerformance ... - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - // VirtualNetworkGatewaySkuNameVpnGw1 ... - VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" - // VirtualNetworkGatewaySkuNameVpnGw1AZ ... - VirtualNetworkGatewaySkuNameVpnGw1AZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - // VirtualNetworkGatewaySkuNameVpnGw2 ... - VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" - // VirtualNetworkGatewaySkuNameVpnGw2AZ ... - VirtualNetworkGatewaySkuNameVpnGw2AZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" - // VirtualNetworkGatewaySkuNameVpnGw3 ... - VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" - // VirtualNetworkGatewaySkuNameVpnGw3AZ ... - VirtualNetworkGatewaySkuNameVpnGw3AZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" -) - -// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. -func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { - return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameErGw1AZ, VirtualNetworkGatewaySkuNameErGw2AZ, VirtualNetworkGatewaySkuNameErGw3AZ, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw1AZ, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw2AZ, VirtualNetworkGatewaySkuNameVpnGw3, VirtualNetworkGatewaySkuNameVpnGw3AZ} -} - -// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. -type VirtualNetworkGatewaySkuTier string - -const ( - // VirtualNetworkGatewaySkuTierBasic ... - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - // VirtualNetworkGatewaySkuTierErGw1AZ ... - VirtualNetworkGatewaySkuTierErGw1AZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - // VirtualNetworkGatewaySkuTierErGw2AZ ... - VirtualNetworkGatewaySkuTierErGw2AZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - // VirtualNetworkGatewaySkuTierErGw3AZ ... - VirtualNetworkGatewaySkuTierErGw3AZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - // VirtualNetworkGatewaySkuTierHighPerformance ... - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - // VirtualNetworkGatewaySkuTierStandard ... - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - // VirtualNetworkGatewaySkuTierUltraPerformance ... - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - // VirtualNetworkGatewaySkuTierVpnGw1 ... - VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" - // VirtualNetworkGatewaySkuTierVpnGw1AZ ... - VirtualNetworkGatewaySkuTierVpnGw1AZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - // VirtualNetworkGatewaySkuTierVpnGw2 ... - VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" - // VirtualNetworkGatewaySkuTierVpnGw2AZ ... - VirtualNetworkGatewaySkuTierVpnGw2AZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" - // VirtualNetworkGatewaySkuTierVpnGw3 ... - VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" - // VirtualNetworkGatewaySkuTierVpnGw3AZ ... - VirtualNetworkGatewaySkuTierVpnGw3AZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" -) - -// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. -func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { - return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierErGw1AZ, VirtualNetworkGatewaySkuTierErGw2AZ, VirtualNetworkGatewaySkuTierErGw3AZ, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw1AZ, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw2AZ, VirtualNetworkGatewaySkuTierVpnGw3, VirtualNetworkGatewaySkuTierVpnGw3AZ} -} - -// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. -type VirtualNetworkGatewayType string - -const ( - // VirtualNetworkGatewayTypeExpressRoute ... - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - // VirtualNetworkGatewayTypeVpn ... - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. -func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { - return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} -} - -// VirtualNetworkPeeringState enumerates the values for virtual network peering state. -type VirtualNetworkPeeringState string - -const ( - // VirtualNetworkPeeringStateConnected ... - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - // VirtualNetworkPeeringStateDisconnected ... - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - // VirtualNetworkPeeringStateInitiated ... - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. -func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { - return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} -} - -// VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. -type VirtualWanSecurityProviderType string - -const ( - // External ... - External VirtualWanSecurityProviderType = "External" - // Native ... - Native VirtualWanSecurityProviderType = "Native" -) - -// PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. -func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{External, Native} -} - -// VpnClientProtocol enumerates the values for vpn client protocol. -type VpnClientProtocol string - -const ( - // IkeV2 ... - IkeV2 VpnClientProtocol = "IkeV2" - // OpenVPN ... - OpenVPN VpnClientProtocol = "OpenVPN" - // SSTP ... - SSTP VpnClientProtocol = "SSTP" -) - -// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. -func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} -} - -// VpnConnectionStatus enumerates the values for vpn connection status. -type VpnConnectionStatus string - -const ( - // VpnConnectionStatusConnected ... - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - // VpnConnectionStatusConnecting ... - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - // VpnConnectionStatusNotConnected ... - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - // VpnConnectionStatusUnknown ... - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. -func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { - return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} -} - -// VpnGatewayTunnelingProtocol enumerates the values for vpn gateway tunneling protocol. -type VpnGatewayTunnelingProtocol string - -const ( - // VpnGatewayTunnelingProtocolIkeV2 ... - VpnGatewayTunnelingProtocolIkeV2 VpnGatewayTunnelingProtocol = "IkeV2" - // VpnGatewayTunnelingProtocolOpenVPN ... - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -// PossibleVpnGatewayTunnelingProtocolValues returns an array of possible values for the VpnGatewayTunnelingProtocol const type. -func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { - return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} -} - -// VpnType enumerates the values for vpn type. -type VpnType string - -const ( - // PolicyBased ... - PolicyBased VpnType = "PolicyBased" - // RouteBased ... - RouteBased VpnType = "RouteBased" -) - -// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. -func PossibleVpnTypeValues() []VpnType { - return []VpnType{PolicyBased, RouteBased} -} - -// WebApplicationFirewallAction enumerates the values for web application firewall action. -type WebApplicationFirewallAction string - -const ( - // WebApplicationFirewallActionAllow ... - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - // WebApplicationFirewallActionBlock ... - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - // WebApplicationFirewallActionLog ... - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -// PossibleWebApplicationFirewallActionValues returns an array of possible values for the WebApplicationFirewallAction const type. -func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { - return []WebApplicationFirewallAction{WebApplicationFirewallActionAllow, WebApplicationFirewallActionBlock, WebApplicationFirewallActionLog} -} - -// WebApplicationFirewallEnabledState enumerates the values for web application firewall enabled state. -type WebApplicationFirewallEnabledState string - -const ( - // WebApplicationFirewallEnabledStateDisabled ... - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - // WebApplicationFirewallEnabledStateEnabled ... - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -// PossibleWebApplicationFirewallEnabledStateValues returns an array of possible values for the WebApplicationFirewallEnabledState const type. -func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { - return []WebApplicationFirewallEnabledState{WebApplicationFirewallEnabledStateDisabled, WebApplicationFirewallEnabledStateEnabled} -} - -// WebApplicationFirewallMatchVariable enumerates the values for web application firewall match variable. -type WebApplicationFirewallMatchVariable string - -const ( - // PostArgs ... - PostArgs WebApplicationFirewallMatchVariable = "PostArgs" - // QueryString ... - QueryString WebApplicationFirewallMatchVariable = "QueryString" - // RemoteAddr ... - RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - // RequestBody ... - RequestBody WebApplicationFirewallMatchVariable = "RequestBody" - // RequestCookies ... - RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - // RequestHeaders ... - RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - // RequestMethod ... - RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - // RequestURI ... - RequestURI WebApplicationFirewallMatchVariable = "RequestUri" -) - -// PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. -func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} -} - -// WebApplicationFirewallMode enumerates the values for web application firewall mode. -type WebApplicationFirewallMode string - -const ( - // WebApplicationFirewallModeDetection ... - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - // WebApplicationFirewallModePrevention ... - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -// PossibleWebApplicationFirewallModeValues returns an array of possible values for the WebApplicationFirewallMode const type. -func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { - return []WebApplicationFirewallMode{WebApplicationFirewallModeDetection, WebApplicationFirewallModePrevention} -} - -// WebApplicationFirewallOperator enumerates the values for web application firewall operator. -type WebApplicationFirewallOperator string - -const ( - // WebApplicationFirewallOperatorBeginsWith ... - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - // WebApplicationFirewallOperatorContains ... - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - // WebApplicationFirewallOperatorEndsWith ... - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - // WebApplicationFirewallOperatorEqual ... - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - // WebApplicationFirewallOperatorGreaterThan ... - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - // WebApplicationFirewallOperatorGreaterThanOrEqual ... - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - // WebApplicationFirewallOperatorIPMatch ... - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - // WebApplicationFirewallOperatorLessThan ... - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - // WebApplicationFirewallOperatorLessThanOrEqual ... - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - // WebApplicationFirewallOperatorRegex ... - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -// PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. -func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { - return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} -} - -// WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource -// state. -type WebApplicationFirewallPolicyResourceState string - -const ( - // WebApplicationFirewallPolicyResourceStateCreating ... - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - // WebApplicationFirewallPolicyResourceStateDeleting ... - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - // WebApplicationFirewallPolicyResourceStateDisabled ... - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - // WebApplicationFirewallPolicyResourceStateDisabling ... - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - // WebApplicationFirewallPolicyResourceStateEnabled ... - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - // WebApplicationFirewallPolicyResourceStateEnabling ... - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -// PossibleWebApplicationFirewallPolicyResourceStateValues returns an array of possible values for the WebApplicationFirewallPolicyResourceState const type. -func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { - return []WebApplicationFirewallPolicyResourceState{WebApplicationFirewallPolicyResourceStateCreating, WebApplicationFirewallPolicyResourceStateDeleting, WebApplicationFirewallPolicyResourceStateDisabled, WebApplicationFirewallPolicyResourceStateDisabling, WebApplicationFirewallPolicyResourceStateEnabled, WebApplicationFirewallPolicyResourceStateEnabling} -} - -// WebApplicationFirewallRuleType enumerates the values for web application firewall rule type. -type WebApplicationFirewallRuleType string - -const ( - // WebApplicationFirewallRuleTypeInvalid ... - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - // WebApplicationFirewallRuleTypeMatchRule ... - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" -) - -// PossibleWebApplicationFirewallRuleTypeValues returns an array of possible values for the WebApplicationFirewallRuleType const type. -func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { - return []WebApplicationFirewallRuleType{WebApplicationFirewallRuleTypeInvalid, WebApplicationFirewallRuleTypeMatchRule} -} - -// WebApplicationFirewallTransform enumerates the values for web application firewall transform. -type WebApplicationFirewallTransform string - -const ( - // HTMLEntityDecode ... - HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - // Lowercase ... - Lowercase WebApplicationFirewallTransform = "Lowercase" - // RemoveNulls ... - RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - // Trim ... - Trim WebApplicationFirewallTransform = "Trim" - // URLDecode ... - URLDecode WebApplicationFirewallTransform = "UrlDecode" - // URLEncode ... - URLEncode WebApplicationFirewallTransform = "UrlEncode" -) - -// PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. -func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, URLDecode, URLEncode} -} - -// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the -// virtual network. +// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the virtual +// network. type AddressSpace struct { // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` @@ -2246,8 +294,7 @@ type ApplicationGatewayAutoscaleConfiguration struct { MaxCapacity *int32 `json:"maxCapacity,omitempty"` } -// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service -// call. +// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service call. type ApplicationGatewayAvailableSslOptions struct { autorest.Response `json:"-"` *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` @@ -2350,8 +397,7 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e return nil } -// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of -// ApplicationGatewayAvailableSslOptions +// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of ApplicationGatewayAvailableSslOptions type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { // PredefinedPolicies - List of available Ssl predefined policy. PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` @@ -2442,10 +488,15 @@ func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { return agaspp.Value == nil || len(*agaspp.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { + return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 +} + // applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - if agaspp.NextLink == nil || len(to.String(agaspp.NextLink)) < 1 { + if !agaspp.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2474,11 +525,16 @@ func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.agaspp) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.agaspp) + if err != nil { + return err + } + page.agaspp = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.agaspp = next return nil } @@ -2512,8 +568,8 @@ func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(getNextPage func(co return ApplicationGatewayAvailableSslPredefinedPoliciesPage{fn: getNextPage} } -// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API -// service call. +// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API service +// call. type ApplicationGatewayAvailableWafRuleSetsResult struct { autorest.Response `json:"-"` // Value - The list of application gateway rule sets. @@ -2622,8 +678,8 @@ func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) er return nil } -// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an -// application gateway. +// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an application +// gateway. type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { // BackendIPConfigurations - Collection of references to IPs defined in network interfaces. BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` @@ -2794,8 +850,8 @@ type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to -// be active for a specified time after the backend server got removed from the configuration. +// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to be +// active for a specified time after the backend server got removed from the configuration. type ApplicationGatewayConnectionDraining struct { // Enabled - Whether connection draining is enabled or not. Enabled *bool `json:"enabled,omitempty"` @@ -2811,8 +867,8 @@ type ApplicationGatewayCustomError struct { CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` } -// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire -// rule group. +// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire rule +// group. type ApplicationGatewayFirewallDisabledRuleGroup struct { // RuleGroupName - The name of the rule group that will be disabled. RuleGroupName *string `json:"ruleGroupName,omitempty"` @@ -2820,8 +876,7 @@ type ApplicationGatewayFirewallDisabledRuleGroup struct { Rules *[]int32 `json:"rules,omitempty"` } -// ApplicationGatewayFirewallExclusion allow to exclude some variable satisfy the condition for the WAF -// check +// ApplicationGatewayFirewallExclusion allow to exclude some variable satisfy the condition for the WAF check type ApplicationGatewayFirewallExclusion struct { // MatchVariable - The variable to be excluded. MatchVariable *string `json:"matchVariable,omitempty"` @@ -3391,8 +1446,7 @@ func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error return nil } -// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application -// gateway. +// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application gateway. type ApplicationGatewayIPConfigurationPropertiesFormat struct { // Subnet - Reference of the subnet resource. A subnet from where application gateway gets its private address. Subnet *SubResource `json:"subnet,omitempty"` @@ -3477,10 +1531,15 @@ func (aglr ApplicationGatewayListResult) IsEmpty() bool { return aglr.Value == nil || len(*aglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aglr ApplicationGatewayListResult) hasNextLink() bool { + return aglr.NextLink != nil && len(*aglr.NextLink) != 0 +} + // applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if aglr.NextLink == nil || len(to.String(aglr.NextLink)) < 1 { + if !aglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3508,11 +1567,16 @@ func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aglr) + if err != nil { + return err + } + page.aglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aglr = next return nil } @@ -3836,6 +1900,84 @@ type ApplicationGatewayPropertiesFormat struct { CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. +func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agpf.Sku != nil { + objectMap["sku"] = agpf.Sku + } + if agpf.SslPolicy != nil { + objectMap["sslPolicy"] = agpf.SslPolicy + } + if agpf.GatewayIPConfigurations != nil { + objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations + } + if agpf.AuthenticationCertificates != nil { + objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates + } + if agpf.TrustedRootCertificates != nil { + objectMap["trustedRootCertificates"] = agpf.TrustedRootCertificates + } + if agpf.SslCertificates != nil { + objectMap["sslCertificates"] = agpf.SslCertificates + } + if agpf.FrontendIPConfigurations != nil { + objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations + } + if agpf.FrontendPorts != nil { + objectMap["frontendPorts"] = agpf.FrontendPorts + } + if agpf.Probes != nil { + objectMap["probes"] = agpf.Probes + } + if agpf.BackendAddressPools != nil { + objectMap["backendAddressPools"] = agpf.BackendAddressPools + } + if agpf.BackendHTTPSettingsCollection != nil { + objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection + } + if agpf.HTTPListeners != nil { + objectMap["httpListeners"] = agpf.HTTPListeners + } + if agpf.URLPathMaps != nil { + objectMap["urlPathMaps"] = agpf.URLPathMaps + } + if agpf.RequestRoutingRules != nil { + objectMap["requestRoutingRules"] = agpf.RequestRoutingRules + } + if agpf.RewriteRuleSets != nil { + objectMap["rewriteRuleSets"] = agpf.RewriteRuleSets + } + if agpf.RedirectConfigurations != nil { + objectMap["redirectConfigurations"] = agpf.RedirectConfigurations + } + if agpf.WebApplicationFirewallConfiguration != nil { + objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration + } + if agpf.FirewallPolicy != nil { + objectMap["firewallPolicy"] = agpf.FirewallPolicy + } + if agpf.EnableHTTP2 != nil { + objectMap["enableHttp2"] = agpf.EnableHTTP2 + } + if agpf.EnableFips != nil { + objectMap["enableFips"] = agpf.EnableFips + } + if agpf.AutoscaleConfiguration != nil { + objectMap["autoscaleConfiguration"] = agpf.AutoscaleConfiguration + } + if agpf.ResourceGUID != nil { + objectMap["resourceGuid"] = agpf.ResourceGUID + } + if agpf.ProvisioningState != nil { + objectMap["provisioningState"] = agpf.ProvisioningState + } + if agpf.CustomErrorConfigurations != nil { + objectMap["customErrorConfigurations"] = agpf.CustomErrorConfigurations + } + return json.Marshal(objectMap) +} + // ApplicationGatewayRedirectConfiguration redirect configuration of an application gateway. type ApplicationGatewayRedirectConfiguration struct { *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` @@ -4045,8 +2187,8 @@ func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) er return nil } -// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the -// application gateway. +// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the application +// gateway. type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` @@ -4175,8 +2317,7 @@ func (agrrs *ApplicationGatewayRewriteRuleSet) UnmarshalJSON(body []byte) error return nil } -// ApplicationGatewayRewriteRuleSetPropertiesFormat properties of rewrite rule set of the application -// gateway. +// ApplicationGatewayRewriteRuleSetPropertiesFormat properties of rewrite rule set of the application gateway. type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { // RewriteRules - Rewrite rules in the rewrite rule set. RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` @@ -4184,6 +2325,15 @@ type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ApplicationGatewayRewriteRuleSetPropertiesFormat. +func (agrrspf ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agrrspf.RewriteRules != nil { + objectMap["rewriteRules"] = agrrspf.RewriteRules + } + return json.Marshal(objectMap) +} + // ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ApplicationGatewaysBackendHealthFuture struct { @@ -4242,8 +2392,8 @@ func (future *ApplicationGatewaysCreateOrUpdateFuture) Result(client Application return } -// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ApplicationGatewaysDeleteFuture struct { azure.Future } @@ -4369,8 +2519,7 @@ func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { return nil } -// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application -// gateway. +// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application gateway. type ApplicationGatewaySslCertificatePropertiesFormat struct { // Data - Base-64 encoded pfx certificate. Only applicable in PUT Request. Data *string `json:"data,omitempty"` @@ -4465,8 +2614,7 @@ func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) e return nil } -// ApplicationGatewaySslPredefinedPolicyPropertiesFormat properties of -// ApplicationGatewaySslPredefinedPolicy +// ApplicationGatewaySslPredefinedPolicyPropertiesFormat properties of ApplicationGatewaySslPredefinedPolicy type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { // CipherSuites - Ssl cipher suites to be enabled in the specified order for application gateway. CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` @@ -4474,8 +2622,8 @@ type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } -// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ApplicationGatewaysStartFuture struct { azure.Future } @@ -4914,8 +3062,17 @@ type ApplicationSecurityGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ApplicationSecurityGroupListResultIterator provides access to a complete listing of -// ApplicationSecurityGroup values. +// MarshalJSON is the custom marshaler for ApplicationSecurityGroupListResult. +func (asglr ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asglr.Value != nil { + objectMap["value"] = asglr.Value + } + return json.Marshal(objectMap) +} + +// ApplicationSecurityGroupListResultIterator provides access to a complete listing of ApplicationSecurityGroup +// values. type ApplicationSecurityGroupListResultIterator struct { i int page ApplicationSecurityGroupListResultPage @@ -4983,10 +3140,15 @@ func (asglr ApplicationSecurityGroupListResult) IsEmpty() bool { return asglr.Value == nil || len(*asglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (asglr ApplicationSecurityGroupListResult) hasNextLink() bool { + return asglr.NextLink != nil && len(*asglr.NextLink) != 0 +} + // applicationSecurityGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (asglr ApplicationSecurityGroupListResult) applicationSecurityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if asglr.NextLink == nil || len(to.String(asglr.NextLink)) < 1 { + if !asglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5014,11 +3176,16 @@ func (page *ApplicationSecurityGroupListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.asglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.asglr) + if err != nil { + return err + } + page.asglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.asglr = next return nil } @@ -5060,8 +3227,8 @@ type ApplicationSecurityGroupPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ApplicationSecurityGroupsCreateOrUpdateFuture struct { azure.Future } @@ -5141,8 +3308,8 @@ func (future *ApplicationSecurityGroupsUpdateTagsFuture) Result(client Applicati return } -// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations -// that belongs to an ExpressRouteCircuit. +// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations that +// belongs to an ExpressRouteCircuit. type AuthorizationListResult struct { autorest.Response `json:"-"` // Value - The authorizations in an ExpressRoute Circuit. @@ -5151,8 +3318,8 @@ type AuthorizationListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// AuthorizationListResultIterator provides access to a complete listing of -// ExpressRouteCircuitAuthorization values. +// AuthorizationListResultIterator provides access to a complete listing of ExpressRouteCircuitAuthorization +// values. type AuthorizationListResultIterator struct { i int page AuthorizationListResultPage @@ -5220,10 +3387,15 @@ func (alr AuthorizationListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (alr AuthorizationListResult) hasNextLink() bool { + return alr.NextLink != nil && len(*alr.NextLink) != 0 +} + // authorizationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { - if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + if !alr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5251,11 +3423,16 @@ func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.alr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.alr = next return nil } @@ -5309,8 +3486,7 @@ type Availability struct { BlobDuration *string `json:"blobDuration,omitempty"` } -// AvailableDelegation the serviceName of an AvailableDelegation indicates a possible delegation for a -// subnet. +// AvailableDelegation the serviceName of an AvailableDelegation indicates a possible delegation for a subnet. type AvailableDelegation struct { // Name - The name of the AvailableDelegation resource. Name *string `json:"name,omitempty"` @@ -5333,6 +3509,15 @@ type AvailableDelegationsResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for AvailableDelegationsResult. +func (adr AvailableDelegationsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adr.Value != nil { + objectMap["value"] = adr.Value + } + return json.Marshal(objectMap) +} + // AvailableDelegationsResultIterator provides access to a complete listing of AvailableDelegation values. type AvailableDelegationsResultIterator struct { i int @@ -5401,10 +3586,15 @@ func (adr AvailableDelegationsResult) IsEmpty() bool { return adr.Value == nil || len(*adr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (adr AvailableDelegationsResult) hasNextLink() bool { + return adr.NextLink != nil && len(*adr.NextLink) != 0 +} + // availableDelegationsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (adr AvailableDelegationsResult) availableDelegationsResultPreparer(ctx context.Context) (*http.Request, error) { - if adr.NextLink == nil || len(to.String(adr.NextLink)) < 1 { + if !adr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5432,11 +3622,16 @@ func (page *AvailableDelegationsResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.adr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.adr) + if err != nil { + return err + } + page.adr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.adr = next return nil } @@ -5519,11 +3714,11 @@ type AvailableProvidersListState struct { } // AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, -// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct -// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous -// operation succeeded, the response body includes the HTTP status code for the successful request. If the -// asynchronous operation failed, the response body includes the HTTP status code for the failed request -// and error information regarding the failure. +// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from +// the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation +// succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous +// operation failed, the response body includes the HTTP status code for the failed request and error +// information regarding the failure. type AzureAsyncOperationResult struct { // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed' Status OperationStatus `json:"status,omitempty"` @@ -5879,8 +4074,7 @@ type AzureFirewallFqdnTagListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// AzureFirewallFqdnTagListResultIterator provides access to a complete listing of AzureFirewallFqdnTag -// values. +// AzureFirewallFqdnTagListResultIterator provides access to a complete listing of AzureFirewallFqdnTag values. type AzureFirewallFqdnTagListResultIterator struct { i int page AzureFirewallFqdnTagListResultPage @@ -5948,10 +4142,15 @@ func (afftlr AzureFirewallFqdnTagListResult) IsEmpty() bool { return afftlr.Value == nil || len(*afftlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (afftlr AzureFirewallFqdnTagListResult) hasNextLink() bool { + return afftlr.NextLink != nil && len(*afftlr.NextLink) != 0 +} + // azureFirewallFqdnTagListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (afftlr AzureFirewallFqdnTagListResult) azureFirewallFqdnTagListResultPreparer(ctx context.Context) (*http.Request, error) { - if afftlr.NextLink == nil || len(to.String(afftlr.NextLink)) < 1 { + if !afftlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -5979,11 +4178,16 @@ func (page *AzureFirewallFqdnTagListResultPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.afftlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.afftlr) + if err != nil { + return err + } + page.afftlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.afftlr = next return nil } @@ -6114,6 +4318,21 @@ type AzureFirewallIPConfigurationPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for AzureFirewallIPConfigurationPropertiesFormat. +func (aficpf AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aficpf.Subnet != nil { + objectMap["subnet"] = aficpf.Subnet + } + if aficpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = aficpf.PublicIPAddress + } + if aficpf.ProvisioningState != "" { + objectMap["provisioningState"] = aficpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // AzureFirewallListResult response for ListAzureFirewalls API service call. type AzureFirewallListResult struct { autorest.Response `json:"-"` @@ -6191,10 +4410,15 @@ func (aflr AzureFirewallListResult) IsEmpty() bool { return aflr.Value == nil || len(*aflr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (aflr AzureFirewallListResult) hasNextLink() bool { + return aflr.NextLink != nil && len(*aflr.NextLink) != 0 +} + // azureFirewallListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (aflr AzureFirewallListResult) azureFirewallListResultPreparer(ctx context.Context) (*http.Request, error) { - if aflr.NextLink == nil || len(to.String(aflr.NextLink)) < 1 { + if !aflr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6222,11 +4446,16 @@ func (page *AzureFirewallListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.aflr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.aflr) + if err != nil { + return err + } + page.aflr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.aflr = next return nil } @@ -6701,6 +4930,15 @@ type BackendAddressPoolPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. +func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bappf.ProvisioningState != nil { + objectMap["provisioningState"] = bappf.ProvisioningState + } + return json.Marshal(objectMap) +} + // BGPCommunity contains bgp community information offered in Service Community resources. type BGPCommunity struct { // ServiceSupportedRegion - The region which the service support. e.g. For O365, region is Global. @@ -6855,8 +5093,7 @@ type BgpServiceCommunityListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity -// values. +// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity values. type BgpServiceCommunityListResultIterator struct { i int page BgpServiceCommunityListResultPage @@ -6924,10 +5161,15 @@ func (bsclr BgpServiceCommunityListResult) IsEmpty() bool { return bsclr.Value == nil || len(*bsclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (bsclr BgpServiceCommunityListResult) hasNextLink() bool { + return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0 +} + // bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) { - if bsclr.NextLink == nil || len(to.String(bsclr.NextLink)) < 1 { + if !bsclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -6955,11 +5197,16 @@ func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.bsclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.bsclr) + if err != nil { + return err + } + page.bsclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.bsclr = next return nil } @@ -7327,8 +5574,8 @@ func (future *ConnectionMonitorsCreateOrUpdateFuture) Result(client ConnectionMo return } -// ConnectionMonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ConnectionMonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ConnectionMonitorsDeleteFuture struct { azure.Future } @@ -7473,6 +5720,39 @@ type ConnectionStateSnapshot struct { Hops *[]ConnectivityHop `json:"hops,omitempty"` } +// MarshalJSON is the custom marshaler for ConnectionStateSnapshot. +func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if CSS.ConnectionState != "" { + objectMap["connectionState"] = CSS.ConnectionState + } + if CSS.StartTime != nil { + objectMap["startTime"] = CSS.StartTime + } + if CSS.EndTime != nil { + objectMap["endTime"] = CSS.EndTime + } + if CSS.EvaluationState != "" { + objectMap["evaluationState"] = CSS.EvaluationState + } + if CSS.AvgLatencyInMs != nil { + objectMap["avgLatencyInMs"] = CSS.AvgLatencyInMs + } + if CSS.MinLatencyInMs != nil { + objectMap["minLatencyInMs"] = CSS.MinLatencyInMs + } + if CSS.MaxLatencyInMs != nil { + objectMap["maxLatencyInMs"] = CSS.MaxLatencyInMs + } + if CSS.ProbesSent != nil { + objectMap["probesSent"] = CSS.ProbesSent + } + if CSS.ProbesFailed != nil { + objectMap["probesFailed"] = CSS.ProbesFailed + } + return json.Marshal(objectMap) +} + // ConnectivityDestination parameters that define destination of connection. type ConnectivityDestination struct { // ResourceID - The ID of the resource to which a connection attempt will be made. @@ -7737,8 +6017,7 @@ func (cnic *ContainerNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) e return nil } -// ContainerNetworkInterfaceConfigurationPropertiesFormat container network interface configuration -// properties. +// ContainerNetworkInterfaceConfigurationPropertiesFormat container network interface configuration properties. type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { // IPConfigurations - A list of ip configurations of the container network interface configuration. IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"` @@ -7748,6 +6027,18 @@ type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceConfigurationPropertiesFormat. +func (cnicpf ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cnicpf.IPConfigurations != nil { + objectMap["ipConfigurations"] = cnicpf.IPConfigurations + } + if cnicpf.ContainerNetworkInterfaces != nil { + objectMap["containerNetworkInterfaces"] = cnicpf.ContainerNetworkInterfaces + } + return json.Marshal(objectMap) +} + // ContainerNetworkInterfaceIPConfiguration the ip configuration for a container network interface. type ContainerNetworkInterfaceIPConfiguration struct { // ContainerNetworkInterfaceIPConfigurationPropertiesFormat - Properties of the container network interface IP configuration. @@ -7826,8 +6117,8 @@ func (cniic *ContainerNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte return nil } -// ContainerNetworkInterfaceIPConfigurationPropertiesFormat properties of the container network interface -// IP configuration. +// ContainerNetworkInterfaceIPConfigurationPropertiesFormat properties of the container network interface IP +// configuration. type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { // ProvisioningState - READ-ONLY; The provisioning state of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` @@ -7845,6 +6136,21 @@ type ContainerNetworkInterfacePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ContainerNetworkInterfacePropertiesFormat. +func (cnipf ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cnipf.ContainerNetworkInterfaceConfiguration != nil { + objectMap["containerNetworkInterfaceConfiguration"] = cnipf.ContainerNetworkInterfaceConfiguration + } + if cnipf.Container != nil { + objectMap["container"] = cnipf.Container + } + if cnipf.IPConfigurations != nil { + objectMap["ipConfigurations"] = cnipf.IPConfigurations + } + return json.Marshal(objectMap) +} + // DdosCustomPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DdosCustomPoliciesCreateOrUpdateFuture struct { @@ -7874,8 +6180,8 @@ func (future *DdosCustomPoliciesCreateOrUpdateFuture) Result(client DdosCustomPo return } -// DdosCustomPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DdosCustomPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DdosCustomPoliciesDeleteFuture struct { azure.Future } @@ -8053,6 +6359,15 @@ type DdosCustomPolicyPropertiesFormat struct { ProtocolCustomSettings *[]ProtocolCustomSettingsFormat `json:"protocolCustomSettings,omitempty"` } +// MarshalJSON is the custom marshaler for DdosCustomPolicyPropertiesFormat. +func (dcppf DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcppf.ProtocolCustomSettings != nil { + objectMap["protocolCustomSettings"] = dcppf.ProtocolCustomSettings + } + return json.Marshal(objectMap) +} + // DdosProtectionPlan a DDoS protection plan in a resource group. type DdosProtectionPlan struct { autorest.Response `json:"-"` @@ -8174,6 +6489,15 @@ type DdosProtectionPlanListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for DdosProtectionPlanListResult. +func (dpplr DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpplr.Value != nil { + objectMap["value"] = dpplr.Value + } + return json.Marshal(objectMap) +} + // DdosProtectionPlanListResultIterator provides access to a complete listing of DdosProtectionPlan values. type DdosProtectionPlanListResultIterator struct { i int @@ -8242,10 +6566,15 @@ func (dpplr DdosProtectionPlanListResult) IsEmpty() bool { return dpplr.Value == nil || len(*dpplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dpplr DdosProtectionPlanListResult) hasNextLink() bool { + return dpplr.NextLink != nil && len(*dpplr.NextLink) != 0 +} + // ddosProtectionPlanListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dpplr DdosProtectionPlanListResult) ddosProtectionPlanListResultPreparer(ctx context.Context) (*http.Request, error) { - if dpplr.NextLink == nil || len(to.String(dpplr.NextLink)) < 1 { + if !dpplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8273,11 +6602,16 @@ func (page *DdosProtectionPlanListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dpplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dpplr) + if err != nil { + return err + } + page.dpplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dpplr = next return nil } @@ -8350,8 +6684,8 @@ func (future *DdosProtectionPlansCreateOrUpdateFuture) Result(client DdosProtect return } -// DdosProtectionPlansDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DdosProtectionPlansDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DdosProtectionPlansDeleteFuture struct { azure.Future } @@ -8501,8 +6835,8 @@ type DeviceProperties struct { LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` } -// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual -// network. Standard DHCP option for a subnet overrides VNET DHCP options. +// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. +// Standard DHCP option for a subnet overrides VNET DHCP options. type DhcpOptions struct { // DNSServers - The list of DNS servers IP addresses. DNSServers *[]string `json:"dnsServers,omitempty"` @@ -8573,6 +6907,15 @@ type EffectiveNetworkSecurityGroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroupListResult. +func (ensglr EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ensglr.Value != nil { + objectMap["value"] = ensglr.Value + } + return json.Marshal(objectMap) +} + // EffectiveNetworkSecurityRule effective network security rules. type EffectiveNetworkSecurityRule struct { // Name - The name of the security rule specified by the user (if created by the user). @@ -8632,6 +6975,15 @@ type EffectiveRouteListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EffectiveRouteListResult. +func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erlr.Value != nil { + objectMap["value"] = erlr.Value + } + return json.Marshal(objectMap) +} + // EndpointService identifies the service being brought into the virtual network. type EndpointService struct { // ID - A unique identifier of the service being referenced by the interface endpoint. @@ -8648,6 +7000,15 @@ type EndpointServiceResult struct { ID *string `json:"id,omitempty"` } +// MarshalJSON is the custom marshaler for EndpointServiceResult. +func (esr EndpointServiceResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esr.ID != nil { + objectMap["id"] = esr.ID + } + return json.Marshal(objectMap) +} + // EndpointServicesListResult response for the ListAvailableEndpointServices API service call. type EndpointServicesListResult struct { autorest.Response `json:"-"` @@ -8657,8 +7018,7 @@ type EndpointServicesListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// EndpointServicesListResultIterator provides access to a complete listing of EndpointServiceResult -// values. +// EndpointServicesListResultIterator provides access to a complete listing of EndpointServiceResult values. type EndpointServicesListResultIterator struct { i int page EndpointServicesListResultPage @@ -8726,10 +7086,15 @@ func (eslr EndpointServicesListResult) IsEmpty() bool { return eslr.Value == nil || len(*eslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (eslr EndpointServicesListResult) hasNextLink() bool { + return eslr.NextLink != nil && len(*eslr.NextLink) != 0 +} + // endpointServicesListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (eslr EndpointServicesListResult) endpointServicesListResultPreparer(ctx context.Context) (*http.Request, error) { - if eslr.NextLink == nil || len(to.String(eslr.NextLink)) < 1 { + if !eslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -8757,11 +7122,16 @@ func (page *EndpointServicesListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.eslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.eslr) + if err != nil { + return err + } + page.eslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.eslr = next return nil } @@ -8827,6 +7197,21 @@ type EvaluatedNetworkSecurityGroup struct { RulesEvaluationResult *[]SecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"` } +// MarshalJSON is the custom marshaler for EvaluatedNetworkSecurityGroup. +func (ensg EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ensg.NetworkSecurityGroupID != nil { + objectMap["networkSecurityGroupId"] = ensg.NetworkSecurityGroupID + } + if ensg.AppliedTo != nil { + objectMap["appliedTo"] = ensg.AppliedTo + } + if ensg.MatchedRule != nil { + objectMap["matchedRule"] = ensg.MatchedRule + } + return json.Marshal(objectMap) +} + // ExpressRouteCircuit expressRouteCircuit resource type ExpressRouteCircuit struct { autorest.Response `json:"-"` @@ -9074,8 +7459,8 @@ func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) Result(clie return } -// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCircuitAuthorizationsDeleteFuture struct { azure.Future } @@ -9097,8 +7482,7 @@ func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) Result(client Expre return } -// ExpressRouteCircuitConnection express Route Circuit Connection in an ExpressRouteCircuitPeering -// resource. +// ExpressRouteCircuitConnection express Route Circuit Connection in an ExpressRouteCircuitPeering resource. type ExpressRouteCircuitConnection struct { autorest.Response `json:"-"` *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` @@ -9176,8 +7560,8 @@ func (ercc *ExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error { return nil } -// ExpressRouteCircuitConnectionListResult response for ListConnections API service call retrieves all -// global reach connections that belongs to a Private Peering for an ExpressRouteCircuit. +// ExpressRouteCircuitConnectionListResult response for ListConnections API service call retrieves all global +// reach connections that belongs to a Private Peering for an ExpressRouteCircuit. type ExpressRouteCircuitConnectionListResult struct { autorest.Response `json:"-"` // Value - The global reach connection associated with Private Peering in an ExpressRoute Circuit. @@ -9255,10 +7639,15 @@ func (ercclr ExpressRouteCircuitConnectionListResult) IsEmpty() bool { return ercclr.Value == nil || len(*ercclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ercclr ExpressRouteCircuitConnectionListResult) hasNextLink() bool { + return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 +} + // expressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ercclr ExpressRouteCircuitConnectionListResult) expressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if ercclr.NextLink == nil || len(to.String(ercclr.NextLink)) < 1 { + if !ercclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9286,11 +7675,16 @@ func (page *ExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ercclr) + if err != nil { + return err + } + page.ercclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ercclr = next return nil } @@ -9340,8 +7734,26 @@ type ExpressRouteCircuitConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ExpressRouteCircuitConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnectionPropertiesFormat. +func (erccpf ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccpf.ExpressRouteCircuitPeering != nil { + objectMap["expressRouteCircuitPeering"] = erccpf.ExpressRouteCircuitPeering + } + if erccpf.PeerExpressRouteCircuitPeering != nil { + objectMap["peerExpressRouteCircuitPeering"] = erccpf.PeerExpressRouteCircuitPeering + } + if erccpf.AddressPrefix != nil { + objectMap["addressPrefix"] = erccpf.AddressPrefix + } + if erccpf.AuthorizationKey != nil { + objectMap["authorizationKey"] = erccpf.AuthorizationKey + } + return json.Marshal(objectMap) +} + +// ExpressRouteCircuitConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type ExpressRouteCircuitConnectionsCreateOrUpdateFuture struct { azure.Future } @@ -9401,8 +7813,7 @@ type ExpressRouteCircuitListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit -// values. +// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit values. type ExpressRouteCircuitListResultIterator struct { i int page ExpressRouteCircuitListResultPage @@ -9470,10 +7881,15 @@ func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { return erclr.Value == nil || len(*erclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { + return erclr.NextLink != nil && len(*erclr.NextLink) != 0 +} + // expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { - if erclr.NextLink == nil || len(to.String(erclr.NextLink)) < 1 { + if !erclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9501,11 +7917,16 @@ func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erclr) + if err != nil { + return err + } + page.erclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erclr = next return nil } @@ -9639,8 +8060,8 @@ type ExpressRouteCircuitPeeringID struct { ID *string `json:"id,omitempty"` } -// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings -// that belong to an ExpressRouteCircuit. +// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings that +// belong to an ExpressRouteCircuit. type ExpressRouteCircuitPeeringListResult struct { autorest.Response `json:"-"` // Value - The peerings in an express route circuit. @@ -9718,10 +8139,15 @@ func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { return ercplr.Value == nil || len(*ercplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { + return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 +} + // expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if ercplr.NextLink == nil || len(to.String(ercplr.NextLink)) < 1 { + if !ercplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -9749,11 +8175,16 @@ func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ercplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ercplr) + if err != nil { + return err + } + page.ercplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ercplr = next return nil } @@ -9831,8 +8262,71 @@ type ExpressRouteCircuitPeeringPropertiesFormat struct { PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` } -// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeeringPropertiesFormat. +func (ercppf ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercppf.PeeringType != "" { + objectMap["peeringType"] = ercppf.PeeringType + } + if ercppf.State != "" { + objectMap["state"] = ercppf.State + } + if ercppf.AzureASN != nil { + objectMap["azureASN"] = ercppf.AzureASN + } + if ercppf.PeerASN != nil { + objectMap["peerASN"] = ercppf.PeerASN + } + if ercppf.PrimaryPeerAddressPrefix != nil { + objectMap["primaryPeerAddressPrefix"] = ercppf.PrimaryPeerAddressPrefix + } + if ercppf.SecondaryPeerAddressPrefix != nil { + objectMap["secondaryPeerAddressPrefix"] = ercppf.SecondaryPeerAddressPrefix + } + if ercppf.PrimaryAzurePort != nil { + objectMap["primaryAzurePort"] = ercppf.PrimaryAzurePort + } + if ercppf.SecondaryAzurePort != nil { + objectMap["secondaryAzurePort"] = ercppf.SecondaryAzurePort + } + if ercppf.SharedKey != nil { + objectMap["sharedKey"] = ercppf.SharedKey + } + if ercppf.VlanID != nil { + objectMap["vlanId"] = ercppf.VlanID + } + if ercppf.MicrosoftPeeringConfig != nil { + objectMap["microsoftPeeringConfig"] = ercppf.MicrosoftPeeringConfig + } + if ercppf.Stats != nil { + objectMap["stats"] = ercppf.Stats + } + if ercppf.ProvisioningState != nil { + objectMap["provisioningState"] = ercppf.ProvisioningState + } + if ercppf.GatewayManagerEtag != nil { + objectMap["gatewayManagerEtag"] = ercppf.GatewayManagerEtag + } + if ercppf.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = ercppf.LastModifiedBy + } + if ercppf.RouteFilter != nil { + objectMap["routeFilter"] = ercppf.RouteFilter + } + if ercppf.Ipv6PeeringConfig != nil { + objectMap["ipv6PeeringConfig"] = ercppf.Ipv6PeeringConfig + } + if ercppf.ExpressRouteConnection != nil { + objectMap["expressRouteConnection"] = ercppf.ExpressRouteConnection + } + if ercppf.Connections != nil { + objectMap["connections"] = ercppf.Connections + } + return json.Marshal(objectMap) +} + +// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { azure.Future } @@ -9917,6 +8411,54 @@ type ExpressRouteCircuitPropertiesFormat struct { GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCircuitPropertiesFormat. +func (ercpf ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercpf.AllowClassicOperations != nil { + objectMap["allowClassicOperations"] = ercpf.AllowClassicOperations + } + if ercpf.CircuitProvisioningState != nil { + objectMap["circuitProvisioningState"] = ercpf.CircuitProvisioningState + } + if ercpf.ServiceProviderProvisioningState != "" { + objectMap["serviceProviderProvisioningState"] = ercpf.ServiceProviderProvisioningState + } + if ercpf.Authorizations != nil { + objectMap["authorizations"] = ercpf.Authorizations + } + if ercpf.Peerings != nil { + objectMap["peerings"] = ercpf.Peerings + } + if ercpf.ServiceKey != nil { + objectMap["serviceKey"] = ercpf.ServiceKey + } + if ercpf.ServiceProviderNotes != nil { + objectMap["serviceProviderNotes"] = ercpf.ServiceProviderNotes + } + if ercpf.ServiceProviderProperties != nil { + objectMap["serviceProviderProperties"] = ercpf.ServiceProviderProperties + } + if ercpf.ExpressRoutePort != nil { + objectMap["expressRoutePort"] = ercpf.ExpressRoutePort + } + if ercpf.BandwidthInGbps != nil { + objectMap["bandwidthInGbps"] = ercpf.BandwidthInGbps + } + if ercpf.ProvisioningState != nil { + objectMap["provisioningState"] = ercpf.ProvisioningState + } + if ercpf.GatewayManagerEtag != nil { + objectMap["gatewayManagerEtag"] = ercpf.GatewayManagerEtag + } + if ercpf.AllowGlobalReach != nil { + objectMap["allowGlobalReach"] = ercpf.AllowGlobalReach + } + if ercpf.GlobalReachEnabled != nil { + objectMap["globalReachEnabled"] = ercpf.GlobalReachEnabled + } + return json.Marshal(objectMap) +} + // ExpressRouteCircuitReference ... type ExpressRouteCircuitReference struct { // ID - Corresponding Express Route Circuit Id. @@ -9951,8 +8493,8 @@ type ExpressRouteCircuitRoutesTableSummary struct { StatePfxRcd *string `json:"statePfxRcd,omitempty"` } -// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route -// Circuits API. +// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route Circuits +// API. type ExpressRouteCircuitsArpTableListResult struct { autorest.Response `json:"-"` // Value - Gets list of the ARP table. @@ -9990,8 +8532,8 @@ func (future *ExpressRouteCircuitsCreateOrUpdateFuture) Result(client ExpressRou return } -// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ExpressRouteCircuitsDeleteFuture struct { azure.Future } @@ -10013,8 +8555,7 @@ func (future *ExpressRouteCircuitsDeleteFuture) Result(client ExpressRouteCircui return } -// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an -// ExpressRouteCircuit. +// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an ExpressRouteCircuit. type ExpressRouteCircuitServiceProviderProperties struct { // ServiceProviderName - The serviceProviderName. ServiceProviderName *string `json:"serviceProviderName,omitempty"` @@ -10092,8 +8633,8 @@ func (future *ExpressRouteCircuitsListRoutesTableFuture) Result(client ExpressRo return } -// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { azure.Future } @@ -10131,8 +8672,8 @@ type ExpressRouteCircuitsRoutesTableListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the -// Express Route Circuits API. +// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the Express +// Route Circuits API. type ExpressRouteCircuitsRoutesTableSummaryListResult struct { autorest.Response `json:"-"` // Value - A list of the routes table. @@ -10275,8 +8816,23 @@ type ExpressRouteConnectionProperties struct { RoutingWeight *int32 `json:"routingWeight,omitempty"` } -// ExpressRouteConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// MarshalJSON is the custom marshaler for ExpressRouteConnectionProperties. +func (ercp ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercp.ExpressRouteCircuitPeering != nil { + objectMap["expressRouteCircuitPeering"] = ercp.ExpressRouteCircuitPeering + } + if ercp.AuthorizationKey != nil { + objectMap["authorizationKey"] = ercp.AuthorizationKey + } + if ercp.RoutingWeight != nil { + objectMap["routingWeight"] = ercp.RoutingWeight + } + return json.Marshal(objectMap) +} + +// ExpressRouteConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteConnectionsCreateOrUpdateFuture struct { azure.Future } @@ -10450,6 +9006,15 @@ type ExpressRouteCrossConnectionListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionListResult. +func (ercclr ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ercclr.Value != nil { + objectMap["value"] = ercclr.Value + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionListResultIterator provides access to a complete listing of // ExpressRouteCrossConnection values. type ExpressRouteCrossConnectionListResultIterator struct { @@ -10519,10 +9084,15 @@ func (ercclr ExpressRouteCrossConnectionListResult) IsEmpty() bool { return ercclr.Value == nil || len(*ercclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ercclr ExpressRouteCrossConnectionListResult) hasNextLink() bool { + return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 +} + // expressRouteCrossConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ercclr ExpressRouteCrossConnectionListResult) expressRouteCrossConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if ercclr.NextLink == nil || len(to.String(ercclr.NextLink)) < 1 { + if !ercclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10550,11 +9120,16 @@ func (page *ExpressRouteCrossConnectionListResultPage) NextWithContext(ctx conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ercclr) + if err != nil { + return err + } + page.ercclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ercclr = next return nil } @@ -10666,8 +9241,8 @@ func (erccp *ExpressRouteCrossConnectionPeering) UnmarshalJSON(body []byte) erro return nil } -// ExpressRouteCrossConnectionPeeringList response for ListPeering API service call retrieves all peerings -// that belong to an ExpressRouteCrossConnection. +// ExpressRouteCrossConnectionPeeringList response for ListPeering API service call retrieves all peerings that +// belong to an ExpressRouteCrossConnection. type ExpressRouteCrossConnectionPeeringList struct { autorest.Response `json:"-"` // Value - The peerings in an express route cross connection. @@ -10676,6 +9251,15 @@ type ExpressRouteCrossConnectionPeeringList struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringList. +func (erccpl ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccpl.Value != nil { + objectMap["value"] = erccpl.Value + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionPeeringListIterator provides access to a complete listing of // ExpressRouteCrossConnectionPeering values. type ExpressRouteCrossConnectionPeeringListIterator struct { @@ -10745,10 +9329,15 @@ func (erccpl ExpressRouteCrossConnectionPeeringList) IsEmpty() bool { return erccpl.Value == nil || len(*erccpl.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erccpl ExpressRouteCrossConnectionPeeringList) hasNextLink() bool { + return erccpl.NextLink != nil && len(*erccpl.NextLink) != 0 +} + // expressRouteCrossConnectionPeeringListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erccpl ExpressRouteCrossConnectionPeeringList) expressRouteCrossConnectionPeeringListPreparer(ctx context.Context) (*http.Request, error) { - if erccpl.NextLink == nil || len(to.String(erccpl.NextLink)) < 1 { + if !erccpl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -10776,11 +9365,16 @@ func (page *ExpressRouteCrossConnectionPeeringListPage) NextWithContext(ctx cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erccpl) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erccpl) + if err != nil { + return err + } + page.erccpl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erccpl = next return nil } @@ -10848,6 +9442,45 @@ type ExpressRouteCrossConnectionPeeringProperties struct { Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringProperties. +func (erccpp ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccpp.PeeringType != "" { + objectMap["peeringType"] = erccpp.PeeringType + } + if erccpp.State != "" { + objectMap["state"] = erccpp.State + } + if erccpp.PeerASN != nil { + objectMap["peerASN"] = erccpp.PeerASN + } + if erccpp.PrimaryPeerAddressPrefix != nil { + objectMap["primaryPeerAddressPrefix"] = erccpp.PrimaryPeerAddressPrefix + } + if erccpp.SecondaryPeerAddressPrefix != nil { + objectMap["secondaryPeerAddressPrefix"] = erccpp.SecondaryPeerAddressPrefix + } + if erccpp.SharedKey != nil { + objectMap["sharedKey"] = erccpp.SharedKey + } + if erccpp.VlanID != nil { + objectMap["vlanId"] = erccpp.VlanID + } + if erccpp.MicrosoftPeeringConfig != nil { + objectMap["microsoftPeeringConfig"] = erccpp.MicrosoftPeeringConfig + } + if erccpp.GatewayManagerEtag != nil { + objectMap["gatewayManagerEtag"] = erccpp.GatewayManagerEtag + } + if erccpp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = erccpp.LastModifiedBy + } + if erccpp.Ipv6PeeringConfig != nil { + objectMap["ipv6PeeringConfig"] = erccpp.Ipv6PeeringConfig + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture struct { @@ -10877,8 +9510,8 @@ func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) Result(cl return } -// ExpressRouteCrossConnectionPeeringsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// ExpressRouteCrossConnectionPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type ExpressRouteCrossConnectionPeeringsDeleteFuture struct { azure.Future } @@ -10924,6 +9557,30 @@ type ExpressRouteCrossConnectionProperties struct { Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionProperties. +func (erccp ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccp.PeeringLocation != nil { + objectMap["peeringLocation"] = erccp.PeeringLocation + } + if erccp.BandwidthInMbps != nil { + objectMap["bandwidthInMbps"] = erccp.BandwidthInMbps + } + if erccp.ExpressRouteCircuit != nil { + objectMap["expressRouteCircuit"] = erccp.ExpressRouteCircuit + } + if erccp.ServiceProviderProvisioningState != "" { + objectMap["serviceProviderProvisioningState"] = erccp.ServiceProviderProvisioningState + } + if erccp.ServiceProviderNotes != nil { + objectMap["serviceProviderNotes"] = erccp.ServiceProviderNotes + } + if erccp.Peerings != nil { + objectMap["peerings"] = erccp.Peerings + } + return json.Marshal(objectMap) +} + // ExpressRouteCrossConnectionRoutesTableSummary the routes table associated with the ExpressRouteCircuit. type ExpressRouteCrossConnectionRoutesTableSummary struct { // Neighbor - IP address of Neighbor router @@ -10936,8 +9593,8 @@ type ExpressRouteCrossConnectionRoutesTableSummary struct { StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` } -// ExpressRouteCrossConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// ExpressRouteCrossConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type ExpressRouteCrossConnectionsCreateOrUpdateFuture struct { azure.Future } @@ -10965,8 +9622,8 @@ func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) Result(client Ex return } -// ExpressRouteCrossConnectionsListArpTableFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// ExpressRouteCrossConnectionsListArpTableFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCrossConnectionsListArpTableFuture struct { azure.Future } @@ -10994,8 +9651,8 @@ func (future *ExpressRouteCrossConnectionsListArpTableFuture) Result(client Expr return } -// ExpressRouteCrossConnectionsListRoutesTableFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// ExpressRouteCrossConnectionsListRoutesTableFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type ExpressRouteCrossConnectionsListRoutesTableFuture struct { azure.Future } @@ -11023,8 +9680,8 @@ func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) Result(client E return } -// ExpressRouteCrossConnectionsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. +// ExpressRouteCrossConnectionsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. type ExpressRouteCrossConnectionsListRoutesTableSummaryFuture struct { azure.Future } @@ -11052,8 +9709,8 @@ func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) Result(c return } -// ExpressRouteCrossConnectionsRoutesTableSummaryListResult response for ListRoutesTable associated with -// the Express Route Cross Connections. +// ExpressRouteCrossConnectionsRoutesTableSummaryListResult response for ListRoutesTable associated with the +// Express Route Cross Connections. type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { autorest.Response `json:"-"` // Value - A list of the routes table. @@ -11062,8 +9719,17 @@ type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCrossConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionsRoutesTableSummaryListResult. +func (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erccrtslr.Value != nil { + objectMap["value"] = erccrtslr.Value + } + return json.Marshal(objectMap) +} + +// ExpressRouteCrossConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ExpressRouteCrossConnectionsUpdateTagsFuture struct { azure.Future } @@ -11224,6 +9890,18 @@ type ExpressRouteGatewayProperties struct { VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteGatewayProperties. +func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ergp.AutoScaleConfiguration != nil { + objectMap["autoScaleConfiguration"] = ergp.AutoScaleConfiguration + } + if ergp.VirtualHub != nil { + objectMap["virtualHub"] = ergp.VirtualHub + } + return json.Marshal(objectMap) +} + // ExpressRouteGatewayPropertiesAutoScaleConfiguration configuration for auto scaling. type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { // Bounds - Minimum and maximum number of scale units to deploy. @@ -11268,8 +9946,8 @@ func (future *ExpressRouteGatewaysCreateOrUpdateFuture) Result(client ExpressRou return } -// ExpressRouteGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ExpressRouteGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ExpressRouteGatewaysDeleteFuture struct { azure.Future } @@ -11447,10 +10125,15 @@ func (erllr ExpressRouteLinkListResult) IsEmpty() bool { return erllr.Value == nil || len(*erllr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erllr ExpressRouteLinkListResult) hasNextLink() bool { + return erllr.NextLink != nil && len(*erllr.NextLink) != 0 +} + // expressRouteLinkListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erllr ExpressRouteLinkListResult) expressRouteLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if erllr.NextLink == nil || len(to.String(erllr.NextLink)) < 1 { + if !erllr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11478,11 +10161,16 @@ func (page *ExpressRouteLinkListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erllr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erllr) + if err != nil { + return err + } + page.erllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erllr = next return nil } @@ -11534,6 +10222,15 @@ type ExpressRouteLinkPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRouteLinkPropertiesFormat. +func (erlpf ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erlpf.AdminState != "" { + objectMap["adminState"] = erlpf.AdminState + } + return json.Marshal(objectMap) +} + // ExpressRoutePort expressRoutePort resource definition. type ExpressRoutePort struct { autorest.Response `json:"-"` @@ -11726,10 +10423,15 @@ func (erplr ExpressRoutePortListResult) IsEmpty() bool { return erplr.Value == nil || len(*erplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erplr ExpressRoutePortListResult) hasNextLink() bool { + return erplr.NextLink != nil && len(*erplr.NextLink) != 0 +} + // expressRoutePortListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erplr ExpressRoutePortListResult) expressRoutePortListResultPreparer(ctx context.Context) (*http.Request, error) { - if erplr.NextLink == nil || len(to.String(erplr.NextLink)) < 1 { + if !erplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -11757,11 +10459,16 @@ func (page *ExpressRoutePortListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erplr) + if err != nil { + return err + } + page.erplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erplr = next return nil } @@ -11821,6 +10528,27 @@ type ExpressRoutePortPropertiesFormat struct { ResourceGUID *string `json:"resourceGuid,omitempty"` } +// MarshalJSON is the custom marshaler for ExpressRoutePortPropertiesFormat. +func (erppf ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erppf.PeeringLocation != nil { + objectMap["peeringLocation"] = erppf.PeeringLocation + } + if erppf.BandwidthInGbps != nil { + objectMap["bandwidthInGbps"] = erppf.BandwidthInGbps + } + if erppf.Encapsulation != "" { + objectMap["encapsulation"] = erppf.Encapsulation + } + if erppf.Links != nil { + objectMap["links"] = erppf.Links + } + if erppf.ResourceGUID != nil { + objectMap["resourceGuid"] = erppf.ResourceGUID + } + return json.Marshal(objectMap) +} + // ExpressRoutePortsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type ExpressRoutePortsCreateOrUpdateFuture struct { @@ -12063,10 +10791,15 @@ func (erpllr ExpressRoutePortsLocationListResult) IsEmpty() bool { return erpllr.Value == nil || len(*erpllr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (erpllr ExpressRoutePortsLocationListResult) hasNextLink() bool { + return erpllr.NextLink != nil && len(*erpllr.NextLink) != 0 +} + // expressRoutePortsLocationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (erpllr ExpressRoutePortsLocationListResult) expressRoutePortsLocationListResultPreparer(ctx context.Context) (*http.Request, error) { - if erpllr.NextLink == nil || len(to.String(erpllr.NextLink)) < 1 { + if !erpllr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -12094,11 +10827,16 @@ func (page *ExpressRoutePortsLocationListResultPage) NextWithContext(ctx context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.erpllr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.erpllr) + if err != nil { + return err + } + page.erpllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.erpllr = next return nil } @@ -12145,8 +10883,17 @@ type ExpressRoutePortsLocationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ExpressRoutePortsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// MarshalJSON is the custom marshaler for ExpressRoutePortsLocationPropertiesFormat. +func (erplpf ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erplpf.AvailableBandwidths != nil { + objectMap["availableBandwidths"] = erplpf.AvailableBandwidths + } + return json.Marshal(objectMap) +} + +// ExpressRoutePortsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ExpressRoutePortsUpdateTagsFuture struct { azure.Future } @@ -12363,10 +11110,15 @@ func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { return ersplr.Value == nil || len(*ersplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { + return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 +} + // expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { - if ersplr.NextLink == nil || len(to.String(ersplr.NextLink)) < 1 { + if !ersplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -12394,11 +11146,16 @@ func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ersplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ersplr) + if err != nil { + return err + } + page.ersplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ersplr = next return nil } @@ -12526,8 +11283,8 @@ type FlowLogProperties struct { Format *FlowLogFormatParameters `json:"format,omitempty"` } -// FlowLogStatusParameters parameters that define a resource to query flow log and traffic analytics -// (optional) status. +// FlowLogStatusParameters parameters that define a resource to query flow log and traffic analytics (optional) +// status. type FlowLogStatusParameters struct { // TargetResourceID - The target resource where getting the flow log and traffic analytics (optional) status. TargetResourceID *string `json:"targetResourceId,omitempty"` @@ -12653,6 +11410,30 @@ type FrontendIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat. +func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ficpf.PrivateIPAddress != nil { + objectMap["privateIPAddress"] = ficpf.PrivateIPAddress + } + if ficpf.PrivateIPAllocationMethod != "" { + objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod + } + if ficpf.Subnet != nil { + objectMap["subnet"] = ficpf.Subnet + } + if ficpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = ficpf.PublicIPAddress + } + if ficpf.PublicIPPrefix != nil { + objectMap["publicIPPrefix"] = ficpf.PublicIPPrefix + } + if ficpf.ProvisioningState != nil { + objectMap["provisioningState"] = ficpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // GatewayRoute gateway routing details type GatewayRoute struct { // LocalAddress - READ-ONLY; The gateway's local address @@ -12990,6 +11771,15 @@ type InboundNatRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InboundNatRuleListResult. +func (inrlr InboundNatRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if inrlr.Value != nil { + objectMap["value"] = inrlr.Value + } + return json.Marshal(objectMap) +} + // InboundNatRuleListResultIterator provides access to a complete listing of InboundNatRule values. type InboundNatRuleListResultIterator struct { i int @@ -13058,10 +11848,15 @@ func (inrlr InboundNatRuleListResult) IsEmpty() bool { return inrlr.Value == nil || len(*inrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (inrlr InboundNatRuleListResult) hasNextLink() bool { + return inrlr.NextLink != nil && len(*inrlr.NextLink) != 0 +} + // inboundNatRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (inrlr InboundNatRuleListResult) inboundNatRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if inrlr.NextLink == nil || len(to.String(inrlr.NextLink)) < 1 { + if !inrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13089,11 +11884,16 @@ func (page *InboundNatRuleListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.inrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.inrlr) + if err != nil { + return err + } + page.inrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.inrlr = next return nil } @@ -13149,6 +11949,36 @@ type InboundNatRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat. +func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if inrpf.FrontendIPConfiguration != nil { + objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration + } + if inrpf.Protocol != "" { + objectMap["protocol"] = inrpf.Protocol + } + if inrpf.FrontendPort != nil { + objectMap["frontendPort"] = inrpf.FrontendPort + } + if inrpf.BackendPort != nil { + objectMap["backendPort"] = inrpf.BackendPort + } + if inrpf.IdleTimeoutInMinutes != nil { + objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes + } + if inrpf.EnableFloatingIP != nil { + objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP + } + if inrpf.EnableTCPReset != nil { + objectMap["enableTcpReset"] = inrpf.EnableTCPReset + } + if inrpf.ProvisioningState != nil { + objectMap["provisioningState"] = inrpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // InboundNatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type InboundNatRulesCreateOrUpdateFuture struct { @@ -13368,6 +12198,15 @@ type InterfaceAssociation struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceAssociation. +func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ia.SecurityRules != nil { + objectMap["securityRules"] = ia.SecurityRules + } + return json.Marshal(objectMap) +} + // InterfaceDNSSettings DNS settings of a network interface. type InterfaceDNSSettings struct { // DNSServers - List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. @@ -13509,6 +12348,15 @@ type InterfaceEndpointListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceEndpointListResult. +func (ielr InterfaceEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ielr.Value != nil { + objectMap["value"] = ielr.Value + } + return json.Marshal(objectMap) +} + // InterfaceEndpointListResultIterator provides access to a complete listing of InterfaceEndpoint values. type InterfaceEndpointListResultIterator struct { i int @@ -13577,10 +12425,15 @@ func (ielr InterfaceEndpointListResult) IsEmpty() bool { return ielr.Value == nil || len(*ielr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ielr InterfaceEndpointListResult) hasNextLink() bool { + return ielr.NextLink != nil && len(*ielr.NextLink) != 0 +} + // interfaceEndpointListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ielr InterfaceEndpointListResult) interfaceEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { - if ielr.NextLink == nil || len(to.String(ielr.NextLink)) < 1 { + if !ielr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13608,11 +12461,16 @@ func (page *InterfaceEndpointListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ielr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ielr) + if err != nil { + return err + } + page.ielr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ielr = next return nil } @@ -13662,6 +12520,21 @@ type InterfaceEndpointProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceEndpointProperties. +func (iep InterfaceEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iep.Fqdn != nil { + objectMap["fqdn"] = iep.Fqdn + } + if iep.EndpointService != nil { + objectMap["endpointService"] = iep.EndpointService + } + if iep.Subnet != nil { + objectMap["subnet"] = iep.Subnet + } + return json.Marshal(objectMap) +} + // InterfaceEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type InterfaceEndpointsCreateOrUpdateFuture struct { @@ -13691,8 +12564,8 @@ func (future *InterfaceEndpointsCreateOrUpdateFuture) Result(client InterfaceEnd return } -// InterfaceEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// InterfaceEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type InterfaceEndpointsDeleteFuture struct { azure.Future } @@ -13805,8 +12678,17 @@ type InterfaceIPConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// InterfaceIPConfigurationListResultIterator provides access to a complete listing of -// InterfaceIPConfiguration values. +// MarshalJSON is the custom marshaler for InterfaceIPConfigurationListResult. +func (iiclr InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iiclr.Value != nil { + objectMap["value"] = iiclr.Value + } + return json.Marshal(objectMap) +} + +// InterfaceIPConfigurationListResultIterator provides access to a complete listing of InterfaceIPConfiguration +// values. type InterfaceIPConfigurationListResultIterator struct { i int page InterfaceIPConfigurationListResultPage @@ -13874,10 +12756,15 @@ func (iiclr InterfaceIPConfigurationListResult) IsEmpty() bool { return iiclr.Value == nil || len(*iiclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (iiclr InterfaceIPConfigurationListResult) hasNextLink() bool { + return iiclr.NextLink != nil && len(*iiclr.NextLink) != 0 +} + // interfaceIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (iiclr InterfaceIPConfigurationListResult) interfaceIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if iiclr.NextLink == nil || len(to.String(iiclr.NextLink)) < 1 { + if !iiclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -13905,11 +12792,16 @@ func (page *InterfaceIPConfigurationListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.iiclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.iiclr) + if err != nil { + return err + } + page.iiclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.iiclr = next return nil } @@ -13980,6 +12872,15 @@ type InterfaceListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceListResult. +func (ilr InterfaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ilr.Value != nil { + objectMap["value"] = ilr.Value + } + return json.Marshal(objectMap) +} + // InterfaceListResultIterator provides access to a complete listing of Interface values. type InterfaceListResultIterator struct { i int @@ -14048,10 +12949,15 @@ func (ilr InterfaceListResult) IsEmpty() bool { return ilr.Value == nil || len(*ilr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilr InterfaceListResult) hasNextLink() bool { + return ilr.NextLink != nil && len(*ilr.NextLink) != 0 +} + // interfaceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + if !ilr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -14079,11 +12985,16 @@ func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilr = next return nil } @@ -14126,6 +13037,15 @@ type InterfaceLoadBalancerListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceLoadBalancerListResult. +func (ilblr InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ilblr.Value != nil { + objectMap["value"] = ilblr.Value + } + return json.Marshal(objectMap) +} + // InterfaceLoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. type InterfaceLoadBalancerListResultIterator struct { i int @@ -14194,10 +13114,15 @@ func (ilblr InterfaceLoadBalancerListResult) IsEmpty() bool { return ilblr.Value == nil || len(*ilblr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ilblr InterfaceLoadBalancerListResult) hasNextLink() bool { + return ilblr.NextLink != nil && len(*ilblr.NextLink) != 0 +} + // interfaceLoadBalancerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ilblr InterfaceLoadBalancerListResult) interfaceLoadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if ilblr.NextLink == nil || len(to.String(ilblr.NextLink)) < 1 { + if !ilblr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -14225,11 +13150,16 @@ func (page *InterfaceLoadBalancerListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ilblr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ilblr) + if err != nil { + return err + } + page.ilblr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ilblr = next return nil } @@ -14293,8 +13223,44 @@ type InterfacePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// MarshalJSON is the custom marshaler for InterfacePropertiesFormat. +func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipf.NetworkSecurityGroup != nil { + objectMap["networkSecurityGroup"] = ipf.NetworkSecurityGroup + } + if ipf.IPConfigurations != nil { + objectMap["ipConfigurations"] = ipf.IPConfigurations + } + if ipf.TapConfigurations != nil { + objectMap["tapConfigurations"] = ipf.TapConfigurations + } + if ipf.DNSSettings != nil { + objectMap["dnsSettings"] = ipf.DNSSettings + } + if ipf.MacAddress != nil { + objectMap["macAddress"] = ipf.MacAddress + } + if ipf.Primary != nil { + objectMap["primary"] = ipf.Primary + } + if ipf.EnableAcceleratedNetworking != nil { + objectMap["enableAcceleratedNetworking"] = ipf.EnableAcceleratedNetworking + } + if ipf.EnableIPForwarding != nil { + objectMap["enableIPForwarding"] = ipf.EnableIPForwarding + } + if ipf.ResourceGUID != nil { + objectMap["resourceGuid"] = ipf.ResourceGUID + } + if ipf.ProvisioningState != nil { + objectMap["provisioningState"] = ipf.ProvisioningState + } + return json.Marshal(objectMap) +} + +// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type InterfacesCreateOrUpdateFuture struct { azure.Future } @@ -14322,8 +13288,7 @@ func (future *InterfacesCreateOrUpdateFuture) Result(client InterfacesClient) (i return } -// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type InterfacesDeleteFuture struct { azure.Future } @@ -14374,8 +13339,8 @@ func (future *InterfacesGetEffectiveRouteTableFuture) Result(client InterfacesCl return } -// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { azure.Future } @@ -14534,6 +13499,15 @@ type InterfaceTapConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for InterfaceTapConfigurationListResult. +func (itclr InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itclr.Value != nil { + objectMap["value"] = itclr.Value + } + return json.Marshal(objectMap) +} + // InterfaceTapConfigurationListResultIterator provides access to a complete listing of // InterfaceTapConfiguration values. type InterfaceTapConfigurationListResultIterator struct { @@ -14603,10 +13577,15 @@ func (itclr InterfaceTapConfigurationListResult) IsEmpty() bool { return itclr.Value == nil || len(*itclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (itclr InterfaceTapConfigurationListResult) hasNextLink() bool { + return itclr.NextLink != nil && len(*itclr.NextLink) != 0 +} + // interfaceTapConfigurationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (itclr InterfaceTapConfigurationListResult) interfaceTapConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if itclr.NextLink == nil || len(to.String(itclr.NextLink)) < 1 { + if !itclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -14634,11 +13613,16 @@ func (page *InterfaceTapConfigurationListResultPage) NextWithContext(ctx context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.itclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.itclr) + if err != nil { + return err + } + page.itclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.itclr = next return nil } @@ -14680,8 +13664,17 @@ type InterfaceTapConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// InterfaceTapConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// MarshalJSON is the custom marshaler for InterfaceTapConfigurationPropertiesFormat. +func (itcpf InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if itcpf.VirtualNetworkTap != nil { + objectMap["virtualNetworkTap"] = itcpf.VirtualNetworkTap + } + return json.Marshal(objectMap) +} + +// InterfaceTapConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type InterfaceTapConfigurationsCreateOrUpdateFuture struct { azure.Future } @@ -14922,6 +13915,15 @@ type IPConfigurationProfilePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for IPConfigurationProfilePropertiesFormat. +func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icppf.Subnet != nil { + objectMap["subnet"] = icppf.Subnet + } + return json.Marshal(objectMap) +} + // IPConfigurationPropertiesFormat properties of IP configuration. type IPConfigurationPropertiesFormat struct { // PrivateIPAddress - The private IP address of the IP configuration. @@ -14978,8 +13980,8 @@ type Ipv6ExpressRouteCircuitPeeringConfig struct { State ExpressRouteCircuitPeeringState `json:"state,omitempty"` } -// ListHubVirtualNetworkConnectionsResult list of HubVirtualNetworkConnections and a URL nextLink to get -// the next set of results. +// ListHubVirtualNetworkConnectionsResult list of HubVirtualNetworkConnections and a URL nextLink to get the +// next set of results. type ListHubVirtualNetworkConnectionsResult struct { autorest.Response `json:"-"` // Value - List of HubVirtualNetworkConnections. @@ -15057,10 +14059,15 @@ func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool { return lhvncr.Value == nil || len(*lhvncr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lhvncr ListHubVirtualNetworkConnectionsResult) hasNextLink() bool { + return lhvncr.NextLink != nil && len(*lhvncr.NextLink) != 0 +} + // listHubVirtualNetworkConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if lhvncr.NextLink == nil || len(to.String(lhvncr.NextLink)) < 1 { + if !lhvncr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15088,11 +14095,16 @@ func (page *ListHubVirtualNetworkConnectionsResultPage) NextWithContext(ctx cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lhvncr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lhvncr) + if err != nil { + return err + } + page.lhvncr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lhvncr = next return nil } @@ -15126,8 +14138,8 @@ func NewListHubVirtualNetworkConnectionsResultPage(getNextPage func(context.Cont return ListHubVirtualNetworkConnectionsResultPage{fn: getNextPage} } -// ListP2SVpnGatewaysResult result of the request to list P2SVpnGateways. It contains a list of -// P2SVpnGateways and a URL nextLink to get the next set of results. +// ListP2SVpnGatewaysResult result of the request to list P2SVpnGateways. It contains a list of P2SVpnGateways +// and a URL nextLink to get the next set of results. type ListP2SVpnGatewaysResult struct { autorest.Response `json:"-"` // Value - List of P2SVpnGateways. @@ -15204,10 +14216,15 @@ func (lpvgr ListP2SVpnGatewaysResult) IsEmpty() bool { return lpvgr.Value == nil || len(*lpvgr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lpvgr ListP2SVpnGatewaysResult) hasNextLink() bool { + return lpvgr.NextLink != nil && len(*lpvgr.NextLink) != 0 +} + // listP2SVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lpvgr ListP2SVpnGatewaysResult) listP2SVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if lpvgr.NextLink == nil || len(to.String(lpvgr.NextLink)) < 1 { + if !lpvgr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15235,11 +14252,16 @@ func (page *ListP2SVpnGatewaysResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lpvgr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lpvgr) + if err != nil { + return err + } + page.lpvgr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lpvgr = next return nil } @@ -15273,9 +14295,9 @@ func NewListP2SVpnGatewaysResultPage(getNextPage func(context.Context, ListP2SVp return ListP2SVpnGatewaysResultPage{fn: getNextPage} } -// ListP2SVpnServerConfigurationsResult result of the request to list all P2SVpnServerConfigurations -// associated to a VirtualWan. It contains a list of P2SVpnServerConfigurations and a URL nextLink to get -// the next set of results. +// ListP2SVpnServerConfigurationsResult result of the request to list all P2SVpnServerConfigurations associated +// to a VirtualWan. It contains a list of P2SVpnServerConfigurations and a URL nextLink to get the next set of +// results. type ListP2SVpnServerConfigurationsResult struct { autorest.Response `json:"-"` // Value - List of P2SVpnServerConfigurations. @@ -15353,10 +14375,15 @@ func (lpvscr ListP2SVpnServerConfigurationsResult) IsEmpty() bool { return lpvscr.Value == nil || len(*lpvscr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lpvscr ListP2SVpnServerConfigurationsResult) hasNextLink() bool { + return lpvscr.NextLink != nil && len(*lpvscr.NextLink) != 0 +} + // listP2SVpnServerConfigurationsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lpvscr ListP2SVpnServerConfigurationsResult) listP2SVpnServerConfigurationsResultPreparer(ctx context.Context) (*http.Request, error) { - if lpvscr.NextLink == nil || len(to.String(lpvscr.NextLink)) < 1 { + if !lpvscr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15384,11 +14411,16 @@ func (page *ListP2SVpnServerConfigurationsResultPage) NextWithContext(ctx contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lpvscr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lpvscr) + if err != nil { + return err + } + page.lpvscr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lpvscr = next return nil } @@ -15428,8 +14460,8 @@ type ListString struct { Value *[]string `json:"value,omitempty"` } -// ListVirtualHubsResult result of the request to list VirtualHubs. It contains a list of VirtualHubs and a -// URL nextLink to get the next set of results. +// ListVirtualHubsResult result of the request to list VirtualHubs. It contains a list of VirtualHubs and a URL +// nextLink to get the next set of results. type ListVirtualHubsResult struct { autorest.Response `json:"-"` // Value - List of VirtualHubs. @@ -15506,10 +14538,15 @@ func (lvhr ListVirtualHubsResult) IsEmpty() bool { return lvhr.Value == nil || len(*lvhr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvhr ListVirtualHubsResult) hasNextLink() bool { + return lvhr.NextLink != nil && len(*lvhr.NextLink) != 0 +} + // listVirtualHubsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvhr.NextLink == nil || len(to.String(lvhr.NextLink)) < 1 { + if !lvhr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15537,11 +14574,16 @@ func (page *ListVirtualHubsResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvhr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvhr) + if err != nil { + return err + } + page.lvhr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvhr = next return nil } @@ -15575,8 +14617,8 @@ func NewListVirtualHubsResultPage(getNextPage func(context.Context, ListVirtualH return ListVirtualHubsResultPage{fn: getNextPage} } -// ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a -// URL nextLink to get the next set of results. +// ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a URL +// nextLink to get the next set of results. type ListVirtualWANsResult struct { autorest.Response `json:"-"` // Value - List of VirtualWANs. @@ -15653,10 +14695,15 @@ func (lvwnr ListVirtualWANsResult) IsEmpty() bool { return lvwnr.Value == nil || len(*lvwnr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvwnr ListVirtualWANsResult) hasNextLink() bool { + return lvwnr.NextLink != nil && len(*lvwnr.NextLink) != 0 +} + // listVirtualWANsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvwnr.NextLink == nil || len(to.String(lvwnr.NextLink)) < 1 { + if !lvwnr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15684,11 +14731,16 @@ func (page *ListVirtualWANsResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvwnr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvwnr) + if err != nil { + return err + } + page.lvwnr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvwnr = next return nil } @@ -15722,8 +14774,8 @@ func NewListVirtualWANsResultPage(getNextPage func(context.Context, ListVirtualW return ListVirtualWANsResultPage{fn: getNextPage} } -// ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. -// It contains a list of Vpn Connections and a URL nextLink to get the next set of results. +// ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. It +// contains a list of Vpn Connections and a URL nextLink to get the next set of results. type ListVpnConnectionsResult struct { autorest.Response `json:"-"` // Value - List of Vpn Connections. @@ -15800,10 +14852,15 @@ func (lvcr ListVpnConnectionsResult) IsEmpty() bool { return lvcr.Value == nil || len(*lvcr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvcr ListVpnConnectionsResult) hasNextLink() bool { + return lvcr.NextLink != nil && len(*lvcr.NextLink) != 0 +} + // listVpnConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if lvcr.NextLink == nil || len(to.String(lvcr.NextLink)) < 1 { + if !lvcr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15831,11 +14888,16 @@ func (page *ListVpnConnectionsResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvcr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvcr) + if err != nil { + return err + } + page.lvcr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvcr = next return nil } @@ -15869,8 +14931,8 @@ func NewListVpnConnectionsResultPage(getNextPage func(context.Context, ListVpnCo return ListVpnConnectionsResultPage{fn: getNextPage} } -// ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a -// URL nextLink to get the next set of results. +// ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a URL +// nextLink to get the next set of results. type ListVpnGatewaysResult struct { autorest.Response `json:"-"` // Value - List of VpnGateways. @@ -15947,10 +15009,15 @@ func (lvgr ListVpnGatewaysResult) IsEmpty() bool { return lvgr.Value == nil || len(*lvgr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvgr ListVpnGatewaysResult) hasNextLink() bool { + return lvgr.NextLink != nil && len(*lvgr.NextLink) != 0 +} + // listVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if lvgr.NextLink == nil || len(to.String(lvgr.NextLink)) < 1 { + if !lvgr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -15978,11 +15045,16 @@ func (page *ListVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvgr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvgr) + if err != nil { + return err + } + page.lvgr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvgr = next return nil } @@ -16016,8 +15088,8 @@ func NewListVpnGatewaysResultPage(getNextPage func(context.Context, ListVpnGatew return ListVpnGatewaysResultPage{fn: getNextPage} } -// ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL -// nextLink to get the next set of results. +// ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL nextLink +// to get the next set of results. type ListVpnSitesResult struct { autorest.Response `json:"-"` // Value - List of VpnSites. @@ -16094,10 +15166,15 @@ func (lvsr ListVpnSitesResult) IsEmpty() bool { return lvsr.Value == nil || len(*lvsr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lvsr ListVpnSitesResult) hasNextLink() bool { + return lvsr.NextLink != nil && len(*lvsr.NextLink) != 0 +} + // listVpnSitesResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer(ctx context.Context) (*http.Request, error) { - if lvsr.NextLink == nil || len(to.String(lvsr.NextLink)) < 1 { + if !lvsr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16125,11 +15202,16 @@ func (page *ListVpnSitesResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lvsr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lvsr) + if err != nil { + return err + } + page.lvsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lvsr = next return nil } @@ -16304,8 +15386,17 @@ type LoadBalancerBackendAddressPoolListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of -// BackendAddressPool values. +// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPoolListResult. +func (lbbaplr LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbbaplr.Value != nil { + objectMap["value"] = lbbaplr.Value + } + return json.Marshal(objectMap) +} + +// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of BackendAddressPool +// values. type LoadBalancerBackendAddressPoolListResultIterator struct { i int page LoadBalancerBackendAddressPoolListResultPage @@ -16373,10 +15464,15 @@ func (lbbaplr LoadBalancerBackendAddressPoolListResult) IsEmpty() bool { return lbbaplr.Value == nil || len(*lbbaplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lbbaplr LoadBalancerBackendAddressPoolListResult) hasNextLink() bool { + return lbbaplr.NextLink != nil && len(*lbbaplr.NextLink) != 0 +} + // loadBalancerBackendAddressPoolListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lbbaplr LoadBalancerBackendAddressPoolListResult) loadBalancerBackendAddressPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbbaplr.NextLink == nil || len(to.String(lbbaplr.NextLink)) < 1 { + if !lbbaplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16404,11 +15500,16 @@ func (page *LoadBalancerBackendAddressPoolListResultPage) NextWithContext(ctx co tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbbaplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lbbaplr) + if err != nil { + return err + } + page.lbbaplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lbbaplr = next return nil } @@ -16451,6 +15552,15 @@ type LoadBalancerFrontendIPConfigurationListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerFrontendIPConfigurationListResult. +func (lbficlr LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbficlr.Value != nil { + objectMap["value"] = lbficlr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerFrontendIPConfigurationListResultIterator provides access to a complete listing of // FrontendIPConfiguration values. type LoadBalancerFrontendIPConfigurationListResultIterator struct { @@ -16520,10 +15630,15 @@ func (lbficlr LoadBalancerFrontendIPConfigurationListResult) IsEmpty() bool { return lbficlr.Value == nil || len(*lbficlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lbficlr LoadBalancerFrontendIPConfigurationListResult) hasNextLink() bool { + return lbficlr.NextLink != nil && len(*lbficlr.NextLink) != 0 +} + // loadBalancerFrontendIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lbficlr LoadBalancerFrontendIPConfigurationListResult) loadBalancerFrontendIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbficlr.NextLink == nil || len(to.String(lbficlr.NextLink)) < 1 { + if !lbficlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16551,11 +15666,16 @@ func (page *LoadBalancerFrontendIPConfigurationListResultPage) NextWithContext(c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbficlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lbficlr) + if err != nil { + return err + } + page.lbficlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lbficlr = next return nil } @@ -16598,6 +15718,15 @@ type LoadBalancerListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerListResult. +func (lblr LoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lblr.Value != nil { + objectMap["value"] = lblr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. type LoadBalancerListResultIterator struct { i int @@ -16666,10 +15795,15 @@ func (lblr LoadBalancerListResult) IsEmpty() bool { return lblr.Value == nil || len(*lblr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lblr LoadBalancerListResult) hasNextLink() bool { + return lblr.NextLink != nil && len(*lblr.NextLink) != 0 +} + // loadBalancerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if lblr.NextLink == nil || len(to.String(lblr.NextLink)) < 1 { + if !lblr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16697,11 +15831,16 @@ func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lblr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lblr) + if err != nil { + return err + } + page.lblr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lblr = next return nil } @@ -16744,8 +15883,17 @@ type LoadBalancerLoadBalancingRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of -// LoadBalancingRule values. +// MarshalJSON is the custom marshaler for LoadBalancerLoadBalancingRuleListResult. +func (lblbrlr LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lblbrlr.Value != nil { + objectMap["value"] = lblbrlr.Value + } + return json.Marshal(objectMap) +} + +// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of LoadBalancingRule +// values. type LoadBalancerLoadBalancingRuleListResultIterator struct { i int page LoadBalancerLoadBalancingRuleListResultPage @@ -16813,10 +15961,15 @@ func (lblbrlr LoadBalancerLoadBalancingRuleListResult) IsEmpty() bool { return lblbrlr.Value == nil || len(*lblbrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lblbrlr LoadBalancerLoadBalancingRuleListResult) hasNextLink() bool { + return lblbrlr.NextLink != nil && len(*lblbrlr.NextLink) != 0 +} + // loadBalancerLoadBalancingRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lblbrlr LoadBalancerLoadBalancingRuleListResult) loadBalancerLoadBalancingRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if lblbrlr.NextLink == nil || len(to.String(lblbrlr.NextLink)) < 1 { + if !lblbrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16844,11 +15997,16 @@ func (page *LoadBalancerLoadBalancingRuleListResultPage) NextWithContext(ctx con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lblbrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lblbrlr) + if err != nil { + return err + } + page.lblbrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lblbrlr = next return nil } @@ -16891,6 +16049,15 @@ type LoadBalancerOutboundRuleListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerOutboundRuleListResult. +func (lborlr LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lborlr.Value != nil { + objectMap["value"] = lborlr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerOutboundRuleListResultIterator provides access to a complete listing of OutboundRule values. type LoadBalancerOutboundRuleListResultIterator struct { i int @@ -16959,10 +16126,15 @@ func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool { return lborlr.Value == nil || len(*lborlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool { + return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0 +} + // loadBalancerOutboundRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if lborlr.NextLink == nil || len(to.String(lborlr.NextLink)) < 1 { + if !lborlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -16990,11 +16162,16 @@ func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context. tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lborlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lborlr) + if err != nil { + return err + } + page.lborlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lborlr = next return nil } @@ -17037,6 +16214,15 @@ type LoadBalancerProbeListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. +func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbplr.Value != nil { + objectMap["value"] = lbplr.Value + } + return json.Marshal(objectMap) +} + // LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. type LoadBalancerProbeListResultIterator struct { i int @@ -17105,10 +16291,15 @@ func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { return lbplr.Value == nil || len(*lbplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { + return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 +} + // loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { - if lbplr.NextLink == nil || len(to.String(lbplr.NextLink)) < 1 { + if !lbplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17136,11 +16327,16 @@ func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lbplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lbplr) + if err != nil { + return err + } + page.lbplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lbplr = next return nil } @@ -17196,8 +16392,8 @@ type LoadBalancerPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type LoadBalancersCreateOrUpdateFuture struct { azure.Future } @@ -17520,8 +16716,16 @@ type LocalNetworkGatewayListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway -// values. +// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. +func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lnglr.Value != nil { + objectMap["value"] = lnglr.Value + } + return json.Marshal(objectMap) +} + +// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway values. type LocalNetworkGatewayListResultIterator struct { i int page LocalNetworkGatewayListResultPage @@ -17589,10 +16793,15 @@ func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { return lnglr.Value == nil || len(*lnglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { + return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 +} + // localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if lnglr.NextLink == nil || len(to.String(lnglr.NextLink)) < 1 { + if !lnglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -17620,11 +16829,16 @@ func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lnglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lnglr) + if err != nil { + return err + } + page.lnglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lnglr = next return nil } @@ -17672,6 +16886,24 @@ type LocalNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. +func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lngpf.LocalNetworkAddressSpace != nil { + objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace + } + if lngpf.GatewayIPAddress != nil { + objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress + } + if lngpf.BgpSettings != nil { + objectMap["bgpSettings"] = lngpf.BgpSettings + } + if lngpf.ResourceGUID != nil { + objectMap["resourceGuid"] = lngpf.ResourceGUID + } + return json.Marshal(objectMap) +} + // LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type LocalNetworkGatewaysCreateOrUpdateFuture struct { @@ -17701,8 +16933,8 @@ func (future *LocalNetworkGatewaysCreateOrUpdateFuture) Result(client LocalNetwo return } -// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type LocalNetworkGatewaysDeleteFuture struct { azure.Future } @@ -17973,8 +17205,8 @@ type OperationDisplay struct { Description *string `json:"description,omitempty"` } -// OperationListResult result of the request to list Network operations. It contains a list of operations -// and a URL link to get the next set of results. +// OperationListResult result of the request to list Network operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationListResult struct { autorest.Response `json:"-"` // Value - List of Network operations supported by the Network resource provider. @@ -18051,10 +17283,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -18082,11 +17319,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -18364,6 +17606,27 @@ type P2SVpnGatewayProperties struct { VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnGatewayProperties. +func (pvgp P2SVpnGatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvgp.VirtualHub != nil { + objectMap["virtualHub"] = pvgp.VirtualHub + } + if pvgp.ProvisioningState != "" { + objectMap["provisioningState"] = pvgp.ProvisioningState + } + if pvgp.VpnGatewayScaleUnit != nil { + objectMap["vpnGatewayScaleUnit"] = pvgp.VpnGatewayScaleUnit + } + if pvgp.P2SVpnServerConfiguration != nil { + objectMap["p2SVpnServerConfiguration"] = pvgp.P2SVpnServerConfiguration + } + if pvgp.VpnClientAddressPool != nil { + objectMap["vpnClientAddressPool"] = pvgp.VpnClientAddressPool + } + return json.Marshal(objectMap) +} + // P2sVpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type P2sVpnGatewaysCreateOrUpdateFuture struct { @@ -18445,8 +17708,8 @@ func (future *P2sVpnGatewaysGenerateVpnProfileFuture) Result(client P2sVpnGatewa return } -// P2sVpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// P2sVpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type P2sVpnGatewaysUpdateTagsFuture struct { azure.Future } @@ -18480,8 +17743,7 @@ type P2SVpnProfileParameters struct { AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` } -// P2SVpnServerConfigRadiusClientRootCertificate radius client root certificate of -// P2SVpnServerConfiguration. +// P2SVpnServerConfigRadiusClientRootCertificate radius client root certificate of P2SVpnServerConfiguration. type P2SVpnServerConfigRadiusClientRootCertificate struct { // P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat - Properties of the Radius client root certificate. *P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat `json:"properties,omitempty"` @@ -18571,8 +17833,16 @@ type P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// P2SVpnServerConfigRadiusServerRootCertificate radius Server root certificate of -// P2SVpnServerConfiguration. +// MarshalJSON is the custom marshaler for P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat. +func (pvscrcrcpf P2SVpnServerConfigRadiusClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscrcrcpf.Thumbprint != nil { + objectMap["thumbprint"] = pvscrcrcpf.Thumbprint + } + return json.Marshal(objectMap) +} + +// P2SVpnServerConfigRadiusServerRootCertificate radius Server root certificate of P2SVpnServerConfiguration. type P2SVpnServerConfigRadiusServerRootCertificate struct { // P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat - Properties of the P2SVpnServerConfiguration Radius Server root certificate. *P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat `json:"properties,omitempty"` @@ -18653,8 +17923,8 @@ func (pvscrsrc *P2SVpnServerConfigRadiusServerRootCertificate) UnmarshalJSON(bod return nil } -// P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat properties of Radius Server root -// certificate of P2SVpnServerConfiguration. +// P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat properties of Radius Server root certificate +// of P2SVpnServerConfiguration. type P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat struct { // PublicCertData - The certificate public data. PublicCertData *string `json:"publicCertData,omitempty"` @@ -18662,6 +17932,15 @@ type P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat. +func (pvscrsrcpf P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscrsrcpf.PublicCertData != nil { + objectMap["publicCertData"] = pvscrsrcpf.PublicCertData + } + return json.Marshal(objectMap) +} + // P2SVpnServerConfiguration p2SVpnServerConfiguration Resource. type P2SVpnServerConfiguration struct { autorest.Response `json:"-"` @@ -18768,8 +18047,44 @@ type P2SVpnServerConfigurationProperties struct { Etag *string `json:"etag,omitempty"` } -// P2sVpnServerConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// MarshalJSON is the custom marshaler for P2SVpnServerConfigurationProperties. +func (pvscp P2SVpnServerConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscp.Name != nil { + objectMap["name"] = pvscp.Name + } + if pvscp.VpnProtocols != nil { + objectMap["vpnProtocols"] = pvscp.VpnProtocols + } + if pvscp.P2SVpnServerConfigVpnClientRootCertificates != nil { + objectMap["p2SVpnServerConfigVpnClientRootCertificates"] = pvscp.P2SVpnServerConfigVpnClientRootCertificates + } + if pvscp.P2SVpnServerConfigVpnClientRevokedCertificates != nil { + objectMap["p2SVpnServerConfigVpnClientRevokedCertificates"] = pvscp.P2SVpnServerConfigVpnClientRevokedCertificates + } + if pvscp.P2SVpnServerConfigRadiusServerRootCertificates != nil { + objectMap["p2SVpnServerConfigRadiusServerRootCertificates"] = pvscp.P2SVpnServerConfigRadiusServerRootCertificates + } + if pvscp.P2SVpnServerConfigRadiusClientRootCertificates != nil { + objectMap["p2SVpnServerConfigRadiusClientRootCertificates"] = pvscp.P2SVpnServerConfigRadiusClientRootCertificates + } + if pvscp.VpnClientIpsecPolicies != nil { + objectMap["vpnClientIpsecPolicies"] = pvscp.VpnClientIpsecPolicies + } + if pvscp.RadiusServerAddress != nil { + objectMap["radiusServerAddress"] = pvscp.RadiusServerAddress + } + if pvscp.RadiusServerSecret != nil { + objectMap["radiusServerSecret"] = pvscp.RadiusServerSecret + } + if pvscp.Etag != nil { + objectMap["etag"] = pvscp.Etag + } + return json.Marshal(objectMap) +} + +// P2sVpnServerConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type P2sVpnServerConfigurationsCreateOrUpdateFuture struct { azure.Future } @@ -18820,8 +18135,7 @@ func (future *P2sVpnServerConfigurationsDeleteFuture) Result(client P2sVpnServer return } -// P2SVpnServerConfigVpnClientRevokedCertificate VPN client revoked certificate of -// P2SVpnServerConfiguration. +// P2SVpnServerConfigVpnClientRevokedCertificate VPN client revoked certificate of P2SVpnServerConfiguration. type P2SVpnServerConfigVpnClientRevokedCertificate struct { // P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat - Properties of the vpn client revoked certificate. *P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` @@ -18911,6 +18225,15 @@ type P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat. +func (pvscvcrcpf P2SVpnServerConfigVpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscvcrcpf.Thumbprint != nil { + objectMap["thumbprint"] = pvscvcrcpf.Thumbprint + } + return json.Marshal(objectMap) +} + // P2SVpnServerConfigVpnClientRootCertificate VPN client root certificate of P2SVpnServerConfiguration. type P2SVpnServerConfigVpnClientRootCertificate struct { // P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat - Properties of the P2SVpnServerConfiguration VPN client root certificate. @@ -19001,6 +18324,15 @@ type P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat. +func (pvscvcrcpf P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pvscvcrcpf.PublicCertData != nil { + objectMap["publicCertData"] = pvscvcrcpf.PublicCertData + } + return json.Marshal(objectMap) +} + // PacketCapture parameters that define the create packet capture operation. type PacketCapture struct { *PacketCaptureParameters `json:"properties,omitempty"` @@ -19547,9 +18879,8 @@ func (percc *PeerExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error return nil } -// PeerExpressRouteCircuitConnectionListResult response for ListPeeredConnections API service call -// retrieves all global reach peer circuit connections that belongs to a Private Peering for an -// ExpressRouteCircuit. +// PeerExpressRouteCircuitConnectionListResult response for ListPeeredConnections API service call retrieves +// all global reach peer circuit connections that belongs to a Private Peering for an ExpressRouteCircuit. type PeerExpressRouteCircuitConnectionListResult struct { autorest.Response `json:"-"` // Value - The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. @@ -19627,10 +18958,15 @@ func (percclr PeerExpressRouteCircuitConnectionListResult) IsEmpty() bool { return percclr.Value == nil || len(*percclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (percclr PeerExpressRouteCircuitConnectionListResult) hasNextLink() bool { + return percclr.NextLink != nil && len(*percclr.NextLink) != 0 +} + // peerExpressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (percclr PeerExpressRouteCircuitConnectionListResult) peerExpressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if percclr.NextLink == nil || len(to.String(percclr.NextLink)) < 1 { + if !percclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -19639,8 +18975,7 @@ func (percclr PeerExpressRouteCircuitConnectionListResult) peerExpressRouteCircu autorest.WithBaseURL(to.String(percclr.NextLink))) } -// PeerExpressRouteCircuitConnectionListResultPage contains a page of PeerExpressRouteCircuitConnection -// values. +// PeerExpressRouteCircuitConnectionListResultPage contains a page of PeerExpressRouteCircuitConnection values. type PeerExpressRouteCircuitConnectionListResultPage struct { fn func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error) percclr PeerExpressRouteCircuitConnectionListResult @@ -19659,11 +18994,16 @@ func (page *PeerExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.percclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.percclr) + if err != nil { + return err + } + page.percclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.percclr = next return nil } @@ -19715,6 +19055,27 @@ type PeerExpressRouteCircuitConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for PeerExpressRouteCircuitConnectionPropertiesFormat. +func (perccpf PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if perccpf.ExpressRouteCircuitPeering != nil { + objectMap["expressRouteCircuitPeering"] = perccpf.ExpressRouteCircuitPeering + } + if perccpf.PeerExpressRouteCircuitPeering != nil { + objectMap["peerExpressRouteCircuitPeering"] = perccpf.PeerExpressRouteCircuitPeering + } + if perccpf.AddressPrefix != nil { + objectMap["addressPrefix"] = perccpf.AddressPrefix + } + if perccpf.ConnectionName != nil { + objectMap["connectionName"] = perccpf.ConnectionName + } + if perccpf.AuthResourceGUID != nil { + objectMap["authResourceGuid"] = perccpf.AuthResourceGUID + } + return json.Marshal(objectMap) +} + // PolicySettings defines contents of a web application firewall global configuration type PolicySettings struct { // EnabledState - Describes if the policy is in enabled state or disabled state. Possible values include: 'WebApplicationFirewallEnabledStateDisabled', 'WebApplicationFirewallEnabledStateEnabled' @@ -19833,6 +19194,30 @@ type ProbePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ProbePropertiesFormat. +func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppf.Protocol != "" { + objectMap["protocol"] = ppf.Protocol + } + if ppf.Port != nil { + objectMap["port"] = ppf.Port + } + if ppf.IntervalInSeconds != nil { + objectMap["intervalInSeconds"] = ppf.IntervalInSeconds + } + if ppf.NumberOfProbes != nil { + objectMap["numberOfProbes"] = ppf.NumberOfProbes + } + if ppf.RequestPath != nil { + objectMap["requestPath"] = ppf.RequestPath + } + if ppf.ProvisioningState != nil { + objectMap["provisioningState"] = ppf.ProvisioningState + } + return json.Marshal(objectMap) +} + // Profile network profile resource. type Profile struct { autorest.Response `json:"-"` @@ -20028,10 +19413,15 @@ func (plr ProfileListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProfileListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // profileListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -20059,11 +19449,16 @@ func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -20109,8 +19504,19 @@ type ProfilePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// MarshalJSON is the custom marshaler for ProfilePropertiesFormat. +func (ppf ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppf.ContainerNetworkInterfaces != nil { + objectMap["containerNetworkInterfaces"] = ppf.ContainerNetworkInterfaces + } + if ppf.ContainerNetworkInterfaceConfigurations != nil { + objectMap["containerNetworkInterfaceConfigurations"] = ppf.ContainerNetworkInterfaceConfigurations + } + return json.Marshal(objectMap) +} + +// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ProfilesDeleteFuture struct { azure.Future } @@ -20357,8 +19763,8 @@ func (future *PublicIPAddressesDeleteFuture) Result(client PublicIPAddressesClie return } -// PublicIPAddressesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// PublicIPAddressesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type PublicIPAddressesUpdateTagsFuture struct { azure.Future } @@ -20463,10 +19869,15 @@ func (pialr PublicIPAddressListResult) IsEmpty() bool { return pialr.Value == nil || len(*pialr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (pialr PublicIPAddressListResult) hasNextLink() bool { + return pialr.NextLink != nil && len(*pialr.NextLink) != 0 +} + // publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { - if pialr.NextLink == nil || len(to.String(pialr.NextLink)) < 1 { + if !pialr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -20494,11 +19905,16 @@ func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.pialr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.pialr) + if err != nil { + return err + } + page.pialr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.pialr = next return nil } @@ -20558,6 +19974,42 @@ type PublicIPAddressPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat. +func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if piapf.PublicIPAllocationMethod != "" { + objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod + } + if piapf.PublicIPAddressVersion != "" { + objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion + } + if piapf.DNSSettings != nil { + objectMap["dnsSettings"] = piapf.DNSSettings + } + if piapf.DdosSettings != nil { + objectMap["ddosSettings"] = piapf.DdosSettings + } + if piapf.IPTags != nil { + objectMap["ipTags"] = piapf.IPTags + } + if piapf.IPAddress != nil { + objectMap["ipAddress"] = piapf.IPAddress + } + if piapf.PublicIPPrefix != nil { + objectMap["publicIPPrefix"] = piapf.PublicIPPrefix + } + if piapf.IdleTimeoutInMinutes != nil { + objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes + } + if piapf.ResourceGUID != nil { + objectMap["resourceGuid"] = piapf.ResourceGUID + } + if piapf.ProvisioningState != nil { + objectMap["provisioningState"] = piapf.ProvisioningState + } + return json.Marshal(objectMap) +} + // PublicIPAddressSku SKU of a public IP address type PublicIPAddressSku struct { // Name - Name of a public IP address SKU. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' @@ -20762,8 +20214,8 @@ func (future *PublicIPPrefixesDeleteFuture) Result(client PublicIPPrefixesClient return } -// PublicIPPrefixesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// PublicIPPrefixesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type PublicIPPrefixesUpdateTagsFuture struct { azure.Future } @@ -20868,10 +20320,15 @@ func (piplr PublicIPPrefixListResult) IsEmpty() bool { return piplr.Value == nil || len(*piplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (piplr PublicIPPrefixListResult) hasNextLink() bool { + return piplr.NextLink != nil && len(*piplr.NextLink) != 0 +} + // publicIPPrefixListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (piplr PublicIPPrefixListResult) publicIPPrefixListResultPreparer(ctx context.Context) (*http.Request, error) { - if piplr.NextLink == nil || len(to.String(piplr.NextLink)) < 1 { + if !piplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -20899,11 +20356,16 @@ func (page *PublicIPPrefixListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.piplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.piplr) + if err != nil { + return err + } + page.piplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.piplr = next return nil } @@ -20957,6 +20419,33 @@ type PublicIPPrefixPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for PublicIPPrefixPropertiesFormat. +func (pippf PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pippf.PublicIPAddressVersion != "" { + objectMap["publicIPAddressVersion"] = pippf.PublicIPAddressVersion + } + if pippf.IPTags != nil { + objectMap["ipTags"] = pippf.IPTags + } + if pippf.PrefixLength != nil { + objectMap["prefixLength"] = pippf.PrefixLength + } + if pippf.IPPrefix != nil { + objectMap["ipPrefix"] = pippf.IPPrefix + } + if pippf.PublicIPAddresses != nil { + objectMap["publicIPAddresses"] = pippf.PublicIPAddresses + } + if pippf.ResourceGUID != nil { + objectMap["resourceGuid"] = pippf.ResourceGUID + } + if pippf.ProvisioningState != nil { + objectMap["provisioningState"] = pippf.ProvisioningState + } + return json.Marshal(objectMap) +} + // PublicIPPrefixSku SKU of a public IP prefix type PublicIPPrefixSku struct { // Name - Name of a public IP prefix SKU. Possible values include: 'Standard' @@ -21092,6 +20581,18 @@ type ResourceNavigationLinkFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat. +func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rnlf.LinkedResourceType != nil { + objectMap["linkedResourceType"] = rnlf.LinkedResourceType + } + if rnlf.Link != nil { + objectMap["link"] = rnlf.Link + } + return json.Marshal(objectMap) +} + // RetentionPolicyParameters parameters that define the retention policy for flow log. type RetentionPolicyParameters struct { // Days - Number of days to retain flow log records. @@ -21373,10 +20874,15 @@ func (rflr RouteFilterListResult) IsEmpty() bool { return rflr.Value == nil || len(*rflr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rflr RouteFilterListResult) hasNextLink() bool { + return rflr.NextLink != nil && len(*rflr.NextLink) != 0 +} + // routeFilterListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) { - if rflr.NextLink == nil || len(to.String(rflr.NextLink)) < 1 { + if !rflr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -21404,11 +20910,16 @@ func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rflr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rflr) + if err != nil { + return err + } + page.rflr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rflr = next return nil } @@ -21452,6 +20963,18 @@ type RouteFilterPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for RouteFilterPropertiesFormat. +func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rfpf.Rules != nil { + objectMap["rules"] = rfpf.Rules + } + if rfpf.Peerings != nil { + objectMap["peerings"] = rfpf.Peerings + } + return json.Marshal(objectMap) +} + // RouteFilterRule route Filter Rule Resource type RouteFilterRule struct { autorest.Response `json:"-"` @@ -21621,10 +21144,15 @@ func (rfrlr RouteFilterRuleListResult) IsEmpty() bool { return rfrlr.Value == nil || len(*rfrlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rfrlr RouteFilterRuleListResult) hasNextLink() bool { + return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0 +} + // routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if rfrlr.NextLink == nil || len(to.String(rfrlr.NextLink)) < 1 { + if !rfrlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -21652,11 +21180,16 @@ func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rfrlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rfrlr) + if err != nil { + return err + } + page.rfrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rfrlr = next return nil } @@ -21702,6 +21235,21 @@ type RouteFilterRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for RouteFilterRulePropertiesFormat. +func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rfrpf.Access != "" { + objectMap["access"] = rfrpf.Access + } + if rfrpf.RouteFilterRuleType != nil { + objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType + } + if rfrpf.Communities != nil { + objectMap["communities"] = rfrpf.Communities + } + return json.Marshal(objectMap) +} + // RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type RouteFilterRulesCreateOrUpdateFuture struct { @@ -21783,8 +21331,8 @@ func (future *RouteFilterRulesUpdateFuture) Result(client RouteFilterRulesClient return } -// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type RouteFiltersCreateOrUpdateFuture struct { azure.Future } @@ -21941,10 +21489,15 @@ func (rlr RouteListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr RouteListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // routeListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -21972,11 +21525,16 @@ func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -22268,10 +21826,15 @@ func (rtlr RouteTableListResult) IsEmpty() bool { return rtlr.Value == nil || len(*rtlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rtlr RouteTableListResult) hasNextLink() bool { + return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 +} + // routeTableListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { - if rtlr.NextLink == nil || len(to.String(rtlr.NextLink)) < 1 { + if !rtlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -22299,11 +21862,16 @@ func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rtlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rtlr) + if err != nil { + return err + } + page.rtlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rtlr = next return nil } @@ -22349,8 +21917,23 @@ type RouteTablePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. +func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rtpf.Routes != nil { + objectMap["routes"] = rtpf.Routes + } + if rtpf.DisableBgpRoutePropagation != nil { + objectMap["disableBgpRoutePropagation"] = rtpf.DisableBgpRoutePropagation + } + if rtpf.ProvisioningState != nil { + objectMap["provisioningState"] = rtpf.ProvisioningState + } + return json.Marshal(objectMap) +} + +// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type RouteTablesCreateOrUpdateFuture struct { azure.Future } @@ -22625,10 +22208,15 @@ func (sglr SecurityGroupListResult) IsEmpty() bool { return sglr.Value == nil || len(*sglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sglr SecurityGroupListResult) hasNextLink() bool { + return sglr.NextLink != nil && len(*sglr.NextLink) != 0 +} + // securityGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if sglr.NextLink == nil || len(to.String(sglr.NextLink)) < 1 { + if !sglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -22656,11 +22244,16 @@ func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sglr) + if err != nil { + return err + } + page.sglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sglr = next return nil } @@ -22717,6 +22310,24 @@ type SecurityGroupPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. +func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgpf.SecurityRules != nil { + objectMap["securityRules"] = sgpf.SecurityRules + } + if sgpf.DefaultSecurityRules != nil { + objectMap["defaultSecurityRules"] = sgpf.DefaultSecurityRules + } + if sgpf.ResourceGUID != nil { + objectMap["resourceGuid"] = sgpf.ResourceGUID + } + if sgpf.ProvisioningState != nil { + objectMap["provisioningState"] = sgpf.ProvisioningState + } + return json.Marshal(objectMap) +} + // SecurityGroupResult network configuration diagnostic result corresponded provided traffic query. type SecurityGroupResult struct { // SecurityRuleAccessResult - The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' @@ -22725,6 +22336,15 @@ type SecurityGroupResult struct { EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"` } +// MarshalJSON is the custom marshaler for SecurityGroupResult. +func (sgr SecurityGroupResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgr.SecurityRuleAccessResult != "" { + objectMap["securityRuleAccessResult"] = sgr.SecurityRuleAccessResult + } + return json.Marshal(objectMap) +} + // SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SecurityGroupsCreateOrUpdateFuture struct { @@ -22777,8 +22397,8 @@ func (future *SecurityGroupsDeleteFuture) Result(client SecurityGroupsClient) (a return } -// SecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// SecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SecurityGroupsUpdateTagsFuture struct { azure.Future } @@ -22989,10 +22609,15 @@ func (srlr SecurityRuleListResult) IsEmpty() bool { return srlr.Value == nil || len(*srlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (srlr SecurityRuleListResult) hasNextLink() bool { + return srlr.NextLink != nil && len(*srlr.NextLink) != 0 +} + // securityRuleListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if srlr.NextLink == nil || len(to.String(srlr.NextLink)) < 1 { + if !srlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -23020,11 +22645,16 @@ func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.srlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.srlr) + if err != nil { + return err + } + page.srlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.srlr = next return nil } @@ -23094,8 +22724,8 @@ type SecurityRulePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type SecurityRulesCreateOrUpdateFuture struct { azure.Future } @@ -23250,6 +22880,18 @@ type ServiceAssociationLinkPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceAssociationLinkPropertiesFormat. +func (salpf ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if salpf.LinkedResourceType != nil { + objectMap["linkedResourceType"] = salpf.LinkedResourceType + } + if salpf.Link != nil { + objectMap["link"] = salpf.Link + } + return json.Marshal(objectMap) +} + // ServiceDelegationPropertiesFormat properties of a service delegation. type ServiceDelegationPropertiesFormat struct { // ServiceName - The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers) @@ -23260,8 +22902,20 @@ type ServiceDelegationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ServiceEndpointPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// MarshalJSON is the custom marshaler for ServiceDelegationPropertiesFormat. +func (sdpf ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdpf.ServiceName != nil { + objectMap["serviceName"] = sdpf.ServiceName + } + if sdpf.Actions != nil { + objectMap["actions"] = sdpf.Actions + } + return json.Marshal(objectMap) +} + +// ServiceEndpointPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ServiceEndpointPoliciesCreateOrUpdateFuture struct { azure.Future } @@ -23541,8 +23195,8 @@ func (sepd *ServiceEndpointPolicyDefinition) UnmarshalJSON(body []byte) error { return nil } -// ServiceEndpointPolicyDefinitionListResult response for ListServiceEndpointPolicyDefinition API service -// call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy. +// ServiceEndpointPolicyDefinitionListResult response for ListServiceEndpointPolicyDefinition API service call. +// Retrieves all service endpoint policy definition that belongs to a service endpoint policy. type ServiceEndpointPolicyDefinitionListResult struct { autorest.Response `json:"-"` // Value - The service endpoint policy definition in a service endpoint policy. @@ -23620,10 +23274,15 @@ func (sepdlr ServiceEndpointPolicyDefinitionListResult) IsEmpty() bool { return sepdlr.Value == nil || len(*sepdlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sepdlr ServiceEndpointPolicyDefinitionListResult) hasNextLink() bool { + return sepdlr.NextLink != nil && len(*sepdlr.NextLink) != 0 +} + // serviceEndpointPolicyDefinitionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sepdlr ServiceEndpointPolicyDefinitionListResult) serviceEndpointPolicyDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if sepdlr.NextLink == nil || len(to.String(sepdlr.NextLink)) < 1 { + if !sepdlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -23651,11 +23310,16 @@ func (page *ServiceEndpointPolicyDefinitionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sepdlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sepdlr) + if err != nil { + return err + } + page.sepdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sepdlr = next return nil } @@ -23701,6 +23365,21 @@ type ServiceEndpointPolicyDefinitionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceEndpointPolicyDefinitionPropertiesFormat. +func (sepdpf ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sepdpf.Description != nil { + objectMap["description"] = sepdpf.Description + } + if sepdpf.Service != nil { + objectMap["service"] = sepdpf.Service + } + if sepdpf.ServiceResources != nil { + objectMap["serviceResources"] = sepdpf.ServiceResources + } + return json.Marshal(objectMap) +} + // ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture struct { @@ -23730,8 +23409,8 @@ func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) Result(clien return } -// ServiceEndpointPolicyDefinitionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// ServiceEndpointPolicyDefinitionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type ServiceEndpointPolicyDefinitionsDeleteFuture struct { azure.Future } @@ -23762,6 +23441,15 @@ type ServiceEndpointPolicyListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceEndpointPolicyListResult. +func (seplr ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if seplr.Value != nil { + objectMap["value"] = seplr.Value + } + return json.Marshal(objectMap) +} + // ServiceEndpointPolicyListResultIterator provides access to a complete listing of ServiceEndpointPolicy // values. type ServiceEndpointPolicyListResultIterator struct { @@ -23831,10 +23519,15 @@ func (seplr ServiceEndpointPolicyListResult) IsEmpty() bool { return seplr.Value == nil || len(*seplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (seplr ServiceEndpointPolicyListResult) hasNextLink() bool { + return seplr.NextLink != nil && len(*seplr.NextLink) != 0 +} + // serviceEndpointPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (seplr ServiceEndpointPolicyListResult) serviceEndpointPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if seplr.NextLink == nil || len(to.String(seplr.NextLink)) < 1 { + if !seplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -23862,11 +23555,16 @@ func (page *ServiceEndpointPolicyListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.seplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.seplr) + if err != nil { + return err + } + page.seplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.seplr = next return nil } @@ -23912,6 +23610,15 @@ type ServiceEndpointPolicyPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for ServiceEndpointPolicyPropertiesFormat. +func (seppf ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if seppf.ServiceEndpointPolicyDefinitions != nil { + objectMap["serviceEndpointPolicyDefinitions"] = seppf.ServiceEndpointPolicyDefinitions + } + return json.Marshal(objectMap) +} + // ServiceEndpointPropertiesFormat the service endpoint properties. type ServiceEndpointPropertiesFormat struct { // Service - The type of the endpoint service. @@ -24018,6 +23725,15 @@ type SubnetAssociation struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` } +// MarshalJSON is the custom marshaler for SubnetAssociation. +func (sa SubnetAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sa.SecurityRules != nil { + objectMap["securityRules"] = sa.SecurityRules + } + return json.Marshal(objectMap) +} + // SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual // network type SubnetListResult struct { @@ -24096,10 +23812,15 @@ func (slr SubnetListResult) IsEmpty() bool { return slr.Value == nil || len(*slr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (slr SubnetListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + // subnetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { - if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + if !slr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -24127,11 +23848,16 @@ func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.slr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.slr = next return nil } @@ -24197,6 +23923,42 @@ type SubnetPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for SubnetPropertiesFormat. +func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spf.AddressPrefix != nil { + objectMap["addressPrefix"] = spf.AddressPrefix + } + if spf.AddressPrefixes != nil { + objectMap["addressPrefixes"] = spf.AddressPrefixes + } + if spf.NetworkSecurityGroup != nil { + objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup + } + if spf.RouteTable != nil { + objectMap["routeTable"] = spf.RouteTable + } + if spf.ServiceEndpoints != nil { + objectMap["serviceEndpoints"] = spf.ServiceEndpoints + } + if spf.ServiceEndpointPolicies != nil { + objectMap["serviceEndpointPolicies"] = spf.ServiceEndpointPolicies + } + if spf.ResourceNavigationLinks != nil { + objectMap["resourceNavigationLinks"] = spf.ResourceNavigationLinks + } + if spf.ServiceAssociationLinks != nil { + objectMap["serviceAssociationLinks"] = spf.ServiceAssociationLinks + } + if spf.Delegations != nil { + objectMap["delegations"] = spf.Delegations + } + if spf.ProvisioningState != nil { + objectMap["provisioningState"] = spf.ProvisioningState + } + return json.Marshal(objectMap) +} + // SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type SubnetsCreateOrUpdateFuture struct { @@ -24226,8 +23988,7 @@ func (future *SubnetsCreateOrUpdateFuture) Result(client SubnetsClient) (s Subne return } -// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type SubnetsDeleteFuture struct { azure.Future } @@ -24305,6 +24066,15 @@ type Topology struct { Resources *[]TopologyResource `json:"resources,omitempty"` } +// MarshalJSON is the custom marshaler for Topology. +func (t Topology) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.Resources != nil { + objectMap["resources"] = t.Resources + } + return json.Marshal(objectMap) +} + // TopologyAssociation resources that have an association with the parent resource. type TopologyAssociation struct { // Name - The name of the resource that is associated with the parent resource. @@ -24483,6 +24253,24 @@ type Usage struct { Name *UsageName `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.Unit != nil { + objectMap["unit"] = u.Unit + } + if u.CurrentValue != nil { + objectMap["currentValue"] = u.CurrentValue + } + if u.Limit != nil { + objectMap["limit"] = u.Limit + } + if u.Name != nil { + objectMap["name"] = u.Name + } + return json.Marshal(objectMap) +} + // UsageName the usage names. type UsageName struct { // Value - A string describing the resource name. @@ -24568,10 +24356,15 @@ func (ulr UsagesListResult) IsEmpty() bool { return ulr.Value == nil || len(*ulr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ulr UsagesListResult) hasNextLink() bool { + return ulr.NextLink != nil && len(*ulr.NextLink) != 0 +} + // usagesListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { - if ulr.NextLink == nil || len(to.String(ulr.NextLink)) < 1 { + if !ulr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -24599,11 +24392,16 @@ func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ulr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ulr) + if err != nil { + return err + } + page.ulr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ulr = next return nil } @@ -24820,8 +24618,8 @@ type VirtualHubRouteTable struct { Routes *[]VirtualHubRoute `json:"routes,omitempty"` } -// VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualHubsCreateOrUpdateFuture struct { azure.Future } @@ -25421,8 +25219,56 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` } -// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API -// service call +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntityPropertiesFormat. +func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngclepf.AuthorizationKey != nil { + objectMap["authorizationKey"] = vngclepf.AuthorizationKey + } + if vngclepf.VirtualNetworkGateway1 != nil { + objectMap["virtualNetworkGateway1"] = vngclepf.VirtualNetworkGateway1 + } + if vngclepf.VirtualNetworkGateway2 != nil { + objectMap["virtualNetworkGateway2"] = vngclepf.VirtualNetworkGateway2 + } + if vngclepf.LocalNetworkGateway2 != nil { + objectMap["localNetworkGateway2"] = vngclepf.LocalNetworkGateway2 + } + if vngclepf.ConnectionType != "" { + objectMap["connectionType"] = vngclepf.ConnectionType + } + if vngclepf.ConnectionProtocol != "" { + objectMap["connectionProtocol"] = vngclepf.ConnectionProtocol + } + if vngclepf.RoutingWeight != nil { + objectMap["routingWeight"] = vngclepf.RoutingWeight + } + if vngclepf.SharedKey != nil { + objectMap["sharedKey"] = vngclepf.SharedKey + } + if vngclepf.Peer != nil { + objectMap["peer"] = vngclepf.Peer + } + if vngclepf.EnableBgp != nil { + objectMap["enableBgp"] = vngclepf.EnableBgp + } + if vngclepf.UsePolicyBasedTrafficSelectors != nil { + objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors + } + if vngclepf.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vngclepf.IpsecPolicies + } + if vngclepf.ResourceGUID != nil { + objectMap["resourceGuid"] = vngclepf.ResourceGUID + } + if vngclepf.ExpressRouteGatewayBypass != nil { + objectMap["expressRouteGatewayBypass"] = vngclepf.ExpressRouteGatewayBypass + } + return json.Marshal(objectMap) +} + +// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API service +// call type VirtualNetworkGatewayConnectionListResult struct { autorest.Response `json:"-"` // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. @@ -25431,6 +25277,15 @@ type VirtualNetworkGatewayConnectionListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListResult. +func (vngclr VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngclr.Value != nil { + objectMap["value"] = vngclr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of // VirtualNetworkGatewayConnection values. type VirtualNetworkGatewayConnectionListResultIterator struct { @@ -25500,10 +25355,15 @@ func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { return vngclr.Value == nil || len(*vngclr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { + return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 +} + // virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if vngclr.NextLink == nil || len(to.String(vngclr.NextLink)) < 1 { + if !vngclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -25531,11 +25391,16 @@ func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx c tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vngclr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vngclr) + if err != nil { + return err + } + page.vngclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vngclr = next return nil } @@ -25611,6 +25476,54 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. +func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngcpf.AuthorizationKey != nil { + objectMap["authorizationKey"] = vngcpf.AuthorizationKey + } + if vngcpf.VirtualNetworkGateway1 != nil { + objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1 + } + if vngcpf.VirtualNetworkGateway2 != nil { + objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2 + } + if vngcpf.LocalNetworkGateway2 != nil { + objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2 + } + if vngcpf.ConnectionType != "" { + objectMap["connectionType"] = vngcpf.ConnectionType + } + if vngcpf.ConnectionProtocol != "" { + objectMap["connectionProtocol"] = vngcpf.ConnectionProtocol + } + if vngcpf.RoutingWeight != nil { + objectMap["routingWeight"] = vngcpf.RoutingWeight + } + if vngcpf.SharedKey != nil { + objectMap["sharedKey"] = vngcpf.SharedKey + } + if vngcpf.Peer != nil { + objectMap["peer"] = vngcpf.Peer + } + if vngcpf.EnableBgp != nil { + objectMap["enableBgp"] = vngcpf.EnableBgp + } + if vngcpf.UsePolicyBasedTrafficSelectors != nil { + objectMap["usePolicyBasedTrafficSelectors"] = vngcpf.UsePolicyBasedTrafficSelectors + } + if vngcpf.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vngcpf.IpsecPolicies + } + if vngcpf.ResourceGUID != nil { + objectMap["resourceGuid"] = vngcpf.ResourceGUID + } + if vngcpf.ExpressRouteGatewayBypass != nil { + objectMap["expressRouteGatewayBypass"] = vngcpf.ExpressRouteGatewayBypass + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { @@ -25640,8 +25553,8 @@ func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) Result(clien return } -// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkGatewayConnectionsDeleteFuture struct { azure.Future } @@ -25692,8 +25605,8 @@ func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) Result(clien return } -// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { azure.Future } @@ -25721,8 +25634,8 @@ func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) Result(client return } -// VirtualNetworkGatewayConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualNetworkGatewayConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct { azure.Future } @@ -25843,8 +25756,23 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API -// service call +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat. +func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngicpf.PrivateIPAllocationMethod != "" { + objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod + } + if vngicpf.Subnet != nil { + objectMap["subnet"] = vngicpf.Subnet + } + if vngicpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = vngicpf.PublicIPAddress + } + return json.Marshal(objectMap) +} + +// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API service +// call type VirtualNetworkGatewayListConnectionsResult struct { autorest.Response `json:"-"` // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. @@ -25853,6 +25781,15 @@ type VirtualNetworkGatewayListConnectionsResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListConnectionsResult. +func (vnglcr VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnglcr.Value != nil { + objectMap["value"] = vnglcr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayListConnectionsResultIterator provides access to a complete listing of // VirtualNetworkGatewayConnectionListEntity values. type VirtualNetworkGatewayListConnectionsResultIterator struct { @@ -25922,10 +25859,15 @@ func (vnglcr VirtualNetworkGatewayListConnectionsResult) IsEmpty() bool { return vnglcr.Value == nil || len(*vnglcr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnglcr VirtualNetworkGatewayListConnectionsResult) hasNextLink() bool { + return vnglcr.NextLink != nil && len(*vnglcr.NextLink) != 0 +} + // virtualNetworkGatewayListConnectionsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayListConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if vnglcr.NextLink == nil || len(to.String(vnglcr.NextLink)) < 1 { + if !vnglcr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -25934,8 +25876,8 @@ func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayLi autorest.WithBaseURL(to.String(vnglcr.NextLink))) } -// VirtualNetworkGatewayListConnectionsResultPage contains a page of -// VirtualNetworkGatewayConnectionListEntity values. +// VirtualNetworkGatewayListConnectionsResultPage contains a page of VirtualNetworkGatewayConnectionListEntity +// values. type VirtualNetworkGatewayListConnectionsResultPage struct { fn func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error) vnglcr VirtualNetworkGatewayListConnectionsResult @@ -25954,11 +25896,16 @@ func (page *VirtualNetworkGatewayListConnectionsResultPage) NextWithContext(ctx tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnglcr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnglcr) + if err != nil { + return err + } + page.vnglcr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnglcr = next return nil } @@ -26001,6 +25948,15 @@ type VirtualNetworkGatewayListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListResult. +func (vnglr VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnglr.Value != nil { + objectMap["value"] = vnglr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway // values. type VirtualNetworkGatewayListResultIterator struct { @@ -26070,10 +26026,15 @@ func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { return vnglr.Value == nil || len(*vnglr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { + return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 +} + // virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnglr.NextLink == nil || len(to.String(vnglr.NextLink)) < 1 { + if !vnglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -26101,11 +26062,16 @@ func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnglr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnglr) + if err != nil { + return err + } + page.vnglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnglr = next return nil } @@ -26165,6 +26131,42 @@ type VirtualNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. +func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngpf.IPConfigurations != nil { + objectMap["ipConfigurations"] = vngpf.IPConfigurations + } + if vngpf.GatewayType != "" { + objectMap["gatewayType"] = vngpf.GatewayType + } + if vngpf.VpnType != "" { + objectMap["vpnType"] = vngpf.VpnType + } + if vngpf.EnableBgp != nil { + objectMap["enableBgp"] = vngpf.EnableBgp + } + if vngpf.ActiveActive != nil { + objectMap["activeActive"] = vngpf.ActiveActive + } + if vngpf.GatewayDefaultSite != nil { + objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite + } + if vngpf.Sku != nil { + objectMap["sku"] = vngpf.Sku + } + if vngpf.VpnClientConfiguration != nil { + objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration + } + if vngpf.BgpSettings != nil { + objectMap["bgpSettings"] = vngpf.BgpSettings + } + if vngpf.ResourceGUID != nil { + objectMap["resourceGuid"] = vngpf.ResourceGUID + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkGatewaysCreateOrUpdateFuture struct { @@ -26246,8 +26248,8 @@ func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) Result(clien return } -// VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkGatewaysGenerateVpnProfileFuture struct { azure.Future } @@ -26275,8 +26277,8 @@ func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) Result(client Virt return } -// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { azure.Future } @@ -26304,8 +26306,8 @@ func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) Result(client Vir return } -// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { azure.Future } @@ -26333,8 +26335,8 @@ func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) Result(client Virtua return } -// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. +// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { azure.Future } @@ -26391,8 +26393,8 @@ func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) Result(cl return } -// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct { azure.Future } @@ -26430,8 +26432,8 @@ type VirtualNetworkGatewaySku struct { Capacity *int32 `json:"capacity,omitempty"` } -// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualNetworkGatewaysResetFuture struct { azure.Future } @@ -26459,8 +26461,8 @@ func (future *VirtualNetworkGatewaysResetFuture) Result(client VirtualNetworkGat return } -// VirtualNetworkGatewaysResetVpnClientSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// VirtualNetworkGatewaysResetVpnClientSharedKeyFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type VirtualNetworkGatewaysResetVpnClientSharedKeyFuture struct { azure.Future } @@ -26617,10 +26619,15 @@ func (vnlr VirtualNetworkListResult) IsEmpty() bool { return vnlr.Value == nil || len(*vnlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnlr VirtualNetworkListResult) hasNextLink() bool { + return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 +} + // virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnlr.NextLink == nil || len(to.String(vnlr.NextLink)) < 1 { + if !vnlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -26648,11 +26655,16 @@ func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) ( tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnlr) + if err != nil { + return err + } + page.vnlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnlr = next return nil } @@ -26695,8 +26707,16 @@ type VirtualNetworkListUsageResult struct { NextLink *string `json:"nextLink,omitempty"` } -// VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage -// values. +// MarshalJSON is the custom marshaler for VirtualNetworkListUsageResult. +func (vnlur VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnlur.NextLink != nil { + objectMap["nextLink"] = vnlur.NextLink + } + return json.Marshal(objectMap) +} + +// VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage values. type VirtualNetworkListUsageResultIterator struct { i int page VirtualNetworkListUsageResultPage @@ -26764,10 +26784,15 @@ func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool { return vnlur.Value == nil || len(*vnlur.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnlur VirtualNetworkListUsageResult) hasNextLink() bool { + return vnlur.NextLink != nil && len(*vnlur.NextLink) != 0 +} + // virtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer(ctx context.Context) (*http.Request, error) { - if vnlur.NextLink == nil || len(to.String(vnlur.NextLink)) < 1 { + if !vnlur.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -26795,11 +26820,16 @@ func (page *VirtualNetworkListUsageResultPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnlur) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnlur) + if err != nil { + return err + } + page.vnlur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnlur = next return nil } @@ -26915,8 +26945,8 @@ func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { return nil } -// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that -// belong to a virtual network. +// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that belong +// to a virtual network. type VirtualNetworkPeeringListResult struct { autorest.Response `json:"-"` // Value - The peerings in a virtual network. @@ -26994,10 +27024,15 @@ func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { return vnplr.Value == nil || len(*vnplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool { + return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0 +} + // virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnplr.NextLink == nil || len(to.String(vnplr.NextLink)) < 1 { + if !vnplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -27025,11 +27060,16 @@ func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnplr) + if err != nil { + return err + } + page.vnplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnplr = next return nil } @@ -27209,8 +27249,8 @@ func (future *VirtualNetworksDeleteFuture) Result(client VirtualNetworksClient) return } -// VirtualNetworksUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworksUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualNetworksUpdateTagsFuture struct { azure.Future } @@ -27433,10 +27473,15 @@ func (vntlr VirtualNetworkTapListResult) IsEmpty() bool { return vntlr.Value == nil || len(*vntlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vntlr VirtualNetworkTapListResult) hasNextLink() bool { + return vntlr.NextLink != nil && len(*vntlr.NextLink) != 0 +} + // virtualNetworkTapListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vntlr VirtualNetworkTapListResult) virtualNetworkTapListResultPreparer(ctx context.Context) (*http.Request, error) { - if vntlr.NextLink == nil || len(to.String(vntlr.NextLink)) < 1 { + if !vntlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -27464,11 +27509,16 @@ func (page *VirtualNetworkTapListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vntlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vntlr) + if err != nil { + return err + } + page.vntlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vntlr = next return nil } @@ -27518,6 +27568,21 @@ type VirtualNetworkTapPropertiesFormat struct { DestinationPort *int32 `json:"destinationPort,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkTapPropertiesFormat. +func (vntpf VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vntpf.DestinationNetworkInterfaceIPConfiguration != nil { + objectMap["destinationNetworkInterfaceIPConfiguration"] = vntpf.DestinationNetworkInterfaceIPConfiguration + } + if vntpf.DestinationLoadBalancerFrontEndIPConfiguration != nil { + objectMap["destinationLoadBalancerFrontEndIPConfiguration"] = vntpf.DestinationLoadBalancerFrontEndIPConfiguration + } + if vntpf.DestinationPort != nil { + objectMap["destinationPort"] = vntpf.DestinationPort + } + return json.Marshal(objectMap) +} + // VirtualNetworkTapsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkTapsCreateOrUpdateFuture struct { @@ -27547,8 +27612,8 @@ func (future *VirtualNetworkTapsCreateOrUpdateFuture) Result(client VirtualNetwo return } -// VirtualNetworkTapsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkTapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualNetworkTapsDeleteFuture struct { azure.Future } @@ -27757,8 +27822,35 @@ type VirtualWanProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// VirtualWansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// MarshalJSON is the custom marshaler for VirtualWanProperties. +func (vwp VirtualWanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vwp.DisableVpnEncryption != nil { + objectMap["disableVpnEncryption"] = vwp.DisableVpnEncryption + } + if vwp.SecurityProviderName != nil { + objectMap["securityProviderName"] = vwp.SecurityProviderName + } + if vwp.AllowBranchToBranchTraffic != nil { + objectMap["allowBranchToBranchTraffic"] = vwp.AllowBranchToBranchTraffic + } + if vwp.AllowVnetToVnetTraffic != nil { + objectMap["allowVnetToVnetTraffic"] = vwp.AllowVnetToVnetTraffic + } + if vwp.Office365LocalBreakoutCategory != "" { + objectMap["office365LocalBreakoutCategory"] = vwp.Office365LocalBreakoutCategory + } + if vwp.P2SVpnServerConfigurations != nil { + objectMap["p2SVpnServerConfigurations"] = vwp.P2SVpnServerConfigurations + } + if vwp.ProvisioningState != "" { + objectMap["provisioningState"] = vwp.ProvisioningState + } + return json.Marshal(objectMap) +} + +// VirtualWansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualWansCreateOrUpdateFuture struct { azure.Future } @@ -27884,6 +27976,18 @@ type VpnClientConnectionHealth struct { AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientConnectionHealth. +func (vcch VpnClientConnectionHealth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcch.VpnClientConnectionsCount != nil { + objectMap["vpnClientConnectionsCount"] = vcch.VpnClientConnectionsCount + } + if vcch.AllocatedIPAddresses != nil { + objectMap["allocatedIpAddresses"] = vcch.AllocatedIPAddresses + } + return json.Marshal(objectMap) +} + // VpnClientIPsecParameters an IPSec parameters for a virtual network gateway P2S connection. type VpnClientIPsecParameters struct { autorest.Response `json:"-"` @@ -28007,6 +28111,15 @@ type VpnClientRevokedCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat. +func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcrcpf.Thumbprint != nil { + objectMap["thumbprint"] = vcrcpf.Thumbprint + } + return json.Marshal(objectMap) +} + // VpnClientRootCertificate VPN client root certificate of virtual network gateway type VpnClientRootCertificate struct { // VpnClientRootCertificatePropertiesFormat - Properties of the vpn client root certificate. @@ -28096,6 +28209,15 @@ type VpnClientRootCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat. +func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcrcpf.PublicCertData != nil { + objectMap["publicCertData"] = vcrcpf.PublicCertData + } + return json.Marshal(objectMap) +} + // VpnConnection vpnConnection Resource. type VpnConnection struct { autorest.Response `json:"-"` @@ -28204,6 +28326,45 @@ type VpnConnectionProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VpnConnectionProperties. +func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcp.RemoteVpnSite != nil { + objectMap["remoteVpnSite"] = vcp.RemoteVpnSite + } + if vcp.RoutingWeight != nil { + objectMap["routingWeight"] = vcp.RoutingWeight + } + if vcp.ConnectionStatus != "" { + objectMap["connectionStatus"] = vcp.ConnectionStatus + } + if vcp.VpnConnectionProtocolType != "" { + objectMap["vpnConnectionProtocolType"] = vcp.VpnConnectionProtocolType + } + if vcp.ConnectionBandwidth != nil { + objectMap["connectionBandwidth"] = vcp.ConnectionBandwidth + } + if vcp.SharedKey != nil { + objectMap["sharedKey"] = vcp.SharedKey + } + if vcp.EnableBgp != nil { + objectMap["enableBgp"] = vcp.EnableBgp + } + if vcp.IpsecPolicies != nil { + objectMap["ipsecPolicies"] = vcp.IpsecPolicies + } + if vcp.EnableRateLimiting != nil { + objectMap["enableRateLimiting"] = vcp.EnableRateLimiting + } + if vcp.EnableInternetSecurity != nil { + objectMap["enableInternetSecurity"] = vcp.EnableInternetSecurity + } + if vcp.ProvisioningState != "" { + objectMap["provisioningState"] = vcp.ProvisioningState + } + return json.Marshal(objectMap) +} + // VpnConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VpnConnectionsCreateOrUpdateFuture struct { @@ -28394,8 +28555,8 @@ type VpnGatewayProperties struct { VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` } -// VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VpnGatewaysCreateOrUpdateFuture struct { azure.Future } @@ -28674,8 +28835,7 @@ func (future *VpnSitesCreateOrUpdateFuture) Result(client VpnSitesClient) (vs Vp return } -// VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type VpnSitesDeleteFuture struct { azure.Future } @@ -28855,8 +29015,8 @@ type WatcherPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WatchersCheckConnectivityFuture struct { azure.Future } @@ -28884,8 +29044,7 @@ func (future *WatchersCheckConnectivityFuture) Result(client WatchersClient) (ci return } -// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type WatchersDeleteFuture struct { azure.Future } @@ -28936,8 +29095,8 @@ func (future *WatchersGetAzureReachabilityReportFuture) Result(client WatchersCl return } -// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WatchersGetFlowLogStatusFuture struct { azure.Future } @@ -28965,8 +29124,8 @@ func (future *WatchersGetFlowLogStatusFuture) Result(client WatchersClient) (fli return } -// WatchersGetNetworkConfigurationDiagnosticFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// WatchersGetNetworkConfigurationDiagnosticFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. type WatchersGetNetworkConfigurationDiagnosticFuture struct { azure.Future } @@ -29023,8 +29182,8 @@ func (future *WatchersGetNextHopFuture) Result(client WatchersClient) (nhr NextH return } -// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WatchersGetTroubleshootingFuture struct { azure.Future } @@ -29081,8 +29240,8 @@ func (future *WatchersGetTroubleshootingResultFuture) Result(client WatchersClie return } -// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type WatchersGetVMSecurityRulesFuture struct { azure.Future } @@ -29213,6 +29372,27 @@ type WebApplicationFirewallCustomRule struct { Action WebApplicationFirewallAction `json:"action,omitempty"` } +// MarshalJSON is the custom marshaler for WebApplicationFirewallCustomRule. +func (wafcr WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafcr.Name != nil { + objectMap["name"] = wafcr.Name + } + if wafcr.Priority != nil { + objectMap["priority"] = wafcr.Priority + } + if wafcr.RuleType != "" { + objectMap["ruleType"] = wafcr.RuleType + } + if wafcr.MatchConditions != nil { + objectMap["matchConditions"] = wafcr.MatchConditions + } + if wafcr.Action != "" { + objectMap["action"] = wafcr.Action + } + return json.Marshal(objectMap) +} + // WebApplicationFirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type WebApplicationFirewallPoliciesDeleteFuture struct { @@ -29433,10 +29613,15 @@ func (wafplr WebApplicationFirewallPolicyListResult) IsEmpty() bool { return wafplr.Value == nil || len(*wafplr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (wafplr WebApplicationFirewallPolicyListResult) hasNextLink() bool { + return wafplr.NextLink != nil && len(*wafplr.NextLink) != 0 +} + // webApplicationFirewallPolicyListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (wafplr WebApplicationFirewallPolicyListResult) webApplicationFirewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if wafplr.NextLink == nil || len(to.String(wafplr.NextLink)) < 1 { + if !wafplr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -29464,11 +29649,16 @@ func (page *WebApplicationFirewallPolicyListResultPage) NextWithContext(ctx cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.wafplr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.wafplr) + if err != nil { + return err + } + page.wafplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.wafplr = next return nil } @@ -29515,3 +29705,15 @@ type WebApplicationFirewallPolicyPropertiesFormat struct { // ResourceState - READ-ONLY; Possible values include: 'WebApplicationFirewallPolicyResourceStateCreating', 'WebApplicationFirewallPolicyResourceStateEnabling', 'WebApplicationFirewallPolicyResourceStateEnabled', 'WebApplicationFirewallPolicyResourceStateDisabling', 'WebApplicationFirewallPolicyResourceStateDisabled', 'WebApplicationFirewallPolicyResourceStateDeleting' ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` } + +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPropertiesFormat. +func (wafppf WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafppf.PolicySettings != nil { + objectMap["policySettings"] = wafppf.PolicySettings + } + if wafppf.CustomRules != nil { + objectMap["customRules"] = wafppf.CustomRules + } + return json.Marshal(objectMap) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/operations.go index 43037ad3aab..5892b39beef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/operations.go @@ -71,6 +71,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe if err != nil { err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -101,7 +104,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpngateways.go index fbc36b01201..f24075e392d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpngateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpngateways.go @@ -113,7 +113,6 @@ func (client P2sVpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (futu func (client P2sVpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client P2sVpnGatewaysClient) DeleteSender(req *http.Request) (future P2sVp func (client P2sVpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfileSender(req *http.Request) ( func (client P2sVpnGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result VpnProfileResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -343,7 +340,6 @@ func (client P2sVpnGatewaysClient) GetSender(req *http.Request) (*http.Response, func (client P2sVpnGatewaysClient) GetResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -381,6 +377,9 @@ func (client P2sVpnGatewaysClient) List(ctx context.Context) (result ListP2SVpnG if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", resp, "Failure responding to request") } + if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -415,7 +414,6 @@ func (client P2sVpnGatewaysClient) ListSender(req *http.Request) (*http.Response func (client P2sVpnGatewaysClient) ListResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -492,6 +490,9 @@ func (client P2sVpnGatewaysClient) ListByResourceGroup(ctx context.Context, reso if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -527,7 +528,6 @@ func (client P2sVpnGatewaysClient) ListByResourceGroupSender(req *http.Request) func (client P2sVpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -643,7 +643,6 @@ func (client P2sVpnGatewaysClient) UpdateTagsSender(req *http.Request) (future P func (client P2sVpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result P2SVpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpnserverconfigurations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpnserverconfigurations.go index bf4f4d9413b..9464571dd68 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpnserverconfigurations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/p2svpnserverconfigurations.go @@ -117,7 +117,6 @@ func (client P2sVpnServerConfigurationsClient) CreateOrUpdateSender(req *http.Re func (client P2sVpnServerConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result P2SVpnServerConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -195,7 +194,6 @@ func (client P2sVpnServerConfigurationsClient) DeleteSender(req *http.Request) ( func (client P2sVpnServerConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -272,7 +270,6 @@ func (client P2sVpnServerConfigurationsClient) GetSender(req *http.Request) (*ht func (client P2sVpnServerConfigurationsClient) GetResponder(resp *http.Response) (result P2SVpnServerConfiguration, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -313,6 +310,9 @@ func (client P2sVpnServerConfigurationsClient) ListByVirtualWan(ctx context.Cont if err != nil { err = autorest.NewErrorWithError(err, "network.P2sVpnServerConfigurationsClient", "ListByVirtualWan", resp, "Failure responding to request") } + if result.lpvscr.hasNextLink() && result.lpvscr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -349,7 +349,6 @@ func (client P2sVpnServerConfigurationsClient) ListByVirtualWanSender(req *http. func (client P2sVpnServerConfigurationsClient) ListByVirtualWanResponder(resp *http.Response) (result ListP2SVpnServerConfigurationsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/packetcaptures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/packetcaptures.go index f6e5c9cd7af..b984be4744a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/packetcaptures.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/packetcaptures.go @@ -124,7 +124,6 @@ func (client PacketCapturesClient) CreateSender(req *http.Request) (future Packe func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result PacketCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,7 +201,6 @@ func (client PacketCapturesClient) DeleteSender(req *http.Request) (future Packe func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -279,7 +277,6 @@ func (client PacketCapturesClient) GetSender(req *http.Request) (*http.Response, func (client PacketCapturesClient) GetResponder(resp *http.Response) (result PacketCaptureResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -357,7 +354,6 @@ func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future Pa func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (result PacketCaptureQueryStatusResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -433,7 +429,6 @@ func (client PacketCapturesClient) ListSender(req *http.Request) (*http.Response func (client PacketCapturesClient) ListResponder(resp *http.Response) (result PacketCaptureListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -511,7 +506,6 @@ func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketC func (client PacketCapturesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/peerexpressroutecircuitconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/peerexpressroutecircuitconnections.go index 62b680038a6..852f6cf62d1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/peerexpressroutecircuitconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/peerexpressroutecircuitconnections.go @@ -115,7 +115,6 @@ func (client PeerExpressRouteCircuitConnectionsClient) GetSender(req *http.Reque func (client PeerExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result PeerExpressRouteCircuitConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -157,6 +156,9 @@ func (client PeerExpressRouteCircuitConnectionsClient) List(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") } + if result.percclr.hasNextLink() && result.percclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -194,7 +196,6 @@ func (client PeerExpressRouteCircuitConnectionsClient) ListSender(req *http.Requ func (client PeerExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result PeerExpressRouteCircuitConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/profiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/profiles.go index c056aa2bcb7..1fecf9b14ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/profiles.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/profiles.go @@ -112,7 +112,6 @@ func (client ProfilesClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client ProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDel func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,6 +304,9 @@ func (client ProfilesClient) List(ctx context.Context, resourceGroupName string) if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -342,7 +342,6 @@ func (client ProfilesClient) ListSender(req *http.Request) (*http.Response, erro func (client ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client ProfilesClient) ListAll(ctx context.Context) (result ProfileListRes if err != nil { err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -451,7 +453,6 @@ func (client ProfilesClient) ListAllSender(req *http.Request) (*http.Response, e func (client ProfilesClient) ListAllResponder(resp *http.Response) (result ProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -567,7 +568,6 @@ func (client ProfilesClient) UpdateTagsSender(req *http.Request) (*http.Response func (client ProfilesClient) UpdateTagsResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipaddresses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipaddresses.go index 92d6ff3a664..19af9010a62 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipaddresses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipaddresses.go @@ -125,7 +125,6 @@ func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (f func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -201,7 +200,6 @@ func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (future Pu func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -280,7 +278,6 @@ func (client PublicIPAddressesClient) GetSender(req *http.Request) (*http.Respon func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -368,7 +365,6 @@ func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressSe func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -408,6 +404,9 @@ func (client PublicIPAddressesClient) List(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to request") } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -443,7 +442,6 @@ func (client PublicIPAddressesClient) ListSender(req *http.Request) (*http.Respo func (client PublicIPAddressesClient) ListResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -518,6 +516,9 @@ func (client PublicIPAddressesClient) ListAll(ctx context.Context) (result Publi if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to request") } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -552,7 +553,6 @@ func (client PublicIPAddressesClient) ListAllSender(req *http.Request) (*http.Re func (client PublicIPAddressesClient) ListAllResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -631,6 +631,9 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure responding to request") } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -667,7 +670,6 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -749,6 +751,9 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure responding to request") } + if result.pialr.hasNextLink() && result.pialr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -788,7 +793,6 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -904,7 +908,6 @@ func (client PublicIPAddressesClient) UpdateTagsSender(req *http.Request) (futur func (client PublicIPAddressesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPAddress, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipprefixes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipprefixes.go index b0abec9f7da..525d67ebd21 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipprefixes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/publicipprefixes.go @@ -113,7 +113,6 @@ func (client PublicIPPrefixesClient) CreateOrUpdateSender(req *http.Request) (fu func (client PublicIPPrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPPrefix, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client PublicIPPrefixesClient) DeleteSender(req *http.Request) (future Pub func (client PublicIPPrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,7 +266,6 @@ func (client PublicIPPrefixesClient) GetSender(req *http.Request) (*http.Respons func (client PublicIPPrefixesClient) GetResponder(resp *http.Response) (result PublicIPPrefix, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -308,6 +305,9 @@ func (client PublicIPPrefixesClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", resp, "Failure responding to request") } + if result.piplr.hasNextLink() && result.piplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -343,7 +343,6 @@ func (client PublicIPPrefixesClient) ListSender(req *http.Request) (*http.Respon func (client PublicIPPrefixesClient) ListResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -418,6 +417,9 @@ func (client PublicIPPrefixesClient) ListAll(ctx context.Context) (result Public if err != nil { err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", resp, "Failure responding to request") } + if result.piplr.hasNextLink() && result.piplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client PublicIPPrefixesClient) ListAllSender(req *http.Request) (*http.Res func (client PublicIPPrefixesClient) ListAllResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,7 +569,6 @@ func (client PublicIPPrefixesClient) UpdateTagsSender(req *http.Request) (future func (client PublicIPPrefixesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPPrefix, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilterrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilterrules.go index 64fc8995af5..e0af50164f3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilterrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilterrules.go @@ -126,7 +126,6 @@ func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (fu func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -204,7 +203,6 @@ func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future Rou func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -281,7 +279,6 @@ func (client RouteFilterRulesClient) GetSender(req *http.Request) (*http.Respons func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -322,6 +319,9 @@ func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, reso if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure responding to request") } + if result.rfrlr.hasNextLink() && result.rfrlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -358,7 +358,6 @@ func (client RouteFilterRulesClient) ListByRouteFilterSender(req *http.Request) func (client RouteFilterRulesClient) ListByRouteFilterResponder(resp *http.Response) (result RouteFilterRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -478,7 +477,6 @@ func (client RouteFilterRulesClient) UpdateSender(req *http.Request) (future Rou func (client RouteFilterRulesClient) UpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilters.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilters.go index bbe4f02cf1c..8ea96ea5ca6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilters.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routefilters.go @@ -113,7 +113,6 @@ func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilter, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFi func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,7 +266,6 @@ func (client RouteFiltersClient) GetSender(req *http.Request) (*http.Response, e func (client RouteFiltersClient) GetResponder(resp *http.Response) (result RouteFilter, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +303,9 @@ func (client RouteFiltersClient) List(ctx context.Context) (result RouteFilterLi if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", resp, "Failure responding to request") } + if result.rflr.hasNextLink() && result.rflr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -340,7 +340,6 @@ func (client RouteFiltersClient) ListSender(req *http.Request) (*http.Response, func (client RouteFiltersClient) ListResponder(resp *http.Response) (result RouteFilterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client RouteFiltersClient) ListByResourceGroup(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.rflr.hasNextLink() && result.rflr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client RouteFiltersClient) ListByResourceGroupSender(req *http.Request) (* func (client RouteFiltersClient) ListByResourceGroupResponder(resp *http.Response) (result RouteFilterListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -571,7 +572,6 @@ func (client RouteFiltersClient) UpdateSender(req *http.Request) (future RouteFi func (client RouteFiltersClient) UpdateResponder(resp *http.Response) (result RouteFilter, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routes.go index 43278a97d51..a3ea8d83027 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routes.go @@ -114,7 +114,6 @@ func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future Route func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result Route, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -192,7 +191,6 @@ func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteF func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -269,7 +267,6 @@ func (client RoutesClient) GetSender(req *http.Request) (*http.Response, error) func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -310,6 +307,9 @@ func (client RoutesClient) List(ctx context.Context, resourceGroupName string, r if err != nil { err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to request") } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -346,7 +346,6 @@ func (client RoutesClient) ListSender(req *http.Request) (*http.Response, error) func (client RoutesClient) ListResponder(resp *http.Response) (result RouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routetables.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routetables.go index eec34752700..0e18600b2b1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routetables.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/routetables.go @@ -112,7 +112,6 @@ func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteTable, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTab func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client RouteTablesClient) GetSender(req *http.Request) (*http.Response, er func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteTable, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,6 +304,9 @@ func (client RouteTablesClient) List(ctx context.Context, resourceGroupName stri if err != nil { err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to request") } + if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -342,7 +342,6 @@ func (client RouteTablesClient) ListSender(req *http.Request) (*http.Response, e func (client RouteTablesClient) ListResponder(resp *http.Response) (result RouteTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client RouteTablesClient) ListAll(ctx context.Context) (result RouteTableL if err != nil { err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to request") } + if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -451,7 +453,6 @@ func (client RouteTablesClient) ListAllSender(req *http.Request) (*http.Response func (client RouteTablesClient) ListAllResponder(resp *http.Response) (result RouteTableListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -567,7 +568,6 @@ func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (future Rout func (client RouteTablesClient) UpdateTagsResponder(resp *http.Response) (result RouteTable, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securitygroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securitygroups.go index 05f9c19a254..2de92d91885 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securitygroups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securitygroups.go @@ -112,7 +112,6 @@ func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (futu func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,7 +187,6 @@ func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future Secur func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,7 +265,6 @@ func (client SecurityGroupsClient) GetSender(req *http.Request) (*http.Response, func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result SecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -307,6 +304,9 @@ func (client SecurityGroupsClient) List(ctx context.Context, resourceGroupName s if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to request") } + if result.sglr.hasNextLink() && result.sglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -342,7 +342,6 @@ func (client SecurityGroupsClient) ListSender(req *http.Request) (*http.Response func (client SecurityGroupsClient) ListResponder(resp *http.Response) (result SecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client SecurityGroupsClient) ListAll(ctx context.Context) (result Security if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to request") } + if result.sglr.hasNextLink() && result.sglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -451,7 +453,6 @@ func (client SecurityGroupsClient) ListAllSender(req *http.Request) (*http.Respo func (client SecurityGroupsClient) ListAllResponder(resp *http.Response) (result SecurityGroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -567,7 +568,6 @@ func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (future S func (client SecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result SecurityGroup, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securityrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securityrules.go index f375a448db4..14e60bc8c80 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securityrules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/securityrules.go @@ -114,7 +114,6 @@ func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (futur func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -192,7 +191,6 @@ func (client SecurityRulesClient) DeleteSender(req *http.Request) (future Securi func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -269,7 +267,6 @@ func (client SecurityRulesClient) GetSender(req *http.Request) (*http.Response, func (client SecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -310,6 +307,9 @@ func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName st if err != nil { err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to request") } + if result.srlr.hasNextLink() && result.srlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -346,7 +346,6 @@ func (client SecurityRulesClient) ListSender(req *http.Request) (*http.Response, func (client SecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicies.go index 896a41efd76..b3706507136 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicies.go @@ -113,7 +113,6 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdateSender(req *http.Reque func (client ServiceEndpointPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client ServiceEndpointPoliciesClient) DeleteSender(req *http.Request) (fut func (client ServiceEndpointPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -268,7 +266,6 @@ func (client ServiceEndpointPoliciesClient) GetSender(req *http.Request) (*http. func (client ServiceEndpointPoliciesClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,6 +303,9 @@ func (client ServiceEndpointPoliciesClient) List(ctx context.Context) (result Se if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", resp, "Failure responding to request") } + if result.seplr.hasNextLink() && result.seplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -340,7 +340,6 @@ func (client ServiceEndpointPoliciesClient) ListSender(req *http.Request) (*http func (client ServiceEndpointPoliciesClient) ListResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -417,6 +416,9 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroup(ctx context.Cont if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.seplr.hasNextLink() && result.seplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -452,7 +454,6 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroupSender(req *http. func (client ServiceEndpointPoliciesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -568,7 +569,6 @@ func (client ServiceEndpointPoliciesClient) UpdateSender(req *http.Request) (fut func (client ServiceEndpointPoliciesClient) UpdateResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicydefinitions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicydefinitions.go index 1d8352a6365..91bea5a462d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicydefinitions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/serviceendpointpolicydefinitions.go @@ -116,7 +116,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateSender(req *h func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -194,7 +193,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) DeleteSender(req *http.Requ func (client ServiceEndpointPolicyDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -271,7 +269,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) GetSender(req *http.Request func (client ServiceEndpointPolicyDefinitionsClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -312,6 +309,9 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroup(ctx con if err != nil { err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.sepdlr.hasNextLink() && result.sepdlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -348,7 +348,6 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupSender(r func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyDefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/subnets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/subnets.go index 03c9b2036e6..548ad25f2e5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/subnets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/subnets.go @@ -114,7 +114,6 @@ func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future Subn func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result Subnet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -192,7 +191,6 @@ func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDelet func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -273,7 +271,6 @@ func (client SubnetsClient) GetSender(req *http.Request) (*http.Response, error) func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -314,6 +311,9 @@ func (client SubnetsClient) List(ctx context.Context, resourceGroupName string, if err != nil { err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to request") } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -350,7 +350,6 @@ func (client SubnetsClient) ListSender(req *http.Request) (*http.Response, error func (client SubnetsClient) ListResponder(resp *http.Response) (result SubnetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -469,7 +468,6 @@ func (client SubnetsClient) PrepareNetworkPoliciesSender(req *http.Request) (fut func (client SubnetsClient) PrepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/usages.go index 06138d13cdf..bef4ab737b6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/usages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/usages.go @@ -80,6 +80,9 @@ func (client UsagesClient) List(ctx context.Context, location string) (result Us if err != nil { err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to request") } + if result.ulr.hasNextLink() && result.ulr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -115,7 +118,6 @@ func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) func (client UsagesClient) ListResponder(resp *http.Response) (result UsagesListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualhubs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualhubs.go index 93debd54768..24c5a94eb07 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualhubs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualhubs.go @@ -113,7 +113,6 @@ func (client VirtualHubsClient) CreateOrUpdateSender(req *http.Request) (future func (client VirtualHubsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHub, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client VirtualHubsClient) DeleteSender(req *http.Request) (future VirtualH func (client VirtualHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client VirtualHubsClient) GetSender(req *http.Request) (*http.Response, er func (client VirtualHubsClient) GetResponder(resp *http.Response) (result VirtualHub, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +299,9 @@ func (client VirtualHubsClient) List(ctx context.Context) (result ListVirtualHub if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure responding to request") } + if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -336,7 +336,6 @@ func (client VirtualHubsClient) ListSender(req *http.Request) (*http.Response, e func (client VirtualHubsClient) ListResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +412,9 @@ func (client VirtualHubsClient) ListByResourceGroup(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client VirtualHubsClient) ListByResourceGroupSender(req *http.Request) (*h func (client VirtualHubsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -564,7 +565,6 @@ func (client VirtualHubsClient) UpdateTagsSender(req *http.Request) (future Virt func (client VirtualHubsClient) UpdateTagsResponder(resp *http.Response) (result VirtualHub, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgatewayconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgatewayconnections.go index 400ccd33bf3..f90f0d03f3e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgatewayconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgatewayconnections.go @@ -127,7 +127,6 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *h func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -203,7 +202,6 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Requ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -278,7 +276,6 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSender(req *http.Request func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -355,7 +352,6 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *htt func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -396,6 +392,9 @@ func (client VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, r if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to request") } + if result.vngclr.hasNextLink() && result.vngclr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -431,7 +430,6 @@ func (client VirtualNetworkGatewayConnectionsClient) ListSender(req *http.Reques func (client VirtualNetworkGatewayConnectionsClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayConnectionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -559,7 +557,6 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *h func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(resp *http.Response) (result ConnectionResetSharedKey, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -647,7 +644,6 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *htt func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -726,7 +722,6 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http. func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgateways.go index 008cbd12af2..2c88db36ca1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkgateways.go @@ -120,7 +120,6 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Reques func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,7 +195,6 @@ func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (futu func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -275,7 +273,6 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *h func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -355,7 +352,6 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Re func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -431,7 +427,6 @@ func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.R func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -510,7 +505,6 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesSender(req *http.R func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -590,7 +584,6 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusSender(req *http.Requ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http.Response) (result BgpPeerStatusListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -667,7 +660,6 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesSender(req *http.Requ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -745,7 +737,6 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersSender(req func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -822,7 +813,6 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *ht func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -862,6 +852,9 @@ func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request") } + if result.vnglr.hasNextLink() && result.vnglr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -897,7 +890,6 @@ func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http. func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -975,6 +967,9 @@ func (client VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure responding to request") } + if result.vnglcr.hasNextLink() && result.vnglcr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1011,7 +1006,6 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsSender(req *http.Reque func (client VirtualNetworkGatewaysClient) ListConnectionsResponder(resp *http.Response) (result VirtualNetworkGatewayListConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1129,7 +1123,6 @@ func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (futur func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1206,7 +1199,6 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeySender(req *ht func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -1293,7 +1285,6 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersSender(req func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1369,7 +1360,6 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesSender(req *http.R func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -1448,7 +1438,6 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsSender(req *http.Request) ( func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1528,7 +1517,6 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptSender(re func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkpeerings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkpeerings.go index 87e8ecd8f42..4815f816850 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkpeerings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworkpeerings.go @@ -116,7 +116,6 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Reques func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -194,7 +193,6 @@ func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (futu func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -271,7 +269,6 @@ func (client VirtualNetworkPeeringsClient) GetSender(req *http.Request) (*http.R func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -312,6 +309,9 @@ func (client VirtualNetworkPeeringsClient) List(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to request") } + if result.vnplr.hasNextLink() && result.vnplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -348,7 +348,6 @@ func (client VirtualNetworkPeeringsClient) ListSender(req *http.Request) (*http. func (client VirtualNetworkPeeringsClient) ListResponder(resp *http.Response) (result VirtualNetworkPeeringListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworks.go index 4e4de59e99f..5761da91950 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworks.go @@ -111,7 +111,6 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilitySender(req *http.R func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *http.Response) (result IPAddressAvailabilityResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -190,7 +189,6 @@ func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (fut func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetwork, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -266,7 +264,6 @@ func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future Virt func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -345,7 +342,6 @@ func (client VirtualNetworksClient) GetSender(req *http.Request) (*http.Response func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result VirtualNetwork, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -385,6 +381,9 @@ func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to request") } + if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -420,7 +419,6 @@ func (client VirtualNetworksClient) ListSender(req *http.Request) (*http.Respons func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -495,6 +493,9 @@ func (client VirtualNetworksClient) ListAll(ctx context.Context) (result Virtual if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to request") } + if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -529,7 +530,6 @@ func (client VirtualNetworksClient) ListAllSender(req *http.Request) (*http.Resp func (client VirtualNetworksClient) ListAllResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -607,6 +607,9 @@ func (client VirtualNetworksClient) ListUsage(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure responding to request") } + if result.vnlur.hasNextLink() && result.vnlur.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -643,7 +646,6 @@ func (client VirtualNetworksClient) ListUsageSender(req *http.Request) (*http.Re func (client VirtualNetworksClient) ListUsageResponder(resp *http.Response) (result VirtualNetworkListUsageResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -759,7 +761,6 @@ func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (future func (client VirtualNetworksClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetwork, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworktaps.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworktaps.go index d3751f12f5a..73d0b0b94c5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworktaps.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualnetworktaps.go @@ -145,7 +145,6 @@ func (client VirtualNetworkTapsClient) CreateOrUpdateSender(req *http.Request) ( func (client VirtualNetworkTapsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkTap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -221,7 +220,6 @@ func (client VirtualNetworkTapsClient) DeleteSender(req *http.Request) (future V func (client VirtualNetworkTapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -296,7 +294,6 @@ func (client VirtualNetworkTapsClient) GetSender(req *http.Request) (*http.Respo func (client VirtualNetworkTapsClient) GetResponder(resp *http.Response) (result VirtualNetworkTap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -334,6 +331,9 @@ func (client VirtualNetworkTapsClient) ListAll(ctx context.Context) (result Virt if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", resp, "Failure responding to request") } + if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -368,7 +368,6 @@ func (client VirtualNetworkTapsClient) ListAllSender(req *http.Request) (*http.R func (client VirtualNetworkTapsClient) ListAllResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -445,6 +444,9 @@ func (client VirtualNetworkTapsClient) ListByResourceGroup(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -480,7 +482,6 @@ func (client VirtualNetworkTapsClient) ListByResourceGroupSender(req *http.Reque func (client VirtualNetworkTapsClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -596,7 +597,6 @@ func (client VirtualNetworkTapsClient) UpdateTagsSender(req *http.Request) (futu func (client VirtualNetworkTapsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkTap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualwans.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualwans.go index 170a5819828..10938d2ffcb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualwans.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/virtualwans.go @@ -113,7 +113,6 @@ func (client VirtualWansClient) CreateOrUpdateSender(req *http.Request) (future func (client VirtualWansClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualWAN, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client VirtualWansClient) DeleteSender(req *http.Request) (future VirtualW func (client VirtualWansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client VirtualWansClient) GetSender(req *http.Request) (*http.Response, er func (client VirtualWansClient) GetResponder(resp *http.Response) (result VirtualWAN, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +299,9 @@ func (client VirtualWansClient) List(ctx context.Context) (result ListVirtualWAN if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", resp, "Failure responding to request") } + if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -336,7 +336,6 @@ func (client VirtualWansClient) ListSender(req *http.Request) (*http.Response, e func (client VirtualWansClient) ListResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +412,9 @@ func (client VirtualWansClient) ListByResourceGroup(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client VirtualWansClient) ListByResourceGroupSender(req *http.Request) (*h func (client VirtualWansClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -564,7 +565,6 @@ func (client VirtualWansClient) UpdateTagsSender(req *http.Request) (future Virt func (client VirtualWansClient) UpdateTagsResponder(resp *http.Response) (result VirtualWAN, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnconnections.go index 96cc4c1ff1a..9463bfbdcb1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnconnections.go @@ -116,7 +116,6 @@ func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (futu func (client VpnConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -194,7 +193,6 @@ func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnCo func (client VpnConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -271,7 +269,6 @@ func (client VpnConnectionsClient) GetSender(req *http.Request) (*http.Response, func (client VpnConnectionsClient) GetResponder(resp *http.Response) (result VpnConnection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -312,6 +309,9 @@ func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure responding to request") } + if result.lvcr.hasNextLink() && result.lvcr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -348,7 +348,6 @@ func (client VpnConnectionsClient) ListByVpnGatewaySender(req *http.Request) (*h func (client VpnConnectionsClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnConnectionsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpngateways.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpngateways.go index c97382863b5..f32f3cf1538 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpngateways.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpngateways.go @@ -113,7 +113,6 @@ func (client VpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future func (client VpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client VpnGatewaysClient) DeleteSender(req *http.Request) (future VpnGatew func (client VpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client VpnGatewaysClient) GetSender(req *http.Request) (*http.Response, er func (client VpnGatewaysClient) GetResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +299,9 @@ func (client VpnGatewaysClient) List(ctx context.Context) (result ListVpnGateway if err != nil { err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure responding to request") } + if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -336,7 +336,6 @@ func (client VpnGatewaysClient) ListSender(req *http.Request) (*http.Response, e func (client VpnGatewaysClient) ListResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +412,9 @@ func (client VpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client VpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*h func (client VpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -564,7 +565,6 @@ func (client VpnGatewaysClient) UpdateTagsSender(req *http.Request) (future VpnG func (client VpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VpnGateway, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsites.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsites.go index 03ed28d630c..284ac723ed5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsites.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsites.go @@ -113,7 +113,6 @@ func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future Vpn func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDel func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -264,7 +262,6 @@ func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,6 +299,9 @@ func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResul if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request") } + if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -336,7 +336,6 @@ func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, erro func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +412,9 @@ func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +450,6 @@ func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -564,7 +565,6 @@ func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (future VpnSite func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsitesconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsitesconfiguration.go index 3f1fac18cde..4b71b320b06 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsitesconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/vpnsitesconfiguration.go @@ -113,7 +113,6 @@ func (client VpnSitesConfigurationClient) DownloadSender(req *http.Request) (fut func (client VpnSitesConfigurationClient) DownloadResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/watchers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/watchers.go index b64db5109aa..858314ed850 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/watchers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/watchers.go @@ -122,7 +122,6 @@ func (client WatchersClient) CheckConnectivitySender(req *http.Request) (future func (client WatchersClient) CheckConnectivityResponder(resp *http.Response) (result ConnectivityInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -201,7 +200,6 @@ func (client WatchersClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client WatchersClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -277,7 +275,6 @@ func (client WatchersClient) DeleteSender(req *http.Request) (future WatchersDel func (client WatchersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -352,7 +349,6 @@ func (client WatchersClient) GetSender(req *http.Request) (*http.Response, error func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -441,7 +437,6 @@ func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Response) (result AzureReachabilityReport, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -526,7 +521,6 @@ func (client WatchersClient) GetFlowLogStatusSender(req *http.Request) (future W func (client WatchersClient) GetFlowLogStatusResponder(resp *http.Response) (result FlowLogInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -612,7 +606,6 @@ func (client WatchersClient) GetNetworkConfigurationDiagnosticSender(req *http.R func (client WatchersClient) GetNetworkConfigurationDiagnosticResponder(resp *http.Response) (result ConfigurationDiagnosticResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -699,7 +692,6 @@ func (client WatchersClient) GetNextHopSender(req *http.Request) (future Watcher func (client WatchersClient) GetNextHopResponder(resp *http.Response) (result NextHopResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -778,7 +770,6 @@ func (client WatchersClient) GetTopologySender(req *http.Request) (*http.Respons func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result Topology, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -867,7 +858,6 @@ func (client WatchersClient) GetTroubleshootingSender(req *http.Request) (future func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (result TroubleshootingResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -952,7 +942,6 @@ func (client WatchersClient) GetTroubleshootingResultSender(req *http.Request) ( func (client WatchersClient) GetTroubleshootingResultResponder(resp *http.Response) (result TroubleshootingResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1037,7 +1026,6 @@ func (client WatchersClient) GetVMSecurityRulesSender(req *http.Request) (future func (client WatchersClient) GetVMSecurityRulesResponder(resp *http.Response) (result SecurityGroupViewResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1111,7 +1099,6 @@ func (client WatchersClient) ListSender(req *http.Request) (*http.Response, erro func (client WatchersClient) ListResponder(resp *http.Response) (result WatcherListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1182,7 +1169,6 @@ func (client WatchersClient) ListAllSender(req *http.Request) (*http.Response, e func (client WatchersClient) ListAllResponder(resp *http.Response) (result WatcherListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1261,7 +1247,6 @@ func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (fu func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response) (result AvailableProvidersList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1358,7 +1343,6 @@ func (client WatchersClient) SetFlowLogConfigurationSender(req *http.Request) (f func (client WatchersClient) SetFlowLogConfigurationResponder(resp *http.Response) (result FlowLogInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1437,7 +1421,6 @@ func (client WatchersClient) UpdateTagsSender(req *http.Request) (*http.Response func (client WatchersClient) UpdateTagsResponder(resp *http.Response) (result Watcher, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1526,7 +1509,6 @@ func (client WatchersClient) VerifyIPFlowSender(req *http.Request) (future Watch func (client WatchersClient) VerifyIPFlowResponder(resp *http.Response) (result VerificationIPFlowResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/webapplicationfirewallpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/webapplicationfirewallpolicies.go index 2f6045bf18f..bccdf938e91 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/webapplicationfirewallpolicies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-12-01/network/webapplicationfirewallpolicies.go @@ -120,7 +120,6 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateSender(req *htt func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,7 +201,6 @@ func (client WebApplicationFirewallPoliciesClient) DeleteSender(req *http.Reques func (client WebApplicationFirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -283,7 +281,6 @@ func (client WebApplicationFirewallPoliciesClient) GetSender(req *http.Request) func (client WebApplicationFirewallPoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -323,6 +320,9 @@ func (client WebApplicationFirewallPoliciesClient) List(ctx context.Context, res if err != nil { err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", resp, "Failure responding to request") } + if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -358,7 +358,6 @@ func (client WebApplicationFirewallPoliciesClient) ListSender(req *http.Request) func (client WebApplicationFirewallPoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -433,6 +432,9 @@ func (client WebApplicationFirewallPoliciesClient) ListAll(ctx context.Context) if err != nil { err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", resp, "Failure responding to request") } + if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -467,7 +469,6 @@ func (client WebApplicationFirewallPoliciesClient) ListAllSender(req *http.Reque func (client WebApplicationFirewallPoliciesClient) ListAllResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/enums.go new file mode 100644 index 00000000000..b5ab94cc3e6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/enums.go @@ -0,0 +1,64 @@ +package dns + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// RecordType enumerates the values for record type. +type RecordType string + +const ( + // A ... + A RecordType = "A" + // AAAA ... + AAAA RecordType = "AAAA" + // CAA ... + CAA RecordType = "CAA" + // CNAME ... + CNAME RecordType = "CNAME" + // MX ... + MX RecordType = "MX" + // NS ... + NS RecordType = "NS" + // PTR ... + PTR RecordType = "PTR" + // SOA ... + SOA RecordType = "SOA" + // SRV ... + SRV RecordType = "SRV" + // TXT ... + TXT RecordType = "TXT" +) + +// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. +func PossibleRecordTypeValues() []RecordType { + return []RecordType{A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT} +} + +// ZoneType enumerates the values for zone type. +type ZoneType string + +const ( + // Private ... + Private ZoneType = "Private" + // Public ... + Public ZoneType = "Public" +) + +// PossibleZoneTypeValues returns an array of possible values for the ZoneType const type. +func PossibleZoneTypeValues() []ZoneType { + return []ZoneType{Private, Public} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go index 538db27d647..cb0504e4d73 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/models.go @@ -30,52 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" -// RecordType enumerates the values for record type. -type RecordType string - -const ( - // A ... - A RecordType = "A" - // AAAA ... - AAAA RecordType = "AAAA" - // CAA ... - CAA RecordType = "CAA" - // CNAME ... - CNAME RecordType = "CNAME" - // MX ... - MX RecordType = "MX" - // NS ... - NS RecordType = "NS" - // PTR ... - PTR RecordType = "PTR" - // SOA ... - SOA RecordType = "SOA" - // SRV ... - SRV RecordType = "SRV" - // TXT ... - TXT RecordType = "TXT" -) - -// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. -func PossibleRecordTypeValues() []RecordType { - return []RecordType{A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT} -} - -// ZoneType enumerates the values for zone type. -type ZoneType string - -const ( - // Private ... - Private ZoneType = "Private" - // Public ... - Public ZoneType = "Public" -) - -// PossibleZoneTypeValues returns an array of possible values for the ZoneType const type. -func PossibleZoneTypeValues() []ZoneType { - return []ZoneType{Private, Public} -} - // AaaaRecord an AAAA record. type AaaaRecord struct { // Ipv6Address - The IPv6 address of this AAAA record. @@ -261,6 +215,15 @@ type RecordSetListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for RecordSetListResult. +func (rslr RecordSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rslr.Value != nil { + objectMap["value"] = rslr.Value + } + return json.Marshal(objectMap) +} + // RecordSetListResultIterator provides access to a complete listing of RecordSet values. type RecordSetListResultIterator struct { i int @@ -329,10 +292,15 @@ func (rslr RecordSetListResult) IsEmpty() bool { return rslr.Value == nil || len(*rslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rslr RecordSetListResult) hasNextLink() bool { + return rslr.NextLink != nil && len(*rslr.NextLink) != 0 +} + // recordSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rslr RecordSetListResult) recordSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if rslr.NextLink == nil || len(to.String(rslr.NextLink)) < 1 { + if !rslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -360,11 +328,16 @@ func (page *RecordSetListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rslr) + if err != nil { + return err + } + page.rslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rslr = next return nil } @@ -678,6 +651,15 @@ type ZoneListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ZoneListResult. +func (zlr ZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if zlr.Value != nil { + objectMap["value"] = zlr.Value + } + return json.Marshal(objectMap) +} + // ZoneListResultIterator provides access to a complete listing of Zone values. type ZoneListResultIterator struct { i int @@ -746,10 +728,15 @@ func (zlr ZoneListResult) IsEmpty() bool { return zlr.Value == nil || len(*zlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (zlr ZoneListResult) hasNextLink() bool { + return zlr.NextLink != nil && len(*zlr.NextLink) != 0 +} + // zoneListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (zlr ZoneListResult) zoneListResultPreparer(ctx context.Context) (*http.Request, error) { - if zlr.NextLink == nil || len(to.String(zlr.NextLink)) < 1 { + if !zlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -777,11 +764,16 @@ func (page *ZoneListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.zlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.zlr) + if err != nil { + return err + } + page.zlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.zlr = next return nil } @@ -831,6 +823,21 @@ type ZoneProperties struct { ResolutionVirtualNetworks *[]SubResource `json:"resolutionVirtualNetworks,omitempty"` } +// MarshalJSON is the custom marshaler for ZoneProperties. +func (zp ZoneProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if zp.ZoneType != "" { + objectMap["zoneType"] = zp.ZoneType + } + if zp.RegistrationVirtualNetworks != nil { + objectMap["registrationVirtualNetworks"] = zp.RegistrationVirtualNetworks + } + if zp.ResolutionVirtualNetworks != nil { + objectMap["resolutionVirtualNetworks"] = zp.ResolutionVirtualNetworks + } + return json.Marshal(objectMap) +} + // ZonesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ZonesDeleteFuture struct { azure.Future diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go index fa1ad571da8..d6e25c8f057 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/recordsets.go @@ -143,7 +143,6 @@ func (client RecordSetsClient) CreateOrUpdateSender(req *http.Request) (*http.Re func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -240,7 +239,6 @@ func (client RecordSetsClient) DeleteSender(req *http.Request) (*http.Response, func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -329,7 +327,6 @@ func (client RecordSetsClient) GetSender(req *http.Request) (*http.Response, err func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -384,6 +381,9 @@ func (client RecordSetsClient) ListAllByDNSZone(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAllByDNSZone", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -426,7 +426,6 @@ func (client RecordSetsClient) ListAllByDNSZoneSender(req *http.Request) (*http. func (client RecordSetsClient) ListAllByDNSZoneResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -518,6 +517,9 @@ func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupN if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByDNSZone", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -560,7 +562,6 @@ func (client RecordSetsClient) ListByDNSZoneSender(req *http.Request) (*http.Res func (client RecordSetsClient) ListByDNSZoneResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -653,6 +654,9 @@ func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListByType", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -696,7 +700,6 @@ func (client RecordSetsClient) ListByTypeSender(req *http.Request) (*http.Respon func (client RecordSetsClient) ListByTypeResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -835,7 +838,6 @@ func (client RecordSetsClient) UpdateSender(req *http.Request) (*http.Response, func (client RecordSetsClient) UpdateResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go index 2a994f8716c..5f89085a2ac 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns/zones.go @@ -135,7 +135,6 @@ func (client ZonesClient) CreateOrUpdateSender(req *http.Request) (*http.Respons func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Zone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -228,7 +227,6 @@ func (client ZonesClient) DeleteSender(req *http.Request) (future ZonesDeleteFut func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -313,7 +311,6 @@ func (client ZonesClient) GetSender(req *http.Request) (*http.Response, error) { func (client ZonesClient) GetResponder(resp *http.Response) (result Zone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -359,6 +356,9 @@ func (client ZonesClient) List(ctx context.Context, top *int32) (result ZoneList if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "List", resp, "Failure responding to request") } + if result.zlr.hasNextLink() && result.zlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -396,7 +396,6 @@ func (client ZonesClient) ListSender(req *http.Request) (*http.Response, error) func (client ZonesClient) ListResponder(resp *http.Response) (result ZoneListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -484,6 +483,9 @@ func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "dns.ZonesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.zlr.hasNextLink() && result.zlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -522,7 +524,6 @@ func (client ZonesClient) ListByResourceGroupSender(req *http.Request) (*http.Re func (client ZonesClient) ListByResourceGroupResponder(resp *http.Response) (result ZoneListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -654,7 +655,6 @@ func (client ZonesClient) UpdateSender(req *http.Request) (*http.Response, error func (client ZonesClient) UpdateResponder(resp *http.Response) (result Zone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/enums.go new file mode 100644 index 00000000000..23e530ee2c0 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/enums.go @@ -0,0 +1,83 @@ +package privatedns + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + +// RecordType enumerates the values for record type. +type RecordType string + +const ( + // A ... + A RecordType = "A" + // AAAA ... + AAAA RecordType = "AAAA" + // CNAME ... + CNAME RecordType = "CNAME" + // MX ... + MX RecordType = "MX" + // PTR ... + PTR RecordType = "PTR" + // SOA ... + SOA RecordType = "SOA" + // SRV ... + SRV RecordType = "SRV" + // TXT ... + TXT RecordType = "TXT" +) + +// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. +func PossibleRecordTypeValues() []RecordType { + return []RecordType{A, AAAA, CNAME, MX, PTR, SOA, SRV, TXT} +} + +// VirtualNetworkLinkState enumerates the values for virtual network link state. +type VirtualNetworkLinkState string + +const ( + // Completed ... + Completed VirtualNetworkLinkState = "Completed" + // InProgress ... + InProgress VirtualNetworkLinkState = "InProgress" +) + +// PossibleVirtualNetworkLinkStateValues returns an array of possible values for the VirtualNetworkLinkState const type. +func PossibleVirtualNetworkLinkStateValues() []VirtualNetworkLinkState { + return []VirtualNetworkLinkState{Completed, InProgress} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/models.go index af93b18015c..a590f9024c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/models.go @@ -30,71 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} -} - -// RecordType enumerates the values for record type. -type RecordType string - -const ( - // A ... - A RecordType = "A" - // AAAA ... - AAAA RecordType = "AAAA" - // CNAME ... - CNAME RecordType = "CNAME" - // MX ... - MX RecordType = "MX" - // PTR ... - PTR RecordType = "PTR" - // SOA ... - SOA RecordType = "SOA" - // SRV ... - SRV RecordType = "SRV" - // TXT ... - TXT RecordType = "TXT" -) - -// PossibleRecordTypeValues returns an array of possible values for the RecordType const type. -func PossibleRecordTypeValues() []RecordType { - return []RecordType{A, AAAA, CNAME, MX, PTR, SOA, SRV, TXT} -} - -// VirtualNetworkLinkState enumerates the values for virtual network link state. -type VirtualNetworkLinkState string - -const ( - // Completed ... - Completed VirtualNetworkLinkState = "Completed" - // InProgress ... - InProgress VirtualNetworkLinkState = "InProgress" -) - -// PossibleVirtualNetworkLinkStateValues returns an array of possible values for the VirtualNetworkLinkState const type. -func PossibleVirtualNetworkLinkStateValues() []VirtualNetworkLinkState { - return []VirtualNetworkLinkState{Completed, InProgress} -} - // AaaaRecord an AAAA record. type AaaaRecord struct { // Ipv6Address - The IPv6 address of this AAAA record. @@ -263,6 +198,15 @@ type PrivateZoneListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for PrivateZoneListResult. +func (pzlr PrivateZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pzlr.Value != nil { + objectMap["value"] = pzlr.Value + } + return json.Marshal(objectMap) +} + // PrivateZoneListResultIterator provides access to a complete listing of PrivateZone values. type PrivateZoneListResultIterator struct { i int @@ -331,10 +275,15 @@ func (pzlr PrivateZoneListResult) IsEmpty() bool { return pzlr.Value == nil || len(*pzlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (pzlr PrivateZoneListResult) hasNextLink() bool { + return pzlr.NextLink != nil && len(*pzlr.NextLink) != 0 +} + // privateZoneListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pzlr PrivateZoneListResult) privateZoneListResultPreparer(ctx context.Context) (*http.Request, error) { - if pzlr.NextLink == nil || len(to.String(pzlr.NextLink)) < 1 { + if !pzlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -362,11 +311,16 @@ func (page *PrivateZoneListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.pzlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.pzlr) + if err != nil { + return err + } + page.pzlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.pzlr = next return nil } @@ -418,8 +372,8 @@ type PrivateZoneProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// PrivateZonesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// PrivateZonesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type PrivateZonesCreateOrUpdateFuture struct { azure.Future } @@ -515,8 +469,8 @@ type PtrRecord struct { Ptrdname *string `json:"ptrdname,omitempty"` } -// RecordSet describes a DNS record set (a collection of DNS records with the same name and type) in a -// Private DNS zone. +// RecordSet describes a DNS record set (a collection of DNS records with the same name and type) in a Private +// DNS zone. type RecordSet struct { autorest.Response `json:"-"` // Etag - The ETag of the record set. @@ -612,6 +566,15 @@ type RecordSetListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for RecordSetListResult. +func (rslr RecordSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rslr.Value != nil { + objectMap["value"] = rslr.Value + } + return json.Marshal(objectMap) +} + // RecordSetListResultIterator provides access to a complete listing of RecordSet values. type RecordSetListResultIterator struct { i int @@ -680,10 +643,15 @@ func (rslr RecordSetListResult) IsEmpty() bool { return rslr.Value == nil || len(*rslr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rslr RecordSetListResult) hasNextLink() bool { + return rslr.NextLink != nil && len(*rslr.NextLink) != 0 +} + // recordSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rslr RecordSetListResult) recordSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if rslr.NextLink == nil || len(to.String(rslr.NextLink)) < 1 { + if !rslr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -711,11 +679,16 @@ func (page *RecordSetListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rslr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rslr) + if err != nil { + return err + } + page.rslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rslr = next return nil } @@ -1015,6 +988,15 @@ type VirtualNetworkLinkListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkLinkListResult. +func (vnllr VirtualNetworkLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnllr.Value != nil { + objectMap["value"] = vnllr.Value + } + return json.Marshal(objectMap) +} + // VirtualNetworkLinkListResultIterator provides access to a complete listing of VirtualNetworkLink values. type VirtualNetworkLinkListResultIterator struct { i int @@ -1083,10 +1065,15 @@ func (vnllr VirtualNetworkLinkListResult) IsEmpty() bool { return vnllr.Value == nil || len(*vnllr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (vnllr VirtualNetworkLinkListResult) hasNextLink() bool { + return vnllr.NextLink != nil && len(*vnllr.NextLink) != 0 +} + // virtualNetworkLinkListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (vnllr VirtualNetworkLinkListResult) virtualNetworkLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if vnllr.NextLink == nil || len(to.String(vnllr.NextLink)) < 1 { + if !vnllr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1114,11 +1101,16 @@ func (page *VirtualNetworkLinkListResultPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.vnllr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.vnllr) + if err != nil { + return err + } + page.vnllr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.vnllr = next return nil } @@ -1164,6 +1156,18 @@ type VirtualNetworkLinkProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for VirtualNetworkLinkProperties. +func (vnlp VirtualNetworkLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnlp.VirtualNetwork != nil { + objectMap["virtualNetwork"] = vnlp.VirtualNetwork + } + if vnlp.RegistrationEnabled != nil { + objectMap["registrationEnabled"] = vnlp.RegistrationEnabled + } + return json.Marshal(objectMap) +} + // VirtualNetworkLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualNetworkLinksCreateOrUpdateFuture struct { @@ -1193,8 +1197,8 @@ func (future *VirtualNetworkLinksCreateOrUpdateFuture) Result(client VirtualNetw return } -// VirtualNetworkLinksDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkLinksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualNetworkLinksDeleteFuture struct { azure.Future } @@ -1216,8 +1220,8 @@ func (future *VirtualNetworkLinksDeleteFuture) Result(client VirtualNetworkLinks return } -// VirtualNetworkLinksUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// VirtualNetworkLinksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type VirtualNetworkLinksUpdateFuture struct { azure.Future } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/privatezones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/privatezones.go index 358c94c248b..b9051430633 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/privatezones.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/privatezones.go @@ -125,7 +125,6 @@ func (client PrivateZonesClient) CreateOrUpdateSender(req *http.Request) (future func (client PrivateZonesClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateZone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -208,7 +207,6 @@ func (client PrivateZonesClient) DeleteSender(req *http.Request) (future Private func (client PrivateZonesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -284,7 +282,6 @@ func (client PrivateZonesClient) GetSender(req *http.Request) (*http.Response, e func (client PrivateZonesClient) GetResponder(resp *http.Response) (result PrivateZone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -324,6 +321,9 @@ func (client PrivateZonesClient) List(ctx context.Context, top *int32) (result P if err != nil { err = autorest.NewErrorWithError(err, "privatedns.PrivateZonesClient", "List", resp, "Failure responding to request") } + if result.pzlr.hasNextLink() && result.pzlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -361,7 +361,6 @@ func (client PrivateZonesClient) ListSender(req *http.Request) (*http.Response, func (client PrivateZonesClient) ListResponder(resp *http.Response) (result PrivateZoneListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -439,6 +438,9 @@ func (client PrivateZonesClient) ListByResourceGroup(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "privatedns.PrivateZonesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.pzlr.hasNextLink() && result.pzlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -477,7 +479,6 @@ func (client PrivateZonesClient) ListByResourceGroupSender(req *http.Request) (* func (client PrivateZonesClient) ListByResourceGroupResponder(resp *http.Response) (result PrivateZoneListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -599,7 +600,6 @@ func (client PrivateZonesClient) UpdateSender(req *http.Request) (future Private func (client PrivateZonesClient) UpdateResponder(resp *http.Response) (result PrivateZone, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/recordsets.go index 421d2d75327..76dc0c3efc5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/recordsets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/recordsets.go @@ -129,7 +129,6 @@ func (client RecordSetsClient) CreateOrUpdateSender(req *http.Request) (*http.Re func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -216,7 +215,6 @@ func (client RecordSetsClient) DeleteSender(req *http.Request) (*http.Response, func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -295,7 +293,6 @@ func (client RecordSetsClient) GetSender(req *http.Request) (*http.Response, err func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -340,6 +337,9 @@ func (client RecordSetsClient) List(ctx context.Context, resourceGroupName strin if err != nil { err = autorest.NewErrorWithError(err, "privatedns.RecordSetsClient", "List", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -382,7 +382,6 @@ func (client RecordSetsClient) ListSender(req *http.Request) (*http.Response, er func (client RecordSetsClient) ListResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -465,6 +464,9 @@ func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "privatedns.RecordSetsClient", "ListByType", resp, "Failure responding to request") } + if result.rslr.hasNextLink() && result.rslr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -508,7 +510,6 @@ func (client RecordSetsClient) ListByTypeSender(req *http.Request) (*http.Respon func (client RecordSetsClient) ListByTypeResponder(resp *http.Response) (result RecordSetListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -634,7 +635,6 @@ func (client RecordSetsClient) UpdateSender(req *http.Request) (*http.Response, func (client RecordSetsClient) UpdateResponder(resp *http.Response) (result RecordSet, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/virtualnetworklinks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/virtualnetworklinks.go index b723e257709..9bfda96e861 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/virtualnetworklinks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns/virtualnetworklinks.go @@ -128,7 +128,6 @@ func (client VirtualNetworkLinksClient) CreateOrUpdateSender(req *http.Request) func (client VirtualNetworkLinksClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkLink, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -214,7 +213,6 @@ func (client VirtualNetworkLinksClient) DeleteSender(req *http.Request) (future func (client VirtualNetworkLinksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -291,7 +289,6 @@ func (client VirtualNetworkLinksClient) GetSender(req *http.Request) (*http.Resp func (client VirtualNetworkLinksClient) GetResponder(resp *http.Response) (result VirtualNetworkLink, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -334,6 +331,9 @@ func (client VirtualNetworkLinksClient) List(ctx context.Context, resourceGroupN if err != nil { err = autorest.NewErrorWithError(err, "privatedns.VirtualNetworkLinksClient", "List", resp, "Failure responding to request") } + if result.vnllr.hasNextLink() && result.vnllr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -373,7 +373,6 @@ func (client VirtualNetworkLinksClient) ListSender(req *http.Request) (*http.Res func (client VirtualNetworkLinksClient) ListResponder(resp *http.Response) (result VirtualNetworkLinkListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -498,7 +497,6 @@ func (client VirtualNetworkLinksClient) UpdateSender(req *http.Request) (future func (client VirtualNetworkLinksClient) UpdateResponder(resp *http.Response) (result VirtualNetworkLink, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go index 063542ab18f..fda4ba61d18 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go @@ -125,7 +125,6 @@ func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Res func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -209,7 +208,6 @@ func (client DeploymentOperationsClient) GetAtSubscriptionScopeSender(req *http. func (client DeploymentOperationsClient) GetAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -263,6 +261,9 @@ func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -302,7 +303,6 @@ func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Re func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -388,6 +388,9 @@ func (client DeploymentOperationsClient) ListAtSubscriptionScope(ctx context.Con if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "ListAtSubscriptionScope", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -426,7 +429,6 @@ func (client DeploymentOperationsClient) ListAtSubscriptionScopeSender(req *http func (client DeploymentOperationsClient) ListAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go index f4f70a463fa..da9b0ceaea0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go @@ -105,7 +105,6 @@ func (client DeploymentsClient) CalculateTemplateHashSender(req *http.Request) ( func (client DeploymentsClient) CalculateTemplateHashResponder(resp *http.Response) (result TemplateHashResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -195,7 +194,6 @@ func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, func (client DeploymentsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -278,7 +276,6 @@ func (client DeploymentsClient) CancelAtSubscriptionScopeSender(req *http.Reques func (client DeploymentsClient) CancelAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -366,7 +363,6 @@ func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.R func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -447,7 +443,6 @@ func (client DeploymentsClient) CheckExistenceAtSubscriptionScopeSender(req *htt func (client DeploymentsClient) CheckExistenceAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -545,7 +540,6 @@ func (client DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -638,7 +632,6 @@ func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopeSender(req *htt func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -733,7 +726,6 @@ func (client DeploymentsClient) DeleteSender(req *http.Request) (future Deployme func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -819,7 +811,6 @@ func (client DeploymentsClient) DeleteAtSubscriptionScopeSender(req *http.Reques func (client DeploymentsClient) DeleteAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -906,7 +897,6 @@ func (client DeploymentsClient) ExportTemplateSender(req *http.Request) (*http.R func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (result DeploymentExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -988,7 +978,6 @@ func (client DeploymentsClient) ExportTemplateAtSubscriptionScopeSender(req *htt func (client DeploymentsClient) ExportTemplateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1076,7 +1065,6 @@ func (client DeploymentsClient) GetSender(req *http.Request) (*http.Response, er func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1158,7 +1146,6 @@ func (client DeploymentsClient) GetAtSubscriptionScopeSender(req *http.Request) func (client DeploymentsClient) GetAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1200,6 +1187,9 @@ func (client DeploymentsClient) ListAtSubscriptionScope(ctx context.Context, fil if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListAtSubscriptionScope", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1240,7 +1230,6 @@ func (client DeploymentsClient) ListAtSubscriptionScopeSender(req *http.Request) func (client DeploymentsClient) ListAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1329,6 +1318,9 @@ func (client DeploymentsClient) ListByResourceGroup(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1370,7 +1362,6 @@ func (client DeploymentsClient) ListByResourceGroupSender(req *http.Request) (*h func (client DeploymentsClient) ListByResourceGroupResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1507,7 +1498,6 @@ func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Respons func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1600,7 +1590,6 @@ func (client DeploymentsClient) ValidateAtSubscriptionScopeSender(req *http.Requ func (client DeploymentsClient) ValidateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go new file mode 100644 index 00000000000..ddced0a6a23 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go @@ -0,0 +1,67 @@ +package resources + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// DeploymentMode enumerates the values for deployment mode. +type DeploymentMode string + +const ( + // Complete ... + Complete DeploymentMode = "Complete" + // Incremental ... + Incremental DeploymentMode = "Incremental" +) + +// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. +func PossibleDeploymentModeValues() []DeploymentMode { + return []DeploymentMode{Complete, Incremental} +} + +// OnErrorDeploymentType enumerates the values for on error deployment type. +type OnErrorDeploymentType string + +const ( + // LastSuccessful ... + LastSuccessful OnErrorDeploymentType = "LastSuccessful" + // SpecificDeployment ... + SpecificDeployment OnErrorDeploymentType = "SpecificDeployment" +) + +// PossibleOnErrorDeploymentTypeValues returns an array of possible values for the OnErrorDeploymentType const type. +func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType { + return []OnErrorDeploymentType{LastSuccessful, SpecificDeployment} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go index 4622d33b0a0..cfe1ba2b98b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go @@ -116,7 +116,6 @@ func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Respon func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -207,7 +206,6 @@ func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -290,7 +288,6 @@ func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteF func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -374,7 +371,6 @@ func (client GroupsClient) ExportTemplateSender(req *http.Request) (*http.Respon func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result GroupExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -456,7 +452,6 @@ func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -498,6 +493,9 @@ func (client GroupsClient) List(ctx context.Context, filter string, top *int32) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to request") } + if result.glr.hasNextLink() && result.glr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -538,7 +536,6 @@ func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -661,7 +658,6 @@ func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, erro func (client GroupsClient) UpdateResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go index 46ad5129bf9..ccb80bd2469 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go @@ -31,55 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" -// DeploymentMode enumerates the values for deployment mode. -type DeploymentMode string - -const ( - // Complete ... - Complete DeploymentMode = "Complete" - // Incremental ... - Incremental DeploymentMode = "Incremental" -) - -// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. -func PossibleDeploymentModeValues() []DeploymentMode { - return []DeploymentMode{Complete, Incremental} -} - -// OnErrorDeploymentType enumerates the values for on error deployment type. -type OnErrorDeploymentType string - -const ( - // LastSuccessful ... - LastSuccessful OnErrorDeploymentType = "LastSuccessful" - // SpecificDeployment ... - SpecificDeployment OnErrorDeploymentType = "SpecificDeployment" -) - -// PossibleOnErrorDeploymentTypeValues returns an array of possible values for the OnErrorDeploymentType const type. -func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType { - return []OnErrorDeploymentType{LastSuccessful, SpecificDeployment} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // None ... - None ResourceIdentityType = "None" - // SystemAssigned ... - SystemAssigned ResourceIdentityType = "SystemAssigned" - // SystemAssignedUserAssigned ... - SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // UserAssigned ... - UserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} -} - // AliasPathType the type of the paths for alias. type AliasPathType struct { // Path - The path of an alias. @@ -140,8 +91,7 @@ func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResourc return } -// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type CreateOrUpdateFuture struct { azure.Future } @@ -261,6 +211,18 @@ type DeploymentExtended struct { Properties *DeploymentPropertiesExtended `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentExtended. +func (de DeploymentExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if de.Location != nil { + objectMap["location"] = de.Location + } + if de.Properties != nil { + objectMap["properties"] = de.Properties + } + return json.Marshal(objectMap) +} + // DeploymentExtendedFilter deployment filter. type DeploymentExtendedFilter struct { // ProvisioningState - The provisioning state. @@ -276,6 +238,15 @@ type DeploymentListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentListResult. +func (dlr DeploymentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dlr.Value != nil { + objectMap["value"] = dlr.Value + } + return json.Marshal(objectMap) +} + // DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values. type DeploymentListResultIterator struct { i int @@ -344,10 +315,15 @@ func (dlr DeploymentListResult) IsEmpty() bool { return dlr.Value == nil || len(*dlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dlr DeploymentListResult) hasNextLink() bool { + return dlr.NextLink != nil && len(*dlr.NextLink) != 0 +} + // deploymentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) { - if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + if !dlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -375,11 +351,16 @@ func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dlr = next return nil } @@ -424,6 +405,15 @@ type DeploymentOperation struct { Properties *DeploymentOperationProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentOperation. +func (do DeploymentOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if do.Properties != nil { + objectMap["properties"] = do.Properties + } + return json.Marshal(objectMap) +} + // DeploymentOperationProperties deployment operation properties. type DeploymentOperationProperties struct { // ProvisioningState - READ-ONLY; The state of the provisioning. @@ -453,8 +443,16 @@ type DeploymentOperationsListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation -// values. +// MarshalJSON is the custom marshaler for DeploymentOperationsListResult. +func (dolr DeploymentOperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dolr.Value != nil { + objectMap["value"] = dolr.Value + } + return json.Marshal(objectMap) +} + +// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation values. type DeploymentOperationsListResultIterator struct { i int page DeploymentOperationsListResultPage @@ -522,10 +520,15 @@ func (dolr DeploymentOperationsListResult) IsEmpty() bool { return dolr.Value == nil || len(*dolr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dolr DeploymentOperationsListResult) hasNextLink() bool { + return dolr.NextLink != nil && len(*dolr.NextLink) != 0 +} + // deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) { - if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 { + if !dolr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -553,11 +556,16 @@ func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dolr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dolr = next return nil } @@ -639,8 +647,44 @@ type DeploymentPropertiesExtended struct { OnErrorDeployment *OnErrorDeploymentExtended `json:"onErrorDeployment,omitempty"` } -// DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// MarshalJSON is the custom marshaler for DeploymentPropertiesExtended. +func (dpe DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpe.Outputs != nil { + objectMap["outputs"] = dpe.Outputs + } + if dpe.Providers != nil { + objectMap["providers"] = dpe.Providers + } + if dpe.Dependencies != nil { + objectMap["dependencies"] = dpe.Dependencies + } + if dpe.Template != nil { + objectMap["template"] = dpe.Template + } + if dpe.TemplateLink != nil { + objectMap["templateLink"] = dpe.TemplateLink + } + if dpe.Parameters != nil { + objectMap["parameters"] = dpe.Parameters + } + if dpe.ParametersLink != nil { + objectMap["parametersLink"] = dpe.ParametersLink + } + if dpe.Mode != "" { + objectMap["mode"] = dpe.Mode + } + if dpe.DebugSetting != nil { + objectMap["debugSetting"] = dpe.DebugSetting + } + if dpe.OnErrorDeployment != nil { + objectMap["onErrorDeployment"] = dpe.OnErrorDeployment + } + return json.Marshal(objectMap) +} + +// DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture struct { azure.Future } @@ -668,8 +712,8 @@ func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) Result(client return } -// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DeploymentsCreateOrUpdateFuture struct { azure.Future } @@ -973,6 +1017,15 @@ type GroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for GroupListResult. +func (glr GroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if glr.Value != nil { + objectMap["value"] = glr.Value + } + return json.Marshal(objectMap) +} + // GroupListResultIterator provides access to a complete listing of Group values. type GroupListResultIterator struct { i int @@ -1041,10 +1094,15 @@ func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (glr GroupListResult) hasNextLink() bool { + return glr.NextLink != nil && len(*glr.NextLink) != 0 +} + // groupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { - if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 { + if !glr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1072,11 +1130,16 @@ func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.glr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.glr = next return nil } @@ -1214,6 +1277,15 @@ type ListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListResult. +func (lr ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lr.Value != nil { + objectMap["value"] = lr.Value + } + return json.Marshal(objectMap) +} + // ListResultIterator provides access to a complete listing of GenericResourceExpanded values. type ListResultIterator struct { i int @@ -1282,10 +1354,15 @@ func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lr ListResult) hasNextLink() bool { + return lr.NextLink != nil && len(*lr.NextLink) != 0 +} + // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if !lr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1313,11 +1390,16 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lr = next return nil } @@ -1371,8 +1453,7 @@ type MoveInfo struct { TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` } -// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation. type MoveResourcesFuture struct { azure.Future } @@ -1412,6 +1493,18 @@ type OnErrorDeploymentExtended struct { DeploymentName *string `json:"deploymentName,omitempty"` } +// MarshalJSON is the custom marshaler for OnErrorDeploymentExtended. +func (oede OnErrorDeploymentExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oede.Type != "" { + objectMap["type"] = oede.Type + } + if oede.DeploymentName != nil { + objectMap["deploymentName"] = oede.DeploymentName + } + return json.Marshal(objectMap) +} + // Operation microsoft.Resources operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -1510,10 +1603,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1541,11 +1639,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -1614,6 +1717,15 @@ type Provider struct { ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"` } +// MarshalJSON is the custom marshaler for Provider. +func (p Provider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Namespace != nil { + objectMap["namespace"] = p.Namespace + } + return json.Marshal(objectMap) +} + // ProviderListResult list of resource providers. type ProviderListResult struct { autorest.Response `json:"-"` @@ -1623,6 +1735,15 @@ type ProviderListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ProviderListResult. +func (plr ProviderListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.Value != nil { + objectMap["value"] = plr.Value + } + return json.Marshal(objectMap) +} + // ProviderListResultIterator provides access to a complete listing of Provider values. type ProviderListResultIterator struct { i int @@ -1691,10 +1812,15 @@ func (plr ProviderListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProviderListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // providerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1722,11 +1848,16 @@ func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -1878,6 +2009,21 @@ type TagDetails struct { Values *[]TagValue `json:"values,omitempty"` } +// MarshalJSON is the custom marshaler for TagDetails. +func (td TagDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if td.TagName != nil { + objectMap["tagName"] = td.TagName + } + if td.Count != nil { + objectMap["count"] = td.Count + } + if td.Values != nil { + objectMap["values"] = td.Values + } + return json.Marshal(objectMap) +} + // TagsListResult list of subscription tags. type TagsListResult struct { autorest.Response `json:"-"` @@ -1887,6 +2033,15 @@ type TagsListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for TagsListResult. +func (tlr TagsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tlr.Value != nil { + objectMap["value"] = tlr.Value + } + return json.Marshal(objectMap) +} + // TagsListResultIterator provides access to a complete listing of TagDetails values. type TagsListResultIterator struct { i int @@ -1955,10 +2110,15 @@ func (tlr TagsListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TagsListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // tagsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1986,11 +2146,16 @@ func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } @@ -2035,6 +2200,18 @@ type TagValue struct { Count *TagCount `json:"count,omitempty"` } +// MarshalJSON is the custom marshaler for TagValue. +func (tv TagValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tv.TagValue != nil { + objectMap["tagValue"] = tv.TagValue + } + if tv.Count != nil { + objectMap["count"] = tv.Count + } + return json.Marshal(objectMap) +} + // TargetResource target resource. type TargetResource struct { // ID - The ID of the resource. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go index e7cc71d7293..4a58f5079d9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go @@ -71,6 +71,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe if err != nil { err = autorest.NewErrorWithError(err, "resources.OperationsClient", "List", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -101,7 +104,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go index 9225ec701a8..049b14a6795 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go @@ -112,7 +112,6 @@ func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, erro func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -155,6 +154,9 @@ func (client ProvidersClient) List(ctx context.Context, top *int32, expand strin if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -195,7 +197,6 @@ func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, err func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,7 +307,6 @@ func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -380,7 +380,6 @@ func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Respons func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go index 88e0d2bbac7..d38870f8427 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go @@ -125,7 +125,6 @@ func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, er func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -199,7 +198,6 @@ func (client Client) CheckExistenceByIDSender(req *http.Request) (*http.Response func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -294,7 +292,6 @@ func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpd func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -379,7 +376,6 @@ func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateO func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -470,7 +466,6 @@ func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err e func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -544,7 +539,6 @@ func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFutur func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -634,7 +628,6 @@ func (client Client) GetSender(req *http.Request) (*http.Response, error) { func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -709,7 +702,6 @@ func (client Client) GetByIDSender(req *http.Request) (*http.Response, error) { func (client Client) GetByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -762,6 +754,9 @@ func (client Client) List(ctx context.Context, filter string, expand string, top if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -805,7 +800,6 @@ func (client Client) ListSender(req *http.Request) (*http.Response, error) { func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -904,6 +898,9 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -948,7 +945,6 @@ func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Respons func (client Client) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1072,7 +1068,6 @@ func (client Client) MoveResourcesSender(req *http.Request) (future MoveResource func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1164,7 +1159,6 @@ func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err e func (client Client) UpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1242,7 +1236,6 @@ func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFutur func (client Client) UpdateByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1331,7 +1324,6 @@ func (client Client) ValidateMoveResourcesSender(req *http.Request) (future Vali func (client Client) ValidateMoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusConflict), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go index d3c5f9f5ead..c7986420ef6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go @@ -108,7 +108,6 @@ func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -184,7 +183,6 @@ func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Res func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -258,7 +256,6 @@ func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -333,7 +330,6 @@ func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, e func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -370,6 +366,9 @@ func (client TagsClient) List(ctx context.Context) (result TagsListResultPage, e if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to request") } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -404,7 +403,6 @@ func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) { func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deploymentoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deploymentoperations.go index 9fde745e782..0e713d214ad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deploymentoperations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deploymentoperations.go @@ -125,7 +125,6 @@ func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Res func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -213,7 +212,6 @@ func (client DeploymentOperationsClient) GetAtManagementGroupScopeSender(req *ht func (client DeploymentOperationsClient) GetAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -297,7 +295,6 @@ func (client DeploymentOperationsClient) GetAtSubscriptionScopeSender(req *http. func (client DeploymentOperationsClient) GetAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,6 +348,9 @@ func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -390,7 +390,6 @@ func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Re func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -480,6 +479,9 @@ func (client DeploymentOperationsClient) ListAtManagementGroupScope(ctx context. if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "ListAtManagementGroupScope", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -518,7 +520,6 @@ func (client DeploymentOperationsClient) ListAtManagementGroupScopeSender(req *h func (client DeploymentOperationsClient) ListAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -604,6 +605,9 @@ func (client DeploymentOperationsClient) ListAtSubscriptionScope(ctx context.Con if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "ListAtSubscriptionScope", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -642,7 +646,6 @@ func (client DeploymentOperationsClient) ListAtSubscriptionScopeSender(req *http func (client DeploymentOperationsClient) ListAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deployments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deployments.go index caf1fc792d4..3ed5f77e6e0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deployments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/deployments.go @@ -105,7 +105,6 @@ func (client DeploymentsClient) CalculateTemplateHashSender(req *http.Request) ( func (client DeploymentsClient) CalculateTemplateHashResponder(resp *http.Response) (result TemplateHashResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -195,7 +194,6 @@ func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, func (client DeploymentsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -282,7 +280,6 @@ func (client DeploymentsClient) CancelAtManagementGroupScopeSender(req *http.Req func (client DeploymentsClient) CancelAtManagementGroupScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -365,7 +362,6 @@ func (client DeploymentsClient) CancelAtSubscriptionScopeSender(req *http.Reques func (client DeploymentsClient) CancelAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -453,7 +449,6 @@ func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.R func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -538,7 +533,6 @@ func (client DeploymentsClient) CheckExistenceAtManagementGroupScopeSender(req * func (client DeploymentsClient) CheckExistenceAtManagementGroupScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -619,7 +613,6 @@ func (client DeploymentsClient) CheckExistenceAtSubscriptionScopeSender(req *htt func (client DeploymentsClient) CheckExistenceAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -717,7 +710,6 @@ func (client DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -814,7 +806,6 @@ func (client DeploymentsClient) CreateOrUpdateAtManagementGroupScopeSender(req * func (client DeploymentsClient) CreateOrUpdateAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -907,7 +898,6 @@ func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopeSender(req *htt func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1002,7 +992,6 @@ func (client DeploymentsClient) DeleteSender(req *http.Request) (future Deployme func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1092,7 +1081,6 @@ func (client DeploymentsClient) DeleteAtManagementGroupScopeSender(req *http.Req func (client DeploymentsClient) DeleteAtManagementGroupScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1178,7 +1166,6 @@ func (client DeploymentsClient) DeleteAtSubscriptionScopeSender(req *http.Reques func (client DeploymentsClient) DeleteAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1265,7 +1252,6 @@ func (client DeploymentsClient) ExportTemplateSender(req *http.Request) (*http.R func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (result DeploymentExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1351,7 +1337,6 @@ func (client DeploymentsClient) ExportTemplateAtManagementGroupScopeSender(req * func (client DeploymentsClient) ExportTemplateAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1433,7 +1418,6 @@ func (client DeploymentsClient) ExportTemplateAtSubscriptionScopeSender(req *htt func (client DeploymentsClient) ExportTemplateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1521,7 +1505,6 @@ func (client DeploymentsClient) GetSender(req *http.Request) (*http.Response, er func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1607,7 +1590,6 @@ func (client DeploymentsClient) GetAtManagementGroupScopeSender(req *http.Reques func (client DeploymentsClient) GetAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1689,7 +1671,6 @@ func (client DeploymentsClient) GetAtSubscriptionScopeSender(req *http.Request) func (client DeploymentsClient) GetAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1739,6 +1720,9 @@ func (client DeploymentsClient) ListAtManagementGroupScope(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListAtManagementGroupScope", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1779,7 +1763,6 @@ func (client DeploymentsClient) ListAtManagementGroupScopeSender(req *http.Reque func (client DeploymentsClient) ListAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1858,6 +1841,9 @@ func (client DeploymentsClient) ListAtSubscriptionScope(ctx context.Context, fil if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListAtSubscriptionScope", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1898,7 +1884,6 @@ func (client DeploymentsClient) ListAtSubscriptionScopeSender(req *http.Request) func (client DeploymentsClient) ListAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1987,6 +1972,9 @@ func (client DeploymentsClient) ListByResourceGroup(ctx context.Context, resourc if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -2028,7 +2016,6 @@ func (client DeploymentsClient) ListByResourceGroupSender(req *http.Request) (*h func (client DeploymentsClient) ListByResourceGroupResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2165,7 +2152,6 @@ func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Respons func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2262,7 +2248,6 @@ func (client DeploymentsClient) ValidateAtManagementGroupScopeSender(req *http.R func (client DeploymentsClient) ValidateAtManagementGroupScopeResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -2355,7 +2340,6 @@ func (client DeploymentsClient) ValidateAtSubscriptionScopeSender(req *http.Requ func (client DeploymentsClient) ValidateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/enums.go new file mode 100644 index 00000000000..ddced0a6a23 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/enums.go @@ -0,0 +1,67 @@ +package resources + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// DeploymentMode enumerates the values for deployment mode. +type DeploymentMode string + +const ( + // Complete ... + Complete DeploymentMode = "Complete" + // Incremental ... + Incremental DeploymentMode = "Incremental" +) + +// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. +func PossibleDeploymentModeValues() []DeploymentMode { + return []DeploymentMode{Complete, Incremental} +} + +// OnErrorDeploymentType enumerates the values for on error deployment type. +type OnErrorDeploymentType string + +const ( + // LastSuccessful ... + LastSuccessful OnErrorDeploymentType = "LastSuccessful" + // SpecificDeployment ... + SpecificDeployment OnErrorDeploymentType = "SpecificDeployment" +) + +// PossibleOnErrorDeploymentTypeValues returns an array of possible values for the OnErrorDeploymentType const type. +func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType { + return []OnErrorDeploymentType{LastSuccessful, SpecificDeployment} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/groups.go index f2f44fd6360..afc6eec85a8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/groups.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/groups.go @@ -116,7 +116,6 @@ func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Respon func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -207,7 +206,6 @@ func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -290,7 +288,6 @@ func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteF func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -374,7 +371,6 @@ func (client GroupsClient) ExportTemplateSender(req *http.Request) (*http.Respon func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result GroupExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -456,7 +452,6 @@ func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -498,6 +493,9 @@ func (client GroupsClient) List(ctx context.Context, filter string, top *int32) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to request") } + if result.glr.hasNextLink() && result.glr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -538,7 +536,6 @@ func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -661,7 +658,6 @@ func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, erro func (client GroupsClient) UpdateResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/models.go index 06ed9873112..95e93cb5e85 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/models.go @@ -31,55 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources" -// DeploymentMode enumerates the values for deployment mode. -type DeploymentMode string - -const ( - // Complete ... - Complete DeploymentMode = "Complete" - // Incremental ... - Incremental DeploymentMode = "Incremental" -) - -// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. -func PossibleDeploymentModeValues() []DeploymentMode { - return []DeploymentMode{Complete, Incremental} -} - -// OnErrorDeploymentType enumerates the values for on error deployment type. -type OnErrorDeploymentType string - -const ( - // LastSuccessful ... - LastSuccessful OnErrorDeploymentType = "LastSuccessful" - // SpecificDeployment ... - SpecificDeployment OnErrorDeploymentType = "SpecificDeployment" -) - -// PossibleOnErrorDeploymentTypeValues returns an array of possible values for the OnErrorDeploymentType const type. -func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType { - return []OnErrorDeploymentType{LastSuccessful, SpecificDeployment} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // None ... - None ResourceIdentityType = "None" - // SystemAssigned ... - SystemAssigned ResourceIdentityType = "SystemAssigned" - // SystemAssignedUserAssigned ... - SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // UserAssigned ... - UserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} -} - // AliasPathType the type of the paths for alias. type AliasPathType struct { // Path - The path of an alias. @@ -140,8 +91,7 @@ func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResourc return } -// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type CreateOrUpdateFuture struct { azure.Future } @@ -261,6 +211,18 @@ type DeploymentExtended struct { Properties *DeploymentPropertiesExtended `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentExtended. +func (de DeploymentExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if de.Location != nil { + objectMap["location"] = de.Location + } + if de.Properties != nil { + objectMap["properties"] = de.Properties + } + return json.Marshal(objectMap) +} + // DeploymentExtendedFilter deployment filter. type DeploymentExtendedFilter struct { // ProvisioningState - The provisioning state. @@ -276,6 +238,15 @@ type DeploymentListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentListResult. +func (dlr DeploymentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dlr.Value != nil { + objectMap["value"] = dlr.Value + } + return json.Marshal(objectMap) +} + // DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values. type DeploymentListResultIterator struct { i int @@ -344,10 +315,15 @@ func (dlr DeploymentListResult) IsEmpty() bool { return dlr.Value == nil || len(*dlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dlr DeploymentListResult) hasNextLink() bool { + return dlr.NextLink != nil && len(*dlr.NextLink) != 0 +} + // deploymentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) { - if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + if !dlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -375,11 +351,16 @@ func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dlr = next return nil } @@ -424,6 +405,15 @@ type DeploymentOperation struct { Properties *DeploymentOperationProperties `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentOperation. +func (do DeploymentOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if do.Properties != nil { + objectMap["properties"] = do.Properties + } + return json.Marshal(objectMap) +} + // DeploymentOperationProperties deployment operation properties. type DeploymentOperationProperties struct { // ProvisioningState - READ-ONLY; The state of the provisioning. @@ -455,8 +445,16 @@ type DeploymentOperationsListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation -// values. +// MarshalJSON is the custom marshaler for DeploymentOperationsListResult. +func (dolr DeploymentOperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dolr.Value != nil { + objectMap["value"] = dolr.Value + } + return json.Marshal(objectMap) +} + +// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation values. type DeploymentOperationsListResultIterator struct { i int page DeploymentOperationsListResultPage @@ -524,10 +522,15 @@ func (dolr DeploymentOperationsListResult) IsEmpty() bool { return dolr.Value == nil || len(*dolr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dolr DeploymentOperationsListResult) hasNextLink() bool { + return dolr.NextLink != nil && len(*dolr.NextLink) != 0 +} + // deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) { - if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 { + if !dolr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -555,11 +558,16 @@ func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dolr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dolr = next return nil } @@ -643,6 +651,42 @@ type DeploymentPropertiesExtended struct { OnErrorDeployment *OnErrorDeploymentExtended `json:"onErrorDeployment,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentPropertiesExtended. +func (dpe DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpe.Outputs != nil { + objectMap["outputs"] = dpe.Outputs + } + if dpe.Providers != nil { + objectMap["providers"] = dpe.Providers + } + if dpe.Dependencies != nil { + objectMap["dependencies"] = dpe.Dependencies + } + if dpe.Template != nil { + objectMap["template"] = dpe.Template + } + if dpe.TemplateLink != nil { + objectMap["templateLink"] = dpe.TemplateLink + } + if dpe.Parameters != nil { + objectMap["parameters"] = dpe.Parameters + } + if dpe.ParametersLink != nil { + objectMap["parametersLink"] = dpe.ParametersLink + } + if dpe.Mode != "" { + objectMap["mode"] = dpe.Mode + } + if dpe.DebugSetting != nil { + objectMap["debugSetting"] = dpe.DebugSetting + } + if dpe.OnErrorDeployment != nil { + objectMap["onErrorDeployment"] = dpe.OnErrorDeployment + } + return json.Marshal(objectMap) +} + // DeploymentsCreateOrUpdateAtManagementGroupScopeFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type DeploymentsCreateOrUpdateAtManagementGroupScopeFuture struct { @@ -672,8 +716,8 @@ func (future *DeploymentsCreateOrUpdateAtManagementGroupScopeFuture) Result(clie return } -// DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. +// DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture struct { azure.Future } @@ -701,8 +745,8 @@ func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) Result(client return } -// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DeploymentsCreateOrUpdateFuture struct { azure.Future } @@ -730,8 +774,8 @@ func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) return } -// DeploymentsDeleteAtManagementGroupScopeFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. +// DeploymentsDeleteAtManagementGroupScopeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. type DeploymentsDeleteAtManagementGroupScopeFuture struct { azure.Future } @@ -1030,6 +1074,15 @@ type GroupListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for GroupListResult. +func (glr GroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if glr.Value != nil { + objectMap["value"] = glr.Value + } + return json.Marshal(objectMap) +} + // GroupListResultIterator provides access to a complete listing of Group values. type GroupListResultIterator struct { i int @@ -1098,10 +1151,15 @@ func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (glr GroupListResult) hasNextLink() bool { + return glr.NextLink != nil && len(*glr.NextLink) != 0 +} + // groupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { - if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 { + if !glr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1129,11 +1187,16 @@ func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.glr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.glr = next return nil } @@ -1272,6 +1335,15 @@ type ListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ListResult. +func (lr ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lr.Value != nil { + objectMap["value"] = lr.Value + } + return json.Marshal(objectMap) +} + // ListResultIterator provides access to a complete listing of GenericResourceExpanded values. type ListResultIterator struct { i int @@ -1340,10 +1412,15 @@ func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lr ListResult) hasNextLink() bool { + return lr.NextLink != nil && len(*lr.NextLink) != 0 +} + // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if !lr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1371,11 +1448,16 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lr = next return nil } @@ -1429,8 +1511,7 @@ type MoveInfo struct { TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` } -// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation. type MoveResourcesFuture struct { azure.Future } @@ -1470,6 +1551,18 @@ type OnErrorDeploymentExtended struct { DeploymentName *string `json:"deploymentName,omitempty"` } +// MarshalJSON is the custom marshaler for OnErrorDeploymentExtended. +func (oede OnErrorDeploymentExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oede.Type != "" { + objectMap["type"] = oede.Type + } + if oede.DeploymentName != nil { + objectMap["deploymentName"] = oede.DeploymentName + } + return json.Marshal(objectMap) +} + // Operation microsoft.Resources operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -1568,10 +1661,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1599,11 +1697,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -1674,6 +1777,15 @@ type Provider struct { ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"` } +// MarshalJSON is the custom marshaler for Provider. +func (p Provider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Namespace != nil { + objectMap["namespace"] = p.Namespace + } + return json.Marshal(objectMap) +} + // ProviderListResult list of resource providers. type ProviderListResult struct { autorest.Response `json:"-"` @@ -1683,6 +1795,15 @@ type ProviderListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ProviderListResult. +func (plr ProviderListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.Value != nil { + objectMap["value"] = plr.Value + } + return json.Marshal(objectMap) +} + // ProviderListResultIterator provides access to a complete listing of Provider values. type ProviderListResultIterator struct { i int @@ -1751,10 +1872,15 @@ func (plr ProviderListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProviderListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // providerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1782,11 +1908,16 @@ func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -1943,6 +2074,21 @@ type TagDetails struct { Values *[]TagValue `json:"values,omitempty"` } +// MarshalJSON is the custom marshaler for TagDetails. +func (td TagDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if td.TagName != nil { + objectMap["tagName"] = td.TagName + } + if td.Count != nil { + objectMap["count"] = td.Count + } + if td.Values != nil { + objectMap["values"] = td.Values + } + return json.Marshal(objectMap) +} + // TagsListResult list of subscription tags. type TagsListResult struct { autorest.Response `json:"-"` @@ -1952,6 +2098,15 @@ type TagsListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for TagsListResult. +func (tlr TagsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tlr.Value != nil { + objectMap["value"] = tlr.Value + } + return json.Marshal(objectMap) +} + // TagsListResultIterator provides access to a complete listing of TagDetails values. type TagsListResultIterator struct { i int @@ -2020,10 +2175,15 @@ func (tlr TagsListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TagsListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // tagsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2051,11 +2211,16 @@ func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } @@ -2100,6 +2265,18 @@ type TagValue struct { Count *TagCount `json:"count,omitempty"` } +// MarshalJSON is the custom marshaler for TagValue. +func (tv TagValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tv.TagValue != nil { + objectMap["tagValue"] = tv.TagValue + } + if tv.Count != nil { + objectMap["count"] = tv.Count + } + return json.Marshal(objectMap) +} + // TargetResource target resource. type TargetResource struct { // ID - The ID of the resource. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/operations.go index 9f4e03f3948..58f10b9ce11 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/operations.go @@ -71,6 +71,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe if err != nil { err = autorest.NewErrorWithError(err, "resources.OperationsClient", "List", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -101,7 +104,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/providers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/providers.go index 66a08a11207..29f37f4205c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/providers.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/providers.go @@ -112,7 +112,6 @@ func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, erro func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -155,6 +154,9 @@ func (client ProvidersClient) List(ctx context.Context, top *int32, expand strin if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -195,7 +197,6 @@ func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, err func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,7 +307,6 @@ func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -380,7 +380,6 @@ func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Respons func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/resources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/resources.go index 222f3ef79a2..63e1d9ab565 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/resources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/resources.go @@ -125,7 +125,6 @@ func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, er func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -199,7 +198,6 @@ func (client Client) CheckExistenceByIDSender(req *http.Request) (*http.Response func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -294,7 +292,6 @@ func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpd func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -379,7 +376,6 @@ func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateO func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -470,7 +466,6 @@ func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err e func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -544,7 +539,6 @@ func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFutur func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -634,7 +628,6 @@ func (client Client) GetSender(req *http.Request) (*http.Response, error) { func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -709,7 +702,6 @@ func (client Client) GetByIDSender(req *http.Request) (*http.Response, error) { func (client Client) GetByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -762,6 +754,9 @@ func (client Client) List(ctx context.Context, filter string, expand string, top if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -805,7 +800,6 @@ func (client Client) ListSender(req *http.Request) (*http.Response, error) { func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -904,6 +898,9 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "ListByResourceGroup", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -948,7 +945,6 @@ func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Respons func (client Client) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1072,7 +1068,6 @@ func (client Client) MoveResourcesSender(req *http.Request) (future MoveResource func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -1164,7 +1159,6 @@ func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err e func (client Client) UpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1242,7 +1236,6 @@ func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFutur func (client Client) UpdateByIDResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1331,7 +1324,6 @@ func (client Client) ValidateMoveResourcesSender(req *http.Request) (future Vali func (client Client) ValidateMoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusConflict), autorest.ByClosing()) result.Response = resp diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/tags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/tags.go index b7cda5d9d65..cfea53cd68a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/tags.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources/tags.go @@ -108,7 +108,6 @@ func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -184,7 +183,6 @@ func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Res func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -258,7 +256,6 @@ func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -333,7 +330,6 @@ func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, e func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -370,6 +366,9 @@ func (client TagsClient) List(ctx context.Context) (result TagsListResultPage, e if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to request") } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -404,7 +403,6 @@ func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) { func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/client.go index c26a7741e75..07236533b49 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/client.go @@ -23,7 +23,12 @@ package subscriptions // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( + "context" "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" ) const ( @@ -50,3 +55,86 @@ func NewWithBaseURI(baseURI string) BaseClient { BaseURI: baseURI, } } + +// CheckResourceName a resource name is valid if it is not a reserved word, does not contains a reserved word and does +// not start with a reserved word +// Parameters: +// resourceNameDefinition - resource object with values for resource name and resource type +func (client BaseClient) CheckResourceName(ctx context.Context, resourceNameDefinition *ResourceName) (result CheckResourceNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckResourceName") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceNameDefinition, + Constraints: []validation.Constraint{{Target: "resourceNameDefinition", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "resourceNameDefinition.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "resourceNameDefinition.Type", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("subscriptions.BaseClient", "CheckResourceName", err.Error()) + } + + req, err := client.CheckResourceNamePreparer(ctx, resourceNameDefinition) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.BaseClient", "CheckResourceName", nil, "Failure preparing request") + return + } + + resp, err := client.CheckResourceNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "subscriptions.BaseClient", "CheckResourceName", resp, "Failure sending request") + return + } + + result, err = client.CheckResourceNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "subscriptions.BaseClient", "CheckResourceName", resp, "Failure responding to request") + } + + return +} + +// CheckResourceNamePreparer prepares the CheckResourceName request. +func (client BaseClient) CheckResourceNamePreparer(ctx context.Context, resourceNameDefinition *ResourceName) (*http.Request, error) { + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Resources/checkResourceName"), + autorest.WithQueryParameters(queryParameters)) + if resourceNameDefinition != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(resourceNameDefinition)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckResourceNameSender sends the CheckResourceName request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckResourceNameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckResourceNameResponder handles the response to the CheckResourceName request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckResourceNameResponder(resp *http.Response) (result CheckResourceNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/enums.go new file mode 100644 index 00000000000..9e69877e248 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/enums.go @@ -0,0 +1,88 @@ +package subscriptions + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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 Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ResourceNameStatus enumerates the values for resource name status. +type ResourceNameStatus string + +const ( + // Allowed ... + Allowed ResourceNameStatus = "Allowed" + // Reserved ... + Reserved ResourceNameStatus = "Reserved" +) + +// PossibleResourceNameStatusValues returns an array of possible values for the ResourceNameStatus const type. +func PossibleResourceNameStatusValues() []ResourceNameStatus { + return []ResourceNameStatus{Allowed, Reserved} +} + +// SpendingLimit enumerates the values for spending limit. +type SpendingLimit string + +const ( + // CurrentPeriodOff ... + CurrentPeriodOff SpendingLimit = "CurrentPeriodOff" + // Off ... + Off SpendingLimit = "Off" + // On ... + On SpendingLimit = "On" +) + +// PossibleSpendingLimitValues returns an array of possible values for the SpendingLimit const type. +func PossibleSpendingLimitValues() []SpendingLimit { + return []SpendingLimit{CurrentPeriodOff, Off, On} +} + +// State enumerates the values for state. +type State string + +const ( + // Deleted ... + Deleted State = "Deleted" + // Disabled ... + Disabled State = "Disabled" + // Enabled ... + Enabled State = "Enabled" + // PastDue ... + PastDue State = "PastDue" + // Warned ... + Warned State = "Warned" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{Deleted, Disabled, Enabled, PastDue, Warned} +} + +// TenantCategory enumerates the values for tenant category. +type TenantCategory string + +const ( + // Home ... + Home TenantCategory = "Home" + // ManagedBy ... + ManagedBy TenantCategory = "ManagedBy" + // ProjectedBy ... + ProjectedBy TenantCategory = "ProjectedBy" +) + +// PossibleTenantCategoryValues returns an array of possible values for the TenantCategory const type. +func PossibleTenantCategoryValues() []TenantCategory { + return []TenantCategory{Home, ManagedBy, ProjectedBy} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/models.go index 42068fd83bc..4751266b0c9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/models.go @@ -19,6 +19,7 @@ package subscriptions import ( "context" + "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" @@ -28,59 +29,30 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions" -// SpendingLimit enumerates the values for spending limit. -type SpendingLimit string - -const ( - // CurrentPeriodOff ... - CurrentPeriodOff SpendingLimit = "CurrentPeriodOff" - // Off ... - Off SpendingLimit = "Off" - // On ... - On SpendingLimit = "On" -) - -// PossibleSpendingLimitValues returns an array of possible values for the SpendingLimit const type. -func PossibleSpendingLimitValues() []SpendingLimit { - return []SpendingLimit{CurrentPeriodOff, Off, On} -} - -// State enumerates the values for state. -type State string - -const ( - // Deleted ... - Deleted State = "Deleted" - // Disabled ... - Disabled State = "Disabled" - // Enabled ... - Enabled State = "Enabled" - // PastDue ... - PastDue State = "PastDue" - // Warned ... - Warned State = "Warned" -) - -// PossibleStateValues returns an array of possible values for the State const type. -func PossibleStateValues() []State { - return []State{Deleted, Disabled, Enabled, PastDue, Warned} +// CheckResourceNameResult resource Name valid if not a reserved word, does not contain a reserved word and +// does not start with a reserved word +type CheckResourceNameResult struct { + autorest.Response `json:"-"` + // Name - Name of Resource + Name *string `json:"name,omitempty"` + // Type - Type of Resource + Type *string `json:"type,omitempty"` + // Status - Is the resource name Allowed or Reserved. Possible values include: 'Allowed', 'Reserved' + Status ResourceNameStatus `json:"status,omitempty"` } -// TenantCategory enumerates the values for tenant category. -type TenantCategory string - -const ( - // Home ... - Home TenantCategory = "Home" - // ManagedBy ... - ManagedBy TenantCategory = "ManagedBy" - // ProjectedBy ... - ProjectedBy TenantCategory = "ProjectedBy" -) +// ErrorDefinition error description and code explaining why resource name is invalid. +type ErrorDefinition struct { + // Message - Description of the error. + Message *string `json:"message,omitempty"` + // Code - Code of the error. + Code *string `json:"code,omitempty"` +} -// PossibleTenantCategoryValues returns an array of possible values for the TenantCategory const type. -func PossibleTenantCategoryValues() []TenantCategory { - return []TenantCategory{Home, ManagedBy, ProjectedBy} +// ErrorResponse error response. +type ErrorResponse struct { + // Error - The error details. + Error *ErrorDefinition `json:"error,omitempty"` } // ListResult subscription list operation response. @@ -160,10 +132,15 @@ func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lr ListResult) hasNextLink() bool { + return lr.NextLink != nil && len(*lr.NextLink) != 0 +} + // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if !lr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -191,11 +168,16 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lr = next return nil } @@ -356,10 +338,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -387,11 +374,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -435,6 +427,14 @@ type Policies struct { SpendingLimit SpendingLimit `json:"spendingLimit,omitempty"` } +// ResourceName name and Type of the Resource +type ResourceName struct { + // Name - Name of the resource + Name *string `json:"name,omitempty"` + // Type - The type of the resource + Type *string `json:"type,omitempty"` +} + // Subscription subscription information. type Subscription struct { autorest.Response `json:"-"` @@ -456,6 +456,21 @@ type Subscription struct { ManagedByTenants *[]ManagedByTenant `json:"managedByTenants,omitempty"` } +// MarshalJSON is the custom marshaler for Subscription. +func (s Subscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SubscriptionPolicies != nil { + objectMap["subscriptionPolicies"] = s.SubscriptionPolicies + } + if s.AuthorizationSource != nil { + objectMap["authorizationSource"] = s.AuthorizationSource + } + if s.ManagedByTenants != nil { + objectMap["managedByTenants"] = s.ManagedByTenants + } + return json.Marshal(objectMap) +} + // TenantIDDescription tenant Id information. type TenantIDDescription struct { // ID - READ-ONLY; The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. @@ -551,10 +566,15 @@ func (tlr TenantListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TenantListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // tenantListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TenantListResult) tenantListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -582,11 +602,16 @@ func (page *TenantListResultPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/operations.go index 4c6c96afb62..f28d149b1b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/operations.go @@ -73,6 +73,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe if err != nil { err = autorest.NewErrorWithError(err, "subscriptions.OperationsClient", "List", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -103,7 +106,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptions.go index c86c5f452de..45ab06176e0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/subscriptions.go @@ -108,7 +108,6 @@ func (client Client) GetSender(req *http.Request) (*http.Response, error) { func (client Client) GetResponder(resp *http.Response) (result Subscription, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -146,6 +145,9 @@ func (client Client) List(ctx context.Context) (result ListResultPage, err error if err != nil { err = autorest.NewErrorWithError(err, "subscriptions.Client", "List", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -176,7 +178,6 @@ func (client Client) ListSender(req *http.Request) (*http.Response, error) { func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -287,7 +288,6 @@ func (client Client) ListLocationsSender(req *http.Request) (*http.Response, err func (client Client) ListLocationsResponder(resp *http.Response) (result LocationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/tenants.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/tenants.go index 27bf0e338c7..0d753917020 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/tenants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions/tenants.go @@ -73,6 +73,9 @@ func (client TenantsClient) List(ctx context.Context) (result TenantListResultPa if err != nil { err = autorest.NewErrorWithError(err, "subscriptions.TenantsClient", "List", resp, "Failure responding to request") } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -103,7 +106,6 @@ func (client TenantsClient) ListSender(req *http.Request) (*http.Response, error func (client TenantsClient) ListResponder(resp *http.Response) (result TenantListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index fff54835134..058279423aa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v43.2.0" +const Number = "v45.0.0" diff --git a/vendor/github.com/Azure/go-autorest/.gitignore b/vendor/github.com/Azure/go-autorest/.gitignore new file mode 100644 index 00000000000..3350aaf7064 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/.gitignore @@ -0,0 +1,32 @@ +# The standard Go .gitignore file follows. (Sourced from: github.com/github/gitignore/master/Go.gitignore) +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test +.DS_Store +.idea/ +.vscode/ + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +# go-autorest specific +vendor/ +autorest/azure/example/example diff --git a/vendor/github.com/Azure/go-autorest/CHANGELOG.md b/vendor/github.com/Azure/go-autorest/CHANGELOG.md new file mode 100644 index 00000000000..d1f596bfc9b --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/CHANGELOG.md @@ -0,0 +1,1004 @@ +# CHANGELOG + +## v14.2.0 + +- Added package comment to make `github.com/Azure/go-autorest` importable. + +## v14.1.1 + +### Bug Fixes + +- Change `x-ms-authorization-auxiliary` header value separator to comma. + +## v14.1.0 + +### New Features + +- Added `azure.SetEnvironment()` that will update the global environments map with the specified values. + +## v14.0.1 + +### Bug Fixes + +- Fix race condition when refreshing token. +- Fixed some tests to work with Go 1.14. + +## v14.0.0 + +## Breaking Changes + +- By default, the `DoRetryForStatusCodes` functions will no longer infinitely retry a request when the response returns an HTTP status code of 429 (StatusTooManyRequests). To opt in to the old behavior set `autorest.Count429AsRetry` to `false`. + +## New Features + +- Variable `autorest.Max429Delay` can be used to control the maximum delay between retries when a 429 is received with no `Retry-After` header. The default is zero which means there is no cap. + +## v13.4.0 + +## New Features + +- Added field `SendDecorators` to the `Client` type. This can be used to specify a custom chain of SendDecorators per client. +- Added method `Client.Send()` which includes logic for selecting the preferred chain of SendDecorators. + +## v13.3.3 + +### Bug Fixes + +- Fixed connection leak when retrying requests. +- Enabled exponential back-off with a 2-minute cap when retrying on 429. +- Fixed some cases where errors were inadvertently dropped. + +## v13.3.2 + +### Bug Fixes + +- Updated `autorest.AsStringSlice()` to convert slice elements to their string representation. + +## v13.3.1 + +- Updated external dependencies. + +### Bug Fixes + +## v13.3.0 + +### New Features + +- Added support for shared key and shared access signature token authorization. + - `autorest.NewSharedKeyAuthorizer()` and dependent types. + - `autorest.NewSASTokenAuthorizer()` and dependent types. +- Added `ServicePrincipalToken.SetCustomRefresh()` so a custom refresh function can be invoked when a token has expired. + +### Bug Fixes + +- Fixed `cli.AccessTokensPath()` to respect `AZURE_CONFIG_DIR` when set. +- Support parsing error messages in XML responses. + +## v13.2.0 + +### New Features + +- Added the following functions to replace their versions that don't take a context. + - `adal.InitiateDeviceAuthWithContext()` + - `adal.CheckForUserCompletionWithContext()` + - `adal.WaitForUserCompletionWithContext()` + +## v13.1.0 + +### New Features + +- Added support for MSI authentication on Azure App Service and Azure Functions. + +## v13.0.2 + +### Bug Fixes + +- Always retry a request even if the sender returns a non-nil error. + +## v13.0.1 + +## Bug Fixes + +- Fixed `autorest.WithQueryParameters()` so that it properly encodes multi-value query parameters. + +## v13.0.0 + +## Breaking Changes + +The `tracing` package has been rewritten to provide a common interface for consumers to wire in the tracing package of their choice. +What this means is that by default no tracing provider will be compiled into your program and setting the `AZURE_SDK_TRACING_ENABLED` +environment variable will have no effect. To enable this previous behavior you must now add the following import to your source file. +```go + import _ "github.com/Azure/go-autorest/tracing/opencensus" +``` +The APIs required by autorest-generated code have remained but some APIs have been removed and new ones added. +The following APIs and variables have been removed (the majority of them were moved to the `opencensus` package). +- tracing.Transport +- tracing.Enable() +- tracing.EnableWithAIForwarding() +- tracing.Disable() + +The following APIs and types have been added +- tracing.Tracer +- tracing.Register() + +To hook up a tracer simply call `tracing.Register()` passing in a type that satisfies the `tracing.Tracer` interface. + +## v12.4.3 + +### Bug Fixes + +- `autorest.MultiTenantServicePrincipalTokenAuthorizer` will now properly add its auxiliary bearer tokens. + +## v12.4.2 + +### Bug Fixes + +- Improvements to the fixes made in v12.4.1. + - Remove `override` stanza from Gopkg.toml and `replace` directive from go.mod as they don't apply when being consumed as a dependency. + - Switched to latest version of `ocagent` that still depends on protobuf v1.2. + - Add indirect dependencies to the `required` clause with matching `constraint` stanzas so that `dep` dependencies match go.sum. + +## v12.4.1 + +### Bug Fixes + +- Updated OpenCensus and OCAgent versions to versions that don't depend on v1.3+ of protobuf as it was breaking kubernetes. +- Pinned opencensus-proto to a version that's compatible with our versions of OpenCensus and OCAgent. + +## v12.4.0 + +### New Features + +- Added `autorest.WithPrepareDecorators` and `autorest.GetPrepareDecorators` for adding and retrieving a custom chain of PrepareDecorators to the provided context. + +## v12.3.0 + +### New Features + +- Support for multi-tenant via x-ms-authorization-auxiliary header has been added for client credentials with + secret scenario; this basically bundles multiple OAuthConfig and ServicePrincipalToken types into corresponding + MultiTenant* types along with a new authorizer that adds the primary and auxiliary token headers to the reqest. + The authenticaion helpers have been updated to support this scenario; if environment var AZURE_AUXILIARY_TENANT_IDS + is set with a semicolon delimited list of tenants the multi-tenant codepath will kick in to create the appropriate authorizer. + See `adal.NewMultiTenantOAuthConfig`, `adal.NewMultiTenantServicePrincipalToken` and `autorest.NewMultiTenantServicePrincipalTokenAuthorizer` + along with their supporting types and methods. +- Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for adding and retrieving a custom chain of SendDecorators to the provided context. +- Added `autorest.DoRetryForStatusCodesWithCap` and `autorest.DelayForBackoffWithCap` to enforce an upper bound on the duration between retries. + +## v12.2.0 + +### New Features + +- Added `autorest.WithXML`, `autorest.AsMerge`, `autorest.WithBytes` preparer decorators. +- Added `autorest.ByUnmarshallingBytes` response decorator. +- Added `Response.IsHTTPStatus` and `Response.HasHTTPStatus` helper methods for inspecting HTTP status code in `autorest.Response` types. + +### Bug Fixes + +- `autorest.DelayWithRetryAfter` now supports HTTP-Dates in the `Retry-After` header and is not limited to just 429 status codes. + +## v12.1.0 + +### New Features + +- Added `to.ByteSlicePtr()`. +- Added blob/queue storage resource ID to `azure.ResourceIdentifier`. + +## v12.0.0 + +### Breaking Changes + +In preparation for modules the following deprecated content has been removed. + + - async.NewFuture() + - async.Future.Done() + - async.Future.WaitForCompletion() + - async.DoPollForAsynchronous() + - The `utils` package + - validation.NewErrorWithValidationError() + - The `version` package + +## v11.9.0 + +### New Features + +- Add `ResourceIdentifiers` field to `azure.Environment` containing resource IDs for public and sovereign clouds. + +## v11.8.0 + +### New Features + +- Added `autorest.NewClientWithOptions()` to support endpoints that require free renegotiation. + +## v11.7.1 + +### Bug Fixes + +- Fix missing support for http(s) proxy when using the default sender. + +## v11.7.0 + +### New Features + +- Added methods to obtain a ServicePrincipalToken on the various credential configuration types in the `auth` package. + +## v11.6.1 + +### Bug Fixes + +- Fix ACR DNS endpoint for government clouds. +- Add Cosmos DB DNS endpoints. +- Update dependencies to resolve build breaks in OpenCensus. + +## v11.6.0 + +### New Features + +- Added type `autorest.BasicAuthorizer` to support Basic authentication. + +## v11.5.2 + +### Bug Fixes + +- Fixed `GetTokenFromCLI` did not work with zsh. + +## v11.5.1 + +### Bug Fixes + +- In `Client.sender()` set the minimum TLS version on HTTP clients to 1.2. + +## v11.5.0 + +### New Features + +- The `auth` package has been refactored so that the environment and file settings are now available. +- The methods used in `auth.NewAuthorizerFromEnvironment()` are now exported so that custom authorization chains can be created. +- Added support for certificate authorization for file-based config. + +## v11.4.0 + +### New Features + +- Added `adal.AddToUserAgent()` so callers can append custom data to the user-agent header used for ADAL requests. +- Exported `adal.UserAgent()` for parity with `autorest.Client`. + +## v11.3.2 + +### Bug Fixes + +- In `Future.WaitForCompletionRef()` if the provided context has a deadline don't add the default deadline. + +## v11.3.1 + +### Bug Fixes + +- For an LRO PUT operation the final GET URL was incorrectly set to the Location polling header in some cases. + +## v11.3.0 + +### New Features + +- Added method `ServicePrincipalToken()` to `DeviceFlowConfig` type. + +## v11.2.8 + +### Bug Fixes + +- Deprecate content in the `version` package. The functionality has been superseded by content in the `autorest` package. + +## v11.2.7 + +### Bug Fixes + +- Fix environment variable name for enabling tracing from `AZURE_SDK_TRACING_ENABELD` to `AZURE_SDK_TRACING_ENABLED`. + Note that for backward compatibility reasons, both will work until the next major version release of the package. + +## v11.2.6 + +### Bug Fixes + +- If zero bytes are read from a polling response body don't attempt to unmarshal them. + +## v11.2.5 + +### Bug Fixes + +- Removed race condition in `autorest.DoRetryForStatusCodes`. + +## v11.2.4 + +### Bug Fixes + +- Function `cli.ProfilePath` now respects environment `AZURE_CONFIG_DIR` if available. + +## v11.2.1 + +NOTE: Versions of Go prior to 1.10 have been removed from CI as they no +longer work with golint. + +### Bug Fixes + +- Method `MSIConfig.Authorizer` now supports user-assigned identities. +- The adal package now reports its own user-agent string. + +## v11.2.0 + +### New Features + +- Added `tracing` package that enables instrumentation of HTTP and API calls. + Setting the env variable `AZURE_SDK_TRACING_ENABLED` or calling `tracing.Enable` + will start instrumenting the code for metrics and traces. + Additionally, setting the env variable `OCAGENT_TRACE_EXPORTER_ENDPOINT` or + calling `tracing.EnableWithAIForwarding` will start the instrumentation and connect to an + App Insights Local Forwarder that is needs to be running. Note that if the + AI Local Forwarder is not running tracking will still be enabled. + By default, instrumentation is disabled. Once enabled, instrumentation can also + be programatically disabled by calling `Disable`. +- Added `DoneWithContext` call for checking LRO status. `Done` has been deprecated. + +### Bug Fixes + +- Don't use the initial request's context for LRO polling. +- Don't override the `refreshLock` and the `http.Client` when unmarshalling `ServicePrincipalToken` if + it is already set. + +## v11.1.1 + +### Bug Fixes + +- When creating a future always include the polling tracker even if there's a failure; this allows the underlying response to be obtained by the caller. + +## v11.1.0 + +### New Features + +- Added `auth.NewAuthorizerFromCLI` to create an authorizer configured from the Azure 2.0 CLI. +- Added `adal.NewOAuthConfigWithAPIVersion` to create an OAuthConfig with the specified API version. + +## v11.0.1 + +### New Features + +- Added `x5c` header to client assertion for certificate Issuer+Subject Name authentication. + +## v11.0.0 + +### Breaking Changes + +- To handle differences between ADFS and AAD the following fields have had their types changed from `string` to `json.Number` + - ExpiresIn + - ExpiresOn + - NotBefore + +### New Features + +- Added `auth.NewAuthorizerFromFileWithResource` to create an authorizer from the config file with the specified resource. +- Setting a client's `PollingDuration` to zero will use the provided context to control a LRO's polling duration. + +## v10.15.5 + +### Bug Fixes + +- In `DoRetryForStatusCodes`, if a request's context is cancelled return the last response. + +## v10.15.4 + +### Bug Fixes + +- If a polling operation returns a failure status code return the associated error. + +## v10.15.3 + +### Bug Fixes + +- Initialize the polling URL and method for an LRO tracker on each iteration, favoring the Azure-AsyncOperation header. + +## v10.15.2 + +### Bug Fixes + +- Use fmt.Fprint when printing request/response so that any escape sequences aren't treated as format specifiers. + +## v10.15.1 + +### Bug Fixes + +- If an LRO API returns a `Failed` provisioning state in the initial response return an error at that point so the caller doesn't have to poll. +- For failed LROs without an OData v4 error include the response body in the error's `AdditionalInfo` field to aid in diagnosing the failure. + +## v10.15.0 + +### New Features + +- Add initial support for request/response logging via setting environment variables. + Setting `AZURE_GO_SDK_LOG_LEVEL` to `LogInfo` will log request/response + without their bodies. To include the bodies set the log level to `LogDebug`. + By default the logger writes to strerr, however it can also write to stdout or a file + if specified in `AZURE_GO_SDK_LOG_FILE`. Note that if the specified file + already exists it will be truncated. + IMPORTANT: by default the logger will redact the Authorization and Ocp-Apim-Subscription-Key + headers. Any other secrets will _not_ be redacted. + +## v10.14.0 + +### New Features + +- Added package version that contains version constants and user-agent data. + +### Bug Fixes + +- Add the user-agent to token requests. + +## v10.13.0 + +- Added support for additionalInfo in ServiceError type. + +## v10.12.0 + +### New Features + +- Added field ServicePrincipalToken.MaxMSIRefreshAttempts to configure the maximun number of attempts to refresh an MSI token. + +## v10.11.4 + +### Bug Fixes + +- If an LRO returns http.StatusOK on the initial response with no async headers return the response body from Future.GetResult(). +- If there is no "final GET URL" return an error from Future.GetResult(). + +## v10.11.3 + +### Bug Fixes + +- In IMDS retry logic, if we don't receive a response don't retry. + - Renamed the retry function so it's clear it's meant for IMDS only. +- For error response bodies that aren't OData-v4 compliant stick the raw JSON in the ServiceError.Details field so the information isn't lost. + - Also add the raw HTTP response to the DetailedResponse. +- Removed superfluous wrapping of response error in azure.DoRetryWithRegistration(). + +## v10.11.2 + +### Bug Fixes + +- Validation for integers handles int and int64 types. + +## v10.11.1 + +### Bug Fixes + +- Adding User information to authorization config as parsed from CLI cache. + +## v10.11.0 + +### New Features + +- Added NewServicePrincipalTokenFromManualTokenSecret for creating a new SPT using a manual token and secret +- Added method ServicePrincipalToken.MarshalTokenJSON() to marshall the inner Token + +## v10.10.0 + +### New Features + +- Most ServicePrincipalTokens can now be marshalled/unmarshall to/from JSON (ServicePrincipalCertificateSecret and ServicePrincipalMSISecret are not supported). +- Added method ServicePrincipalToken.SetRefreshCallbacks(). + +## v10.9.2 + +### Bug Fixes + +- Refreshing a refresh token obtained from a web app authorization code now works. + +## v10.9.1 + +### Bug Fixes + +- The retry logic for MSI token requests now uses exponential backoff per the guidelines. +- IsTemporaryNetworkError() will return true for errors that don't implement the net.Error interface. + +## v10.9.0 + +### Deprecated Methods + +| Old Method | New Method | +| -------------------------: | :---------------------------: | +| azure.NewFuture() | azure.NewFutureFromResponse() | +| Future.WaitForCompletion() | Future.WaitForCompletionRef() | + +### New Features + +- Added azure.NewFutureFromResponse() for creating a Future from the initial response from an async operation. +- Added Future.GetResult() for making the final GET call to retrieve the result from an async operation. + +### Bug Fixes + +- Some futures failed to return their results, this should now be fixed. + +## v10.8.2 + +### Bug Fixes + +- Add nil-gaurd to token retry logic. + +## v10.8.1 + +### Bug Fixes + +- Return a TokenRefreshError if the sender fails on the initial request. +- Don't retry on non-temporary network errors. + +## v10.8.0 + +- Added NewAuthorizerFromEnvironmentWithResource() helper function. + +## v10.7.0 + +### New Features + +- Added \*WithContext() methods to ADAL token refresh operations. + +## v10.6.2 + +- Fixed a bug on device authentication. + +## v10.6.1 + +- Added retries to MSI token get request. + +## v10.6.0 + +- Changed MSI token implementation. Now, the token endpoint is the IMDS endpoint. + +## v10.5.1 + +### Bug Fixes + +- `DeviceFlowConfig.Authorizer()` now prints the device code message when running `go test`. `-v` flag is required. + +## v10.5.0 + +### New Features + +- Added NewPollingRequestWithContext() for use with polling asynchronous operations. + +### Bug Fixes + +- Make retry logic use the request's context instead of the deprecated Cancel object. + +## v10.4.0 + +### New Features + +- Added helper for parsing Azure Resource ID's. +- Added deprecation message to utils.GetEnvVarOrExit() + +## v10.3.0 + +### New Features + +- Added EnvironmentFromURL method to load an Environment from a given URL. This function is particularly useful in the private and hybrid Cloud model, where one may define their own endpoints +- Added TokenAudience endpoint to Environment structure. This is useful in private and hybrid cloud models where TokenAudience endpoint can be different from ResourceManagerEndpoint + +## v10.2.0 + +### New Features + +- Added endpoints for batch management. + +## v10.1.3 + +### Bug Fixes + +- In Client.Do() invoke WithInspection() last so that it will inspect WithAuthorization(). +- Fixed authorization methods to invoke p.Prepare() first, aligning them with the other preparers. + +## v10.1.2 + +- Corrected comment for auth.NewAuthorizerFromFile() function. + +## v10.1.1 + +- Updated version number to match current release. + +## v10.1.0 + +### New Features + +- Expose the polling URL for futures. + +### Bug Fixes + +- Add validation.NewErrorWithValidationError back to prevent breaking changes (it is deprecated). + +## v10.0.0 + +### New Features + +- Added target and innererror fields to ServiceError to comply with OData v4 spec. +- The Done() method on futures will now return a ServiceError object when available (it used to return a partial value of such errors). +- Added helper methods for obtaining authorizers. +- Expose the polling URL for futures. + +### Bug Fixes + +- Switched from glide to dep for dependency management. +- Fixed unmarshaling of ServiceError for JSON bodies that don't conform to the OData spec. +- Fixed a race condition in token refresh. + +### Breaking Changes + +- The ServiceError.Details field type has been changed to match the OData v4 spec. +- Go v1.7 has been dropped from CI. +- API parameter validation failures will now return a unique error type validation.Error. +- The adal.Token type has been decomposed from adal.ServicePrincipalToken (this was necessary in order to fix the token refresh race). + +## v9.10.0 + +- Fix the Service Bus suffix in Azure public env +- Add Service Bus Endpoint (AAD ResourceURI) for use in [Azure Service Bus RBAC Preview](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-role-based-access-control) + +## v9.9.0 + +### New Features + +- Added EventGridKeyAuthorizer for key authorization with event grid topics. + +### Bug Fixes + +- Fixed race condition when auto-refreshing service principal tokens. + +## v9.8.1 + +### Bug Fixes + +- Added http.StatusNoContent (204) to the list of expected status codes for long-running operations. +- Updated runtime version info so it's current. + +## v9.8.0 + +### New Features + +- Added type azure.AsyncOpIncompleteError to be returned from a future's Result() method when the operation has not completed. + +## v9.7.1 + +### Bug Fixes + +- Use correct AAD and Graph endpoints for US Gov environment. + +## v9.7.0 + +### New Features + +- Added support for application/octet-stream MIME types. + +## v9.6.1 + +### Bug Fixes + +- Ensure Authorization header is added to request when polling for registration status. + +## v9.6.0 + +### New Features + +- Added support for acquiring tokens via MSI with a user assigned identity. + +## v9.5.3 + +### Bug Fixes + +- Don't remove encoding of existing URL Query parameters when calling autorest.WithQueryParameters. +- Set correct Content Type when using autorest.WithFormData. + +## v9.5.2 + +### Bug Fixes + +- Check for nil \*http.Response before dereferencing it. + +## v9.5.1 + +### Bug Fixes + +- Don't count http.StatusTooManyRequests (429) against the retry cap. +- Use retry logic when SkipResourceProviderRegistration is set to true. + +## v9.5.0 + +### New Features + +- Added support for username + password, API key, authoriazation code and cognitive services authentication. +- Added field SkipResourceProviderRegistration to clients to provide a way to skip auto-registration of RPs. +- Added utility function AsStringSlice() to convert its parameters to a string slice. + +### Bug Fixes + +- When checking for authentication failures look at the error type not the status code as it could vary. + +## v9.4.2 + +### Bug Fixes + +- Validate parameters when creating credentials. +- Don't retry requests if the returned status is a 401 (http.StatusUnauthorized) as it will never succeed. + +## v9.4.1 + +### Bug Fixes + +- Update the AccessTokensPath() to read access tokens path through AZURE_ACCESS_TOKEN_FILE. If this + environment variable is not set, it will fall back to use default path set by Azure CLI. +- Use case-insensitive string comparison for polling states. + +## v9.4.0 + +### New Features + +- Added WaitForCompletion() to Future as a default polling implementation. + +### Bug Fixes + +- Method Future.Done() shouldn't update polling status for unexpected HTTP status codes. + +## v9.3.1 + +### Bug Fixes + +- DoRetryForStatusCodes will retry if sender.Do returns a non-nil error. + +## v9.3.0 + +### New Features + +- Added PollingMethod() to Future so callers know what kind of polling mechanism is used. +- Added azure.ChangeToGet() which transforms an http.Request into a GET (to be used with LROs). + +## v9.2.0 + +### New Features + +- Added support for custom Azure Stack endpoints. +- Added type azure.Future used to track the status of long-running operations. + +### Bug Fixes + +- Preserve the original error in DoRetryWithRegistration when registration fails. + +## v9.1.1 + +- Fixes a bug regarding the cookie jar on `autorest.Client.Sender`. + +## v9.1.0 + +### New Features + +- In cases where there is a non-empty error from the service, attempt to unmarshal it instead of uniformly calling it an "Unknown" error. +- Support for loading Azure CLI Authentication files. +- Automatically register your subscription with the Azure Resource Provider if it hadn't been previously. + +### Bug Fixes + +- RetriableRequest can now tolerate a ReadSeekable body being read but not reset. +- Adding missing Apache Headers + +## v9.0.0 + +> **IMPORTANT:** This release was intially labeled incorrectly as `v8.4.0`. From the time it was released, it should have been marked `v9.0.0` because it contains breaking changes to the MSI packages. We appologize for any inconvenience this causes. + +Adding MSI Endpoint Support and CLI token rehydration. + +## v8.3.1 + +Pick up bug fix in adal for MSI support. + +## v8.3.0 + +Updates to Error string formats for clarity. Also, adding a copy of the http.Response to errors for an improved debugging experience. + +## v8.2.0 + +### New Features + +- Add support for bearer authentication callbacks +- Support 429 response codes that include "Retry-After" header +- Support validation constraint "Pattern" for map keys + +### Bug Fixes + +- Make RetriableRequest work with multiple versions of Go + +## v8.1.1 + +Updates the RetriableRequest to take advantage of GetBody() added in Go 1.8. + +## v8.1.0 + +Adds RetriableRequest type for more efficient handling of retrying HTTP requests. + +## v8.0.0 + +ADAL refactored into its own package. +Support for UNIX time. + +## v7.3.1 + +- Version Testing now removed from production bits that are shipped with the library. + +## v7.3.0 + +- Exposing new `RespondDecorator`, `ByDiscardingBody`. This allows operations + to acknowledge that they do not need either the entire or a trailing portion + of accepts response body. In doing so, Go's http library can reuse HTTP + connections more readily. +- Adding `PrepareDecorator` to target custom BaseURLs. +- Adding ACR suffix to public cloud environment. +- Updating Glide dependencies. + +## v7.2.5 + +- Fixed the Active Directory endpoint for the China cloud. +- Removes UTF-8 BOM if present in response payload. +- Added telemetry. + +## v7.2.3 + +- Fixing bug in calls to `DelayForBackoff` that caused doubling of delay + duration. + +## v7.2.2 + +- autorest/azure: added ASM and ARM VM DNS suffixes. + +## v7.2.1 + +- fixed parsing of UTC times that are not RFC3339 conformant. + +## v7.2.0 + +- autorest/validation: Reformat validation error for better error message. + +## v7.1.0 + +- preparer: Added support for multipart formdata - WithMultiPartFormdata() +- preparer: Added support for sending file in request body - WithFile +- client: Added RetryDuration parameter. +- autorest/validation: new package for validation code for Azure Go SDK. + +## v7.0.7 + +- Add trailing / to endpoint +- azure: add EnvironmentFromName + +## v7.0.6 + +- Add retry logic for 408, 500, 502, 503 and 504 status codes. +- Change url path and query encoding logic. +- Fix DelayForBackoff for proper exponential delay. +- Add CookieJar in Client. + +## v7.0.5 + +- Add check to start polling only when status is in [200,201,202]. +- Refactoring for unchecked errors. +- azure/persist changes. +- Fix 'file in use' issue in renewing token in deviceflow. +- Store header RetryAfter for subsequent requests in polling. +- Add attribute details in service error. + +## v7.0.4 + +- Better error messages for long running operation failures + +## v7.0.3 + +- Corrected DoPollForAsynchronous to properly handle the initial response + +## v7.0.2 + +- Corrected DoPollForAsynchronous to continue using the polling method first discovered + +## v7.0.1 + +- Fixed empty JSON input error in ByUnmarshallingJSON +- Fixed polling support for GET calls +- Changed format name from TimeRfc1123 to TimeRFC1123 + +## v7.0.0 + +- Added ByCopying responder with supporting TeeReadCloser +- Rewrote Azure asynchronous handling +- Reverted to only unmarshalling JSON +- Corrected handling of RFC3339 time strings and added support for Rfc1123 time format + +The `json.Decoder` does not catch bad data as thoroughly as `json.Unmarshal`. Since +`encoding/json` successfully deserializes all core types, and extended types normally provide +their custom JSON serialization handlers, the code has been reverted back to using +`json.Unmarshal`. The original change to use `json.Decode` was made to reduce duplicate +code; there is no loss of function, and there is a gain in accuracy, by reverting. + +Additionally, Azure services indicate requests to be polled by multiple means. The existing code +only checked for one of those (that is, the presence of the `Azure-AsyncOperation` header). +The new code correctly covers all cases and aligns with the other Azure SDKs. + +## v6.1.0 + +- Introduced `date.ByUnmarshallingJSONDate` and `date.ByUnmarshallingJSONTime` to enable JSON encoded values. + +## v6.0.0 + +- Completely reworked the handling of polled and asynchronous requests +- Removed unnecessary routines +- Reworked `mocks.Sender` to replay a series of `http.Response` objects +- Added `PrepareDecorators` for primitive types (e.g., bool, int32) + +Handling polled and asynchronous requests is no longer part of `Client#Send`. Instead new +`SendDecorators` implement different styles of polled behavior. See`autorest.DoPollForStatusCodes` +and `azure.DoPollForAsynchronous` for examples. + +## v5.0.0 + +- Added new RespondDecorators unmarshalling primitive types +- Corrected application of inspection and authorization PrependDecorators + +## v4.0.0 + +- Added support for Azure long-running operations. +- Added cancelation support to all decorators and functions that may delay. +- Breaking: `DelayForBackoff` now accepts a channel, which may be nil. + +## v3.1.0 + +- Add support for OAuth Device Flow authorization. +- Add support for ServicePrincipalTokens that are backed by an existing token, rather than other secret material. +- Add helpers for persisting and restoring Tokens. +- Increased code coverage in the github.com/Azure/autorest/azure package + +## v3.0.0 + +- Breaking: `NewErrorWithError` no longer takes `statusCode int`. +- Breaking: `NewErrorWithStatusCode` is replaced with `NewErrorWithResponse`. +- Breaking: `Client#Send()` no longer takes `codes ...int` argument. +- Add: XML unmarshaling support with `ByUnmarshallingXML()` +- Stopped vending dependencies locally and switched to [Glide](https://github.com/Masterminds/glide). + Applications using this library should either use Glide or vendor dependencies locally some other way. +- Add: `azure.WithErrorUnlessStatusCode()` decorator to handle Azure errors. +- Fix: use `net/http.DefaultClient` as base client. +- Fix: Missing inspection for polling responses added. +- Add: CopyAndDecode helpers. +- Improved `./autorest/to` with `[]string` helpers. +- Removed golint suppressions in .travis.yml. + +## v2.1.0 + +- Added `StatusCode` to `Error` for more easily obtaining the HTTP Reponse StatusCode (if any) + +## v2.0.0 + +- Changed `to.StringMapPtr` method signature to return a pointer +- Changed `ServicePrincipalCertificateSecret` and `NewServicePrincipalTokenFromCertificate` to support generic certificate and private keys + +## v1.0.0 + +- Added Logging inspectors to trace http.Request / Response +- Added support for User-Agent header +- Changed WithHeader PrepareDecorator to use set vs. add +- Added JSON to error when unmarshalling fails +- Added Client#Send method +- Corrected case of "Azure" in package paths +- Added "to" helpers, Azure helpers, and improved ease-of-use +- Corrected golint issues + +## v1.0.1 + +- Added CHANGELOG.md + +## v1.1.0 + +- Added mechanism to retrieve a ServicePrincipalToken using a certificate-signed JWT +- Added an example of creating a certificate-based ServicePrincipal and retrieving an OAuth token using the certificate + +## v1.1.1 + +- Introduce godeps and vendor dependencies introduced in v1.1.1 diff --git a/vendor/github.com/Azure/go-autorest/GNUmakefile b/vendor/github.com/Azure/go-autorest/GNUmakefile new file mode 100644 index 00000000000..a434e73ac49 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/GNUmakefile @@ -0,0 +1,23 @@ +DIR?=./autorest/ + +default: build + +build: fmt + go install $(DIR) + +test: + go test $(DIR) || exit 1 + +vet: + @echo "go vet ." + @go vet $(DIR)... ; if [ $$? -eq 1 ]; then \ + echo ""; \ + echo "Vet found suspicious constructs. Please check the reported constructs"; \ + echo "and fix them if necessary before submitting the code for review."; \ + exit 1; \ + fi + +fmt: + gofmt -w $(DIR) + +.PHONY: build test vet fmt diff --git a/vendor/github.com/Azure/go-autorest/Gopkg.lock b/vendor/github.com/Azure/go-autorest/Gopkg.lock new file mode 100644 index 00000000000..dc6e3e633e6 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/Gopkg.lock @@ -0,0 +1,324 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:892e39e5c083d0943f1e80ab8351690f183c6a5ab24e1d280adcad424c26255e" + name = "contrib.go.opencensus.io/exporter/ocagent" + packages = ["."] + pruneopts = "UT" + revision = "a8a6f458bbc1d5042322ad1f9b65eeb0b69be9ea" + version = "v0.6.0" + +[[projects]] + digest = "1:8f5acd4d4462b5136af644d25101f0968a7a94ee90fcb2059cec5b7cc42e0b20" + name = "github.com/census-instrumentation/opencensus-proto" + packages = [ + "gen-go/agent/common/v1", + "gen-go/agent/metrics/v1", + "gen-go/agent/trace/v1", + "gen-go/metrics/v1", + "gen-go/resource/v1", + "gen-go/trace/v1", + ] + pruneopts = "UT" + revision = "d89fa54de508111353cb0b06403c00569be780d8" + version = "v0.2.1" + +[[projects]] + digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" + name = "github.com/davecgh/go-spew" + packages = ["spew"] + pruneopts = "UT" + revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" + version = "v1.1.1" + +[[projects]] + digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" + name = "github.com/dgrijalva/jwt-go" + packages = ["."] + pruneopts = "UT" + revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" + version = "v3.2.0" + +[[projects]] + digest = "1:cf0d2e435fd4ce45b789e93ef24b5f08e86be0e9807a16beb3694e2d8c9af965" + name = "github.com/dimchansky/utfbom" + packages = ["."] + pruneopts = "UT" + revision = "d2133a1ce379ef6fa992b0514a77146c60db9d1c" + version = "v1.1.0" + +[[projects]] + branch = "master" + digest = "1:b7cb6054d3dff43b38ad2e92492f220f57ae6087ee797dca298139776749ace8" + name = "github.com/golang/groupcache" + packages = ["lru"] + pruneopts = "UT" + revision = "611e8accdfc92c4187d399e95ce826046d4c8d73" + +[[projects]] + digest = "1:e3839df32927e8d3403cd5aa7253d966e8ff80fc8f10e2e35d146461cd83fcfa" + name = "github.com/golang/protobuf" + packages = [ + "descriptor", + "jsonpb", + "proto", + "protoc-gen-go/descriptor", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/struct", + "ptypes/timestamp", + "ptypes/wrappers", + ] + pruneopts = "UT" + revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7" + version = "v1.3.2" + +[[projects]] + digest = "1:c560cd79300fac84f124b96225181a637a70b60155919a3c36db50b7cca6b806" + name = "github.com/grpc-ecosystem/grpc-gateway" + packages = [ + "internal", + "runtime", + "utilities", + ] + pruneopts = "UT" + revision = "f7120437bb4f6c71f7f5076ad65a45310de2c009" + version = "v1.12.1" + +[[projects]] + digest = "1:5d231480e1c64a726869bc4142d270184c419749d34f167646baa21008eb0a79" + name = "github.com/mitchellh/go-homedir" + packages = ["."] + pruneopts = "UT" + revision = "af06845cf3004701891bf4fdb884bfe4920b3727" + version = "v1.1.0" + +[[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" + name = "github.com/pmezard/go-difflib" + packages = ["difflib"] + pruneopts = "UT" + revision = "792786c7400a136282c1664665ae0a8db921c6c2" + version = "v1.0.0" + +[[projects]] + digest = "1:99d32780e5238c2621fff621123997c3e3cca96db8be13179013aea77dfab551" + name = "github.com/stretchr/testify" + packages = [ + "assert", + "require", + ] + pruneopts = "UT" + revision = "221dbe5ed46703ee255b1da0dec05086f5035f62" + version = "v1.4.0" + +[[projects]] + digest = "1:7c5e00383399fe13de0b4b65c9fdde16275407ce8ac02d867eafeaa916edcc71" + name = "go.opencensus.io" + packages = [ + ".", + "internal", + "internal/tagencoding", + "metric/metricdata", + "metric/metricproducer", + "plugin/ocgrpc", + "plugin/ochttp", + "plugin/ochttp/propagation/b3", + "plugin/ochttp/propagation/tracecontext", + "resource", + "stats", + "stats/internal", + "stats/view", + "tag", + "trace", + "trace/internal", + "trace/propagation", + "trace/tracestate", + ] + pruneopts = "UT" + revision = "aad2c527c5defcf89b5afab7f37274304195a6b2" + version = "v0.22.2" + +[[projects]] + branch = "master" + digest = "1:f604f5e2ee721b6757d962dfe7bab4f28aae50c456e39cfb2f3819762a44a6ae" + name = "golang.org/x/crypto" + packages = [ + "pkcs12", + "pkcs12/internal/rc2", + ] + pruneopts = "UT" + revision = "e9b2fee46413994441b28dfca259d911d963dfed" + +[[projects]] + branch = "master" + digest = "1:334b27eac455cb6567ea28cd424230b07b1a64334a2f861a8075ac26ce10af43" + name = "golang.org/x/lint" + packages = [ + ".", + "golint", + ] + pruneopts = "UT" + revision = "fdd1cda4f05fd1fd86124f0ef9ce31a0b72c8448" + +[[projects]] + branch = "master" + digest = "1:257a75d024975428ab9192bfc334c3490882f8cb21322ea5784ca8eca000a910" + name = "golang.org/x/net" + packages = [ + "http/httpguts", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "trace", + ] + pruneopts = "UT" + revision = "1ddd1de85cb0337b623b740a609d35817d516a8d" + +[[projects]] + branch = "master" + digest = "1:382bb5a7fb4034db3b6a2d19e5a4a6bcf52f4750530603c01ca18a172fa3089b" + name = "golang.org/x/sync" + packages = ["semaphore"] + pruneopts = "UT" + revision = "cd5d95a43a6e21273425c7ae415d3df9ea832eeb" + +[[projects]] + branch = "master" + digest = "1:4da420ceda5f68e8d748aa2169d0ed44ffadb1bbd6537cf778a49563104189b8" + name = "golang.org/x/sys" + packages = ["unix"] + pruneopts = "UT" + revision = "ce4227a45e2eb77e5c847278dcc6a626742e2945" + +[[projects]] + digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405" + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/language", + "internal/language/compact", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable", + ] + pruneopts = "UT" + revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475" + version = "v0.3.2" + +[[projects]] + branch = "master" + digest = "1:4eb5ea8395fb60212dd58b92c9db80bab59d5e99c7435f9a6a0a528c373b60e7" + name = "golang.org/x/tools" + packages = [ + "go/ast/astutil", + "go/gcexportdata", + "go/internal/gcimporter", + "go/types/typeutil", + ] + pruneopts = "UT" + revision = "259af5ff87bdcd4abf2ecda8edc3f13f04f26a42" + +[[projects]] + digest = "1:964bb30febc27fabfbec4759fa530c6ec35e77a7c85fed90b9317ea39a054877" + name = "google.golang.org/api" + packages = ["support/bundler"] + pruneopts = "UT" + revision = "8a410c21381766a810817fd6200fce8838ecb277" + version = "v0.14.0" + +[[projects]] + branch = "master" + digest = "1:a8d5c2c6e746b3485e36908ab2a9e3d77b86b81f8156d88403c7d2b462431dfd" + name = "google.golang.org/genproto" + packages = [ + "googleapis/api/httpbody", + "googleapis/rpc/status", + "protobuf/field_mask", + ] + pruneopts = "UT" + revision = "51378566eb590fa106d1025ea12835a4416dda84" + +[[projects]] + digest = "1:b59ce3ddb11daeeccccc9cb3183b58ebf8e9a779f1c853308cd91612e817a301" + name = "google.golang.org/grpc" + packages = [ + ".", + "backoff", + "balancer", + "balancer/base", + "balancer/roundrobin", + "binarylog/grpc_binarylog_v1", + "codes", + "connectivity", + "credentials", + "credentials/internal", + "encoding", + "encoding/proto", + "grpclog", + "internal", + "internal/backoff", + "internal/balancerload", + "internal/binarylog", + "internal/buffer", + "internal/channelz", + "internal/envconfig", + "internal/grpcrand", + "internal/grpcsync", + "internal/resolver/dns", + "internal/resolver/passthrough", + "internal/syscall", + "internal/transport", + "keepalive", + "metadata", + "naming", + "peer", + "resolver", + "serviceconfig", + "stats", + "status", + "tap", + ] + pruneopts = "UT" + revision = "1a3960e4bd028ac0cec0a2afd27d7d8e67c11514" + version = "v1.25.1" + +[[projects]] + digest = "1:b75b3deb2bce8bc079e16bb2aecfe01eb80098f5650f9e93e5643ca8b7b73737" + name = "gopkg.in/yaml.v2" + packages = ["."] + pruneopts = "UT" + revision = "1f64d6156d11335c3f22d9330b0ad14fc1e789ce" + version = "v2.2.7" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "contrib.go.opencensus.io/exporter/ocagent", + "github.com/dgrijalva/jwt-go", + "github.com/dimchansky/utfbom", + "github.com/mitchellh/go-homedir", + "github.com/stretchr/testify/require", + "go.opencensus.io/plugin/ochttp", + "go.opencensus.io/plugin/ochttp/propagation/tracecontext", + "go.opencensus.io/stats/view", + "go.opencensus.io/trace", + "golang.org/x/crypto/pkcs12", + "golang.org/x/lint/golint", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/Azure/go-autorest/Gopkg.toml b/vendor/github.com/Azure/go-autorest/Gopkg.toml new file mode 100644 index 00000000000..1fc28659696 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/Gopkg.toml @@ -0,0 +1,59 @@ +# Gopkg.toml example +# +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + +required = ["golang.org/x/lint/golint"] + +[prune] + go-tests = true + unused-packages = true + +[[constraint]] + name = "contrib.go.opencensus.io/exporter/ocagent" + version = "0.6.0" + +[[constraint]] + name = "github.com/dgrijalva/jwt-go" + version = "3.2.0" + +[[constraint]] + name = "github.com/dimchansky/utfbom" + version = "1.1.0" + +[[constraint]] + name = "github.com/mitchellh/go-homedir" + version = "1.1.0" + +[[constraint]] + name = "github.com/stretchr/testify" + version = "1.3.0" + +[[constraint]] + name = "go.opencensus.io" + version = "0.22.0" + +[[constraint]] + branch = "master" + name = "golang.org/x/crypto" diff --git a/vendor/sourcegraph.com/sqs/pbtypes/LICENSE b/vendor/github.com/Azure/go-autorest/LICENSE similarity index 94% rename from vendor/sourcegraph.com/sqs/pbtypes/LICENSE rename to vendor/github.com/Azure/go-autorest/LICENSE index 261eeb9e9f8..b9d6a27ea92 100644 --- a/vendor/sourcegraph.com/sqs/pbtypes/LICENSE +++ b/vendor/github.com/Azure/go-autorest/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -175,18 +176,7 @@ 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] + Copyright 2015 Microsoft Corporation 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/github.com/Azure/go-autorest/README.md b/vendor/github.com/Azure/go-autorest/README.md new file mode 100644 index 00000000000..de1e19a44df --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/README.md @@ -0,0 +1,165 @@ +# go-autorest + +[![GoDoc](https://godoc.org/github.com/Azure/go-autorest/autorest?status.png)](https://godoc.org/github.com/Azure/go-autorest/autorest) +[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/go/Azure.go-autorest?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=625&branchName=master) +[![Go Report Card](https://goreportcard.com/badge/Azure/go-autorest)](https://goreportcard.com/report/Azure/go-autorest) + +Package go-autorest provides an HTTP request client for use with [Autorest](https://github.com/Azure/autorest.go)-generated API client packages. + +An authentication client tested with Azure Active Directory (AAD) is also +provided in this repo in the package +`github.com/Azure/go-autorest/autorest/adal`. Despite its name, this package +is maintained only as part of the Azure Go SDK and is not related to other +"ADAL" libraries in [github.com/AzureAD](https://github.com/AzureAD). + +## Overview + +Package go-autorest implements an HTTP request pipeline suitable for use across +multiple goroutines and provides the shared routines used by packages generated +by [Autorest](https://github.com/Azure/autorest.go). + +The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending, +and Responding. A typical pattern is: + +```go + req, err := Prepare(&http.Request{}, + token.WithAuthorization()) + + resp, err := Send(req, + WithLogging(logger), + DoErrorIfStatusCode(http.StatusInternalServerError), + DoCloseIfError(), + DoRetryForAttempts(5, time.Second)) + + err = Respond(resp, + ByDiscardingBody(), + ByClosing()) +``` + +Each phase relies on decorators to modify and / or manage processing. Decorators may first modify +and then pass the data along, pass the data first and then modify the result, or wrap themselves +around passing the data (such as a logger might do). Decorators run in the order provided. For +example, the following: + +```go + req, err := Prepare(&http.Request{}, + WithBaseURL("https://microsoft.com/"), + WithPath("a"), + WithPath("b"), + WithPath("c")) +``` + +will set the URL to: + +``` + https://microsoft.com/a/b/c +``` + +Preparers and Responders may be shared and re-used (assuming the underlying decorators support +sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders +shared among multiple go-routines, and a single Sender shared among multiple sending go-routines, +all bound together by means of input / output channels. + +Decorators hold their passed state within a closure (such as the path components in the example +above). Be careful to share Preparers and Responders only in a context where such held state +applies. For example, it may not make sense to share a Preparer that applies a query string from a +fixed set of values. Similarly, sharing a Responder that reads the response body into a passed +struct (e.g., `ByUnmarshallingJson`) is likely incorrect. + +Errors raised by autorest objects and methods will conform to the `autorest.Error` interface. + +See the included examples for more detail. For details on the suggested use of this package by +generated clients, see the Client described below. + +## Helpers + +### Handling Swagger Dates + +The Swagger specification (https://swagger.io) that drives AutoRest +(https://github.com/Azure/autorest/) precisely defines two date forms: date and date-time. The +github.com/Azure/go-autorest/autorest/date package provides time.Time derivations to ensure correct +parsing and formatting. + +### Handling Empty Values + +In JSON, missing values have different semantics than empty values. This is especially true for +services using the HTTP PATCH verb. The JSON submitted with a PATCH request generally contains +only those values to modify. Missing values are to be left unchanged. Developers, then, require a +means to both specify an empty value and to leave the value out of the submitted JSON. + +The Go JSON package (`encoding/json`) supports the `omitempty` tag. When specified, it omits +empty values from the rendered JSON. Since Go defines default values for all base types (such as "" +for string and 0 for int) and provides no means to mark a value as actually empty, the JSON package +treats default values as meaning empty, omitting them from the rendered JSON. This means that, using +the Go base types encoded through the default JSON package, it is not possible to create JSON to +clear a value at the server. + +The workaround within the Go community is to use pointers to base types in lieu of base types within +structures that map to JSON. For example, instead of a value of type `string`, the workaround uses +`*string`. While this enables distinguishing empty values from those to be unchanged, creating +pointers to a base type (notably constant, in-line values) requires additional variables. This, for +example, + +```go + s := struct { + S *string + }{ S: &"foo" } +``` +fails, while, this + +```go + v := "foo" + s := struct { + S *string + }{ S: &v } +``` +succeeds. + +To ease using pointers, the subpackage `to` contains helpers that convert to and from pointers for +Go base types which have Swagger analogs. It also provides a helper that converts between +`map[string]string` and `map[string]*string`, enabling the JSON to specify that the value +associated with a key should be cleared. With the helpers, the previous example becomes + +```go + s := struct { + S *string + }{ S: to.StringPtr("foo") } +``` + +## Install + +```bash +go get github.com/Azure/go-autorest/autorest +go get github.com/Azure/go-autorest/autorest/azure +go get github.com/Azure/go-autorest/autorest/date +go get github.com/Azure/go-autorest/autorest/to +``` + +### Using with Go Modules +In [v12.0.1](https://github.com/Azure/go-autorest/pull/386), this repository introduced the following modules. + +- autorest/adal +- autorest/azure/auth +- autorest/azure/cli +- autorest/date +- autorest/mocks +- autorest/to +- autorest/validation +- autorest +- logger +- tracing + +Tagging cumulative SDK releases as a whole (e.g. `v12.3.0`) is still enabled to support consumers of this repo that have not yet migrated to modules. + +## License + +See LICENSE file. + +----- + +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/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go index f43e1a6ed5a..1226c411150 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go +++ b/vendor/github.com/Azure/go-autorest/autorest/authorization.go @@ -138,6 +138,11 @@ func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator { } } +// TokenProvider returns OAuthTokenProvider so that it can be used for authorization outside the REST. +func (ba *BearerAuthorizer) TokenProvider() adal.OAuthTokenProvider { + return ba.tokenProvider +} + // BearerAuthorizerCallbackFunc is the authentication callback signature. type BearerAuthorizerCallbackFunc func(tenantID, resource string) (*BearerAuthorizer, error) @@ -294,18 +299,24 @@ type MultiTenantServicePrincipalTokenAuthorizer interface { // NewMultiTenantServicePrincipalTokenAuthorizer crates a BearerAuthorizer using the given token provider func NewMultiTenantServicePrincipalTokenAuthorizer(tp adal.MultitenantOAuthTokenProvider) MultiTenantServicePrincipalTokenAuthorizer { - return &multiTenantSPTAuthorizer{tp: tp} + return NewMultiTenantBearerAuthorizer(tp) } -type multiTenantSPTAuthorizer struct { +// MultiTenantBearerAuthorizer implements bearer authorization across multiple tenants. +type MultiTenantBearerAuthorizer struct { tp adal.MultitenantOAuthTokenProvider } +// NewMultiTenantBearerAuthorizer creates a MultiTenantBearerAuthorizer using the given token provider. +func NewMultiTenantBearerAuthorizer(tp adal.MultitenantOAuthTokenProvider) *MultiTenantBearerAuthorizer { + return &MultiTenantBearerAuthorizer{tp: tp} +} + // WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header using the // primary token along with the auxiliary authorization header using the auxiliary tokens. // // By default, the token will be automatically refreshed through the Refresher interface. -func (mt multiTenantSPTAuthorizer) WithAuthorization() PrepareDecorator { +func (mt *MultiTenantBearerAuthorizer) WithAuthorization() PrepareDecorator { return func(p Preparer) Preparer { return PreparerFunc(func(r *http.Request) (*http.Request, error) { r, err := p.Prepare(r) @@ -331,7 +342,12 @@ func (mt multiTenantSPTAuthorizer) WithAuthorization() PrepareDecorator { for i := range auxTokens { auxTokens[i] = fmt.Sprintf("Bearer %s", auxTokens[i]) } - return Prepare(r, WithHeader(headerAuxAuthorization, strings.Join(auxTokens, "; "))) + return Prepare(r, WithHeader(headerAuxAuthorization, strings.Join(auxTokens, ", "))) }) } } + +// TokenProvider returns the underlying MultitenantOAuthTokenProvider for this authorizer. +func (mt *MultiTenantBearerAuthorizer) TokenProvider() adal.MultitenantOAuthTokenProvider { + return mt.tp +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go b/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go index e2a3fe586cd..66501493bd6 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go +++ b/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go @@ -54,13 +54,10 @@ func (sas *SASTokenAuthorizer) WithAuthorization() PrepareDecorator { return r, err } - if r.URL.RawQuery != "" { - // When retrying the request we need to ensure the sasToken isn't present - if !strings.Contains(r.URL.RawQuery, sas.sasToken) { - r.URL.RawQuery = fmt.Sprintf("%s&%s", r.URL.RawQuery, sas.sasToken) - } - } else { + if r.URL.RawQuery == "" { r.URL.RawQuery = sas.sasToken + } else if !strings.Contains(r.URL.RawQuery, sas.sasToken) { + r.URL.RawQuery = fmt.Sprintf("%s&%s", r.URL.RawQuery, sas.sasToken) } return Prepare(r) diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go b/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go index 22260e7a4e5..2af5030a1cd 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go +++ b/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go @@ -35,9 +35,6 @@ const ( // SharedKey is used to authorize against blobs, files and queues services. SharedKey SharedKeyType = "sharedKey" - // SharedKey is used to authorize against the account. - SharedKeyForAccount SharedKeyType = "sharedKeyAccount" - // SharedKeyForTable is used to authorize against the table service. SharedKeyForTable SharedKeyType = "sharedKeyTable" @@ -130,14 +127,6 @@ func buildSharedKey(accName string, accKey []byte, req *http.Request, keyType Sh date := time.Now().UTC().Format(http.TimeFormat) req.Header.Set(headerXMSDate, date) } - - if keyType == SharedKeyForAccount { - // ensure a content length is set if appropriate - if req.Header.Get(headerContentLength) == "" { - req.Header.Set("Content-Length", fmt.Sprintf("%d", int(req.ContentLength))) - } - } - canString, err := buildCanonicalizedString(req.Method, req.Header, canRes, keyType) if err != nil { return "", err @@ -156,9 +145,6 @@ func buildCanonicalizedResource(accountName, uri string, keyType SharedKeyType) if accountName != storageEmulatorAccountName { cr.WriteString("/") cr.WriteString(getCanonicalizedAccountName(accountName)) - if keyType == SharedKeyForAccount { - cr.WriteString("/") - } } if len(u.Path) > 0 { @@ -166,6 +152,9 @@ func buildCanonicalizedResource(accountName, uri string, keyType SharedKeyType) // the resource's URI should be encoded exactly as it is in the URI. // -- https://msdn.microsoft.com/en-gb/library/azure/dd179428.aspx cr.WriteString(u.EscapedPath()) + } else { + // a slash is required to indicate the root path + cr.WriteString("/") } params, err := url.ParseQuery(u.RawQuery) @@ -174,7 +163,7 @@ func buildCanonicalizedResource(accountName, uri string, keyType SharedKeyType) } // See https://github.com/Azure/azure-storage-net/blob/master/Lib/Common/Core/Util/AuthenticationUtility.cs#L277 - if keyType == SharedKey || keyType == SharedKeyForAccount { + if keyType == SharedKey { if len(params) > 0 { cr.WriteString("\n") @@ -217,7 +206,7 @@ func buildCanonicalizedString(verb string, headers http.Header, canonicalizedRes } date := headers.Get(headerDate) if v := headers.Get(headerXMSDate); v != "" { - if keyType == SharedKey || keyType == SharedKeyForAccount || keyType == SharedKeyLite { + if keyType == SharedKey || keyType == SharedKeyLite { date = "" } else { date = v @@ -225,7 +214,7 @@ func buildCanonicalizedString(verb string, headers http.Header, canonicalizedRes } var canString string switch keyType { - case SharedKey, SharedKeyForAccount: + case SharedKey: canString = strings.Join([]string{ verb, headers.Get(headerContentEncoding), @@ -309,7 +298,7 @@ func createAuthorizationHeader(accountName string, accountKey []byte, canonicali signature := base64.StdEncoding.EncodeToString(h.Sum(nil)) var key string switch keyType { - case SharedKey, SharedKeyForAccount, SharedKeyForTable: + case SharedKey, SharedKeyForTable: key = "SharedKey" case SharedKeyLite, SharedKeyLiteForTable: key = "SharedKeyLite" diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go index c5fc511f67c..5326f1fd3b9 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go @@ -167,7 +167,13 @@ func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Clien cancelCtx, cancel = context.WithTimeout(ctx, d) defer cancel() } - + // if the initial response has a Retry-After, sleep for the specified amount of time before starting to poll + if delay, ok := f.GetPollingDelay(); ok { + if delayElapsed := autorest.DelayForBackoff(delay, 0, cancelCtx.Done()); !delayElapsed { + err = cancelCtx.Err() + return + } + } done, err := f.DoneWithContext(ctx, client) for attempts := 0; !done; done, err = f.DoneWithContext(ctx, client) { if attempts >= client.RetryAttempts { diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go index 74898dfc3b0..5f02026b391 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go @@ -466,7 +466,7 @@ func decode(b []byte) ([]byte, error) { } func (settings FileSettings) getResourceForToken(baseURI string) (string, error) { - // Compare default base URI from the SDK to the endpoints from the public cloud + // Compare dafault base URI from the SDK to the endpoints from the public cloud // Base URI and token resource are the same string. This func finds the authentication // file field that matches the SDK base URI. The SDK defines the public cloud // endpoint as its default base URI diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.mod b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.mod index ab5df62d4de..e98dfe8623a 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.mod +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.mod @@ -3,11 +3,9 @@ module github.com/Azure/go-autorest/autorest/azure/auth go 1.12 require ( - github.com/Azure/go-autorest/autorest v0.9.3 - github.com/Azure/go-autorest/autorest/adal v0.8.2 + github.com/Azure/go-autorest/autorest v0.9.2 + github.com/Azure/go-autorest/autorest/adal v0.8.0 github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 github.com/dimchansky/utfbom v1.1.0 - golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 + golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480 ) - -replace github.com/Azure/go-autorest/autorest => github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200317095413-f2d2d0252c3c diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.sum b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.sum index 00d6469ca70..d706fd5836b 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.sum +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go.sum @@ -1,15 +1,11 @@ github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3 h1:OZEIaBbMdUE/Js+BQKlpO81XlISgipr6yDJ+PSwsgi4= -github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= +github.com/Azure/go-autorest/autorest v0.9.2 h1:6AWuh3uWrsZJcNoCHrCF/+g4aKPCU39kaMO6/qrnK/4= +github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0 h1:CxTzQrySOxDnKpLjFJeZAS5Qrv/qFPkgLjx5bOAi//I= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/adal v0.8.1 h1:pZdL8o72rK+avFWl+p9nE8RWi1JInZrWJYlnpfXJwHk= -github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= @@ -32,14 +28,9 @@ github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TR github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/tombuildsstuff/go-autorest/autorest v0.9.3-hashi-auth h1:lxCuE8Hd/BZmXTK/v7/isjw7K4g8UDci0EC87UeK6BY= -github.com/tombuildsstuff/go-autorest/autorest v0.9.3-hashi-auth/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200317095413-f2d2d0252c3c h1:9KiivLYWWeGGT2jzfB5T5Tj/gsSWf1KgbDwD9H7rrWM= -github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200317095413-f2d2d0252c3c/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480 h1:O5YqonU5IWby+w98jVUG9h7zlCWCcH4RHyPVReBmhzk= +golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e h1:nFYrTHrdrAOpShe27kaFHjsqYSEQ0KWqdWLu3xuZJts= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go index 6c20b8179ab..efbb5761765 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go @@ -46,6 +46,7 @@ type ResourceIdentifier struct { Batch string `json:"batch"` OperationalInsights string `json:"operationalInsights"` Storage string `json:"storage"` + Synapse string `json:"synapse"` } // Environment represents a set of endpoints for each of Azure's Clouds. @@ -71,6 +72,8 @@ type Environment struct { ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"` CosmosDBDNSSuffix string `json:"cosmosDBDNSSuffix"` TokenAudience string `json:"tokenAudience"` + APIManagementHostNameSuffix string `json:"apiManagementHostNameSuffix"` + SynapseEndpointSuffix string `json:"synapseEndpointSuffix"` ResourceIdentifiers ResourceIdentifier `json:"resourceIdentifiers"` } @@ -98,6 +101,8 @@ var ( ContainerRegistryDNSSuffix: "azurecr.io", CosmosDBDNSSuffix: "documents.azure.com", TokenAudience: "https://management.azure.com/", + APIManagementHostNameSuffix: "azure-api.net", + SynapseEndpointSuffix: "dev.azuresynapse.net", ResourceIdentifiers: ResourceIdentifier{ Graph: "https://graph.windows.net/", KeyVault: "https://vault.azure.net", @@ -105,6 +110,7 @@ var ( Batch: "https://batch.core.windows.net/", OperationalInsights: "https://api.loganalytics.io", Storage: "https://storage.azure.com/", + Synapse: "https://dev.azuresynapse.net", }, } @@ -127,10 +133,12 @@ var ( KeyVaultDNSSuffix: "vault.usgovcloudapi.net", ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net", ServiceManagementVMDNSSuffix: "usgovcloudapp.net", - ResourceManagerVMDNSSuffix: "cloudapp.windowsazure.us", + ResourceManagerVMDNSSuffix: "cloudapp.usgovcloudapi.net", ContainerRegistryDNSSuffix: "azurecr.us", CosmosDBDNSSuffix: "documents.azure.us", TokenAudience: "https://management.usgovcloudapi.net/", + APIManagementHostNameSuffix: "azure-api.us", + SynapseEndpointSuffix: NotAvailable, ResourceIdentifiers: ResourceIdentifier{ Graph: "https://graph.windows.net/", KeyVault: "https://vault.usgovcloudapi.net", @@ -138,6 +146,7 @@ var ( Batch: "https://batch.core.usgovcloudapi.net/", OperationalInsights: "https://api.loganalytics.us", Storage: "https://storage.azure.com/", + Synapse: NotAvailable, }, } @@ -160,10 +169,12 @@ var ( KeyVaultDNSSuffix: "vault.azure.cn", ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn", ServiceManagementVMDNSSuffix: "chinacloudapp.cn", - ResourceManagerVMDNSSuffix: "cloudapp.azure.cn", + ResourceManagerVMDNSSuffix: "cloudapp.chinacloudapi.cn", ContainerRegistryDNSSuffix: "azurecr.cn", CosmosDBDNSSuffix: "documents.azure.cn", TokenAudience: "https://management.chinacloudapi.cn/", + APIManagementHostNameSuffix: "azure-api.cn", + SynapseEndpointSuffix: "dev.azuresynapse.azure.cn", ResourceIdentifiers: ResourceIdentifier{ Graph: "https://graph.chinacloudapi.cn/", KeyVault: "https://vault.azure.cn", @@ -171,6 +182,7 @@ var ( Batch: "https://batch.chinacloudapi.cn/", OperationalInsights: NotAvailable, Storage: "https://storage.azure.com/", + Synapse: "https://dev.azuresynapse.net", }, } @@ -197,6 +209,8 @@ var ( ContainerRegistryDNSSuffix: NotAvailable, CosmosDBDNSSuffix: "documents.microsoftazure.de", TokenAudience: "https://management.microsoftazure.de/", + APIManagementHostNameSuffix: NotAvailable, + SynapseEndpointSuffix: NotAvailable, ResourceIdentifiers: ResourceIdentifier{ Graph: "https://graph.cloudapi.de/", KeyVault: "https://vault.microsoftazure.de", @@ -204,6 +218,7 @@ var ( Batch: "https://batch.cloudapi.de/", OperationalInsights: NotAvailable, Storage: "https://storage.azure.com/", + Synapse: NotAvailable, }, } ) @@ -242,3 +257,8 @@ func EnvironmentFromFile(location string) (unmarshaled Environment, err error) { return } + +// SetEnvironment updates the environment map with the specified values. +func SetEnvironment(name string, env Environment) { + environments[strings.ToUpper(name)] = env +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/go.mod b/vendor/github.com/Azure/go-autorest/autorest/go.mod index 499c56de48a..44652c445f4 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/go.mod +++ b/vendor/github.com/Azure/go-autorest/autorest/go.mod @@ -3,9 +3,10 @@ module github.com/Azure/go-autorest/autorest go 1.12 require ( - github.com/Azure/go-autorest/autorest/adal v0.8.2 - github.com/Azure/go-autorest/autorest/mocks v0.3.0 - github.com/Azure/go-autorest/logger v0.1.0 - github.com/Azure/go-autorest/tracing v0.5.0 - golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 + github.com/Azure/go-autorest v14.2.0+incompatible + github.com/Azure/go-autorest/autorest/adal v0.9.4 + github.com/Azure/go-autorest/autorest/mocks v0.4.1 + github.com/Azure/go-autorest/logger v0.2.0 + github.com/Azure/go-autorest/tracing v0.6.0 + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 ) diff --git a/vendor/github.com/Azure/go-autorest/autorest/go.sum b/vendor/github.com/Azure/go-autorest/autorest/go.sum index 37398d1d48a..84eee840dfe 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/go.sum +++ b/vendor/github.com/Azure/go-autorest/autorest/go.sum @@ -1,28 +1,21 @@ -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0 h1:Kx+AUU2Te+A3JIyYn6Dfs+cFgx5XorQKuIXrZGoq/SI= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0 h1:Ww5g4zThfD/6cLb4z6xxgeyDa7QDkizMkJKe0ysZXp0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest/adal v0.9.4 h1:1/DtH4Szusk4psLBrJn/gocMRIf1ji30WAz3GfyULRQ= +github.com/Azure/go-autorest/autorest/adal v0.9.4/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= +github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go new file mode 100644 index 00000000000..da65e1041eb --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go @@ -0,0 +1,24 @@ +// +build modhack + +package autorest + +// Copyright 2017 Microsoft Corporation +// +// 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. + +// This file, and the github.com/Azure/go-autorest import, won't actually become part of +// the resultant binary. + +// Necessary for safely adding multi-module repo. +// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/to/go.mod b/vendor/github.com/Azure/go-autorest/autorest/to/go.mod index 48fd8c6e57b..8fd041e2bae 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/to/go.mod +++ b/vendor/github.com/Azure/go-autorest/autorest/to/go.mod @@ -2,4 +2,4 @@ module github.com/Azure/go-autorest/autorest/to go 1.12 -require github.com/Azure/go-autorest/autorest v0.9.0 +require github.com/Azure/go-autorest v14.2.0+incompatible diff --git a/vendor/github.com/Azure/go-autorest/autorest/to/go.sum b/vendor/github.com/Azure/go-autorest/autorest/to/go.sum index d7ee6b46231..1fc56a962ee 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/to/go.sum +++ b/vendor/github.com/Azure/go-autorest/autorest/to/go.sum @@ -1,17 +1,2 @@ -github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0 h1:Ww5g4zThfD/6cLb4z6xxgeyDa7QDkizMkJKe0ysZXp0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= diff --git a/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go index 8e829210707..b7310f6b868 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go +++ b/vendor/github.com/Azure/go-autorest/autorest/to/go_mod_tidy_hack.go @@ -16,9 +16,9 @@ package to // See the License for the specific language governing permissions and // limitations under the License. -// This file, and the github.com/Azure/go-autorest/autorest import, won't actually become part of +// This file, and the github.com/Azure/go-autorest import, won't actually become part of // the resultant binary. // Necessary for safely adding multi-module repo. // See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest/autorest" +import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go index 2bf84cc8f48..713e23581d9 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ b/vendor/github.com/Azure/go-autorest/autorest/version.go @@ -19,7 +19,7 @@ import ( "runtime" ) -const number = "v14.0.0" +const number = "v14.2.1" var ( userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s", diff --git a/vendor/github.com/Azure/go-autorest/azure-pipelines.yml b/vendor/github.com/Azure/go-autorest/azure-pipelines.yml new file mode 100644 index 00000000000..6fb8404fd01 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/azure-pipelines.yml @@ -0,0 +1,105 @@ +variables: + GOPATH: '$(system.defaultWorkingDirectory)/work' + sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' + +jobs: + - job: 'goautorest' + displayName: 'Run go-autorest CI Checks' + + strategy: + matrix: + Linux_Go113: + vm.image: 'ubuntu-18.04' + go.version: '1.13' + Linux_Go114: + vm.image: 'ubuntu-18.04' + go.version: '1.14' + + pool: + vmImage: '$(vm.image)' + + steps: + - task: GoTool@0 + inputs: + version: '$(go.version)' + displayName: "Select Go Version" + + - script: | + set -e + mkdir -p '$(GOPATH)/bin' + mkdir -p '$(sdkPath)' + shopt -s extglob + mv !(work) '$(sdkPath)' + echo '##vso[task.prependpath]$(GOPATH)/bin' + displayName: 'Create Go Workspace' + + - script: | + set -e + curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure -v + go install ./vendor/golang.org/x/lint/golint + go get github.com/jstemmer/go-junit-report + go get github.com/axw/gocov/gocov + go get github.com/AlekSi/gocov-xml + go get -u github.com/matm/gocov-html + workingDirectory: '$(sdkPath)' + displayName: 'Install Dependencies' + + - script: | + go vet ./autorest/... + go vet ./logger/... + go vet ./tracing/... + workingDirectory: '$(sdkPath)' + displayName: 'Vet' + + - script: | + go build -v ./autorest/... + go build -v ./logger/... + go build -v ./tracing/... + workingDirectory: '$(sdkPath)' + displayName: 'Build' + + - script: | + set -e + go test -race -v -coverprofile=coverage.txt -covermode atomic ./autorest/... ./logger/... ./tracing/... 2>&1 | go-junit-report > report.xml + gocov convert coverage.txt > coverage.json + gocov-xml < coverage.json > coverage.xml + gocov-html < coverage.json > coverage.html + workingDirectory: '$(sdkPath)' + displayName: 'Run Tests' + + - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Copyright Header Check' + failOnStderr: true + condition: succeededOrFailed() + + - script: | + gofmt -s -l -w ./autorest/. >&2 + gofmt -s -l -w ./logger/. >&2 + gofmt -s -l -w ./tracing/. >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Format Check' + failOnStderr: true + condition: succeededOrFailed() + + - script: | + golint ./autorest/... >&2 + golint ./logger/... >&2 + golint ./tracing/... >&2 + workingDirectory: '$(sdkPath)' + displayName: 'Linter Check' + failOnStderr: true + condition: succeededOrFailed() + + - task: PublishTestResults@2 + inputs: + testRunner: JUnit + testResultsFiles: $(sdkPath)/report.xml + failTaskOnFailedTests: true + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: $(sdkPath)/coverage.xml + additionalCodeCoverageFiles: $(sdkPath)/coverage.html diff --git a/vendor/github.com/Azure/go-autorest/doc.go b/vendor/github.com/Azure/go-autorest/doc.go new file mode 100644 index 00000000000..99ae6ca988a --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/doc.go @@ -0,0 +1,18 @@ +/* +Package go-autorest provides an HTTP request client for use with Autorest-generated API client packages. +*/ +package go_autorest + +// Copyright 2017 Microsoft Corporation +// +// 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/Azure/go-autorest/logger/go.mod b/vendor/github.com/Azure/go-autorest/logger/go.mod index f22ed56bcde..bedeaee039e 100644 --- a/vendor/github.com/Azure/go-autorest/logger/go.mod +++ b/vendor/github.com/Azure/go-autorest/logger/go.mod @@ -1,3 +1,5 @@ module github.com/Azure/go-autorest/logger go 1.12 + +require github.com/Azure/go-autorest v14.2.0+incompatible diff --git a/vendor/github.com/Azure/go-autorest/logger/go.sum b/vendor/github.com/Azure/go-autorest/logger/go.sum new file mode 100644 index 00000000000..1fc56a962ee --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/logger/go.sum @@ -0,0 +1,2 @@ +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= diff --git a/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go new file mode 100644 index 00000000000..0aa27680db9 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go @@ -0,0 +1,24 @@ +// +build modhack + +package logger + +// Copyright 2017 Microsoft Corporation +// +// 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. + +// This file, and the github.com/Azure/go-autorest import, won't actually become part of +// the resultant binary. + +// Necessary for safely adding multi-module repo. +// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/tracing/go.mod b/vendor/github.com/Azure/go-autorest/tracing/go.mod index 25c34c1085a..a2cdec78c81 100644 --- a/vendor/github.com/Azure/go-autorest/tracing/go.mod +++ b/vendor/github.com/Azure/go-autorest/tracing/go.mod @@ -1,3 +1,5 @@ module github.com/Azure/go-autorest/tracing go 1.12 + +require github.com/Azure/go-autorest v14.2.0+incompatible diff --git a/vendor/github.com/Azure/go-autorest/tracing/go.sum b/vendor/github.com/Azure/go-autorest/tracing/go.sum new file mode 100644 index 00000000000..1fc56a962ee --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/tracing/go.sum @@ -0,0 +1,2 @@ +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= diff --git a/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go new file mode 100644 index 00000000000..e163975cd4e --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go @@ -0,0 +1,24 @@ +// +build modhack + +package tracing + +// Copyright 2017 Microsoft Corporation +// +// 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. + +// This file, and the github.com/Azure/go-autorest import, won't actually become part of +// the resultant binary. + +// Necessary for safely adding multi-module repo. +// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Djarvur/go-err113/README.adoc b/vendor/github.com/Djarvur/go-err113/README.adoc index b4c1f437542..b26af403862 100644 --- a/vendor/github.com/Djarvur/go-err113/README.adoc +++ b/vendor/github.com/Djarvur/go-err113/README.adoc @@ -23,7 +23,7 @@ So, `err113` reports every `==` and `!=` comparison for exact `error` type varia Also, any call of `errors.New()` and `fmt.Errorf()` methods are reported except the calls used to initialise package-level variables and the `fmt.Errorf()` calls wrapping the other errors. -Note: non-standard packages, like `github.com/pkg/errors` are ignored complitely. +Note: non-standard packages, like `github.com/pkg/errors` are ignored completely. == Install @@ -71,3 +71,5 @@ Flags: == Thanks To link:https://github.com/quasilyte[Iskander (Alex) Sharipov] for the really useful advices. + +To link:https://github.com/jackwhelpton[Jack Whelpton] for the bugfix provided. \ No newline at end of file diff --git a/vendor/github.com/Djarvur/go-err113/comparison.go b/vendor/github.com/Djarvur/go-err113/comparison.go index 7e7777df68b..0ffe2863c4c 100644 --- a/vendor/github.com/Djarvur/go-err113/comparison.go +++ b/vendor/github.com/Djarvur/go-err113/comparison.go @@ -21,18 +21,7 @@ func inspectComparision(pass *analysis.Pass, n ast.Node) bool { // nolint: unpar return true } - // check that both left and right hand side are not nil - if pass.TypesInfo.Types[be.X].IsNil() || pass.TypesInfo.Types[be.Y].IsNil() { - return true - } - - // check that both left and right hand side are not io.EOF - if isEOF(be.X, pass.TypesInfo) || isEOF(be.Y, pass.TypesInfo) { - return true - } - - // check that both left and right hand side are errors - if !isError(be.X, pass.TypesInfo) && !isError(be.Y, pass.TypesInfo) { + if !areBothErrors(be.X, be.Y, pass.TypesInfo) { return true } @@ -99,5 +88,24 @@ func asImportedName(ex ast.Expr, info *types.Info) (string, bool) { return "", false } - return ep.Imported().Name(), true + return ep.Imported().Path(), true +} + +func areBothErrors(x, y ast.Expr, typesInfo *types.Info) bool { + // check that both left and right hand side are not nil + if typesInfo.Types[x].IsNil() || typesInfo.Types[y].IsNil() { + return false + } + + // check that both left and right hand side are not io.EOF + if isEOF(x, typesInfo) || isEOF(y, typesInfo) { + return false + } + + // check that both left and right hand side are errors + if !isError(x, typesInfo) && !isError(y, typesInfo) { + return false + } + + return true } diff --git a/vendor/github.com/Djarvur/go-err113/err113.go b/vendor/github.com/Djarvur/go-err113/err113.go index e9d93a7a0fe..ec4f52ac729 100644 --- a/vendor/github.com/Djarvur/go-err113/err113.go +++ b/vendor/github.com/Djarvur/go-err113/err113.go @@ -10,7 +10,7 @@ import ( "golang.org/x/tools/go/analysis" ) -// NewAnalyzer creates a new analysis.Analyzer instance tuned to run err113 checks +// NewAnalyzer creates a new analysis.Analyzer instance tuned to run err113 checks. func NewAnalyzer() *analysis.Analyzer { return &analysis.Analyzer{ Name: "err113", @@ -35,7 +35,7 @@ func run(pass *analysis.Pass) (interface{}, error) { return nil, nil } -// render returns the pretty-print of the given node +// render returns the pretty-print of the given node. func render(fset *token.FileSet, x interface{}) string { var buf bytes.Buffer if err := printer.Fprint(&buf, fset, x); err != nil { diff --git a/vendor/github.com/MakeNowJust/heredoc/LICENSE b/vendor/github.com/MakeNowJust/heredoc/LICENSE index 8a58c222086..6d0eb9d5d68 100644 --- a/vendor/github.com/MakeNowJust/heredoc/LICENSE +++ b/vendor/github.com/MakeNowJust/heredoc/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2017 TSUYUSATO Kitsune +Copyright (c) 2014-2019 TSUYUSATO Kitsune Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/github.com/MakeNowJust/heredoc/README.md b/vendor/github.com/MakeNowJust/heredoc/README.md index a3a65faba1a..e9924d2974a 100644 --- a/vendor/github.com/MakeNowJust/heredoc/README.md +++ b/vendor/github.com/MakeNowJust/heredoc/README.md @@ -1,4 +1,6 @@ -# heredoc [![CircleCI](https://circleci.com/gh/MakeNowJust/heredoc.svg?style=svg)](https://circleci.com/gh/MakeNowJust/heredoc) [![Go Walker](http://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/MakeNowJust/heredoc) +# heredoc + +[![Build Status](https://circleci.com/gh/MakeNowJust/heredoc.svg?style=svg)](https://circleci.com/gh/MakeNowJust/heredoc) [![GoDoc](https://godoc.org/github.com/MakeNowJusti/heredoc?status.svg)](https://godoc.org/github.com/MakeNowJust/heredoc) ## About @@ -15,8 +17,6 @@ $ go get github.com/MakeNowJust/heredoc ```go // usual import "github.com/MakeNowJust/heredoc" -// shortcuts -import . "github.com/MakeNowJust/heredoc/dot" ``` ## Example @@ -26,11 +26,11 @@ package main import ( "fmt" - . "github.com/MakeNowJust/heredoc/dot" + "github.com/MakeNowJust/heredoc" ) func main() { - fmt.Println(D(` + fmt.Println(heredoc.Doc(` Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, ... @@ -45,8 +45,7 @@ func main() { ## API Document - - [Go Walker - github.com/MakeNowJust/heredoc](https://gowalker.org/github.com/MakeNowJust/heredoc) - - [Go Walker - github.com/MakeNowJust/heredoc/dot](https://gowalker.org/github.com/MakeNowJust/heredoc/dot) + - [heredoc - GoDoc](https://godoc.org/github.com/MakeNowJust/heredoc) ## License diff --git a/vendor/github.com/MakeNowJust/heredoc/go.mod b/vendor/github.com/MakeNowJust/heredoc/go.mod new file mode 100644 index 00000000000..52b0dfd49cb --- /dev/null +++ b/vendor/github.com/MakeNowJust/heredoc/go.mod @@ -0,0 +1,3 @@ +module github.com/MakeNowJust/heredoc + +go 1.12 diff --git a/vendor/github.com/MakeNowJust/heredoc/heredoc.go b/vendor/github.com/MakeNowJust/heredoc/heredoc.go index fea12e622f1..1fc04695551 100644 --- a/vendor/github.com/MakeNowJust/heredoc/heredoc.go +++ b/vendor/github.com/MakeNowJust/heredoc/heredoc.go @@ -1,24 +1,31 @@ -// Copyright (c) 2014-2017 TSUYUSATO Kitsune +// Copyright (c) 2014-2019 TSUYUSATO Kitsune // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // Package heredoc provides creation of here-documents from raw strings. // // Golang supports raw-string syntax. +// // doc := ` // Foo // Bar // ` +// // But raw-string cannot recognize indentation. Thus such content is an indented string, equivalent to +// // "\n\tFoo\n\tBar\n" +// // I dont't want this! // // However this problem is solved by package heredoc. +// // doc := heredoc.Doc(` // Foo // Bar // `) +// // Is equivalent to +// // "Foo\nBar\n" package heredoc @@ -33,7 +40,7 @@ const maxInt = int(^uint(0) >> 1) // Doc returns un-indented string as here-document. func Doc(raw string) string { skipFirstLine := false - if raw[0] == '\n' { + if len(raw) > 0 && raw[0] == '\n' { raw = raw[1:] } else { skipFirstLine = true diff --git a/vendor/github.com/Masterminds/semver/.travis.yml b/vendor/github.com/Masterminds/semver/.travis.yml new file mode 100644 index 00000000000..096369d44d9 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/.travis.yml @@ -0,0 +1,29 @@ +language: go + +go: + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x + - 1.12.x + - tip + +# Setting sudo access to false will let Travis CI use containers rather than +# VMs to run the tests. For more details see: +# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +# - http://docs.travis-ci.com/user/workers/standard-infrastructure/ +sudo: false + +script: + - make setup + - make test + +notifications: + webhooks: + urls: + - https://webhooks.gitter.im/e/06e3328629952dabe3e0 + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: never # options: [always|never|change] default: always diff --git a/vendor/github.com/Masterminds/semver/CHANGELOG.md b/vendor/github.com/Masterminds/semver/CHANGELOG.md new file mode 100644 index 00000000000..e405c9a84d9 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/CHANGELOG.md @@ -0,0 +1,109 @@ +# 1.5.0 (2019-09-11) + +## Added + +- #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c) + +## Changed + +- #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil) +- #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil) +- #72: Adding docs comment pointing to vert for a cli +- #71: Update the docs on pre-release comparator handling +- #89: Test with new go versions (thanks @thedevsaddam) +- #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll) + +## Fixed + +- #78: Fix unchecked error in example code (thanks @ravron) +- #70: Fix the handling of pre-releases and the 0.0.0 release edge case +- #97: Fixed copyright file for proper display on GitHub +- #107: Fix handling prerelease when sorting alphanum and num +- #109: Fixed where Validate sometimes returns wrong message on error + +# 1.4.2 (2018-04-10) + +## Changed +- #72: Updated the docs to point to vert for a console appliaction +- #71: Update the docs on pre-release comparator handling + +## Fixed +- #70: Fix the handling of pre-releases and the 0.0.0 release edge case + +# 1.4.1 (2018-04-02) + +## Fixed +- Fixed #64: Fix pre-release precedence issue (thanks @uudashr) + +# 1.4.0 (2017-10-04) + +## Changed +- #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill) + +# 1.3.1 (2017-07-10) + +## Fixed +- Fixed #57: number comparisons in prerelease sometimes inaccurate + +# 1.3.0 (2017-05-02) + +## Added +- #45: Added json (un)marshaling support (thanks @mh-cbon) +- Stability marker. See https://masterminds.github.io/stability/ + +## Fixed +- #51: Fix handling of single digit tilde constraint (thanks @dgodd) + +## Changed +- #55: The godoc icon moved from png to svg + +# 1.2.3 (2017-04-03) + +## Fixed +- #46: Fixed 0.x.x and 0.0.x in constraints being treated as * + +# Release 1.2.2 (2016-12-13) + +## Fixed +- #34: Fixed issue where hyphen range was not working with pre-release parsing. + +# Release 1.2.1 (2016-11-28) + +## Fixed +- #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha" + properly. + +# Release 1.2.0 (2016-11-04) + +## Added +- #20: Added MustParse function for versions (thanks @adamreese) +- #15: Added increment methods on versions (thanks @mh-cbon) + +## Fixed +- Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and + might not satisfy the intended compatibility. The change here ignores pre-releases + on constraint checks (e.g., ~ or ^) when a pre-release is not part of the + constraint. For example, `^1.2.3` will ignore pre-releases while + `^1.2.3-alpha` will include them. + +# Release 1.1.1 (2016-06-30) + +## Changed +- Issue #9: Speed up version comparison performance (thanks @sdboyer) +- Issue #8: Added benchmarks (thanks @sdboyer) +- Updated Go Report Card URL to new location +- Updated Readme to add code snippet formatting (thanks @mh-cbon) +- Updating tagging to v[SemVer] structure for compatibility with other tools. + +# Release 1.1.0 (2016-03-11) + +- Issue #2: Implemented validation to provide reasons a versions failed a + constraint. + +# Release 1.0.1 (2015-12-31) + +- Fixed #1: * constraint failing on valid versions. + +# Release 1.0.0 (2015-10-20) + +- Initial release diff --git a/vendor/github.com/Masterminds/semver/LICENSE.txt b/vendor/github.com/Masterminds/semver/LICENSE.txt new file mode 100644 index 00000000000..9ff7da9c48b --- /dev/null +++ b/vendor/github.com/Masterminds/semver/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (C) 2014-2019, Matt Butcher and Matt Farina + +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. diff --git a/vendor/github.com/Masterminds/semver/Makefile b/vendor/github.com/Masterminds/semver/Makefile new file mode 100644 index 00000000000..a7a1b4e36de --- /dev/null +++ b/vendor/github.com/Masterminds/semver/Makefile @@ -0,0 +1,36 @@ +.PHONY: setup +setup: + go get -u gopkg.in/alecthomas/gometalinter.v1 + gometalinter.v1 --install + +.PHONY: test +test: validate lint + @echo "==> Running tests" + go test -v + +.PHONY: validate +validate: + @echo "==> Running static validations" + @gometalinter.v1 \ + --disable-all \ + --enable deadcode \ + --severity deadcode:error \ + --enable gofmt \ + --enable gosimple \ + --enable ineffassign \ + --enable misspell \ + --enable vet \ + --tests \ + --vendor \ + --deadline 60s \ + ./... || exit_code=1 + +.PHONY: lint +lint: + @echo "==> Running linters" + @gometalinter.v1 \ + --disable-all \ + --enable golint \ + --vendor \ + --deadline 60s \ + ./... || : diff --git a/vendor/github.com/Masterminds/semver/README.md b/vendor/github.com/Masterminds/semver/README.md new file mode 100644 index 00000000000..1b52d2f4362 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/README.md @@ -0,0 +1,194 @@ +# SemVer + +The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to: + +* Parse semantic versions +* Sort semantic versions +* Check if a semantic version fits within a set of constraints +* Optionally work with a `v` prefix + +[![Stability: +Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html) +[![Build Status](https://travis-ci.org/Masterminds/semver.svg)](https://travis-ci.org/Masterminds/semver) [![Build status](https://ci.appveyor.com/api/projects/status/jfk66lib7hb985k8/branch/master?svg=true&passingText=windows%20build%20passing&failingText=windows%20build%20failing)](https://ci.appveyor.com/project/mattfarina/semver/branch/master) [![GoDoc](https://godoc.org/github.com/Masterminds/semver?status.svg)](https://godoc.org/github.com/Masterminds/semver) [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/semver)](https://goreportcard.com/report/github.com/Masterminds/semver) + +If you are looking for a command line tool for version comparisons please see +[vert](https://github.com/Masterminds/vert) which uses this library. + +## Parsing Semantic Versions + +To parse a semantic version use the `NewVersion` function. For example, + +```go + v, err := semver.NewVersion("1.2.3-beta.1+build345") +``` + +If there is an error the version wasn't parseable. The version object has methods +to get the parts of the version, compare it to other versions, convert the +version back into a string, and get the original string. For more details +please see the [documentation](https://godoc.org/github.com/Masterminds/semver). + +## Sorting Semantic Versions + +A set of versions can be sorted using the [`sort`](https://golang.org/pkg/sort/) +package from the standard library. For example, + +```go + raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} + vs := make([]*semver.Version, len(raw)) + for i, r := range raw { + v, err := semver.NewVersion(r) + if err != nil { + t.Errorf("Error parsing version: %s", err) + } + + vs[i] = v + } + + sort.Sort(semver.Collection(vs)) +``` + +## Checking Version Constraints + +Checking a version against version constraints is one of the most featureful +parts of the package. + +```go + c, err := semver.NewConstraint(">= 1.2.3") + if err != nil { + // Handle constraint not being parseable. + } + + v, _ := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parseable. + } + // Check if the version meets the constraints. The a variable will be true. + a := c.Check(v) +``` + +## Basic Comparisons + +There are two elements to the comparisons. First, a comparison string is a list +of comma separated and comparisons. These are then separated by || separated or +comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a +comparison that's greater than or equal to 1.2 and less than 3.0.0 or is +greater than or equal to 4.2.3. + +The basic comparisons are: + +* `=`: equal (aliased to no operator) +* `!=`: not equal +* `>`: greater than +* `<`: less than +* `>=`: greater than or equal to +* `<=`: less than or equal to + +## Working With Pre-release Versions + +Pre-releases, for those not familiar with them, are used for software releases +prior to stable or generally available releases. Examples of pre-releases include +development, alpha, beta, and release candidate releases. A pre-release may be +a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the +order of precidence, pre-releases come before their associated releases. In this +example `1.2.3-beta.1 < 1.2.3`. + +According to the Semantic Version specification pre-releases may not be +API compliant with their release counterpart. It says, + +> A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. + +SemVer comparisons without a pre-release comparator will skip pre-release versions. +For example, `>=1.2.3` will skip pre-releases when looking at a list of releases +while `>=1.2.3-0` will evaluate and find pre-releases. + +The reason for the `0` as a pre-release version in the example comparison is +because pre-releases can only contain ASCII alphanumerics and hyphens (along with +`.` separators), per the spec. Sorting happens in ASCII sort order, again per the spec. The lowest character is a `0` in ASCII sort order (see an [ASCII Table](http://www.asciitable.com/)) + +Understanding ASCII sort ordering is important because A-Z comes before a-z. That +means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case +sensitivity doesn't apply here. This is due to ASCII sort ordering which is what +the spec specifies. + +## Hyphen Range Comparisons + +There are multiple methods to handle ranges and the first is hyphens ranges. +These look like: + +* `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` +* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4, <= 4.5` + +## Wildcards In Comparisons + +The `x`, `X`, and `*` characters can be used as a wildcard character. This works +for all comparison operators. When used on the `=` operator it falls +back to the pack level comparison (see tilde below). For example, + +* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` +* `>= 1.2.x` is equivalent to `>= 1.2.0` +* `<= 2.x` is equivalent to `< 3` +* `*` is equivalent to `>= 0.0.0` + +## Tilde Range Comparisons (Patch) + +The tilde (`~`) comparison operator is for patch level ranges when a minor +version is specified and major level changes when the minor number is missing. +For example, + +* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` +* `~1` is equivalent to `>= 1, < 2` +* `~2.3` is equivalent to `>= 2.3, < 2.4` +* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` +* `~1.x` is equivalent to `>= 1, < 2` + +## Caret Range Comparisons (Major) + +The caret (`^`) comparison operator is for major level changes. This is useful +when comparisons of API versions as a major change is API breaking. For example, + +* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` +* `^0.0.1` is equivalent to `>= 0.0.1, < 1.0.0` +* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` +* `^2.3` is equivalent to `>= 2.3, < 3` +* `^2.x` is equivalent to `>= 2.0.0, < 3` + +# Validation + +In addition to testing a version against a constraint, a version can be validated +against a constraint. When validation fails a slice of errors containing why a +version didn't meet the constraint is returned. For example, + +```go + c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") + if err != nil { + // Handle constraint not being parseable. + } + + v, _ := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parseable. + } + + // Validate a version against a constraint. + a, msgs := c.Validate(v) + // a is false + for _, m := range msgs { + fmt.Println(m) + + // Loops over the errors which would read + // "1.3 is greater than 1.2.3" + // "1.3 is less than 1.4" + } +``` + +# Fuzzing + + [dvyukov/go-fuzz](https://github.com/dvyukov/go-fuzz) is used for fuzzing. + +1. `go-fuzz-build` +2. `go-fuzz -workdir=fuzz` + +# Contribute + +If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues) +or [create a pull request](https://github.com/Masterminds/semver/pulls). diff --git a/vendor/github.com/Masterminds/semver/appveyor.yml b/vendor/github.com/Masterminds/semver/appveyor.yml new file mode 100644 index 00000000000..b2778df15a4 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/appveyor.yml @@ -0,0 +1,44 @@ +version: build-{build}.{branch} + +clone_folder: C:\gopath\src\github.com\Masterminds\semver +shallow_clone: true + +environment: + GOPATH: C:\gopath + +platform: + - x64 + +install: + - go version + - go env + - go get -u gopkg.in/alecthomas/gometalinter.v1 + - set PATH=%PATH%;%GOPATH%\bin + - gometalinter.v1.exe --install + +build_script: + - go install -v ./... + +test_script: + - "gometalinter.v1 \ + --disable-all \ + --enable deadcode \ + --severity deadcode:error \ + --enable gofmt \ + --enable gosimple \ + --enable ineffassign \ + --enable misspell \ + --enable vet \ + --tests \ + --vendor \ + --deadline 60s \ + ./... || exit_code=1" + - "gometalinter.v1 \ + --disable-all \ + --enable golint \ + --vendor \ + --deadline 60s \ + ./... || :" + - go test -v + +deploy: off diff --git a/vendor/github.com/Masterminds/semver/collection.go b/vendor/github.com/Masterminds/semver/collection.go new file mode 100644 index 00000000000..a78235895fd --- /dev/null +++ b/vendor/github.com/Masterminds/semver/collection.go @@ -0,0 +1,24 @@ +package semver + +// Collection is a collection of Version instances and implements the sort +// interface. See the sort package for more details. +// https://golang.org/pkg/sort/ +type Collection []*Version + +// Len returns the length of a collection. The number of Version instances +// on the slice. +func (c Collection) Len() int { + return len(c) +} + +// Less is needed for the sort interface to compare two Version objects on the +// slice. If checks if one is less than the other. +func (c Collection) Less(i, j int) bool { + return c[i].LessThan(c[j]) +} + +// Swap is needed for the sort interface to replace the Version objects +// at two different positions in the slice. +func (c Collection) Swap(i, j int) { + c[i], c[j] = c[j], c[i] +} diff --git a/vendor/github.com/Masterminds/semver/constraints.go b/vendor/github.com/Masterminds/semver/constraints.go new file mode 100644 index 00000000000..b94b93413f3 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/constraints.go @@ -0,0 +1,423 @@ +package semver + +import ( + "errors" + "fmt" + "regexp" + "strings" +) + +// Constraints is one or more constraint that a semantic version can be +// checked against. +type Constraints struct { + constraints [][]*constraint +} + +// NewConstraint returns a Constraints instance that a Version instance can +// be checked against. If there is a parse error it will be returned. +func NewConstraint(c string) (*Constraints, error) { + + // Rewrite - ranges into a comparison operation. + c = rewriteRange(c) + + ors := strings.Split(c, "||") + or := make([][]*constraint, len(ors)) + for k, v := range ors { + cs := strings.Split(v, ",") + result := make([]*constraint, len(cs)) + for i, s := range cs { + pc, err := parseConstraint(s) + if err != nil { + return nil, err + } + + result[i] = pc + } + or[k] = result + } + + o := &Constraints{constraints: or} + return o, nil +} + +// Check tests if a version satisfies the constraints. +func (cs Constraints) Check(v *Version) bool { + // loop over the ORs and check the inner ANDs + for _, o := range cs.constraints { + joy := true + for _, c := range o { + if !c.check(v) { + joy = false + break + } + } + + if joy { + return true + } + } + + return false +} + +// Validate checks if a version satisfies a constraint. If not a slice of +// reasons for the failure are returned in addition to a bool. +func (cs Constraints) Validate(v *Version) (bool, []error) { + // loop over the ORs and check the inner ANDs + var e []error + + // Capture the prerelease message only once. When it happens the first time + // this var is marked + var prerelesase bool + for _, o := range cs.constraints { + joy := true + for _, c := range o { + // Before running the check handle the case there the version is + // a prerelease and the check is not searching for prereleases. + if c.con.pre == "" && v.pre != "" { + if !prerelesase { + em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) + e = append(e, em) + prerelesase = true + } + joy = false + + } else { + + if !c.check(v) { + em := fmt.Errorf(c.msg, v, c.orig) + e = append(e, em) + joy = false + } + } + } + + if joy { + return true, []error{} + } + } + + return false, e +} + +var constraintOps map[string]cfunc +var constraintMsg map[string]string +var constraintRegex *regexp.Regexp + +func init() { + constraintOps = map[string]cfunc{ + "": constraintTildeOrEqual, + "=": constraintTildeOrEqual, + "!=": constraintNotEqual, + ">": constraintGreaterThan, + "<": constraintLessThan, + ">=": constraintGreaterThanEqual, + "=>": constraintGreaterThanEqual, + "<=": constraintLessThanEqual, + "=<": constraintLessThanEqual, + "~": constraintTilde, + "~>": constraintTilde, + "^": constraintCaret, + } + + constraintMsg = map[string]string{ + "": "%s is not equal to %s", + "=": "%s is not equal to %s", + "!=": "%s is equal to %s", + ">": "%s is less than or equal to %s", + "<": "%s is greater than or equal to %s", + ">=": "%s is less than %s", + "=>": "%s is less than %s", + "<=": "%s is greater than %s", + "=<": "%s is greater than %s", + "~": "%s does not have same major and minor version as %s", + "~>": "%s does not have same major and minor version as %s", + "^": "%s does not have same major version as %s", + } + + ops := make([]string, 0, len(constraintOps)) + for k := range constraintOps { + ops = append(ops, regexp.QuoteMeta(k)) + } + + constraintRegex = regexp.MustCompile(fmt.Sprintf( + `^\s*(%s)\s*(%s)\s*$`, + strings.Join(ops, "|"), + cvRegex)) + + constraintRangeRegex = regexp.MustCompile(fmt.Sprintf( + `\s*(%s)\s+-\s+(%s)\s*`, + cvRegex, cvRegex)) +} + +// An individual constraint +type constraint struct { + // The callback function for the restraint. It performs the logic for + // the constraint. + function cfunc + + msg string + + // The version used in the constraint check. For example, if a constraint + // is '<= 2.0.0' the con a version instance representing 2.0.0. + con *Version + + // The original parsed version (e.g., 4.x from != 4.x) + orig string + + // When an x is used as part of the version (e.g., 1.x) + minorDirty bool + dirty bool + patchDirty bool +} + +// Check if a version meets the constraint +func (c *constraint) check(v *Version) bool { + return c.function(v, c) +} + +type cfunc func(v *Version, c *constraint) bool + +func parseConstraint(c string) (*constraint, error) { + m := constraintRegex.FindStringSubmatch(c) + if m == nil { + return nil, fmt.Errorf("improper constraint: %s", c) + } + + ver := m[2] + orig := ver + minorDirty := false + patchDirty := false + dirty := false + if isX(m[3]) { + ver = "0.0.0" + dirty = true + } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { + minorDirty = true + dirty = true + ver = fmt.Sprintf("%s.0.0%s", m[3], m[6]) + } else if isX(strings.TrimPrefix(m[5], ".")) { + dirty = true + patchDirty = true + ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6]) + } + + con, err := NewVersion(ver) + if err != nil { + + // The constraintRegex should catch any regex parsing errors. So, + // we should never get here. + return nil, errors.New("constraint Parser Error") + } + + cs := &constraint{ + function: constraintOps[m[1]], + msg: constraintMsg[m[1]], + con: con, + orig: orig, + minorDirty: minorDirty, + patchDirty: patchDirty, + dirty: dirty, + } + return cs, nil +} + +// Constraint functions +func constraintNotEqual(v *Version, c *constraint) bool { + if c.dirty { + + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if c.con.Major() != v.Major() { + return true + } + if c.con.Minor() != v.Minor() && !c.minorDirty { + return true + } else if c.minorDirty { + return false + } + + return false + } + + return !v.Equal(c.con) +} + +func constraintGreaterThan(v *Version, c *constraint) bool { + + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + return v.Compare(c.con) == 1 +} + +func constraintLessThan(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if !c.dirty { + return v.Compare(c.con) < 0 + } + + if v.Major() > c.con.Major() { + return false + } else if v.Minor() > c.con.Minor() && !c.minorDirty { + return false + } + + return true +} + +func constraintGreaterThanEqual(v *Version, c *constraint) bool { + + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + return v.Compare(c.con) >= 0 +} + +func constraintLessThanEqual(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if !c.dirty { + return v.Compare(c.con) <= 0 + } + + if v.Major() > c.con.Major() { + return false + } else if v.Minor() > c.con.Minor() && !c.minorDirty { + return false + } + + return true +} + +// ~*, ~>* --> >= 0.0.0 (any) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 +func constraintTilde(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if v.LessThan(c.con) { + return false + } + + // ~0.0.0 is a special case where all constraints are accepted. It's + // equivalent to >= 0.0.0. + if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 && + !c.minorDirty && !c.patchDirty { + return true + } + + if v.Major() != c.con.Major() { + return false + } + + if v.Minor() != c.con.Minor() && !c.minorDirty { + return false + } + + return true +} + +// When there is a .x (dirty) status it automatically opts in to ~. Otherwise +// it's a straight = +func constraintTildeOrEqual(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if c.dirty { + c.msg = constraintMsg["~"] + return constraintTilde(v, c) + } + + return v.Equal(c.con) +} + +// ^* --> (any) +// ^2, ^2.x, ^2.x.x --> >=2.0.0, <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0, <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0, <2.0.0 +// ^1.2.3 --> >=1.2.3, <2.0.0 +// ^1.2.0 --> >=1.2.0, <2.0.0 +func constraintCaret(v *Version, c *constraint) bool { + // If there is a pre-release on the version but the constraint isn't looking + // for them assume that pre-releases are not compatible. See issue 21 for + // more details. + if v.Prerelease() != "" && c.con.Prerelease() == "" { + return false + } + + if v.LessThan(c.con) { + return false + } + + if v.Major() != c.con.Major() { + return false + } + + return true +} + +var constraintRangeRegex *regexp.Regexp + +const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` + + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + +func isX(x string) bool { + switch x { + case "x", "*", "X": + return true + default: + return false + } +} + +func rewriteRange(i string) string { + m := constraintRangeRegex.FindAllStringSubmatch(i, -1) + if m == nil { + return i + } + o := i + for _, v := range m { + t := fmt.Sprintf(">= %s, <= %s", v[1], v[11]) + o = strings.Replace(o, v[0], t, 1) + } + + return o +} diff --git a/vendor/github.com/Masterminds/semver/doc.go b/vendor/github.com/Masterminds/semver/doc.go new file mode 100644 index 00000000000..6a6c24c6d6e --- /dev/null +++ b/vendor/github.com/Masterminds/semver/doc.go @@ -0,0 +1,115 @@ +/* +Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. + +Specifically it provides the ability to: + + * Parse semantic versions + * Sort semantic versions + * Check if a semantic version fits within a set of constraints + * Optionally work with a `v` prefix + +Parsing Semantic Versions + +To parse a semantic version use the `NewVersion` function. For example, + + v, err := semver.NewVersion("1.2.3-beta.1+build345") + +If there is an error the version wasn't parseable. The version object has methods +to get the parts of the version, compare it to other versions, convert the +version back into a string, and get the original string. For more details +please see the documentation at https://godoc.org/github.com/Masterminds/semver. + +Sorting Semantic Versions + +A set of versions can be sorted using the `sort` package from the standard library. +For example, + + raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} + vs := make([]*semver.Version, len(raw)) + for i, r := range raw { + v, err := semver.NewVersion(r) + if err != nil { + t.Errorf("Error parsing version: %s", err) + } + + vs[i] = v + } + + sort.Sort(semver.Collection(vs)) + +Checking Version Constraints + +Checking a version against version constraints is one of the most featureful +parts of the package. + + c, err := semver.NewConstraint(">= 1.2.3") + if err != nil { + // Handle constraint not being parseable. + } + + v, err := semver.NewVersion("1.3") + if err != nil { + // Handle version not being parseable. + } + // Check if the version meets the constraints. The a variable will be true. + a := c.Check(v) + +Basic Comparisons + +There are two elements to the comparisons. First, a comparison string is a list +of comma separated and comparisons. These are then separated by || separated or +comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a +comparison that's greater than or equal to 1.2 and less than 3.0.0 or is +greater than or equal to 4.2.3. + +The basic comparisons are: + + * `=`: equal (aliased to no operator) + * `!=`: not equal + * `>`: greater than + * `<`: less than + * `>=`: greater than or equal to + * `<=`: less than or equal to + +Hyphen Range Comparisons + +There are multiple methods to handle ranges and the first is hyphens ranges. +These look like: + + * `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` + * `2.3.4 - 4.5` which is equivalent to `>= 2.3.4, <= 4.5` + +Wildcards In Comparisons + +The `x`, `X`, and `*` characters can be used as a wildcard character. This works +for all comparison operators. When used on the `=` operator it falls +back to the pack level comparison (see tilde below). For example, + + * `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` + * `>= 1.2.x` is equivalent to `>= 1.2.0` + * `<= 2.x` is equivalent to `<= 3` + * `*` is equivalent to `>= 0.0.0` + +Tilde Range Comparisons (Patch) + +The tilde (`~`) comparison operator is for patch level ranges when a minor +version is specified and major level changes when the minor number is missing. +For example, + + * `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` + * `~1` is equivalent to `>= 1, < 2` + * `~2.3` is equivalent to `>= 2.3, < 2.4` + * `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` + * `~1.x` is equivalent to `>= 1, < 2` + +Caret Range Comparisons (Major) + +The caret (`^`) comparison operator is for major level changes. This is useful +when comparisons of API versions as a major change is API breaking. For example, + + * `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` + * `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` + * `^2.3` is equivalent to `>= 2.3, < 3` + * `^2.x` is equivalent to `>= 2.0.0, < 3` +*/ +package semver diff --git a/vendor/github.com/Masterminds/semver/version.go b/vendor/github.com/Masterminds/semver/version.go new file mode 100644 index 00000000000..400d4f93412 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/version.go @@ -0,0 +1,425 @@ +package semver + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "regexp" + "strconv" + "strings" +) + +// The compiled version of the regex created at init() is cached here so it +// only needs to be created once. +var versionRegex *regexp.Regexp +var validPrereleaseRegex *regexp.Regexp + +var ( + // ErrInvalidSemVer is returned a version is found to be invalid when + // being parsed. + ErrInvalidSemVer = errors.New("Invalid Semantic Version") + + // ErrInvalidMetadata is returned when the metadata is an invalid format + ErrInvalidMetadata = errors.New("Invalid Metadata string") + + // ErrInvalidPrerelease is returned when the pre-release is an invalid format + ErrInvalidPrerelease = errors.New("Invalid Prerelease string") +) + +// SemVerRegex is the regular expression used to parse a semantic version. +const SemVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + +// ValidPrerelease is the regular expression which validates +// both prerelease and metadata values. +const ValidPrerelease string = `^([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*)$` + +// Version represents a single semantic version. +type Version struct { + major, minor, patch int64 + pre string + metadata string + original string +} + +func init() { + versionRegex = regexp.MustCompile("^" + SemVerRegex + "$") + validPrereleaseRegex = regexp.MustCompile(ValidPrerelease) +} + +// NewVersion parses a given version and returns an instance of Version or +// an error if unable to parse the version. +func NewVersion(v string) (*Version, error) { + m := versionRegex.FindStringSubmatch(v) + if m == nil { + return nil, ErrInvalidSemVer + } + + sv := &Version{ + metadata: m[8], + pre: m[5], + original: v, + } + + var temp int64 + temp, err := strconv.ParseInt(m[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("Error parsing version segment: %s", err) + } + sv.major = temp + + if m[2] != "" { + temp, err = strconv.ParseInt(strings.TrimPrefix(m[2], "."), 10, 64) + if err != nil { + return nil, fmt.Errorf("Error parsing version segment: %s", err) + } + sv.minor = temp + } else { + sv.minor = 0 + } + + if m[3] != "" { + temp, err = strconv.ParseInt(strings.TrimPrefix(m[3], "."), 10, 64) + if err != nil { + return nil, fmt.Errorf("Error parsing version segment: %s", err) + } + sv.patch = temp + } else { + sv.patch = 0 + } + + return sv, nil +} + +// MustParse parses a given version and panics on error. +func MustParse(v string) *Version { + sv, err := NewVersion(v) + if err != nil { + panic(err) + } + return sv +} + +// String converts a Version object to a string. +// Note, if the original version contained a leading v this version will not. +// See the Original() method to retrieve the original value. Semantic Versions +// don't contain a leading v per the spec. Instead it's optional on +// implementation. +func (v *Version) String() string { + var buf bytes.Buffer + + fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch) + if v.pre != "" { + fmt.Fprintf(&buf, "-%s", v.pre) + } + if v.metadata != "" { + fmt.Fprintf(&buf, "+%s", v.metadata) + } + + return buf.String() +} + +// Original returns the original value passed in to be parsed. +func (v *Version) Original() string { + return v.original +} + +// Major returns the major version. +func (v *Version) Major() int64 { + return v.major +} + +// Minor returns the minor version. +func (v *Version) Minor() int64 { + return v.minor +} + +// Patch returns the patch version. +func (v *Version) Patch() int64 { + return v.patch +} + +// Prerelease returns the pre-release version. +func (v *Version) Prerelease() string { + return v.pre +} + +// Metadata returns the metadata on the version. +func (v *Version) Metadata() string { + return v.metadata +} + +// originalVPrefix returns the original 'v' prefix if any. +func (v *Version) originalVPrefix() string { + + // Note, only lowercase v is supported as a prefix by the parser. + if v.original != "" && v.original[:1] == "v" { + return v.original[:1] + } + return "" +} + +// IncPatch produces the next patch version. +// If the current version does not have prerelease/metadata information, +// it unsets metadata and prerelease values, increments patch number. +// If the current version has any of prerelease or metadata information, +// it unsets both values and keeps curent patch value +func (v Version) IncPatch() Version { + vNext := v + // according to http://semver.org/#spec-item-9 + // Pre-release versions have a lower precedence than the associated normal version. + // according to http://semver.org/#spec-item-10 + // Build metadata SHOULD be ignored when determining version precedence. + if v.pre != "" { + vNext.metadata = "" + vNext.pre = "" + } else { + vNext.metadata = "" + vNext.pre = "" + vNext.patch = v.patch + 1 + } + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext +} + +// IncMinor produces the next minor version. +// Sets patch to 0. +// Increments minor number. +// Unsets metadata. +// Unsets prerelease status. +func (v Version) IncMinor() Version { + vNext := v + vNext.metadata = "" + vNext.pre = "" + vNext.patch = 0 + vNext.minor = v.minor + 1 + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext +} + +// IncMajor produces the next major version. +// Sets patch to 0. +// Sets minor to 0. +// Increments major number. +// Unsets metadata. +// Unsets prerelease status. +func (v Version) IncMajor() Version { + vNext := v + vNext.metadata = "" + vNext.pre = "" + vNext.patch = 0 + vNext.minor = 0 + vNext.major = v.major + 1 + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext +} + +// SetPrerelease defines the prerelease value. +// Value must not include the required 'hypen' prefix. +func (v Version) SetPrerelease(prerelease string) (Version, error) { + vNext := v + if len(prerelease) > 0 && !validPrereleaseRegex.MatchString(prerelease) { + return vNext, ErrInvalidPrerelease + } + vNext.pre = prerelease + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext, nil +} + +// SetMetadata defines metadata value. +// Value must not include the required 'plus' prefix. +func (v Version) SetMetadata(metadata string) (Version, error) { + vNext := v + if len(metadata) > 0 && !validPrereleaseRegex.MatchString(metadata) { + return vNext, ErrInvalidMetadata + } + vNext.metadata = metadata + vNext.original = v.originalVPrefix() + "" + vNext.String() + return vNext, nil +} + +// LessThan tests if one version is less than another one. +func (v *Version) LessThan(o *Version) bool { + return v.Compare(o) < 0 +} + +// GreaterThan tests if one version is greater than another one. +func (v *Version) GreaterThan(o *Version) bool { + return v.Compare(o) > 0 +} + +// Equal tests if two versions are equal to each other. +// Note, versions can be equal with different metadata since metadata +// is not considered part of the comparable version. +func (v *Version) Equal(o *Version) bool { + return v.Compare(o) == 0 +} + +// Compare compares this version to another one. It returns -1, 0, or 1 if +// the version smaller, equal, or larger than the other version. +// +// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is +// lower than the version without a prerelease. +func (v *Version) Compare(o *Version) int { + // Compare the major, minor, and patch version for differences. If a + // difference is found return the comparison. + if d := compareSegment(v.Major(), o.Major()); d != 0 { + return d + } + if d := compareSegment(v.Minor(), o.Minor()); d != 0 { + return d + } + if d := compareSegment(v.Patch(), o.Patch()); d != 0 { + return d + } + + // At this point the major, minor, and patch versions are the same. + ps := v.pre + po := o.Prerelease() + + if ps == "" && po == "" { + return 0 + } + if ps == "" { + return 1 + } + if po == "" { + return -1 + } + + return comparePrerelease(ps, po) +} + +// UnmarshalJSON implements JSON.Unmarshaler interface. +func (v *Version) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + temp, err := NewVersion(s) + if err != nil { + return err + } + v.major = temp.major + v.minor = temp.minor + v.patch = temp.patch + v.pre = temp.pre + v.metadata = temp.metadata + v.original = temp.original + temp = nil + return nil +} + +// MarshalJSON implements JSON.Marshaler interface. +func (v *Version) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +func compareSegment(v, o int64) int { + if v < o { + return -1 + } + if v > o { + return 1 + } + + return 0 +} + +func comparePrerelease(v, o string) int { + + // split the prelease versions by their part. The separator, per the spec, + // is a . + sparts := strings.Split(v, ".") + oparts := strings.Split(o, ".") + + // Find the longer length of the parts to know how many loop iterations to + // go through. + slen := len(sparts) + olen := len(oparts) + + l := slen + if olen > slen { + l = olen + } + + // Iterate over each part of the prereleases to compare the differences. + for i := 0; i < l; i++ { + // Since the lentgh of the parts can be different we need to create + // a placeholder. This is to avoid out of bounds issues. + stemp := "" + if i < slen { + stemp = sparts[i] + } + + otemp := "" + if i < olen { + otemp = oparts[i] + } + + d := comparePrePart(stemp, otemp) + if d != 0 { + return d + } + } + + // Reaching here means two versions are of equal value but have different + // metadata (the part following a +). They are not identical in string form + // but the version comparison finds them to be equal. + return 0 +} + +func comparePrePart(s, o string) int { + // Fastpath if they are equal + if s == o { + return 0 + } + + // When s or o are empty we can use the other in an attempt to determine + // the response. + if s == "" { + if o != "" { + return -1 + } + return 1 + } + + if o == "" { + if s != "" { + return 1 + } + return -1 + } + + // When comparing strings "99" is greater than "103". To handle + // cases like this we need to detect numbers and compare them. According + // to the semver spec, numbers are always positive. If there is a - at the + // start like -99 this is to be evaluated as an alphanum. numbers always + // have precedence over alphanum. Parsing as Uints because negative numbers + // are ignored. + + oi, n1 := strconv.ParseUint(o, 10, 64) + si, n2 := strconv.ParseUint(s, 10, 64) + + // The case where both are strings compare the strings + if n1 != nil && n2 != nil { + if s > o { + return 1 + } + return -1 + } else if n1 != nil { + // o is a string and s is a number + return -1 + } else if n2 != nil { + // s is a string and o is a number + return 1 + } + // Both are numbers + if si > oi { + return 1 + } + return -1 + +} diff --git a/vendor/github.com/Masterminds/semver/version_fuzz.go b/vendor/github.com/Masterminds/semver/version_fuzz.go new file mode 100644 index 00000000000..b42bcd62b95 --- /dev/null +++ b/vendor/github.com/Masterminds/semver/version_fuzz.go @@ -0,0 +1,10 @@ +// +build gofuzz + +package semver + +func Fuzz(data []byte) int { + if _, err := NewVersion(string(data)); err != nil { + return 0 + } + return 1 +} diff --git a/vendor/github.com/apparentlymart/go-cidr/LICENSE b/vendor/github.com/apparentlymart/go-cidr/LICENSE new file mode 100644 index 00000000000..21253788607 --- /dev/null +++ b/vendor/github.com/apparentlymart/go-cidr/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Martin Atkins + +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. diff --git a/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go b/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go new file mode 100644 index 00000000000..ed749d4c51c --- /dev/null +++ b/vendor/github.com/apparentlymart/go-cidr/cidr/cidr.go @@ -0,0 +1,218 @@ +// Package cidr is a collection of assorted utilities for computing +// network and host addresses within network ranges. +// +// It expects a CIDR-type address structure where addresses are divided into +// some number of prefix bits representing the network and then the remaining +// suffix bits represent the host. +// +// For example, it can help to calculate addresses for sub-networks of a +// parent network, or to calculate host addresses within a particular prefix. +// +// At present this package is prioritizing simplicity of implementation and +// de-prioritizing speed and memory usage. Thus caution is advised before +// using this package in performance-critical applications or hot codepaths. +// Patches to improve the speed and memory usage may be accepted as long as +// they do not result in a significant increase in code complexity. +package cidr + +import ( + "fmt" + "math/big" + "net" +) + +// Subnet takes a parent CIDR range and creates a subnet within it +// with the given number of additional prefix bits and the given +// network number. +// +// For example, 10.3.0.0/16, extended by 8 bits, with a network number +// of 5, becomes 10.3.5.0/24 . +func Subnet(base *net.IPNet, newBits int, num int) (*net.IPNet, error) { + ip := base.IP + mask := base.Mask + + parentLen, addrLen := mask.Size() + newPrefixLen := parentLen + newBits + + if newPrefixLen > addrLen { + return nil, fmt.Errorf("insufficient address space to extend prefix of %d by %d", parentLen, newBits) + } + + maxNetNum := uint64(1< maxNetNum { + return nil, fmt.Errorf("prefix extension of %d does not accommodate a subnet numbered %d", newBits, num) + } + + return &net.IPNet{ + IP: insertNumIntoIP(ip, big.NewInt(int64(num)), newPrefixLen), + Mask: net.CIDRMask(newPrefixLen, addrLen), + }, nil +} + +// Host takes a parent CIDR range and turns it into a host IP address with +// the given host number. +// +// For example, 10.3.0.0/16 with a host number of 2 gives 10.3.0.2. +func Host(base *net.IPNet, num int) (net.IP, error) { + ip := base.IP + mask := base.Mask + bigNum := big.NewInt(int64(num)) + + parentLen, addrLen := mask.Size() + hostLen := addrLen - parentLen + + maxHostNum := big.NewInt(int64(1)) + maxHostNum.Lsh(maxHostNum, uint(hostLen)) + maxHostNum.Sub(maxHostNum, big.NewInt(1)) + + numUint64 := big.NewInt(int64(bigNum.Uint64())) + if bigNum.Cmp(big.NewInt(0)) == -1 { + numUint64.Neg(bigNum) + numUint64.Sub(numUint64, big.NewInt(int64(1))) + bigNum.Sub(maxHostNum, numUint64) + } + + if numUint64.Cmp(maxHostNum) == 1 { + return nil, fmt.Errorf("prefix of %d does not accommodate a host numbered %d", parentLen, num) + } + var bitlength int + if ip.To4() != nil { + bitlength = 32 + } else { + bitlength = 128 + } + return insertNumIntoIP(ip, bigNum, bitlength), nil +} + +// AddressRange returns the first and last addresses in the given CIDR range. +func AddressRange(network *net.IPNet) (net.IP, net.IP) { + // the first IP is easy + firstIP := network.IP + + // the last IP is the network address OR NOT the mask address + prefixLen, bits := network.Mask.Size() + if prefixLen == bits { + // Easy! + // But make sure that our two slices are distinct, since they + // would be in all other cases. + lastIP := make([]byte, len(firstIP)) + copy(lastIP, firstIP) + return firstIP, lastIP + } + + firstIPInt, bits := ipToInt(firstIP) + hostLen := uint(bits) - uint(prefixLen) + lastIPInt := big.NewInt(1) + lastIPInt.Lsh(lastIPInt, hostLen) + lastIPInt.Sub(lastIPInt, big.NewInt(1)) + lastIPInt.Or(lastIPInt, firstIPInt) + + return firstIP, intToIP(lastIPInt, bits) +} + +// AddressCount returns the number of distinct host addresses within the given +// CIDR range. +// +// Since the result is a uint64, this function returns meaningful information +// only for IPv4 ranges and IPv6 ranges with a prefix size of at least 65. +func AddressCount(network *net.IPNet) uint64 { + prefixLen, bits := network.Mask.Size() + return 1 << (uint64(bits) - uint64(prefixLen)) +} + +//VerifyNoOverlap takes a list subnets and supernet (CIDRBlock) and verifies +//none of the subnets overlap and all subnets are in the supernet +//it returns an error if any of those conditions are not satisfied +func VerifyNoOverlap(subnets []*net.IPNet, CIDRBlock *net.IPNet) error { + firstLastIP := make([][]net.IP, len(subnets)) + for i, s := range subnets { + first, last := AddressRange(s) + firstLastIP[i] = []net.IP{first, last} + } + for i, s := range subnets { + if !CIDRBlock.Contains(firstLastIP[i][0]) || !CIDRBlock.Contains(firstLastIP[i][1]) { + return fmt.Errorf("%s does not fully contain %s", CIDRBlock.String(), s.String()) + } + for j := 0; j < len(subnets); j++ { + if i == j { + continue + } + + first := firstLastIP[j][0] + last := firstLastIP[j][1] + if s.Contains(first) || s.Contains(last) { + return fmt.Errorf("%s overlaps with %s", subnets[j].String(), s.String()) + } + } + } + return nil +} + +// PreviousSubnet returns the subnet of the desired mask in the IP space +// just lower than the start of IPNet provided. If the IP space rolls over +// then the second return value is true +func PreviousSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { + startIP := checkIPv4(network.IP) + previousIP := make(net.IP, len(startIP)) + copy(previousIP, startIP) + cMask := net.CIDRMask(prefixLen, 8*len(previousIP)) + previousIP = Dec(previousIP) + previous := &net.IPNet{IP: previousIP.Mask(cMask), Mask: cMask} + if startIP.Equal(net.IPv4zero) || startIP.Equal(net.IPv6zero) { + return previous, true + } + return previous, false +} + +// NextSubnet returns the next available subnet of the desired mask size +// starting for the maximum IP of the offset subnet +// If the IP exceeds the maxium IP then the second return value is true +func NextSubnet(network *net.IPNet, prefixLen int) (*net.IPNet, bool) { + _, currentLast := AddressRange(network) + mask := net.CIDRMask(prefixLen, 8*len(currentLast)) + currentSubnet := &net.IPNet{IP: currentLast.Mask(mask), Mask: mask} + _, last := AddressRange(currentSubnet) + last = Inc(last) + next := &net.IPNet{IP: last.Mask(mask), Mask: mask} + if last.Equal(net.IPv4zero) || last.Equal(net.IPv6zero) { + return next, true + } + return next, false +} + +//Inc increases the IP by one this returns a new []byte for the IP +func Inc(IP net.IP) net.IP { + IP = checkIPv4(IP) + incIP := make([]byte, len(IP)) + copy(incIP, IP) + for j := len(incIP) - 1; j >= 0; j-- { + incIP[j]++ + if incIP[j] > 0 { + break + } + } + return incIP +} + +//Dec decreases the IP by one this returns a new []byte for the IP +func Dec(IP net.IP) net.IP { + IP = checkIPv4(IP) + decIP := make([]byte, len(IP)) + copy(decIP, IP) + decIP = checkIPv4(decIP) + for j := len(decIP) - 1; j >= 0; j-- { + decIP[j]-- + if decIP[j] < 255 { + break + } + } + return decIP +} + +func checkIPv4(ip net.IP) net.IP { + // Go for some reason allocs IPv6len for IPv4 so we have to correct it + if v4 := ip.To4(); v4 != nil { + return v4 + } + return ip +} diff --git a/vendor/github.com/apparentlymart/go-cidr/cidr/wrangling.go b/vendor/github.com/apparentlymart/go-cidr/cidr/wrangling.go new file mode 100644 index 00000000000..e5e6a2cf91a --- /dev/null +++ b/vendor/github.com/apparentlymart/go-cidr/cidr/wrangling.go @@ -0,0 +1,37 @@ +package cidr + +import ( + "fmt" + "math/big" + "net" +) + +func ipToInt(ip net.IP) (*big.Int, int) { + val := &big.Int{} + val.SetBytes([]byte(ip)) + if len(ip) == net.IPv4len { + return val, 32 + } else if len(ip) == net.IPv6len { + return val, 128 + } else { + panic(fmt.Errorf("Unsupported address length %d", len(ip))) + } +} + +func intToIP(ipInt *big.Int, bits int) net.IP { + ipBytes := ipInt.Bytes() + ret := make([]byte, bits/8) + // Pack our IP bytes into the end of the return array, + // since big.Int.Bytes() removes front zero padding. + for i := 1; i <= len(ipBytes); i++ { + ret[len(ret)-i] = ipBytes[len(ipBytes)-i] + } + return net.IP(ret) +} + +func insertNumIntoIP(ip net.IP, bigNum *big.Int, prefixLen int) net.IP { + ipInt, totalBits := ipToInt(ip) + bigNum.Lsh(bigNum, uint(totalBits-prefixLen)) + ipInt.Or(ipInt, bigNum) + return intToIP(ipInt, totalBits) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index 2c002e152af..3b809e8478c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -43,7 +43,7 @@ type Config struct { // An optional endpoint URL (hostname only or fully qualified URI) // that overrides the default generated endpoint for a client. Set this - // to `nil` to use the default generated endpoint. + // to `nil` or the value to `""` to use the default generated endpoint. // // Note: You must still provide a `Region` value when specifying an // endpoint for a client. @@ -138,7 +138,7 @@ type Config struct { // `ExpectContinueTimeout` for information on adjusting the continue wait // timeout. https://golang.org/pkg/net/http/#Transport // - // You should use this flag to disble 100-Continue if you experience issues + // You should use this flag to disable 100-Continue if you experience issues // with proxies or third party S3 compatible services. S3Disable100Continue *bool @@ -183,7 +183,7 @@ type Config struct { // // Example: // sess := session.Must(session.NewSession(aws.NewConfig() - // .WithEC2MetadataDiableTimeoutOverride(true))) + // .WithEC2MetadataDisableTimeoutOverride(true))) // // svc := s3.New(sess) // @@ -194,7 +194,7 @@ type Config struct { // both IPv4 and IPv6 addressing. // // Setting this for a service which does not support dual stack will fail - // to make requets. It is not recommended to set this value on the session + // to make requests. It is not recommended to set this value on the session // as it will apply to all service clients created with the session. Even // services which don't support dual stack endpoints. // diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index aa902d70837..d95a5eb5408 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -225,6 +225,8 @@ var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointH if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" { r.Error = aws.ErrMissingRegion } else if r.ClientInfo.Endpoint == "" { + // Was any endpoint provided by the user, or one was derived by the + // SDK's endpoint resolver? r.Error = aws.ErrMissingEndpoint } }} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go index 6feb262b2f7..cefe2a76d4d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go @@ -52,9 +52,21 @@ type WebIdentityRoleProvider struct { credentials.Expiry PolicyArns []*sts.PolicyDescriptorType - client stsiface.STSAPI + // Duration the STS credentials will be valid for. Truncated to seconds. + // If unset, the assumed role will use AssumeRoleWithWebIdentity's default + // expiry duration. See + // https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#STS.AssumeRoleWithWebIdentity + // for more information. + Duration time.Duration + + // The amount of time the credentials will be refreshed before they expire. + // This is useful refresh credentials before they expire to reduce risk of + // using credentials as they expire. If unset, will default to no expiry + // window. ExpiryWindow time.Duration + client stsiface.STSAPI + tokenFetcher TokenFetcher roleARN string roleSessionName string @@ -107,11 +119,18 @@ func (p *WebIdentityRoleProvider) RetrieveWithContext(ctx credentials.Context) ( // uses unix time in nanoseconds to uniquely identify sessions. sessionName = strconv.FormatInt(now().UnixNano(), 10) } + + var duration *int64 + if p.Duration != 0 { + duration = aws.Int64(int64(p.Duration / time.Second)) + } + req, resp := p.client.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ PolicyArns: p.PolicyArns, RoleArn: &p.roleARN, RoleSessionName: &sessionName, WebIdentityToken: aws.String(string(b)), + DurationSeconds: duration, }) req.SetContext(ctx) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index a716c021cf3..69fa63dc08f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -20,7 +20,7 @@ func (c *EC2Metadata) getToken(ctx aws.Context, duration time.Duration) (tokenOu op := &request.Operation{ Name: "GetToken", HTTPMethod: "PUT", - HTTPPath: "/api/token", + HTTPPath: "/latest/api/token", } var output tokenOutput @@ -62,7 +62,7 @@ func (c *EC2Metadata) GetMetadataWithContext(ctx aws.Context, p string) (string, op := &request.Operation{ Name: "GetMetadata", HTTPMethod: "GET", - HTTPPath: sdkuri.PathJoin("/meta-data", p), + HTTPPath: sdkuri.PathJoin("/latest/meta-data", p), } output := &metadataOutput{} @@ -88,7 +88,7 @@ func (c *EC2Metadata) GetUserDataWithContext(ctx aws.Context) (string, error) { op := &request.Operation{ Name: "GetUserData", HTTPMethod: "GET", - HTTPPath: "/user-data", + HTTPPath: "/latest/user-data", } output := &metadataOutput{} @@ -113,7 +113,7 @@ func (c *EC2Metadata) GetDynamicDataWithContext(ctx aws.Context, p string) (stri op := &request.Operation{ Name: "GetDynamicData", HTTPMethod: "GET", - HTTPPath: sdkuri.PathJoin("/dynamic", p), + HTTPPath: sdkuri.PathJoin("/latest/dynamic", p), } output := &metadataOutput{} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go index b8b2940d744..8f35b3464ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -5,6 +5,10 @@ // variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to // true instructs the SDK to disable the EC2 Metadata client. The client cannot // be used while the environment variable is set to true, (case insensitive). +// +// The endpoint of the EC2 IMDS client can be configured via the environment +// variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a +// Session. See aws/session#Options.EC2IMDSEndpoint for more details. package ec2metadata import ( @@ -12,6 +16,7 @@ import ( "errors" "io" "net/http" + "net/url" "os" "strconv" "strings" @@ -41,7 +46,7 @@ const ( enableTokenProviderHandlerName = "enableTokenProviderHandler" // TTL constants - defaultTTL = 21600 * time.Second + defaultTTL = 21600 * time.Second ttlExpirationWindow = 30 * time.Second ) @@ -69,6 +74,9 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata { // a client when not using a session. Generally using just New with a session // is preferred. // +// Will remove the URL path from the endpoint provided to ensure the EC2 IMDS +// client is able to communicate with the EC2 IMDS API. +// // If an unmodified HTTP client is provided from the stdlib default, or no client // the EC2RoleProvider's EC2Metadata HTTP client's timeout will be shortened. // To disable this set Config.EC2MetadataDisableTimeoutOverride to false. Enabled by default. @@ -86,6 +94,15 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio cfg.MaxRetries = aws.Int(2) } + if u, err := url.Parse(endpoint); err == nil { + // Remove path from the endpoint since it will be added by requests. + // This is an artifact of the SDK adding `/latest` to the endpoint for + // EC2 IMDS, but this is now moved to the operation definition. + u.Path = "" + u.RawPath = "" + endpoint = u.String() + } + svc := &EC2Metadata{ Client: client.New( cfg, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 64089826da7..b695f1f7936 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -194,12 +194,42 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "access-analyzer-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "access-analyzer-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "access-analyzer-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "access-analyzer-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "access-analyzer-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "acm": service{ @@ -262,6 +292,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -271,6 +302,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -317,6 +349,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -328,6 +361,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -422,6 +456,30 @@ var awsPartition = partition{ Region: "eu-west-3", }, }, + "fips-dkr-us-east-1": endpoint{ + Hostname: "ecr-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-dkr-us-east-2": endpoint{ + Hostname: "ecr-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-dkr-us-west-1": endpoint{ + Hostname: "ecr-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-dkr-us-west-2": endpoint{ + Hostname: "ecr-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, "fips-us-east-1": endpoint{ Hostname: "ecr-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -602,6 +660,26 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "appflow": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "application-autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -662,6 +740,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, @@ -684,11 +763,17 @@ var awsPartition = partition{ "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -704,6 +789,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -802,6 +888,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -892,6 +979,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -1002,6 +1090,7 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -1011,6 +1100,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -1553,6 +1643,7 @@ var awsPartition = partition{ "datasync": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -1562,6 +1653,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -1682,6 +1774,8 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, @@ -1803,6 +1897,7 @@ var awsPartition = partition{ "ds": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -1812,6 +1907,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2039,6 +2135,7 @@ var awsPartition = partition{ Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -2048,6 +2145,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2531,6 +2629,7 @@ var awsPartition = partition{ "firehose": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -2540,6 +2639,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2580,6 +2680,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2681,11 +2782,12 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "forecast": service{ @@ -2732,6 +2834,8 @@ var awsPartition = partition{ "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -2826,6 +2930,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2886,9 +2991,21 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, - "me-south-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-2": endpoint{ + Hostname: "groundstation-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "groundstation-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "guardduty": service{ @@ -2897,6 +3014,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -2906,6 +3024,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2947,6 +3066,12 @@ var awsPartition = partition{ "us-east-1": endpoint{}, }, }, + "honeycode": service{ + + Endpoints: endpoints{ + "us-west-2": endpoint{}, + }, + }, "iam": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, @@ -2966,6 +3091,21 @@ var awsPartition = partition{ }, }, }, + "identitystore": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "importexport": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, @@ -3053,6 +3193,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, @@ -3190,6 +3331,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -3328,6 +3470,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -3390,6 +3533,7 @@ var awsPartition = partition{ "license-manager": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -3399,6 +3543,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -3469,12 +3614,36 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "logs-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "logs-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "logs-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "logs-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "machinelearning": service{ @@ -3503,6 +3672,52 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "macie2": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "macie2-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "macie2-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "macie2-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "macie2-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "managedblockchain": service{ Endpoints: endpoints{ @@ -3510,6 +3725,7 @@ var awsPartition = partition{ "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, }, }, @@ -3604,10 +3820,28 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "medialive-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "medialive-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "medialive-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "mediapackage": service{ @@ -3678,6 +3912,8 @@ var awsPartition = partition{ "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, @@ -3695,6 +3931,7 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, @@ -3815,6 +4052,12 @@ var awsPartition = partition{ "neptune": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{ + Hostname: "rds.ap-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-east-1", + }, + }, "ap-northeast-1": endpoint{ Hostname: "rds.ap-northeast-1.amazonaws.com", CredentialScope: credentialScope{ @@ -3887,6 +4130,12 @@ var awsPartition = partition{ Region: "me-south-1", }, }, + "sa-east-1": endpoint{ + Hostname: "rds.sa-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "sa-east-1", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -3899,6 +4148,12 @@ var awsPartition = partition{ Region: "us-east-2", }, }, + "us-west-1": endpoint{ + Hostname: "rds.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, "us-west-2": endpoint{ Hostname: "rds.us-west-2.amazonaws.com", CredentialScope: credentialScope{ @@ -3934,6 +4189,12 @@ var awsPartition = partition{ Region: "eu-central-1", }, }, + "eu-north-1": endpoint{ + Hostname: "oidc.eu-north-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-north-1", + }, + }, "eu-west-1": endpoint{ Hostname: "oidc.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -4022,14 +4283,17 @@ var awsPartition = partition{ "outposts": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -4064,6 +4328,7 @@ var awsPartition = partition{ }, }, "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -4077,6 +4342,8 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, @@ -4242,6 +4509,7 @@ var awsPartition = partition{ "ram": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -4251,6 +4519,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -4385,10 +4654,34 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "rekognition-fips.us-east-1": endpoint{ + Hostname: "rekognition-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "rekognition-fips.us-east-2": endpoint{ + Hostname: "rekognition-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "rekognition-fips.us-west-1": endpoint{ + Hostname: "rekognition-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "rekognition-fips.us-west-2": endpoint{ + Hostname: "rekognition-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "resource-groups": service{ @@ -4476,6 +4769,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -4485,6 +4779,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -4503,6 +4798,7 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, @@ -4996,6 +5292,7 @@ var awsPartition = partition{ "servicecatalog": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -5005,6 +5302,7 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -5063,6 +5361,33 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "servicequotas": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-south-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "session.qldb": service{ Endpoints: endpoints{ @@ -5151,6 +5476,7 @@ var awsPartition = partition{ "snowball": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -5158,6 +5484,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -5502,12 +5829,18 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips": endpoint{ + Hostname: "storagegateway-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "streams.dynamodb": service{ @@ -5789,11 +6122,41 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "transfer-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "transfer-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "transfer-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "transfer-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "transfer-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "translate": service{ @@ -5859,6 +6222,12 @@ var awsPartition = partition{ "waf-regional": service{ Endpoints: endpoints{ + "af-south-1": endpoint{ + Hostname: "waf-regional.af-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "af-south-1", + }, + }, "ap-east-1": endpoint{ Hostname: "waf-regional.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -5913,6 +6282,12 @@ var awsPartition = partition{ Region: "eu-north-1", }, }, + "eu-south-1": endpoint{ + Hostname: "waf-regional.eu-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-south-1", + }, + }, "eu-west-1": endpoint{ Hostname: "waf-regional.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -5931,6 +6306,12 @@ var awsPartition = partition{ Region: "eu-west-3", }, }, + "fips-af-south-1": endpoint{ + Hostname: "waf-regional-fips.af-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "af-south-1", + }, + }, "fips-ap-east-1": endpoint{ Hostname: "waf-regional-fips.ap-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -5985,6 +6366,12 @@ var awsPartition = partition{ Region: "eu-north-1", }, }, + "fips-eu-south-1": endpoint{ + Hostname: "waf-regional-fips.eu-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-south-1", + }, + }, "fips-eu-west-1": endpoint{ Hostname: "waf-regional-fips.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -6183,6 +6570,13 @@ var awscnPartition = partition{ }, }, Services: services{ + "access-analyzer": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "acm": service{ Endpoints: endpoints{ @@ -6275,6 +6669,32 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "budgets": service{ + PartitionEndpoint: "aws-cn-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "budgets.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "ce": service{ + PartitionEndpoint: "aws-cn-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "ce.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, "cloudformation": service{ Endpoints: endpoints{ @@ -6337,6 +6757,12 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "cur": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "dax": service{ Endpoints: endpoints{ @@ -6630,6 +7056,25 @@ var awscnPartition = partition{ }, }, }, + "organizations": service{ + PartitionEndpoint: "aws-cn-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + "fips-aws-cn-global": endpoint{ + Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, "polly": service{ Endpoints: endpoints{ @@ -6738,13 +7183,20 @@ var awscnPartition = partition{ "snowball": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, "fips-cn-north-1": endpoint{ Hostname: "snowball-fips.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, }, + "fips-cn-northwest-1": endpoint{ + Hostname: "snowball-fips.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, }, }, "sns": service{ @@ -6899,8 +7351,18 @@ var awsusgovPartition = partition{ "access-analyzer": service{ Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, + "us-gov-east-1": endpoint{ + Hostname: "access-analyzer.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "access-analyzer.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, "acm": service{ @@ -6934,6 +7396,18 @@ var awsusgovPartition = partition{ "api.ecr": service{ Endpoints: endpoints{ + "fips-dkr-us-gov-east-1": endpoint{ + Hostname: "ecr-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-dkr-us-gov-west-1": endpoint{ + Hostname: "ecr-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, "fips-us-gov-east-1": endpoint{ Hostname: "ecr-fips.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -7054,6 +7528,13 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "backup": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "batch": service{ Endpoints: endpoints{ @@ -7228,6 +7709,12 @@ var awsusgovPartition = partition{ "comprehendmedical": service{ Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "comprehendmedical-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, "us-gov-west-1": endpoint{}, }, }, @@ -7287,6 +7774,17 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "docdb": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{ + Hostname: "rds.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "ds": service{ Endpoints: endpoints{ @@ -7385,7 +7883,7 @@ var awsusgovPartition = partition{ Endpoints: endpoints{ "fips": endpoint{ - Hostname: "elasticache-fips.us-gov-west-1.amazonaws.com", + Hostname: "elasticache.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, @@ -7434,13 +7932,13 @@ var awsusgovPartition = partition{ Endpoints: endpoints{ "fips-us-gov-east-1": endpoint{ - Hostname: "elasticloadbalancing-fips.us-gov-east-1.amazonaws.com", + Hostname: "elasticloadbalancing.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, "fips-us-gov-west-1": endpoint{ - Hostname: "elasticloadbalancing-fips.us-gov-west-1.amazonaws.com", + Hostname: "elasticloadbalancing.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, @@ -7650,12 +8148,14 @@ var awsusgovPartition = partition{ }, }, Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, "iotsecuredtunneling": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -7669,18 +8169,23 @@ var awsusgovPartition = partition{ "kinesis": service{ Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "kinesis-fips.us-gov-east-1.amazonaws.com", + "us-gov-east-1": endpoint{ + Hostname: "kinesis.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, }, - "fips-us-gov-west-1": endpoint{ - Hostname: "kinesis-fips.us-gov-west-1.amazonaws.com", + "us-gov-west-1": endpoint{ + Hostname: "kinesis.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, }, + }, + }, + "kinesisanalytics": service{ + + Endpoints: endpoints{ "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, @@ -7739,8 +8244,18 @@ var awsusgovPartition = partition{ "logs": service{ Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, + "us-gov-east-1": endpoint{ + Hostname: "logs.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "logs.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, "mediaconvert": service{ @@ -7905,6 +8420,12 @@ var awsusgovPartition = partition{ "rekognition": service{ Endpoints: endpoints{ + "rekognition-fips.us-gov-west-1": endpoint{ + Hostname: "rekognition-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, "us-gov-west-1": endpoint{}, }, }, @@ -8746,6 +9267,20 @@ var awsisoPartition = partition{ "us-iso-east-1": endpoint{}, }, }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "transcribestreaming": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "workspaces": service{ Endpoints: endpoints{ @@ -8929,6 +9464,12 @@ var awsisobPartition = partition{ "us-isob-east-1": endpoint{}, }, }, + "lambda": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, "license-manager": service{ Endpoints: endpoints{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index eb2ac83c992..773613722f4 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -7,6 +7,8 @@ import ( "strings" ) +var regionValidationRegex = regexp.MustCompile(`^[[:alnum:]]([[:alnum:]\-]*[[:alnum:]])?$`) + type partitions []partition func (ps partitions) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { @@ -124,7 +126,7 @@ func (p partition) EndpointFor(service, region string, opts ...func(*Options)) ( defs := []endpoint{p.Defaults, s.Defaults} - return e.resolve(service, p.ID, region, p.DNSSuffix, defs, opt), nil + return e.resolve(service, p.ID, region, p.DNSSuffix, defs, opt) } func serviceList(ss services) []string { @@ -233,7 +235,7 @@ func getByPriority(s []string, p []string, def string) string { return s[0] } -func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { +func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs []endpoint, opts Options) (ResolvedEndpoint, error) { var merged endpoint for _, def := range defs { merged.mergeIn(def) @@ -260,6 +262,10 @@ func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs [ region = signingRegion } + if !validateInputRegion(region) { + return ResolvedEndpoint{}, fmt.Errorf("invalid region identifier format provided") + } + u := strings.Replace(hostname, "{service}", service, 1) u = strings.Replace(u, "{region}", region, 1) u = strings.Replace(u, "{dnsSuffix}", dnsSuffix, 1) @@ -274,7 +280,7 @@ func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs [ SigningName: signingName, SigningNameDerived: signingNameDerived, SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), - } + }, nil } func getEndpointScheme(protocols []string, disableSSL bool) string { @@ -339,3 +345,7 @@ const ( boxedFalse boxedTrue ) + +func validateInputRegion(region string) bool { + return regionValidationRegex.MatchString(region) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go index d9b37f4d32a..2ba3c56c11f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go @@ -9,7 +9,8 @@ func isErrConnectionReset(err error) bool { return false } - if strings.Contains(err.Error(), "connection reset") || + if strings.Contains(err.Error(), "use of closed network connection") || + strings.Contains(err.Error(), "connection reset") || strings.Contains(err.Error(), "broken pipe") { return true } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go index 7ec66e7e589..cc461bd3230 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go @@ -241,5 +241,22 @@ over the AWS_CA_BUNDLE environment variable, and will be used if both are set. Setting a custom HTTPClient in the aws.Config options will override this setting. To use this option and custom HTTP client, the HTTP client needs to be provided when creating the session. Not the service client. + +The endpoint of the EC2 IMDS client can be configured via the environment +variable, AWS_EC2_METADATA_SERVICE_ENDPOINT when creating the client with a +Session. See Options.EC2IMDSEndpoint for more details. + + AWS_EC2_METADATA_SERVICE_ENDPOINT=http://169.254.169.254 + +If using an URL with an IPv6 address literal, the IPv6 address +component must be enclosed in square brackets. + + AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] + +The custom EC2 IMDS endpoint can also be specified via the Session options. + + sess, err := session.NewSessionWithOptions(session.Options{ + EC2IMDSEndpoint: "http://[::1]", + }) */ package session diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go index c1e0e9c9543..d67c261d74f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -148,6 +148,11 @@ type envConfig struct { // // AWS_S3_USE_ARN_REGION=true S3UseARNRegion bool + + // Specifies the alternative endpoint to use for EC2 IMDS. + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] + EC2IMDSEndpoint string } var ( @@ -211,6 +216,9 @@ var ( s3UseARNRegionEnvKey = []string{ "AWS_S3_USE_ARN_REGION", } + ec2IMDSEndpointEnvKey = []string{ + "AWS_EC2_METADATA_SERVICE_ENDPOINT", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -332,6 +340,8 @@ func envConfigLoad(enableSharedConfig bool) (envConfig, error) { } } + setFromEnvVal(&cfg.EC2IMDSEndpoint, ec2IMDSEndpointEnvKey) + return cfg, nil } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 0ff49960510..6430a7f1526 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -48,6 +48,8 @@ var ErrSharedConfigInvalidCredSource = awserr.New(ErrCodeSharedConfig, "credenti type Session struct { Config *aws.Config Handlers request.Handlers + + options Options } // New creates a new instance of the handlers merging in the provided configs @@ -99,7 +101,7 @@ func New(cfgs ...*aws.Config) *Session { return s } - s := deprecatedNewSession(cfgs...) + s := deprecatedNewSession(envCfg, cfgs...) if envErr != nil { msg := "failed to load env config" s.logDeprecatedNewSessionError(msg, envErr, cfgs) @@ -243,6 +245,23 @@ type Options struct { // function to initialize this value before changing the handlers to be // used by the SDK. Handlers request.Handlers + + // Allows specifying a custom endpoint to be used by the EC2 IMDS client + // when making requests to the EC2 IMDS API. The must endpoint value must + // include protocol prefix. + // + // If unset, will the EC2 IMDS client will use its default endpoint. + // + // Can also be specified via the environment variable, + // AWS_EC2_METADATA_SERVICE_ENDPOINT. + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://169.254.169.254 + // + // If using an URL with an IPv6 address literal, the IPv6 address + // component must be enclosed in square brackets. + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] + EC2IMDSEndpoint string } // NewSessionWithOptions returns a new Session created from SDK defaults, config files, @@ -329,7 +348,25 @@ func Must(sess *Session, err error) *Session { return sess } -func deprecatedNewSession(cfgs ...*aws.Config) *Session { +// Wraps the endpoint resolver with a resolver that will return a custom +// endpoint for EC2 IMDS. +func wrapEC2IMDSEndpoint(resolver endpoints.Resolver, endpoint string) endpoints.Resolver { + return endpoints.ResolverFunc( + func(service, region string, opts ...func(*endpoints.Options)) ( + endpoints.ResolvedEndpoint, error, + ) { + if service == ec2MetadataServiceID { + return endpoints.ResolvedEndpoint{ + URL: endpoint, + SigningName: ec2MetadataServiceID, + SigningRegion: region, + }, nil + } + return resolver.EndpointFor(service, region) + }) +} + +func deprecatedNewSession(envCfg envConfig, cfgs ...*aws.Config) *Session { cfg := defaults.Config() handlers := defaults.Handlers() @@ -341,6 +378,11 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session { // endpoints for service client configurations. cfg.EndpointResolver = endpoints.DefaultResolver() } + + if len(envCfg.EC2IMDSEndpoint) != 0 { + cfg.EndpointResolver = wrapEC2IMDSEndpoint(cfg.EndpointResolver, envCfg.EC2IMDSEndpoint) + } + cfg.Credentials = defaults.CredChain(cfg, handlers) // Reapply any passed in configs to override credentials if set @@ -349,6 +391,9 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session { s := &Session{ Config: cfg, Handlers: handlers, + options: Options{ + EC2IMDSEndpoint: envCfg.EC2IMDSEndpoint, + }, } initHandlers(s) @@ -418,6 +463,7 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, s := &Session{ Config: cfg, Handlers: handlers, + options: opts, } initHandlers(s) @@ -570,6 +616,14 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, endpoints.LegacyS3UsEast1Endpoint, }) + ec2IMDSEndpoint := sessOpts.EC2IMDSEndpoint + if len(ec2IMDSEndpoint) == 0 { + ec2IMDSEndpoint = envCfg.EC2IMDSEndpoint + } + if len(ec2IMDSEndpoint) != 0 { + cfg.EndpointResolver = wrapEC2IMDSEndpoint(cfg.EndpointResolver, ec2IMDSEndpoint) + } + // Configure credentials if not already set by the user when creating the // Session. if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { @@ -627,6 +681,7 @@ func (s *Session) Copy(cfgs ...*aws.Config) *Session { newSession := &Session{ Config: s.Config.Copy(cfgs...), Handlers: s.Handlers.Copy(), + options: s.options, } initHandlers(newSession) @@ -665,6 +720,8 @@ func (s *Session) ClientConfig(service string, cfgs ...*aws.Config) client.Confi } } +const ec2MetadataServiceID = "ec2metadata" + func (s *Session) resolveEndpoint(service, region string, cfg *aws.Config) (endpoints.ResolvedEndpoint, error) { if ep := aws.StringValue(cfg.Endpoint); len(ep) != 0 { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 4c57113ff6e..850c5c605cd 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.32.3" +const SDKVersion = "1.34.21" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go index bb8ea5da165..0e4aa42f3e4 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go @@ -69,10 +69,23 @@ func (r *EventReader) ReadEvent() (event interface{}, err error) { case ErrorMessageType: return nil, r.unmarshalErrorMessage(msg) default: - return nil, fmt.Errorf("unknown eventstream message type, %v", typ) + return nil, &UnknownMessageTypeError{ + Type: typ, Message: msg.Clone(), + } } } +// UnknownMessageTypeError provides an error when a message is received from +// the stream, but the reader is unable to determine what kind of message it is. +type UnknownMessageTypeError struct { + Type string + Message eventstream.Message +} + +func (e *UnknownMessageTypeError) Error() string { + return "unknown eventstream message type, " + e.Type +} + func (r *EventReader) unmarshalEventMessage( msg eventstream.Message, ) (event interface{}, err error) { diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go index 3b44dde2f32..f6f8c5674ed 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go @@ -52,6 +52,15 @@ func (hs *Headers) Del(name string) { } } +// Clone returns a deep copy of the headers +func (hs Headers) Clone() Headers { + o := make(Headers, 0, len(hs)) + for _, h := range hs { + o.Set(h.Name, h.Value) + } + return o +} + func decodeHeaders(r io.Reader) (Headers, error) { hs := Headers{} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go index 25c9783cde6..f7427da039e 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go @@ -57,6 +57,20 @@ func (m *Message) rawMessage() (rawMessage, error) { return raw, nil } +// Clone returns a deep copy of the message. +func (m Message) Clone() Message { + var payload []byte + if m.Payload != nil { + payload = make([]byte, len(m.Payload)) + copy(payload, m.Payload) + } + + return Message{ + Headers: m.Headers.Clone(), + Payload: payload, + } +} + type messagePrelude struct { Length uint32 HeadersLen uint32 diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go index 5e9499699ba..8b2c9bbeba0 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io" + "math/big" "reflect" "strings" "time" @@ -15,6 +16,8 @@ import ( "github.com/aws/aws-sdk-go/private/protocol" ) +var millisecondsFloat = new(big.Float).SetInt64(1e3) + // UnmarshalJSONError unmarshal's the reader's JSON document into the passed in // type. The value to unmarshal the json document into must be a pointer to the // type. @@ -39,7 +42,9 @@ func UnmarshalJSONError(v interface{}, stream io.Reader) error { func UnmarshalJSON(v interface{}, stream io.Reader) error { var out interface{} - err := json.NewDecoder(stream).Decode(&out) + decoder := json.NewDecoder(stream) + decoder.UseNumber() + err := decoder.Decode(&out) if err == io.EOF { return nil } else if err != nil { @@ -54,7 +59,9 @@ func UnmarshalJSON(v interface{}, stream io.Reader) error { func UnmarshalJSONCaseInsensitive(v interface{}, stream io.Reader) error { var out interface{} - err := json.NewDecoder(stream).Decode(&out) + decoder := json.NewDecoder(stream) + decoder.UseNumber() + err := decoder.Decode(&out) if err == io.EOF { return nil } else if err != nil { @@ -254,16 +261,31 @@ func (u unmarshaler) unmarshalScalar(value reflect.Value, data interface{}, tag default: return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) } - case float64: + case json.Number: switch value.Interface().(type) { case *int64: - di := int64(d) + // Retain the old behavior where we would just truncate the float64 + // calling d.Int64() here could cause an invalid syntax error due to the usage of strconv.ParseInt + f, err := d.Float64() + if err != nil { + return err + } + di := int64(f) value.Set(reflect.ValueOf(&di)) case *float64: - value.Set(reflect.ValueOf(&d)) + f, err := d.Float64() + if err != nil { + return err + } + value.Set(reflect.ValueOf(&f)) case *time.Time: - // Time unmarshaled from a float64 can only be epoch seconds - t := time.Unix(int64(d), 0).UTC() + float, ok := new(big.Float).SetString(d.String()) + if !ok { + return fmt.Errorf("unsupported float time representation: %v", d.String()) + } + float = float.Mul(float, millisecondsFloat) + ms, _ := float.Int64() + t := time.Unix(0, ms*1e6).UTC() value.Set(reflect.ValueOf(&t)) default: return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go index 05d4ff51925..98f4caed91c 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go @@ -27,8 +27,8 @@ const ( // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" - // This format is used for output time without seconds precision - ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z" + // This format is used for output time with fractional second precision up to milliseconds + ISO8601OutputTimeFormat = "2006-01-02T15:04:05.999999999Z" ) // IsKnownTimestampFormat returns if the timestamp format name @@ -48,7 +48,7 @@ func IsKnownTimestampFormat(name string) bool { // FormatTime returns a string value of the time. func FormatTime(name string, t time.Time) string { - t = t.UTC() + t = t.UTC().Truncate(time.Millisecond) switch name { case RFC822TimeFormatName: @@ -56,7 +56,8 @@ func FormatTime(name string, t time.Time) string { case ISO8601TimeFormatName: return t.Format(ISO8601OutputTimeFormat) case UnixTimeFormatName: - return strconv.FormatInt(t.Unix(), 10) + ms := t.UnixNano() / int64(time.Millisecond) + return strconv.FormatFloat(float64(ms)/1e3, 'f', -1, 64) default: panic("unknown timestamp format name, " + name) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index 08409e8c87e..b85c5b2aeae 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -554,6 +554,10 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request. // For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) // in the Amazon Elastic Compute Cloud User Guide. // +// You can allocate a carrier IP address which is a public IP address from a +// telecommunication carrier, to a network interface which resides in a subnet +// in a Wavelength Zone (for example an EC2 instance). +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -955,7 +959,8 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *reques // AssociateAddress API operation for Amazon Elastic Compute Cloud. // -// Associates an Elastic IP address with an instance or a network interface. +// Associates an Elastic IP address, or carrier IP address (for instances that +// are in subnets in Wavelength Zones) with an instance or a network interface. // Before you can use an Elastic IP address, you must allocate it to your account. // // An Elastic IP address is for use in either the EC2-Classic platform or in @@ -976,6 +981,9 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *reques // an Elastic IP address with an instance or network interface that has an existing // Elastic IP address. // +// [Subnets in Wavelength Zones] You can associate an IP address from the telecommunication +// carrier to the instance or network interface. +// // You cannot associate an Elastic IP address with an interface in a different // network border group. // @@ -1943,7 +1951,7 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques // in the Amazon Elastic Compute Cloud User Guide. // // After you attach an EBS volume, you must make it available. For more information, -// see Making an EBS Volume Available For Use (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html). +// see Making an EBS volume available for use (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html). // // If a volume has an AWS Marketplace product code: // @@ -1957,7 +1965,7 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques // the product. For example, you can't detach a volume from a Windows instance // and attach it to a Linux instance. // -// For more information, see Attaching Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) +// For more information, see Attaching Amazon EBS volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3325,7 +3333,7 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques // Snapshots created by copying another snapshot have an arbitrary volume ID // that should not be used for any purpose. // -// For more information, see Copying an Amazon EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) +// For more information, see Copying an Amazon EBS snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3453,6 +3461,82 @@ func (c *EC2) CreateCapacityReservationWithContext(ctx aws.Context, input *Creat return out, req.Send() } +const opCreateCarrierGateway = "CreateCarrierGateway" + +// CreateCarrierGatewayRequest generates a "aws/request.Request" representing the +// client's request for the CreateCarrierGateway operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateCarrierGateway for more information on using the CreateCarrierGateway +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateCarrierGatewayRequest method. +// req, resp := client.CreateCarrierGatewayRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCarrierGateway +func (c *EC2) CreateCarrierGatewayRequest(input *CreateCarrierGatewayInput) (req *request.Request, output *CreateCarrierGatewayOutput) { + op := &request.Operation{ + Name: opCreateCarrierGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateCarrierGatewayInput{} + } + + output = &CreateCarrierGatewayOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateCarrierGateway API operation for Amazon Elastic Compute Cloud. +// +// Creates a carrier gateway. For more information about carrier gateways, see +// Carrier gateways (https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#wavelength-carrier-gateway) +// in the AWS Wavelength Developer Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateCarrierGateway for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCarrierGateway +func (c *EC2) CreateCarrierGateway(input *CreateCarrierGatewayInput) (*CreateCarrierGatewayOutput, error) { + req, out := c.CreateCarrierGatewayRequest(input) + return out, req.Send() +} + +// CreateCarrierGatewayWithContext is the same as CreateCarrierGateway with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCarrierGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateCarrierGatewayWithContext(ctx aws.Context, input *CreateCarrierGatewayInput, opts ...request.Option) (*CreateCarrierGatewayOutput, error) { + req, out := c.CreateCarrierGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateClientVpnEndpoint = "CreateClientVpnEndpoint" // CreateClientVpnEndpointRequest generates a "aws/request.Request" representing the @@ -3653,7 +3737,7 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r // Provides information to AWS about your VPN customer gateway device. The customer // gateway is the appliance at your end of the VPN connection. (The device on // the AWS side of the VPN connection is the virtual private gateway.) You must -// provide the Internet-routable IP address of the customer gateway's external +// provide the internet-routable IP address of the customer gateway's external // interface. The IP address must be static and can be behind a device performing // network address translation (NAT). // @@ -3662,9 +3746,16 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r // ASN assigned to your network. If you don't have an ASN already, you can use // a private ASN (in the 64512 - 65534 range). // -// Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with -// the exception of 7224, which is reserved in the us-east-1 Region, and 9059, -// which is reserved in the eu-west-1 Region. +// Amazon EC2 supports all 4-byte ASN numbers in the range of 1 - 2147483647, +// with the exception of the following: +// +// * 7224 - reserved in the us-east-1 Region +// +// * 9059 - reserved in the eu-west-1 Region +// +// * 17943 - reserved in the ap-southeast-1 Region +// +// * 10124 - reserved in the ap-northeast-1 Region // // For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) // in the AWS Site-to-Site VPN User Guide. @@ -3926,13 +4017,13 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ // * domain-name - If you're using AmazonProvidedDNS in us-east-1, specify // ec2.internal. If you're using AmazonProvidedDNS in another Region, specify // region.compute.internal (for example, ap-northeast-1.compute.internal). -// Otherwise, specify a domain name (for example, MyCompany.com). This value -// is used to complete unqualified DNS hostnames. Important: Some Linux operating -// systems accept multiple domain names separated by spaces. However, Windows -// and other Linux operating systems treat the value as a single domain, -// which results in unexpected behavior. If your DHCP options set is associated -// with a VPC that has instances with multiple operating systems, specify -// only one domain name. +// Otherwise, specify a domain name (for example, ExampleCompany.com). This +// value is used to complete unqualified DNS hostnames. Important: Some Linux +// operating systems accept multiple domain names separated by spaces. However, +// Windows and other Linux operating systems treat the value as a single +// domain, which results in unexpected behavior. If your DHCP options set +// is associated with a VPC that has instances with multiple operating systems, +// specify only one domain name. // // * ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) // servers. @@ -4432,7 +4523,7 @@ func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInp // CreateInstanceExportTask API operation for Amazon Elastic Compute Cloud. // -// Exports a running or stopped instance to an S3 bucket. +// Exports a running or stopped instance to an Amazon S3 bucket. // // For information about the supported operating systems, image formats, and // known limitations for the types of instances you can export, see Exporting @@ -4938,6 +5029,84 @@ func (c *EC2) CreateLocalGatewayRouteTableVpcAssociationWithContext(ctx aws.Cont return out, req.Send() } +const opCreateManagedPrefixList = "CreateManagedPrefixList" + +// CreateManagedPrefixListRequest generates a "aws/request.Request" representing the +// client's request for the CreateManagedPrefixList operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateManagedPrefixList for more information on using the CreateManagedPrefixList +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateManagedPrefixListRequest method. +// req, resp := client.CreateManagedPrefixListRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateManagedPrefixList +func (c *EC2) CreateManagedPrefixListRequest(input *CreateManagedPrefixListInput) (req *request.Request, output *CreateManagedPrefixListOutput) { + op := &request.Operation{ + Name: opCreateManagedPrefixList, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateManagedPrefixListInput{} + } + + output = &CreateManagedPrefixListOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateManagedPrefixList API operation for Amazon Elastic Compute Cloud. +// +// Creates a managed prefix list. You can specify one or more entries for the +// prefix list. Each entry consists of a CIDR block and an optional description. +// +// You must specify the maximum number of entries for the prefix list. The maximum +// number of entries cannot be changed later. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateManagedPrefixList for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateManagedPrefixList +func (c *EC2) CreateManagedPrefixList(input *CreateManagedPrefixListInput) (*CreateManagedPrefixListOutput, error) { + req, out := c.CreateManagedPrefixListRequest(input) + return out, req.Send() +} + +// CreateManagedPrefixListWithContext is the same as CreateManagedPrefixList with the addition of +// the ability to pass a context and additional request options. +// +// See CreateManagedPrefixList for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateManagedPrefixListWithContext(ctx aws.Context, input *CreateManagedPrefixListInput, opts ...request.Option) (*CreateManagedPrefixListOutput, error) { + req, out := c.CreateManagedPrefixListRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateNatGateway = "CreateNatGateway" // CreateNatGatewayRequest generates a "aws/request.Request" representing the @@ -5397,7 +5566,7 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req // instances in one partition do not share the same hardware with instances // in another partition. // -// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) +// For more information, see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -5864,7 +6033,7 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Re // protected. // // You can tag your snapshots during creation. For more information, see Tagging -// Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) +// your Amazon EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon Elastic Compute Cloud User Guide. // // For more information, see Amazon Elastic Block Store (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) @@ -6022,7 +6191,7 @@ func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSub // // Creates a data feed for Spot Instances, enabling you to view Spot Instance // usage logs. You can create one data feed per AWS account. For more information, -// see Spot Instance Data Feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) +// see Spot Instance data feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon EC2 User Guide for Linux Instances. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -6097,15 +6266,12 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Reques // CreateSubnet API operation for Amazon Elastic Compute Cloud. // -// Creates a subnet in an existing VPC. +// Creates a subnet in a specified VPC. // -// When you create each subnet, you provide the VPC ID and IPv4 CIDR block for -// the subnet. After you create a subnet, you can't change its CIDR block. The -// size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR -// block, or a subset of a VPC's IPv4 CIDR block. If you create more than one -// subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest -// IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), -// and the largest uses a /16 netmask (65,536 IPv4 addresses). +// You must specify an IPv4 CIDR block for the subnet. After you create a subnet, +// you can't change its CIDR block. The allowed block size is between a /16 +// netmask (65,536 IP addresses) and /28 netmask (16 IP addresses). The CIDR +// block must not overlap with the CIDR block of an existing subnet in the VPC. // // If you've associated an IPv6 CIDR block with your VPC, you can create a subnet // with an IPv6 CIDR block that uses a /64 prefix length. @@ -6116,9 +6282,7 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Reques // If you add more than one subnet to a VPC, they're set up in a star topology // with a logical router in the middle. // -// If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP -// address doesn't change if you stop and restart the instance (unlike a similar -// instance launched outside a VPC, which gets a new IP address when restarted). +// When you stop an instance in a subnet, it retains its private IPv4 address. // It's therefore possible to have a subnet with no running instances (they're // all stopped), but no remaining IP addresses available. // @@ -6818,6 +6982,81 @@ func (c *EC2) CreateTransitGatewayPeeringAttachmentWithContext(ctx aws.Context, return out, req.Send() } +const opCreateTransitGatewayPrefixListReference = "CreateTransitGatewayPrefixListReference" + +// CreateTransitGatewayPrefixListReferenceRequest generates a "aws/request.Request" representing the +// client's request for the CreateTransitGatewayPrefixListReference operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTransitGatewayPrefixListReference for more information on using the CreateTransitGatewayPrefixListReference +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTransitGatewayPrefixListReferenceRequest method. +// req, resp := client.CreateTransitGatewayPrefixListReferenceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayPrefixListReference +func (c *EC2) CreateTransitGatewayPrefixListReferenceRequest(input *CreateTransitGatewayPrefixListReferenceInput) (req *request.Request, output *CreateTransitGatewayPrefixListReferenceOutput) { + op := &request.Operation{ + Name: opCreateTransitGatewayPrefixListReference, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTransitGatewayPrefixListReferenceInput{} + } + + output = &CreateTransitGatewayPrefixListReferenceOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTransitGatewayPrefixListReference API operation for Amazon Elastic Compute Cloud. +// +// Creates a reference (route) to a prefix list in a specified transit gateway +// route table. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation CreateTransitGatewayPrefixListReference for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayPrefixListReference +func (c *EC2) CreateTransitGatewayPrefixListReference(input *CreateTransitGatewayPrefixListReferenceInput) (*CreateTransitGatewayPrefixListReferenceOutput, error) { + req, out := c.CreateTransitGatewayPrefixListReferenceRequest(input) + return out, req.Send() +} + +// CreateTransitGatewayPrefixListReferenceWithContext is the same as CreateTransitGatewayPrefixListReference with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTransitGatewayPrefixListReference for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateTransitGatewayPrefixListReferenceWithContext(ctx aws.Context, input *CreateTransitGatewayPrefixListReferenceInput, opts ...request.Option) (*CreateTransitGatewayPrefixListReferenceOutput, error) { + req, out := c.CreateTransitGatewayPrefixListReferenceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateTransitGatewayRoute = "CreateTransitGatewayRoute" // CreateTransitGatewayRouteRequest generates a "aws/request.Request" representing the @@ -7106,10 +7345,10 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques // in the Amazon Elastic Compute Cloud User Guide. // // You can tag your volumes during creation. For more information, see Tagging -// Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) +// your Amazon EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon Elastic Compute Cloud User Guide. // -// For more information, see Creating an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) +// For more information, see Creating an Amazon EBS volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -7622,15 +7861,15 @@ func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req * // CreateVpnConnection API operation for Amazon Elastic Compute Cloud. // -// Creates a VPN connection between an existing virtual private gateway and -// a VPN customer gateway. The supported connection type is ipsec.1. +// Creates a VPN connection between an existing virtual private gateway or transit +// gateway and a customer gateway. The supported connection type is ipsec.1. // // The response includes information that you need to give to your network administrator // to configure your customer gateway. // // We strongly recommend that you use HTTPS when calling this operation because // the response contains sensitive cryptographic information for configuring -// your customer gateway. +// your customer gateway device. // // If you decide to shut down your VPN connection for any reason and later create // a new VPN connection, you must reconfigure your customer gateway with the @@ -7830,6 +8069,84 @@ func (c *EC2) CreateVpnGatewayWithContext(ctx aws.Context, input *CreateVpnGatew return out, req.Send() } +const opDeleteCarrierGateway = "DeleteCarrierGateway" + +// DeleteCarrierGatewayRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCarrierGateway operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteCarrierGateway for more information on using the DeleteCarrierGateway +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteCarrierGatewayRequest method. +// req, resp := client.DeleteCarrierGatewayRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCarrierGateway +func (c *EC2) DeleteCarrierGatewayRequest(input *DeleteCarrierGatewayInput) (req *request.Request, output *DeleteCarrierGatewayOutput) { + op := &request.Operation{ + Name: opDeleteCarrierGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteCarrierGatewayInput{} + } + + output = &DeleteCarrierGatewayOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteCarrierGateway API operation for Amazon Elastic Compute Cloud. +// +// Deletes a carrier gateway. +// +// If you do not delete the route that contains the carrier gateway as the Target, +// the route is a blackhole route. For information about how to delete a route, +// see DeleteRoute (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteRoute.html). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteCarrierGateway for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCarrierGateway +func (c *EC2) DeleteCarrierGateway(input *DeleteCarrierGatewayInput) (*DeleteCarrierGatewayOutput, error) { + req, out := c.DeleteCarrierGatewayRequest(input) + return out, req.Send() +} + +// DeleteCarrierGatewayWithContext is the same as DeleteCarrierGateway with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCarrierGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteCarrierGatewayWithContext(ctx aws.Context, input *DeleteCarrierGatewayInput, opts ...request.Option) (*DeleteCarrierGatewayOutput, error) { + req, out := c.DeleteCarrierGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteClientVpnEndpoint = "DeleteClientVpnEndpoint" // DeleteClientVpnEndpointRequest generates a "aws/request.Request" representing the @@ -8890,6 +9207,81 @@ func (c *EC2) DeleteLocalGatewayRouteTableVpcAssociationWithContext(ctx aws.Cont return out, req.Send() } +const opDeleteManagedPrefixList = "DeleteManagedPrefixList" + +// DeleteManagedPrefixListRequest generates a "aws/request.Request" representing the +// client's request for the DeleteManagedPrefixList operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteManagedPrefixList for more information on using the DeleteManagedPrefixList +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteManagedPrefixListRequest method. +// req, resp := client.DeleteManagedPrefixListRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteManagedPrefixList +func (c *EC2) DeleteManagedPrefixListRequest(input *DeleteManagedPrefixListInput) (req *request.Request, output *DeleteManagedPrefixListOutput) { + op := &request.Operation{ + Name: opDeleteManagedPrefixList, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteManagedPrefixListInput{} + } + + output = &DeleteManagedPrefixListOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteManagedPrefixList API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified managed prefix list. You must first remove all references +// to the prefix list in your resources. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteManagedPrefixList for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteManagedPrefixList +func (c *EC2) DeleteManagedPrefixList(input *DeleteManagedPrefixListInput) (*DeleteManagedPrefixListOutput, error) { + req, out := c.DeleteManagedPrefixListRequest(input) + return out, req.Send() +} + +// DeleteManagedPrefixListWithContext is the same as DeleteManagedPrefixList with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteManagedPrefixList for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteManagedPrefixListWithContext(ctx aws.Context, input *DeleteManagedPrefixListInput, opts ...request.Option) (*DeleteManagedPrefixListOutput, error) { + req, out := c.DeleteManagedPrefixListRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteNatGateway = "DeleteNatGateway" // DeleteNatGatewayRequest generates a "aws/request.Request" representing the @@ -9318,7 +9710,7 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req // // Deletes the specified placement group. You must terminate all instances in // the placement group before you can delete the placement group. For more information, -// see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) +// see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -9712,7 +10104,7 @@ func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Re // a registered AMI. You must first de-register the AMI before you can delete // the snapshot. // -// For more information, see Deleting an Amazon EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html) +// For more information, see Deleting an Amazon EBS snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -10497,6 +10889,81 @@ func (c *EC2) DeleteTransitGatewayPeeringAttachmentWithContext(ctx aws.Context, return out, req.Send() } +const opDeleteTransitGatewayPrefixListReference = "DeleteTransitGatewayPrefixListReference" + +// DeleteTransitGatewayPrefixListReferenceRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTransitGatewayPrefixListReference operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTransitGatewayPrefixListReference for more information on using the DeleteTransitGatewayPrefixListReference +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTransitGatewayPrefixListReferenceRequest method. +// req, resp := client.DeleteTransitGatewayPrefixListReferenceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayPrefixListReference +func (c *EC2) DeleteTransitGatewayPrefixListReferenceRequest(input *DeleteTransitGatewayPrefixListReferenceInput) (req *request.Request, output *DeleteTransitGatewayPrefixListReferenceOutput) { + op := &request.Operation{ + Name: opDeleteTransitGatewayPrefixListReference, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTransitGatewayPrefixListReferenceInput{} + } + + output = &DeleteTransitGatewayPrefixListReferenceOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTransitGatewayPrefixListReference API operation for Amazon Elastic Compute Cloud. +// +// Deletes a reference (route) to a prefix list in a specified transit gateway +// route table. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteTransitGatewayPrefixListReference for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayPrefixListReference +func (c *EC2) DeleteTransitGatewayPrefixListReference(input *DeleteTransitGatewayPrefixListReferenceInput) (*DeleteTransitGatewayPrefixListReferenceOutput, error) { + req, out := c.DeleteTransitGatewayPrefixListReferenceRequest(input) + return out, req.Send() +} + +// DeleteTransitGatewayPrefixListReferenceWithContext is the same as DeleteTransitGatewayPrefixListReference with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTransitGatewayPrefixListReference for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteTransitGatewayPrefixListReferenceWithContext(ctx aws.Context, input *DeleteTransitGatewayPrefixListReferenceInput, opts ...request.Option) (*DeleteTransitGatewayPrefixListReferenceOutput, error) { + req, out := c.DeleteTransitGatewayPrefixListReferenceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteTransitGatewayRoute = "DeleteTransitGatewayRoute" // DeleteTransitGatewayRouteRequest generates a "aws/request.Request" representing the @@ -10771,7 +11238,7 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Reques // // The volume can remain in the deleting state for several minutes. // -// For more information, see Deleting an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) +// For more information, see Deleting an Amazon EBS volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -12123,13 +12590,12 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI // DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud. // -// Describes the Availability Zones and Local Zones that are available to you. -// If there is an event impacting an Availability Zone or Local Zone, you can -// use this request to view the state and any provided messages for that Availability -// Zone or Local Zone. +// Describes the Availability Zones, Local Zones, and Wavelength Zones that +// are available to you. If there is an event impacting a zone, you can use +// this request to view the state and any provided messages for that zone. // -// For more information about Availability Zones and Local Zones, see Regions -// and Availability Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) +// For more information about Availability Zones, Local Zones, and Wavelength +// Zones, see Regions, Zones and Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -12507,6 +12973,138 @@ func (c *EC2) DescribeCapacityReservationsPagesWithContext(ctx aws.Context, inpu return p.Err() } +const opDescribeCarrierGateways = "DescribeCarrierGateways" + +// DescribeCarrierGatewaysRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCarrierGateways operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeCarrierGateways for more information on using the DescribeCarrierGateways +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeCarrierGatewaysRequest method. +// req, resp := client.DescribeCarrierGatewaysRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCarrierGateways +func (c *EC2) DescribeCarrierGatewaysRequest(input *DescribeCarrierGatewaysInput) (req *request.Request, output *DescribeCarrierGatewaysOutput) { + op := &request.Operation{ + Name: opDescribeCarrierGateways, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeCarrierGatewaysInput{} + } + + output = &DescribeCarrierGatewaysOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeCarrierGateways API operation for Amazon Elastic Compute Cloud. +// +// Describes one or more of your carrier gateways. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeCarrierGateways for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCarrierGateways +func (c *EC2) DescribeCarrierGateways(input *DescribeCarrierGatewaysInput) (*DescribeCarrierGatewaysOutput, error) { + req, out := c.DescribeCarrierGatewaysRequest(input) + return out, req.Send() +} + +// DescribeCarrierGatewaysWithContext is the same as DescribeCarrierGateways with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCarrierGateways for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeCarrierGatewaysWithContext(ctx aws.Context, input *DescribeCarrierGatewaysInput, opts ...request.Option) (*DescribeCarrierGatewaysOutput, error) { + req, out := c.DescribeCarrierGatewaysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeCarrierGatewaysPages iterates over the pages of a DescribeCarrierGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeCarrierGateways method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeCarrierGateways operation. +// pageNum := 0 +// err := client.DescribeCarrierGatewaysPages(params, +// func(page *ec2.DescribeCarrierGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeCarrierGatewaysPages(input *DescribeCarrierGatewaysInput, fn func(*DescribeCarrierGatewaysOutput, bool) bool) error { + return c.DescribeCarrierGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeCarrierGatewaysPagesWithContext same as DescribeCarrierGatewaysPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeCarrierGatewaysPagesWithContext(ctx aws.Context, input *DescribeCarrierGatewaysInput, fn func(*DescribeCarrierGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCarrierGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCarrierGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeCarrierGatewaysOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" // DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the @@ -13984,7 +14582,7 @@ func (c *EC2) DescribeExportImageTasksRequest(input *DescribeExportImageTasksInp // DescribeExportImageTasks API operation for Amazon Elastic Compute Cloud. // -// Describes the specified export image tasks or all your export image tasks. +// Describes the specified export image tasks or all of your export image tasks. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -14110,7 +14708,7 @@ func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req * // DescribeExportTasks API operation for Amazon Elastic Compute Cloud. // -// Describes the specified export instance tasks or all your export instance +// Describes the specified export instance tasks or all of your export instance // tasks. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -16195,7 +16793,7 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc // all, the call fails. If you specify only instance IDs in an unaffected zone, // the call works normally. // -// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) +// For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -16411,18 +17009,18 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) // // * Status checks - Amazon EC2 performs status checks on running EC2 instances // to identify hardware and software issues. For more information, see Status -// Checks for Your Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html) -// and Troubleshooting Instances with Failed Status Checks (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) +// checks for your instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html) +// and Troubleshooting instances with failed status checks (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) // in the Amazon Elastic Compute Cloud User Guide. // // * Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, // or terminate) for your instances related to hardware issues, software -// updates, or system maintenance. For more information, see Scheduled Events -// for Your Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) +// updates, or system maintenance. For more information, see Scheduled events +// for your instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) // in the Amazon Elastic Compute Cloud User Guide. // // * Instance state - You can manage your instances from the moment you launch -// them through their termination. For more information, see Instance Lifecycle +// them through their termination. For more information, see Instance lifecycle // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) // in the Amazon Elastic Compute Cloud User Guide. // @@ -17316,7 +17914,9 @@ func (c *EC2) DescribeLaunchTemplateVersionsRequest(input *DescribeLaunchTemplat // DescribeLaunchTemplateVersions API operation for Amazon Elastic Compute Cloud. // // Describes one or more versions of a specified launch template. You can describe -// all versions, individual versions, or a range of versions. +// all versions, individual versions, or a range of versions. You can also describe +// all the latest versions or all the default versions of all the launch templates +// in your account. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -18326,6 +18926,140 @@ func (c *EC2) DescribeLocalGatewaysPagesWithContext(ctx aws.Context, input *Desc return p.Err() } +const opDescribeManagedPrefixLists = "DescribeManagedPrefixLists" + +// DescribeManagedPrefixListsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeManagedPrefixLists operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeManagedPrefixLists for more information on using the DescribeManagedPrefixLists +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeManagedPrefixListsRequest method. +// req, resp := client.DescribeManagedPrefixListsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeManagedPrefixLists +func (c *EC2) DescribeManagedPrefixListsRequest(input *DescribeManagedPrefixListsInput) (req *request.Request, output *DescribeManagedPrefixListsOutput) { + op := &request.Operation{ + Name: opDescribeManagedPrefixLists, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeManagedPrefixListsInput{} + } + + output = &DescribeManagedPrefixListsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeManagedPrefixLists API operation for Amazon Elastic Compute Cloud. +// +// Describes your managed prefix lists and any AWS-managed prefix lists. +// +// To view the entries for your prefix list, use GetManagedPrefixListEntries. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeManagedPrefixLists for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeManagedPrefixLists +func (c *EC2) DescribeManagedPrefixLists(input *DescribeManagedPrefixListsInput) (*DescribeManagedPrefixListsOutput, error) { + req, out := c.DescribeManagedPrefixListsRequest(input) + return out, req.Send() +} + +// DescribeManagedPrefixListsWithContext is the same as DescribeManagedPrefixLists with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeManagedPrefixLists for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeManagedPrefixListsWithContext(ctx aws.Context, input *DescribeManagedPrefixListsInput, opts ...request.Option) (*DescribeManagedPrefixListsOutput, error) { + req, out := c.DescribeManagedPrefixListsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeManagedPrefixListsPages iterates over the pages of a DescribeManagedPrefixLists operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeManagedPrefixLists method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeManagedPrefixLists operation. +// pageNum := 0 +// err := client.DescribeManagedPrefixListsPages(params, +// func(page *ec2.DescribeManagedPrefixListsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeManagedPrefixListsPages(input *DescribeManagedPrefixListsInput, fn func(*DescribeManagedPrefixListsOutput, bool) bool) error { + return c.DescribeManagedPrefixListsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeManagedPrefixListsPagesWithContext same as DescribeManagedPrefixListsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeManagedPrefixListsPagesWithContext(ctx aws.Context, input *DescribeManagedPrefixListsInput, fn func(*DescribeManagedPrefixListsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeManagedPrefixListsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeManagedPrefixListsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeManagedPrefixListsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeMovingAddresses = "DescribeMovingAddresses" // DescribeMovingAddressesRequest generates a "aws/request.Request" representing the @@ -19111,7 +19845,7 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput // DescribePlacementGroups API operation for Amazon Elastic Compute Cloud. // // Describes the specified placement groups or all of your placement groups. -// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) +// For more information, see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -19194,10 +19928,9 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req * // // Describes available AWS services in a prefix list format, which includes // the prefix list name and prefix list ID of the service and the IP address -// range for the service. A prefix list ID is required for creating an outbound -// security group rule that allows traffic from a VPC to access an AWS service -// through a gateway VPC endpoint. Currently, the services that support this -// action are Amazon S3 and Amazon DynamoDB. +// range for the service. +// +// We recommend that you use DescribeManagedPrefixLists instead. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -20884,12 +21617,12 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ // (if you own the snapshots), self for snapshots for which you own or have // explicit permissions, or all for public snapshots. // -// If you are describing a long list of snapshots, you can paginate the output -// to make the list more manageable. The MaxResults parameter sets the maximum -// number of results returned in a single page. If the list of results exceeds -// your MaxResults value, then that number of results is returned along with -// a NextToken value that can be passed to a subsequent DescribeSnapshots request -// to retrieve the remaining results. +// If you are describing a long list of snapshots, we recommend that you paginate +// the output to make the list more manageable. The MaxResults parameter sets +// the maximum number of results returned in a single page. If the list of results +// exceeds your MaxResults value, then that number of results is returned along +// with a NextToken value that can be passed to a subsequent DescribeSnapshots +// request to retrieve the remaining results. // // To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores. // @@ -21021,7 +21754,7 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee // DescribeSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. // // Describes the data feed for Spot Instances. For more information, see Spot -// Instance Data Feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) +// Instance data feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon EC2 User Guide for Linux Instances. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -21539,7 +22272,7 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp // DescribeSpotPriceHistory API operation for Amazon Elastic Compute Cloud. // // Describes the Spot price history. For more information, see Spot Instance -// Pricing History (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) +// pricing history (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) // in the Amazon EC2 User Guide for Linux Instances. // // When you specify a start and end time, this operation returns the prices @@ -23372,7 +24105,7 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req // status of the volume is ok. If the check fails, the overall status is impaired. // If the status is insufficient-data, then the checks may still be taking place // on your volume at the time. We recommend that you retry the request. For -// more information about volume status, see Monitoring the Status of Your Volumes +// more information about volume status, see Monitoring the status of your volumes // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html) // in the Amazon Elastic Compute Cloud User Guide. // @@ -23524,12 +24257,12 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request. // // Describes the specified EBS volumes or all of your EBS volumes. // -// If you are describing a long list of volumes, you can paginate the output -// to make the list more manageable. The MaxResults parameter sets the maximum -// number of results returned in a single page. If the list of results exceeds -// your MaxResults value, then that number of results is returned along with -// a NextToken value that can be passed to a subsequent DescribeVolumes request -// to retrieve the remaining results. +// If you are describing a long list of volumes, we recommend that you paginate +// the output to make the list more manageable. The MaxResults parameter sets +// the maximum number of results returned in a single page. If the list of results +// exceeds your MaxResults value, then that number of results is returned along +// with a NextToken value that can be passed to a subsequent DescribeVolumes +// request to retrieve the remaining results. // // For more information about EBS volumes, see Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -23664,19 +24397,17 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica // DescribeVolumesModifications API operation for Amazon Elastic Compute Cloud. // -// Reports the current modification status of EBS volumes. +// Describes the most recent volume modification request for the specified EBS +// volumes. // -// Current-generation EBS volumes support modification of attributes including -// type, size, and (for io1 volumes) IOPS provisioning while either attached -// to or detached from an instance. Following an action from the API or the -// console to modify a volume, the status of the modification may be modifying, -// optimizing, completed, or failed. If a volume has never been modified, then -// certain elements of the returned VolumeModification objects are null. +// If a volume has never been modified, some information in the output will +// be null. If a volume has been modified more than once, the output includes +// only the most recent modification request. // // You can also use CloudWatch Events to check the status of a modification // to an EBS volume. For information about CloudWatch Events, see the Amazon // CloudWatch Events User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// For more information, see Monitoring Volume Modifications" (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods) +// For more information, see Monitoring volume modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -25485,7 +26216,7 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Reques // When a volume with an AWS Marketplace product code is detached from an instance, // the product code is no longer associated with the instance. // -// For more information, see Detaching an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) +// For more information, see Detaching an Amazon EBS volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -26749,7 +27480,7 @@ func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDe // // After you enable encryption by default, you can no longer launch instances // using instance types that do not support encryption. For more information, -// see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). +// see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -26830,7 +27561,7 @@ func (c *EC2) EnableFastSnapshotRestoresRequest(input *EnableFastSnapshotRestore // state. To get the current state of fast snapshot restores, use DescribeFastSnapshotRestores. // To disable fast snapshot restores, use DisableFastSnapshotRestores. // -// For more information, see Amazon EBS Fast Snapshot Restore (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-fast-snapshot-restore.html) +// For more information, see Amazon EBS fast snapshot restore (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-fast-snapshot-restore.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -28056,7 +28787,7 @@ func (c *EC2) GetDefaultCreditSpecificationRequest(input *GetDefaultCreditSpecif // Describes the default credit option for CPU usage of a burstable performance // instance family. // -// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) +// For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -28244,6 +28975,138 @@ func (c *EC2) GetEbsEncryptionByDefaultWithContext(ctx aws.Context, input *GetEb return out, req.Send() } +const opGetGroupsForCapacityReservation = "GetGroupsForCapacityReservation" + +// GetGroupsForCapacityReservationRequest generates a "aws/request.Request" representing the +// client's request for the GetGroupsForCapacityReservation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroupsForCapacityReservation for more information on using the GetGroupsForCapacityReservation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupsForCapacityReservationRequest method. +// req, resp := client.GetGroupsForCapacityReservationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetGroupsForCapacityReservation +func (c *EC2) GetGroupsForCapacityReservationRequest(input *GetGroupsForCapacityReservationInput) (req *request.Request, output *GetGroupsForCapacityReservationOutput) { + op := &request.Operation{ + Name: opGetGroupsForCapacityReservation, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetGroupsForCapacityReservationInput{} + } + + output = &GetGroupsForCapacityReservationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroupsForCapacityReservation API operation for Amazon Elastic Compute Cloud. +// +// Lists the resource groups to which a Capacity Reservation has been added. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation GetGroupsForCapacityReservation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetGroupsForCapacityReservation +func (c *EC2) GetGroupsForCapacityReservation(input *GetGroupsForCapacityReservationInput) (*GetGroupsForCapacityReservationOutput, error) { + req, out := c.GetGroupsForCapacityReservationRequest(input) + return out, req.Send() +} + +// GetGroupsForCapacityReservationWithContext is the same as GetGroupsForCapacityReservation with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroupsForCapacityReservation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetGroupsForCapacityReservationWithContext(ctx aws.Context, input *GetGroupsForCapacityReservationInput, opts ...request.Option) (*GetGroupsForCapacityReservationOutput, error) { + req, out := c.GetGroupsForCapacityReservationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetGroupsForCapacityReservationPages iterates over the pages of a GetGroupsForCapacityReservation operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetGroupsForCapacityReservation method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetGroupsForCapacityReservation operation. +// pageNum := 0 +// err := client.GetGroupsForCapacityReservationPages(params, +// func(page *ec2.GetGroupsForCapacityReservationOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetGroupsForCapacityReservationPages(input *GetGroupsForCapacityReservationInput, fn func(*GetGroupsForCapacityReservationOutput, bool) bool) error { + return c.GetGroupsForCapacityReservationPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetGroupsForCapacityReservationPagesWithContext same as GetGroupsForCapacityReservationPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetGroupsForCapacityReservationPagesWithContext(ctx aws.Context, input *GetGroupsForCapacityReservationInput, fn func(*GetGroupsForCapacityReservationOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetGroupsForCapacityReservationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetGroupsForCapacityReservationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetGroupsForCapacityReservationOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" // GetHostReservationPurchasePreviewRequest generates a "aws/request.Request" representing the @@ -28370,6 +29233,12 @@ func (c *EC2) GetLaunchTemplateDataRequest(input *GetLaunchTemplateDataInput) (r // Retrieves the configuration data of the specified instance. You can use this // data to create a launch template. // +// This action calls on other describe actions to get instance information. +// Depending on your instance configuration, you may need to allow the following +// actions in your IAM policy: DescribeSpotInstanceRequests, DescribeInstanceCreditSpecifications, +// DescribeVolumes, DescribeInstanceAttribute, and DescribeElasticGpus. Or, +// you can allow describe* depending on your instance requirements. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -28398,6 +29267,271 @@ func (c *EC2) GetLaunchTemplateDataWithContext(ctx aws.Context, input *GetLaunch return out, req.Send() } +const opGetManagedPrefixListAssociations = "GetManagedPrefixListAssociations" + +// GetManagedPrefixListAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the GetManagedPrefixListAssociations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetManagedPrefixListAssociations for more information on using the GetManagedPrefixListAssociations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetManagedPrefixListAssociationsRequest method. +// req, resp := client.GetManagedPrefixListAssociationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetManagedPrefixListAssociations +func (c *EC2) GetManagedPrefixListAssociationsRequest(input *GetManagedPrefixListAssociationsInput) (req *request.Request, output *GetManagedPrefixListAssociationsOutput) { + op := &request.Operation{ + Name: opGetManagedPrefixListAssociations, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetManagedPrefixListAssociationsInput{} + } + + output = &GetManagedPrefixListAssociationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetManagedPrefixListAssociations API operation for Amazon Elastic Compute Cloud. +// +// Gets information about the resources that are associated with the specified +// managed prefix list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation GetManagedPrefixListAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetManagedPrefixListAssociations +func (c *EC2) GetManagedPrefixListAssociations(input *GetManagedPrefixListAssociationsInput) (*GetManagedPrefixListAssociationsOutput, error) { + req, out := c.GetManagedPrefixListAssociationsRequest(input) + return out, req.Send() +} + +// GetManagedPrefixListAssociationsWithContext is the same as GetManagedPrefixListAssociations with the addition of +// the ability to pass a context and additional request options. +// +// See GetManagedPrefixListAssociations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetManagedPrefixListAssociationsWithContext(ctx aws.Context, input *GetManagedPrefixListAssociationsInput, opts ...request.Option) (*GetManagedPrefixListAssociationsOutput, error) { + req, out := c.GetManagedPrefixListAssociationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetManagedPrefixListAssociationsPages iterates over the pages of a GetManagedPrefixListAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetManagedPrefixListAssociations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetManagedPrefixListAssociations operation. +// pageNum := 0 +// err := client.GetManagedPrefixListAssociationsPages(params, +// func(page *ec2.GetManagedPrefixListAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetManagedPrefixListAssociationsPages(input *GetManagedPrefixListAssociationsInput, fn func(*GetManagedPrefixListAssociationsOutput, bool) bool) error { + return c.GetManagedPrefixListAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetManagedPrefixListAssociationsPagesWithContext same as GetManagedPrefixListAssociationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetManagedPrefixListAssociationsPagesWithContext(ctx aws.Context, input *GetManagedPrefixListAssociationsInput, fn func(*GetManagedPrefixListAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetManagedPrefixListAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetManagedPrefixListAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetManagedPrefixListAssociationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetManagedPrefixListEntries = "GetManagedPrefixListEntries" + +// GetManagedPrefixListEntriesRequest generates a "aws/request.Request" representing the +// client's request for the GetManagedPrefixListEntries operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetManagedPrefixListEntries for more information on using the GetManagedPrefixListEntries +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetManagedPrefixListEntriesRequest method. +// req, resp := client.GetManagedPrefixListEntriesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetManagedPrefixListEntries +func (c *EC2) GetManagedPrefixListEntriesRequest(input *GetManagedPrefixListEntriesInput) (req *request.Request, output *GetManagedPrefixListEntriesOutput) { + op := &request.Operation{ + Name: opGetManagedPrefixListEntries, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetManagedPrefixListEntriesInput{} + } + + output = &GetManagedPrefixListEntriesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetManagedPrefixListEntries API operation for Amazon Elastic Compute Cloud. +// +// Gets information about the entries for a specified managed prefix list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation GetManagedPrefixListEntries for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetManagedPrefixListEntries +func (c *EC2) GetManagedPrefixListEntries(input *GetManagedPrefixListEntriesInput) (*GetManagedPrefixListEntriesOutput, error) { + req, out := c.GetManagedPrefixListEntriesRequest(input) + return out, req.Send() +} + +// GetManagedPrefixListEntriesWithContext is the same as GetManagedPrefixListEntries with the addition of +// the ability to pass a context and additional request options. +// +// See GetManagedPrefixListEntries for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetManagedPrefixListEntriesWithContext(ctx aws.Context, input *GetManagedPrefixListEntriesInput, opts ...request.Option) (*GetManagedPrefixListEntriesOutput, error) { + req, out := c.GetManagedPrefixListEntriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetManagedPrefixListEntriesPages iterates over the pages of a GetManagedPrefixListEntries operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetManagedPrefixListEntries method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetManagedPrefixListEntries operation. +// pageNum := 0 +// err := client.GetManagedPrefixListEntriesPages(params, +// func(page *ec2.GetManagedPrefixListEntriesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetManagedPrefixListEntriesPages(input *GetManagedPrefixListEntriesInput, fn func(*GetManagedPrefixListEntriesOutput, bool) bool) error { + return c.GetManagedPrefixListEntriesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetManagedPrefixListEntriesPagesWithContext same as GetManagedPrefixListEntriesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetManagedPrefixListEntriesPagesWithContext(ctx aws.Context, input *GetManagedPrefixListEntriesInput, fn func(*GetManagedPrefixListEntriesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetManagedPrefixListEntriesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetManagedPrefixListEntriesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetManagedPrefixListEntriesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opGetPasswordData = "GetPasswordData" // GetPasswordDataRequest generates a "aws/request.Request" representing the @@ -28832,6 +29966,139 @@ func (c *EC2) GetTransitGatewayMulticastDomainAssociationsPagesWithContext(ctx a return p.Err() } +const opGetTransitGatewayPrefixListReferences = "GetTransitGatewayPrefixListReferences" + +// GetTransitGatewayPrefixListReferencesRequest generates a "aws/request.Request" representing the +// client's request for the GetTransitGatewayPrefixListReferences operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTransitGatewayPrefixListReferences for more information on using the GetTransitGatewayPrefixListReferences +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTransitGatewayPrefixListReferencesRequest method. +// req, resp := client.GetTransitGatewayPrefixListReferencesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayPrefixListReferences +func (c *EC2) GetTransitGatewayPrefixListReferencesRequest(input *GetTransitGatewayPrefixListReferencesInput) (req *request.Request, output *GetTransitGatewayPrefixListReferencesOutput) { + op := &request.Operation{ + Name: opGetTransitGatewayPrefixListReferences, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetTransitGatewayPrefixListReferencesInput{} + } + + output = &GetTransitGatewayPrefixListReferencesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTransitGatewayPrefixListReferences API operation for Amazon Elastic Compute Cloud. +// +// Gets information about the prefix list references in a specified transit +// gateway route table. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation GetTransitGatewayPrefixListReferences for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayPrefixListReferences +func (c *EC2) GetTransitGatewayPrefixListReferences(input *GetTransitGatewayPrefixListReferencesInput) (*GetTransitGatewayPrefixListReferencesOutput, error) { + req, out := c.GetTransitGatewayPrefixListReferencesRequest(input) + return out, req.Send() +} + +// GetTransitGatewayPrefixListReferencesWithContext is the same as GetTransitGatewayPrefixListReferences with the addition of +// the ability to pass a context and additional request options. +// +// See GetTransitGatewayPrefixListReferences for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayPrefixListReferencesWithContext(ctx aws.Context, input *GetTransitGatewayPrefixListReferencesInput, opts ...request.Option) (*GetTransitGatewayPrefixListReferencesOutput, error) { + req, out := c.GetTransitGatewayPrefixListReferencesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// GetTransitGatewayPrefixListReferencesPages iterates over the pages of a GetTransitGatewayPrefixListReferences operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayPrefixListReferences method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetTransitGatewayPrefixListReferences operation. +// pageNum := 0 +// err := client.GetTransitGatewayPrefixListReferencesPages(params, +// func(page *ec2.GetTransitGatewayPrefixListReferencesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayPrefixListReferencesPages(input *GetTransitGatewayPrefixListReferencesInput, fn func(*GetTransitGatewayPrefixListReferencesOutput, bool) bool) error { + return c.GetTransitGatewayPrefixListReferencesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayPrefixListReferencesPagesWithContext same as GetTransitGatewayPrefixListReferencesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayPrefixListReferencesPagesWithContext(ctx aws.Context, input *GetTransitGatewayPrefixListReferencesInput, fn func(*GetTransitGatewayPrefixListReferencesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayPrefixListReferencesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayPrefixListReferencesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetTransitGatewayPrefixListReferencesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opGetTransitGatewayRouteTableAssociations = "GetTransitGatewayRouteTableAssociations" // GetTransitGatewayRouteTableAssociationsRequest generates a "aws/request.Request" representing the @@ -29610,9 +30877,10 @@ func (c *EC2) ModifyAvailabilityZoneGroupRequest(input *ModifyAvailabilityZoneGr // ModifyAvailabilityZoneGroup API operation for Amazon Elastic Compute Cloud. // -// Enables or disables an Availability Zone group for your account. +// Changes the opt-in status of the Local Zone and Wavelength Zone group for +// your account. // -// Use describe-availability-zones (https://docs.aws.amazon.com/AWSEC2ApiDocReef/build/server-root/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html) +// Use DescribeAvailabilityZones (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html) // to view the value for GroupName. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -29854,7 +31122,7 @@ func (c *EC2) ModifyDefaultCreditSpecificationRequest(input *ModifyDefaultCredit // can call GetDefaultCreditSpecification and check DefaultCreditSpecification // for updates. // -// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) +// For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -30566,7 +31834,7 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput // we recommend that you use the ModifyNetworkInterfaceAttribute action. // // To modify some attributes, the instance must be stopped. For more information, -// see Modifying Attributes of a Stopped Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) +// see Modifying attributes of a stopped instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -30721,7 +31989,7 @@ func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCred // Modifies the credit option for CPU usage on a running or stopped burstable // performance instance. The credit options are standard and unlimited. // -// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) +// For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -30876,7 +32144,7 @@ func (c *EC2) ModifyInstanceMetadataOptionsRequest(input *ModifyInstanceMetadata // the API responds with a state of “pending”. After the parameter modifications // are successfully applied to the instance, the state of the modifications // changes from “pending” to “applied” in subsequent describe-instances -// API calls. For more information, see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). +// API calls. For more information, see Instance metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -31077,6 +32345,86 @@ func (c *EC2) ModifyLaunchTemplateWithContext(ctx aws.Context, input *ModifyLaun return out, req.Send() } +const opModifyManagedPrefixList = "ModifyManagedPrefixList" + +// ModifyManagedPrefixListRequest generates a "aws/request.Request" representing the +// client's request for the ModifyManagedPrefixList operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyManagedPrefixList for more information on using the ModifyManagedPrefixList +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyManagedPrefixListRequest method. +// req, resp := client.ModifyManagedPrefixListRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyManagedPrefixList +func (c *EC2) ModifyManagedPrefixListRequest(input *ModifyManagedPrefixListInput) (req *request.Request, output *ModifyManagedPrefixListOutput) { + op := &request.Operation{ + Name: opModifyManagedPrefixList, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyManagedPrefixListInput{} + } + + output = &ModifyManagedPrefixListOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyManagedPrefixList API operation for Amazon Elastic Compute Cloud. +// +// Modifies the specified managed prefix list. +// +// Adding or removing entries in a prefix list creates a new version of the +// prefix list. Changing the name of the prefix list does not affect the version. +// +// If you specify a current version number that does not match the true current +// version number, the request fails. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ModifyManagedPrefixList for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyManagedPrefixList +func (c *EC2) ModifyManagedPrefixList(input *ModifyManagedPrefixListInput) (*ModifyManagedPrefixListOutput, error) { + req, out := c.ModifyManagedPrefixListRequest(input) + return out, req.Send() +} + +// ModifyManagedPrefixListWithContext is the same as ModifyManagedPrefixList with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyManagedPrefixList for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ModifyManagedPrefixListWithContext(ctx aws.Context, input *ModifyManagedPrefixListInput, opts ...request.Option) (*ModifyManagedPrefixListOutput, error) { + req, out := c.ModifyManagedPrefixListRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" // ModifyNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the @@ -31289,7 +32637,7 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput // be made public. Snapshots encrypted with your default CMK cannot be shared // with other accounts. // -// For more information about modifying snapshot permissions, see Sharing Snapshots +// For more information about modifying snapshot permissions, see Sharing snapshots // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) // in the Amazon Elastic Compute Cloud User Guide. // @@ -31734,6 +33082,157 @@ func (c *EC2) ModifyTrafficMirrorSessionWithContext(ctx aws.Context, input *Modi return out, req.Send() } +const opModifyTransitGateway = "ModifyTransitGateway" + +// ModifyTransitGatewayRequest generates a "aws/request.Request" representing the +// client's request for the ModifyTransitGateway operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyTransitGateway for more information on using the ModifyTransitGateway +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyTransitGatewayRequest method. +// req, resp := client.ModifyTransitGatewayRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGateway +func (c *EC2) ModifyTransitGatewayRequest(input *ModifyTransitGatewayInput) (req *request.Request, output *ModifyTransitGatewayOutput) { + op := &request.Operation{ + Name: opModifyTransitGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyTransitGatewayInput{} + } + + output = &ModifyTransitGatewayOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyTransitGateway API operation for Amazon Elastic Compute Cloud. +// +// Modifies the specified transit gateway. When you modify a transit gateway, +// the modified options are applied to new transit gateway attachments only. +// Your existing transit gateway attachments are not modified. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ModifyTransitGateway for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGateway +func (c *EC2) ModifyTransitGateway(input *ModifyTransitGatewayInput) (*ModifyTransitGatewayOutput, error) { + req, out := c.ModifyTransitGatewayRequest(input) + return out, req.Send() +} + +// ModifyTransitGatewayWithContext is the same as ModifyTransitGateway with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyTransitGateway for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ModifyTransitGatewayWithContext(ctx aws.Context, input *ModifyTransitGatewayInput, opts ...request.Option) (*ModifyTransitGatewayOutput, error) { + req, out := c.ModifyTransitGatewayRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opModifyTransitGatewayPrefixListReference = "ModifyTransitGatewayPrefixListReference" + +// ModifyTransitGatewayPrefixListReferenceRequest generates a "aws/request.Request" representing the +// client's request for the ModifyTransitGatewayPrefixListReference operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyTransitGatewayPrefixListReference for more information on using the ModifyTransitGatewayPrefixListReference +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyTransitGatewayPrefixListReferenceRequest method. +// req, resp := client.ModifyTransitGatewayPrefixListReferenceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayPrefixListReference +func (c *EC2) ModifyTransitGatewayPrefixListReferenceRequest(input *ModifyTransitGatewayPrefixListReferenceInput) (req *request.Request, output *ModifyTransitGatewayPrefixListReferenceOutput) { + op := &request.Operation{ + Name: opModifyTransitGatewayPrefixListReference, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyTransitGatewayPrefixListReferenceInput{} + } + + output = &ModifyTransitGatewayPrefixListReferenceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyTransitGatewayPrefixListReference API operation for Amazon Elastic Compute Cloud. +// +// Modifies a reference (route) to a prefix list in a specified transit gateway +// route table. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ModifyTransitGatewayPrefixListReference for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayPrefixListReference +func (c *EC2) ModifyTransitGatewayPrefixListReference(input *ModifyTransitGatewayPrefixListReferenceInput) (*ModifyTransitGatewayPrefixListReferenceOutput, error) { + req, out := c.ModifyTransitGatewayPrefixListReferenceRequest(input) + return out, req.Send() +} + +// ModifyTransitGatewayPrefixListReferenceWithContext is the same as ModifyTransitGatewayPrefixListReference with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyTransitGatewayPrefixListReference for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ModifyTransitGatewayPrefixListReferenceWithContext(ctx aws.Context, input *ModifyTransitGatewayPrefixListReferenceInput, opts ...request.Option) (*ModifyTransitGatewayPrefixListReferenceOutput, error) { + req, out := c.ModifyTransitGatewayPrefixListReferenceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyTransitGatewayVpcAttachment = "ModifyTransitGatewayVpcAttachment" // ModifyTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the @@ -31856,30 +33355,30 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques // size, volume type, and IOPS capacity. If your EBS volume is attached to a // current-generation EC2 instance type, you may be able to apply these changes // without stopping the instance or detaching the volume from it. For more information -// about modifying an EBS volume running Linux, see Modifying the Size, IOPS, -// or Type of an EBS Volume on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). +// about modifying an EBS volume running Linux, see Modifying the size, IOPS, +// or type of an EBS volume on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). // For more information about modifying an EBS volume running Windows, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// the size, IOPS, or type of an EBS volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). // // When you complete a resize operation on your volume, you need to extend the // volume's file-system size to take advantage of the new storage capacity. // For information about extending a Linux file system, see Extending a Linux -// File System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux). +// file system (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux). // For information about extending a Windows file system, see Extending a Windows -// File System (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). +// file system (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). // // You can use CloudWatch Events to check the status of a modification to an // EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch // Events User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). // You can also track the status of a modification using DescribeVolumesModifications. // For information about tracking status changes using either method, see Monitoring -// Volume Modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). +// volume modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). // // With previous-generation instance types, resizing an EBS volume may require // detaching and reattaching the volume or stopping and restarting the instance. -// For more information, see Modifying the Size, IOPS, or Type of an EBS Volume +// For more information, see Modifying the size, IOPS, or type of an EBS volume // on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html) -// and Modifying the Size, IOPS, or Type of an EBS Volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// and Modifying the size, IOPS, or type of an EBS volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). // // If you reach the maximum volume modification rate per volume limit, you will // need to wait at least six hours before applying further modifications to @@ -32682,6 +34181,85 @@ func (c *EC2) ModifyVpnConnectionWithContext(ctx aws.Context, input *ModifyVpnCo return out, req.Send() } +const opModifyVpnConnectionOptions = "ModifyVpnConnectionOptions" + +// ModifyVpnConnectionOptionsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpnConnectionOptions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyVpnConnectionOptions for more information on using the ModifyVpnConnectionOptions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyVpnConnectionOptionsRequest method. +// req, resp := client.ModifyVpnConnectionOptionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnectionOptions +func (c *EC2) ModifyVpnConnectionOptionsRequest(input *ModifyVpnConnectionOptionsInput) (req *request.Request, output *ModifyVpnConnectionOptionsOutput) { + op := &request.Operation{ + Name: opModifyVpnConnectionOptions, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyVpnConnectionOptionsInput{} + } + + output = &ModifyVpnConnectionOptionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyVpnConnectionOptions API operation for Amazon Elastic Compute Cloud. +// +// Modifies the connection options for your Site-to-Site VPN VPN connection. +// +// When you modify the VPN connection options, the VPN endpoint IP addresses +// on the AWS side do not change, and the tunnel options do not change. Your +// VPN connection will be temporarily unavailable for a brief period while the +// VPN connection is updated. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ModifyVpnConnectionOptions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnectionOptions +func (c *EC2) ModifyVpnConnectionOptions(input *ModifyVpnConnectionOptionsInput) (*ModifyVpnConnectionOptionsOutput, error) { + req, out := c.ModifyVpnConnectionOptionsRequest(input) + return out, req.Send() +} + +// ModifyVpnConnectionOptionsWithContext is the same as ModifyVpnConnectionOptions with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyVpnConnectionOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ModifyVpnConnectionOptionsWithContext(ctx aws.Context, input *ModifyVpnConnectionOptionsInput, opts ...request.Option) (*ModifyVpnConnectionOptionsOutput, error) { + req, out := c.ModifyVpnConnectionOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyVpnTunnelCertificate = "ModifyVpnTunnelCertificate" // ModifyVpnTunnelCertificateRequest generates a "aws/request.Request" representing the @@ -32879,7 +34457,7 @@ func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *reques // MonitorInstances API operation for Amazon Elastic Compute Cloud. // // Enables detailed monitoring for a running instance. Otherwise, basic monitoring -// is enabled. For more information, see Monitoring Your Instances and Volumes +// is enabled. For more information, see Monitoring your instances and volumes // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) // in the Amazon Elastic Compute Cloud User Guide. // @@ -33383,8 +34961,8 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request. // If an instance does not cleanly shut down within four minutes, Amazon EC2 // performs a hard reboot. // -// For more information about troubleshooting, see Getting Console Output and -// Rebooting Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) +// For more information about troubleshooting, see Getting console output and +// rebooting instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -33461,7 +35039,7 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // // Registers an AMI. When you're creating an AMI, this is the final step you // must complete before you can launch an instance from the AMI. For more information -// about creating AMIs, see Creating Your Own AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) +// about creating AMIs, see Creating your own AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) // in the Amazon Elastic Compute Cloud User Guide. // // For Amazon EBS-backed instances, CreateImage creates and registers the AMI @@ -33469,12 +35047,12 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // // You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from // a snapshot of a root device volume. You specify the snapshot using the block -// device mapping. For more information, see Launching a Linux Instance from -// a Backup (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) +// device mapping. For more information, see Launching a Linux instance from +// a backup (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. // -// You can't register an image where a secondary (non-root) snapshot has AWS -// Marketplace product codes. +// If any snapshots have AWS Marketplace product codes, they are copied to the +// new AMI. // // Windows and some Linux distributions, such as Red Hat Enterprise Linux (RHEL) // and SUSE Linux Enterprise Server (SLES), use the EC2 billing product code @@ -33495,7 +35073,7 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ // a Reserved Instance without the matching billing product code, the Reserved // Instance will not be applied to the On-Demand Instance. For information about // how to obtain the platform details and billing information of an AMI, see -// Obtaining Billing Information (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) +// Obtaining billing information (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) // in the Amazon Elastic Compute Cloud User Guide. // // If needed, you can deregister an AMI at any time. Any modifications you make @@ -34873,7 +36451,7 @@ func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *reques // the fleet. You cannot tag other resource types in a Spot Fleet request because // only the spot-fleet-request and instance resource types are supported. // -// For more information, see Spot Fleet Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) +// For more information, see Spot Fleet requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) // in the Amazon EC2 User Guide for Linux Instances. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -34950,7 +36528,7 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req // // Creates a Spot Instance request. // -// For more information, see Spot Instance Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) +// For more information, see Spot Instance requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) // in the Amazon EC2 User Guide for Linux Instances. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -35419,7 +36997,7 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) // // Resets permission settings for the specified snapshot. // -// For more information about modifying snapshot permissions, see Sharing Snapshots +// For more information about modifying snapshot permissions, see Sharing snapshots // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) // in the Amazon Elastic Compute Cloud User Guide. // @@ -35528,6 +37106,81 @@ func (c *EC2) RestoreAddressToClassicWithContext(ctx aws.Context, input *Restore return out, req.Send() } +const opRestoreManagedPrefixListVersion = "RestoreManagedPrefixListVersion" + +// RestoreManagedPrefixListVersionRequest generates a "aws/request.Request" representing the +// client's request for the RestoreManagedPrefixListVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RestoreManagedPrefixListVersion for more information on using the RestoreManagedPrefixListVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RestoreManagedPrefixListVersionRequest method. +// req, resp := client.RestoreManagedPrefixListVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreManagedPrefixListVersion +func (c *EC2) RestoreManagedPrefixListVersionRequest(input *RestoreManagedPrefixListVersionInput) (req *request.Request, output *RestoreManagedPrefixListVersionOutput) { + op := &request.Operation{ + Name: opRestoreManagedPrefixListVersion, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RestoreManagedPrefixListVersionInput{} + } + + output = &RestoreManagedPrefixListVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// RestoreManagedPrefixListVersion API operation for Amazon Elastic Compute Cloud. +// +// Restores the entries from a previous version of a managed prefix list to +// a new version of the prefix list. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation RestoreManagedPrefixListVersion for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreManagedPrefixListVersion +func (c *EC2) RestoreManagedPrefixListVersion(input *RestoreManagedPrefixListVersionInput) (*RestoreManagedPrefixListVersionOutput, error) { + req, out := c.RestoreManagedPrefixListVersionRequest(input) + return out, req.Send() +} + +// RestoreManagedPrefixListVersionWithContext is the same as RestoreManagedPrefixListVersion with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreManagedPrefixListVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RestoreManagedPrefixListVersionWithContext(ctx aws.Context, input *RestoreManagedPrefixListVersionInput, opts ...request.Option) (*RestoreManagedPrefixListVersionOutput, error) { + req, out := c.RestoreManagedPrefixListVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opRevokeClientVpnIngress = "RevokeClientVpnIngress" // RevokeClientVpnIngressRequest generates a "aws/request.Request" representing the @@ -35838,17 +37491,17 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques // // * Some instance types must be launched into a VPC. If you do not have // a default VPC, or if you do not specify a subnet ID, the request fails. -// For more information, see Instance Types Available Only in a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types). +// For more information, see Instance types available only in a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types). // // * [EC2-VPC] All instances have a network interface with a primary private // IPv4 address. If you don't specify this address, we choose one from the // IPv4 range of your subnet. // // * Not all instance types support IPv6 addresses. For more information, -// see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). +// see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). // // * If you don't specify a security group ID, we use the default security -// group. For more information, see Security Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html). +// group. For more information, see Security groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html). // // * If any of the AMIs have a product code attached for which the user has // not subscribed, the request fails. @@ -35865,17 +37518,17 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques // An instance is ready for you to use when it's in the running state. You can // check the state of your instance using DescribeInstances. You can tag instances // and EBS volumes during launch, after launch, or both. For more information, -// see CreateTags and Tagging Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). +// see CreateTags and Tagging your Amazon EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). // // Linux instances have access to the public key of the key pair at boot. You // can use this key to provide secure access to the instance. Amazon EC2 public // images use this feature to provide secure access without passwords. For more -// information, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) +// information, see Key pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) // in the Amazon Elastic Compute Cloud User Guide. // -// For troubleshooting, see What To Do If An Instance Immediately Terminates +// For troubleshooting, see What to do if an instance immediately terminates // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), -// and Troubleshooting Connecting to Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) +// and Troubleshooting connecting to your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -36388,8 +38041,8 @@ func (c *EC2) SendDiagnosticInterruptRequest(input *SendDiagnosticInterruptInput // system is configured to perform the required diagnostic tasks. // // For more information about configuring your operating system to generate -// a crash dump when a kernel panic or stop error occurs, see Send a Diagnostic -// Interrupt (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/diagnostic-interrupt.html) +// a crash dump when a kernel panic or stop error occurs, see Send a diagnostic +// interrupt (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/diagnostic-interrupt.html) // (Linux instances) or Send a Diagnostic Interrupt (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/diagnostic-interrupt.html) // (Windows instances). // @@ -36486,7 +38139,7 @@ func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Re // Performing this operation on an instance that uses an instance store as its // root device returns an error. // -// For more information, see Stopping Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) +// For more information, see Stopping instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -36649,7 +38302,7 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // You can use the Stop action to hibernate an instance if the instance is enabled // for hibernation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation) // and it meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) +// For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. // // We don't charge usage for a stopped instance, or data transfer fees; however, @@ -36665,7 +38318,7 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // You can't stop or hibernate instance store-backed instances. You can't use // the Stop action to hibernate Spot Instances, but you can specify that Amazon // EC2 should hibernate Spot Instances when they are interrupted. For more information, -// see Hibernating Interrupted Spot Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances) +// see Hibernating interrupted Spot Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances) // in the Amazon Elastic Compute Cloud User Guide. // // When you stop or hibernate an instance, we shut it down. You can restart @@ -36681,13 +38334,13 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ // an instance, the root device and any other devices attached during the instance // launch are automatically deleted. For more information about the differences // between rebooting, stopping, hibernating, and terminating instances, see -// Instance Lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) +// Instance lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) // in the Amazon Elastic Compute Cloud User Guide. // // When you stop an instance, we attempt to shut it down forcibly after a short // while. If your instance appears stuck in the stopping state after a period // of time, there may be an issue with the underlying host computer. For more -// information, see Troubleshooting Stopping Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) +// information, see Troubleshooting stopping your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -36857,11 +38510,11 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *re // an instance, any attached EBS volumes with the DeleteOnTermination block // device mapping parameter set to true are automatically deleted. For more // information about the differences between stopping and terminating instances, -// see Instance Lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) +// see Instance lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) // in the Amazon Elastic Compute Cloud User Guide. // -// For more information about troubleshooting, see Troubleshooting Terminating -// Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) +// For more information about troubleshooting, see Troubleshooting terminating +// your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -37086,7 +38739,7 @@ func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *re // UnmonitorInstances API operation for Amazon Elastic Compute Cloud. // // Disables detailed monitoring for a running instance. For more information, -// see Monitoring Your Instances and Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) +// see Monitoring your instances and volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -37855,7 +39508,57 @@ func (s *ActiveInstance) SetSpotInstanceRequestId(v string) *ActiveInstance { return s } -// Describes an Elastic IP address. +// An entry for a prefix list. +type AddPrefixListEntry struct { + _ struct{} `type:"structure"` + + // The CIDR block. + // + // Cidr is a required field + Cidr *string `type:"string" required:"true"` + + // A description for the entry. + // + // Constraints: Up to 255 characters in length. + Description *string `type:"string"` +} + +// String returns the string representation +func (s AddPrefixListEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddPrefixListEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddPrefixListEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddPrefixListEntry"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCidr sets the Cidr field's value. +func (s *AddPrefixListEntry) SetCidr(v string) *AddPrefixListEntry { + s.Cidr = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *AddPrefixListEntry) SetDescription(v string) *AddPrefixListEntry { + s.Description = &v + return s +} + +// Describes an Elastic IP address, or a carrier IP address. type Address struct { _ struct{} `type:"structure"` @@ -37866,6 +39569,11 @@ type Address struct { // VPC. AssociationId *string `locationName:"associationId" type:"string"` + // The carrier IP address associated. This option is only available for network + // interfaces which reside in a subnet in a Wavelength Zone (for example an + // EC2 instance). + CarrierIp *string `locationName:"carrierIp" type:"string"` + // The customer-owned IP address. CustomerOwnedIp *string `locationName:"customerOwnedIp" type:"string"` @@ -37879,7 +39587,8 @@ type Address struct { // The ID of the instance that the address is associated with (if any). InstanceId *string `locationName:"instanceId" type:"string"` - // The name of the location from which the IP address is advertised. + // The name of the unique set of Availability Zones, Local Zones, or Wavelength + // Zones from which AWS advertises IP addresses. NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` // The ID of the network interface. @@ -37923,6 +39632,12 @@ func (s *Address) SetAssociationId(v string) *Address { return s } +// SetCarrierIp sets the CarrierIp field's value. +func (s *Address) SetCarrierIp(v string) *Address { + s.CarrierIp = &v + return s +} + // SetCustomerOwnedIp sets the CustomerOwnedIp field's value. func (s *Address) SetCustomerOwnedIp(v string) *Address { s.CustomerOwnedIp = &v @@ -38075,9 +39790,11 @@ type AllocateAddressInput struct { // address from the address pool. CustomerOwnedIpv4Pool *string `type:"string"` - // Set to vpc to allocate the address for use with instances in a VPC. + // Indicates whether the Elastic IP address is for use with instances in a VPC + // or instances in EC2-Classic. // - // Default: The address is for use with instances in EC2-Classic. + // Default: If the Region supports EC2-Classic, the default is standard. Otherwise, + // the default is vpc. Domain *string `type:"string" enum:"DomainType"` // Checks whether you have the required permissions for the action, without @@ -38086,12 +39803,9 @@ type AllocateAddressInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The location from which the IP address is advertised. Use this parameter - // to limit the address to this location. - // - // A network border group is a unique set of Availability Zones or Local Zones - // from where AWS advertises IP addresses and limits the addresses to the group. - // IP addresses cannot move between network border groups. + // A unique set of Availability Zones, Local Zones, or Wavelength Zones from + // which AWS advertises IP addresses. Use this parameter to limit the IP address + // to this location. IP addresses cannot move between network border groups. // // Use DescribeAvailabilityZones (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html) // to view the network border groups. @@ -38160,17 +39874,22 @@ type AllocateAddressOutput struct { // IP address for use with instances in a VPC. AllocationId *string `locationName:"allocationId" type:"string"` + // The carrier IP address. This option is only available for network interfaces + // which reside in a subnet in a Wavelength Zone (for example an EC2 instance). + CarrierIp *string `locationName:"carrierIp" type:"string"` + // The customer-owned IP address. CustomerOwnedIp *string `locationName:"customerOwnedIp" type:"string"` // The ID of the customer-owned address pool. CustomerOwnedIpv4Pool *string `locationName:"customerOwnedIpv4Pool" type:"string"` - // Indicates whether this Elastic IP address is for use with instances in EC2-Classic - // (standard) or instances in a VPC (vpc). + // Indicates whether the Elastic IP address is for use with instances in a VPC + // (vpc) or instances in EC2-Classic (standard). Domain *string `locationName:"domain" type:"string" enum:"DomainType"` - // The location from which the IP address is advertised. + // The set of Availability Zones, Local Zones, or Wavelength Zones from which + // AWS advertises IP addresses. NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` // The Elastic IP address. @@ -38196,6 +39915,12 @@ func (s *AllocateAddressOutput) SetAllocationId(v string) *AllocateAddressOutput return s } +// SetCarrierIp sets the CarrierIp field's value. +func (s *AllocateAddressOutput) SetCarrierIp(v string) *AllocateAddressOutput { + s.CarrierIp = &v + return s +} + // SetCustomerOwnedIp sets the CustomerOwnedIp field's value. func (s *AllocateAddressOutput) SetCustomerOwnedIp(v string) *AllocateAddressOutput { s.CustomerOwnedIp = &v @@ -39488,7 +41213,7 @@ type AssociateVpcCidrBlockInput struct { Ipv6CidrBlock *string `type:"string"` // The name of the location from which we advertise the IPV6 CIDR block. Use - // this parameter to limit the CiDR block to this location. + // this parameter to limit the CIDR block to this location. // // You must set AmazonProvidedIpv6CidrBlock to true to use this parameter. // @@ -40245,11 +41970,13 @@ type AuthorizeClientVpnIngressInput struct { _ struct{} `type:"structure"` // The ID of the group to grant access to, for example, the Active Directory - // group or identity provider (IdP) group. + // group or identity provider (IdP) group. Required if AuthorizeAllGroups is + // false or not specified. AccessGroupId *string `type:"string"` - // Indicates whether to grant access to all clients. Use true to grant all clients - // who successfully establish a VPN connection access to the network. + // Indicates whether to grant access to all clients. Specify true to grant all + // clients who successfully establish a VPN connection access to the network. + // Must be set to true if AccessGroupId is not specified. AuthorizeAllGroups *bool `type:"boolean"` // Unique, case-sensitive identifier that you provide to ensure the idempotency @@ -40657,38 +42384,52 @@ func (s AuthorizeSecurityGroupIngressOutput) GoString() string { return s.String() } -// Describes an Availability Zone or Local Zone. +// Describes Availability Zones, Local Zones, and Wavelength Zones. type AvailabilityZone struct { _ struct{} `type:"structure"` // For Availability Zones, this parameter has the same value as the Region name. // // For Local Zones, the name of the associated group, for example us-west-2-lax-1. + // + // For Wavelength Zones, the name of the associated group, for example us-east-1-wl1-bos-wlz-1. GroupName *string `locationName:"groupName" type:"string"` - // Any messages about the Availability Zone or Local Zone. + // Any messages about the Availability Zone, Local Zone, or Wavelength Zone. Messages []*AvailabilityZoneMessage `locationName:"messageSet" locationNameList:"item" type:"list"` - // The name of the location from which the address is advertised. + // The name of the network border group. NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` // For Availability Zones, this parameter always has the value of opt-in-not-required. // - // For Local Zones, this parameter is the opt in status. The possible values - // are opted-in, and not-opted-in. + // For Local Zones and Wavelength Zones, this parameter is the opt-in status. + // The possible values are opted-in, and not-opted-in. OptInStatus *string `locationName:"optInStatus" type:"string" enum:"AvailabilityZoneOptInStatus"` + // The ID of the zone that handles some of the Local Zone or Wavelength Zone + // control plane operations, such as API calls. + ParentZoneId *string `locationName:"parentZoneId" type:"string"` + + // The name of the zone that handles some of the Local Zone or Wavelength Zone + // control plane operations, such as API calls. + ParentZoneName *string `locationName:"parentZoneName" type:"string"` + // The name of the Region. RegionName *string `locationName:"regionName" type:"string"` - // The state of the Availability Zone or Local Zone. + // The state of the Availability Zone, Local Zone, or Wavelength Zone. State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` - // The ID of the Availability Zone or Local Zone. + // The ID of the Availability Zone, Local Zone, or Wavelength Zone. ZoneId *string `locationName:"zoneId" type:"string"` - // The name of the Availability Zone or Local Zone. + // The name of the Availability Zone, Local Zone, or Wavelength Zone. ZoneName *string `locationName:"zoneName" type:"string"` + + // The type of zone. The valid values are availability-zone, local-zone, and + // wavelength-zone. + ZoneType *string `locationName:"zoneType" type:"string"` } // String returns the string representation @@ -40725,6 +42466,18 @@ func (s *AvailabilityZone) SetOptInStatus(v string) *AvailabilityZone { return s } +// SetParentZoneId sets the ParentZoneId field's value. +func (s *AvailabilityZone) SetParentZoneId(v string) *AvailabilityZone { + s.ParentZoneId = &v + return s +} + +// SetParentZoneName sets the ParentZoneName field's value. +func (s *AvailabilityZone) SetParentZoneName(v string) *AvailabilityZone { + s.ParentZoneName = &v + return s +} + // SetRegionName sets the RegionName field's value. func (s *AvailabilityZone) SetRegionName(v string) *AvailabilityZone { s.RegionName = &v @@ -40749,11 +42502,18 @@ func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { return s } -// Describes a message about an Availability Zone or Local Zone. +// SetZoneType sets the ZoneType field's value. +func (s *AvailabilityZone) SetZoneType(v string) *AvailabilityZone { + s.ZoneType = &v + return s +} + +// Describes a message about an Availability Zone, Local Zone, or Wavelength +// Zone. type AvailabilityZoneMessage struct { _ struct{} `type:"structure"` - // The message about the Availability Zone or Local Zone. + // The message about the Availability Zone, Local Zone, or Wavelength Zone. Message *string `locationName:"message" type:"string"` } @@ -42136,6 +43896,39 @@ func (s *CapacityReservation) SetTotalInstanceCount(v int64) *CapacityReservatio return s } +// Describes a resource group to which a Capacity Reservation has been added. +type CapacityReservationGroup struct { + _ struct{} `type:"structure"` + + // The ARN of the resource group. + GroupArn *string `locationName:"groupArn" type:"string"` + + // The ID of the AWS account that owns the resource group. + OwnerId *string `locationName:"ownerId" type:"string"` +} + +// String returns the string representation +func (s CapacityReservationGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CapacityReservationGroup) GoString() string { + return s.String() +} + +// SetGroupArn sets the GroupArn field's value. +func (s *CapacityReservationGroup) SetGroupArn(v string) *CapacityReservationGroup { + s.GroupArn = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *CapacityReservationGroup) SetOwnerId(v string) *CapacityReservationGroup { + s.OwnerId = &v + return s +} + // Describes the strategy for using unused Capacity Reservations for fulfilling // On-Demand capacity. // @@ -42234,7 +44027,7 @@ func (s *CapacityReservationOptionsRequest) SetUsageStrategy(v string) *Capacity // to run as an On-Demand Instance or to run in any open Capacity Reservation // that has matching attributes (instance type, platform, Availability Zone). // Use the CapacityReservationTarget parameter to explicitly target a specific -// Capacity Reservation. +// Capacity Reservation or a Capacity Reservation group. type CapacityReservationSpecification struct { _ struct{} `type:"structure"` @@ -42248,7 +44041,8 @@ type CapacityReservationSpecification struct { // one is available. The instance runs as an On-Demand Instance. CapacityReservationPreference *string `type:"string" enum:"CapacityReservationPreference"` - // Information about the target Capacity Reservation. + // Information about the target Capacity Reservation or Capacity Reservation + // group. CapacityReservationTarget *CapacityReservationTarget `type:"structure"` } @@ -42279,7 +44073,8 @@ func (s *CapacityReservationSpecification) SetCapacityReservationTarget(v *Capac // instance is configured to run in On-Demand capacity, or if it is configured // in run in any open Capacity Reservation that has matching attributes (instance // type, platform, Availability Zone). The action returns the capacityReservationTarget -// response element if the instance explicily targets a specific Capacity Reservation. +// response element if the instance explicily targets a specific Capacity Reservation +// or Capacity Reservation group. type CapacityReservationSpecificationResponse struct { _ struct{} `type:"structure"` @@ -42293,7 +44088,8 @@ type CapacityReservationSpecificationResponse struct { // one is available. The instance runs in On-Demand capacity. CapacityReservationPreference *string `locationName:"capacityReservationPreference" type:"string" enum:"CapacityReservationPreference"` - // Information about the targeted Capacity Reservation. + // Information about the targeted Capacity Reservation or Capacity Reservation + // group. CapacityReservationTarget *CapacityReservationTargetResponse `locationName:"capacityReservationTarget" type:"structure"` } @@ -42319,12 +44115,15 @@ func (s *CapacityReservationSpecificationResponse) SetCapacityReservationTarget( return s } -// Describes a target Capacity Reservation. +// Describes a target Capacity Reservation or Capacity Reservation group. type CapacityReservationTarget struct { _ struct{} `type:"structure"` - // The ID of the Capacity Reservation. + // The ID of the Capacity Reservation in which to run the instance. CapacityReservationId *string `type:"string"` + + // The ARN of the Capacity Reservation resource group in which to run the instance. + CapacityReservationResourceGroupArn *string `type:"string"` } // String returns the string representation @@ -42343,12 +44142,21 @@ func (s *CapacityReservationTarget) SetCapacityReservationId(v string) *Capacity return s } -// Describes a target Capacity Reservation. +// SetCapacityReservationResourceGroupArn sets the CapacityReservationResourceGroupArn field's value. +func (s *CapacityReservationTarget) SetCapacityReservationResourceGroupArn(v string) *CapacityReservationTarget { + s.CapacityReservationResourceGroupArn = &v + return s +} + +// Describes a target Capacity Reservation or Capacity Reservation group. type CapacityReservationTargetResponse struct { _ struct{} `type:"structure"` - // The ID of the Capacity Reservation. + // The ID of the targeted Capacity Reservation. CapacityReservationId *string `locationName:"capacityReservationId" type:"string"` + + // The ARN of the targeted Capacity Reservation group. + CapacityReservationResourceGroupArn *string `locationName:"capacityReservationResourceGroupArn" type:"string"` } // String returns the string representation @@ -42367,6 +44175,72 @@ func (s *CapacityReservationTargetResponse) SetCapacityReservationId(v string) * return s } +// SetCapacityReservationResourceGroupArn sets the CapacityReservationResourceGroupArn field's value. +func (s *CapacityReservationTargetResponse) SetCapacityReservationResourceGroupArn(v string) *CapacityReservationTargetResponse { + s.CapacityReservationResourceGroupArn = &v + return s +} + +// Describes a carrier gateway. +type CarrierGateway struct { + _ struct{} `type:"structure"` + + // The ID of the carrier gateway. + CarrierGatewayId *string `locationName:"carrierGatewayId" type:"string"` + + // The AWS account ID of the owner of the carrier gateway. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The state of the carrier gateway. + State *string `locationName:"state" type:"string" enum:"CarrierGatewayState"` + + // The tags assigned to the carrier gateway. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC associated with the carrier gateway. + VpcId *string `locationName:"vpcId" type:"string"` +} + +// String returns the string representation +func (s CarrierGateway) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CarrierGateway) GoString() string { + return s.String() +} + +// SetCarrierGatewayId sets the CarrierGatewayId field's value. +func (s *CarrierGateway) SetCarrierGatewayId(v string) *CarrierGateway { + s.CarrierGatewayId = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *CarrierGateway) SetOwnerId(v string) *CarrierGateway { + s.OwnerId = &v + return s +} + +// SetState sets the State field's value. +func (s *CarrierGateway) SetState(v string) *CarrierGateway { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CarrierGateway) SetTags(v []*Tag) *CarrierGateway { + s.Tags = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *CarrierGateway) SetVpcId(v string) *CarrierGateway { + s.VpcId = &v + return s +} + // Information about the client certificate used for authentication. type CertificateAuthentication struct { _ struct{} `type:"structure"` @@ -43450,6 +45324,9 @@ type CoipPool struct { // The ID of the local gateway route table. LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` + // The ARN of the address pool. + PoolArn *string `locationName:"poolArn" min:"1" type:"string"` + // The address ranges of the address pool. PoolCidrs []*string `locationName:"poolCidrSet" locationNameList:"item" type:"list"` @@ -43476,6 +45353,12 @@ func (s *CoipPool) SetLocalGatewayRouteTableId(v string) *CoipPool { return s } +// SetPoolArn sets the PoolArn field's value. +func (s *CoipPool) SetPoolArn(v string) *CoipPool { + s.PoolArn = &v + return s +} + // SetPoolCidrs sets the PoolCidrs field's value. func (s *CoipPool) SetPoolCidrs(v []*string) *CoipPool { s.PoolCidrs = v @@ -43596,7 +45479,8 @@ func (s *ConfirmProductInstanceOutput) SetReturn(v bool) *ConfirmProductInstance type ConnectionLogOptions struct { _ struct{} `type:"structure"` - // The name of the CloudWatch Logs log group. + // The name of the CloudWatch Logs log group. Required if connection logging + // is enabled. CloudwatchLogGroup *string `type:"string"` // The name of the CloudWatch Logs log stream to which the connection data is @@ -44397,8 +46281,6 @@ type CreateCapacityReservationInput struct { // Unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraint: Maximum 64 ASCII characters. ClientToken *string `type:"string"` // Checks whether you have the required permissions for the action, without @@ -44626,6 +46508,98 @@ func (s *CreateCapacityReservationOutput) SetCapacityReservation(v *CapacityRese return s } +type CreateCarrierGatewayInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The tags to associate with the carrier gateway. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The ID of the VPC to associate with the carrier gateway. + // + // VpcId is a required field + VpcId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateCarrierGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCarrierGatewayInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCarrierGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCarrierGatewayInput"} + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateCarrierGatewayInput) SetClientToken(v string) *CreateCarrierGatewayInput { + s.ClientToken = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateCarrierGatewayInput) SetDryRun(v bool) *CreateCarrierGatewayInput { + s.DryRun = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateCarrierGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateCarrierGatewayInput { + s.TagSpecifications = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *CreateCarrierGatewayInput) SetVpcId(v string) *CreateCarrierGatewayInput { + s.VpcId = &v + return s +} + +type CreateCarrierGatewayOutput struct { + _ struct{} `type:"structure"` + + // Information about the carrier gateway. + CarrierGateway *CarrierGateway `locationName:"carrierGateway" type:"structure"` +} + +// String returns the string representation +func (s CreateCarrierGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCarrierGatewayOutput) GoString() string { + return s.String() +} + +// SetCarrierGateway sets the CarrierGateway field's value. +func (s *CreateCarrierGatewayOutput) SetCarrierGateway(v *CarrierGateway) *CreateCarrierGatewayOutput { + s.CarrierGateway = v + return s +} + type CreateClientVpnEndpointInput struct { _ struct{} `type:"structure"` @@ -45034,6 +47008,9 @@ type CreateCustomerGatewayInput struct { // The address must be static. PublicIp *string `locationName:"IpAddress" type:"string"` + // The tags to apply to the customer gateway. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The type of VPN connection that this customer gateway supports (ipsec.1). // // Type is a required field @@ -45096,6 +47073,12 @@ func (s *CreateCustomerGatewayInput) SetPublicIp(v string) *CreateCustomerGatewa return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateCustomerGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateCustomerGatewayInput { + s.TagSpecifications = v + return s +} + // SetType sets the Type field's value. func (s *CreateCustomerGatewayInput) SetType(v string) *CreateCustomerGatewayInput { s.Type = &v @@ -45261,6 +47244,9 @@ type CreateDhcpOptionsInput struct { // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The tags to assign to the DHCP option. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -45298,6 +47284,12 @@ func (s *CreateDhcpOptionsInput) SetDryRun(v bool) *CreateDhcpOptionsInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateDhcpOptionsInput) SetTagSpecifications(v []*TagSpecification) *CreateDhcpOptionsInput { + s.TagSpecifications = v + return s +} + type CreateDhcpOptionsOutput struct { _ struct{} `type:"structure"` @@ -45334,6 +47326,9 @@ type CreateEgressOnlyInternetGatewayInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` + // The tags to assign to the egress-only internet gateway. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the VPC for which to create the egress-only internet gateway. // // VpcId is a required field @@ -45375,6 +47370,12 @@ func (s *CreateEgressOnlyInternetGatewayInput) SetDryRun(v bool) *CreateEgressOn return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateEgressOnlyInternetGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateEgressOnlyInternetGatewayInput { + s.TagSpecifications = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *CreateEgressOnlyInternetGatewayInput) SetVpcId(v string) *CreateEgressOnlyInternetGatewayInput { s.VpcId = &v @@ -46261,7 +48262,7 @@ type CreateInstanceExportTaskInput struct { _ struct{} `type:"structure"` // A description for the conversion task or the resource being exported. The - // maximum length is 255 bytes. + // maximum length is 255 characters. Description *string `locationName:"description" type:"string"` // The format and location for an instance export task. @@ -46272,6 +48273,9 @@ type CreateInstanceExportTaskInput struct { // InstanceId is a required field InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + // The tags to apply to the instance export task during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The target virtualization environment. TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` } @@ -46317,6 +48321,12 @@ func (s *CreateInstanceExportTaskInput) SetInstanceId(v string) *CreateInstanceE return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateInstanceExportTaskInput) SetTagSpecifications(v []*TagSpecification) *CreateInstanceExportTaskInput { + s.TagSpecifications = v + return s +} + // SetTargetEnvironment sets the TargetEnvironment field's value. func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateInstanceExportTaskInput { s.TargetEnvironment = &v @@ -46354,6 +48364,9 @@ type CreateInternetGatewayInput struct { // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The tags to assign to the internet gateway. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -46372,6 +48385,12 @@ func (s *CreateInternetGatewayInput) SetDryRun(v bool) *CreateInternetGatewayInp return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateInternetGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateInternetGatewayInput { + s.TagSpecifications = v + return s +} + type CreateInternetGatewayOutput struct { _ struct{} `type:"structure"` @@ -46996,6 +49015,151 @@ func (s *CreateLocalGatewayRouteTableVpcAssociationOutput) SetLocalGatewayRouteT return s } +type CreateManagedPrefixListInput struct { + _ struct{} `type:"structure"` + + // The IP address type. + // + // Valid Values: IPv4 | IPv6 + // + // AddressFamily is a required field + AddressFamily *string `type:"string" required:"true"` + + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // + // Constraints: Up to 255 UTF-8 characters in length. + ClientToken *string `type:"string" idempotencyToken:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more entries for the prefix list. + Entries []*AddPrefixListEntry `locationName:"Entry" type:"list"` + + // The maximum number of entries for the prefix list. + // + // MaxEntries is a required field + MaxEntries *int64 `type:"integer" required:"true"` + + // A name for the prefix list. + // + // Constraints: Up to 255 characters in length. The name cannot start with com.amazonaws. + // + // PrefixListName is a required field + PrefixListName *string `type:"string" required:"true"` + + // The tags to apply to the prefix list during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s CreateManagedPrefixListInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateManagedPrefixListInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateManagedPrefixListInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateManagedPrefixListInput"} + if s.AddressFamily == nil { + invalidParams.Add(request.NewErrParamRequired("AddressFamily")) + } + if s.MaxEntries == nil { + invalidParams.Add(request.NewErrParamRequired("MaxEntries")) + } + if s.PrefixListName == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListName")) + } + if s.Entries != nil { + for i, v := range s.Entries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAddressFamily sets the AddressFamily field's value. +func (s *CreateManagedPrefixListInput) SetAddressFamily(v string) *CreateManagedPrefixListInput { + s.AddressFamily = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateManagedPrefixListInput) SetClientToken(v string) *CreateManagedPrefixListInput { + s.ClientToken = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateManagedPrefixListInput) SetDryRun(v bool) *CreateManagedPrefixListInput { + s.DryRun = &v + return s +} + +// SetEntries sets the Entries field's value. +func (s *CreateManagedPrefixListInput) SetEntries(v []*AddPrefixListEntry) *CreateManagedPrefixListInput { + s.Entries = v + return s +} + +// SetMaxEntries sets the MaxEntries field's value. +func (s *CreateManagedPrefixListInput) SetMaxEntries(v int64) *CreateManagedPrefixListInput { + s.MaxEntries = &v + return s +} + +// SetPrefixListName sets the PrefixListName field's value. +func (s *CreateManagedPrefixListInput) SetPrefixListName(v string) *CreateManagedPrefixListInput { + s.PrefixListName = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateManagedPrefixListInput) SetTagSpecifications(v []*TagSpecification) *CreateManagedPrefixListInput { + s.TagSpecifications = v + return s +} + +type CreateManagedPrefixListOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list. + PrefixList *ManagedPrefixList `locationName:"prefixList" type:"structure"` +} + +// String returns the string representation +func (s CreateManagedPrefixListOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateManagedPrefixListOutput) GoString() string { + return s.String() +} + +// SetPrefixList sets the PrefixList field's value. +func (s *CreateManagedPrefixListOutput) SetPrefixList(v *ManagedPrefixList) *CreateManagedPrefixListOutput { + s.PrefixList = v + return s +} + type CreateNatGatewayInput struct { _ struct{} `type:"structure"` @@ -47120,6 +49284,8 @@ type CreateNetworkAclEntryInput struct { _ struct{} `type:"structure"` // The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). + // We modify the specified CIDR block to its canonical form; for example, if + // you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. CidrBlock *string `locationName:"cidrBlock" type:"string"` // Checks whether you have the required permissions for the action, without @@ -47294,6 +49460,9 @@ type CreateNetworkAclInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The tags to assign to the network ACL. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the VPC. // // VpcId is a required field @@ -47329,6 +49498,12 @@ func (s *CreateNetworkAclInput) SetDryRun(v bool) *CreateNetworkAclInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateNetworkAclInput) SetTagSpecifications(v []*TagSpecification) *CreateNetworkAclInput { + s.TagSpecifications = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput { s.VpcId = &v @@ -47415,6 +49590,9 @@ type CreateNetworkInterfaceInput struct { // // SubnetId is a required field SubnetId *string `locationName:"subnetId" type:"string" required:"true"` + + // The tags to apply to the new network interface. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -47500,6 +49678,12 @@ func (s *CreateNetworkInterfaceInput) SetSubnetId(v string) *CreateNetworkInterf return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateNetworkInterfaceInput) SetTagSpecifications(v []*TagSpecification) *CreateNetworkInterfaceInput { + s.TagSpecifications = v + return s +} + // Contains the output of CreateNetworkInterface. type CreateNetworkInterfaceOutput struct { _ struct{} `type:"structure"` @@ -47833,14 +50017,25 @@ func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v [] type CreateRouteInput struct { _ struct{} `type:"structure"` + // The ID of the carrier gateway. + // + // You can only use this option when the VPC contains a subnet which is associated + // with a Wavelength Zone. + CarrierGatewayId *string `type:"string"` + // The IPv4 CIDR address block used for the destination match. Routing decisions - // are based on the most specific match. + // are based on the most specific match. We modify the specified CIDR block + // to its canonical form; for example, if you specify 100.68.0.18/18, we modify + // it to 100.68.0.0/18. DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` // The IPv6 CIDR block used for the destination match. Routing decisions are // based on the most specific match. DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` + // The ID of a prefix list used for the destination match. + DestinationPrefixListId *string `type:"string"` + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -47902,6 +50097,12 @@ func (s *CreateRouteInput) Validate() error { return nil } +// SetCarrierGatewayId sets the CarrierGatewayId field's value. +func (s *CreateRouteInput) SetCarrierGatewayId(v string) *CreateRouteInput { + s.CarrierGatewayId = &v + return s +} + // SetDestinationCidrBlock sets the DestinationCidrBlock field's value. func (s *CreateRouteInput) SetDestinationCidrBlock(v string) *CreateRouteInput { s.DestinationCidrBlock = &v @@ -47914,6 +50115,12 @@ func (s *CreateRouteInput) SetDestinationIpv6CidrBlock(v string) *CreateRouteInp return s } +// SetDestinationPrefixListId sets the DestinationPrefixListId field's value. +func (s *CreateRouteInput) SetDestinationPrefixListId(v string) *CreateRouteInput { + s.DestinationPrefixListId = &v + return s +} + // SetDryRun sets the DryRun field's value. func (s *CreateRouteInput) SetDryRun(v bool) *CreateRouteInput { s.DryRun = &v @@ -48006,6 +50213,9 @@ type CreateRouteTableInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The tags to assign to the route table. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the VPC. // // VpcId is a required field @@ -48041,6 +50251,12 @@ func (s *CreateRouteTableInput) SetDryRun(v bool) *CreateRouteTableInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateRouteTableInput) SetTagSpecifications(v []*TagSpecification) *CreateRouteTableInput { + s.TagSpecifications = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput { s.VpcId = &v @@ -48101,6 +50317,9 @@ type CreateSecurityGroupInput struct { // GroupName is a required field GroupName *string `type:"string" required:"true"` + // The tags to assign to the security group. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. VpcId *string `type:"string"` } @@ -48149,6 +50368,12 @@ func (s *CreateSecurityGroupInput) SetGroupName(v string) *CreateSecurityGroupIn return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateSecurityGroupInput) SetTagSpecifications(v []*TagSpecification) *CreateSecurityGroupInput { + s.TagSpecifications = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *CreateSecurityGroupInput) SetVpcId(v string) *CreateSecurityGroupInput { s.VpcId = &v @@ -48160,6 +50385,9 @@ type CreateSecurityGroupOutput struct { // The ID of the security group. GroupId *string `locationName:"groupId" type:"string"` + + // The tags assigned to the security group. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -48178,6 +50406,12 @@ func (s *CreateSecurityGroupOutput) SetGroupId(v string) *CreateSecurityGroupOut return s } +// SetTags sets the Tags field's value. +func (s *CreateSecurityGroupOutput) SetTags(v []*Tag) *CreateSecurityGroupOutput { + s.Tags = v + return s +} + type CreateSnapshotInput struct { _ struct{} `type:"structure"` @@ -48451,6 +50685,8 @@ type CreateSubnetInput struct { AvailabilityZoneId *string `type:"string"` // The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. + // We modify the specified CIDR block to its canonical form; for example, if + // you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. // // CidrBlock is a required field CidrBlock *string `type:"string" required:"true"` @@ -48469,6 +50705,9 @@ type CreateSubnetInput struct { // ARN, you must also specify the Availability Zone of the Outpost subnet. OutpostArn *string `type:"string"` + // The tags to assign to the subnet. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the VPC. // // VpcId is a required field @@ -48537,6 +50776,12 @@ func (s *CreateSubnetInput) SetOutpostArn(v string) *CreateSubnetInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateSubnetInput) SetTagSpecifications(v []*TagSpecification) *CreateSubnetInput { + s.TagSpecifications = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *CreateSubnetInput) SetVpcId(v string) *CreateSubnetInput { s.VpcId = &v @@ -49513,6 +51758,111 @@ func (s *CreateTransitGatewayPeeringAttachmentOutput) SetTransitGatewayPeeringAt return s } +type CreateTransitGatewayPrefixListReferenceInput struct { + _ struct{} `type:"structure"` + + // Indicates whether to drop traffic that matches this route. + Blackhole *bool `type:"boolean"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the prefix list that is used for destination matches. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` + + // The ID of the attachment to which traffic is routed. + TransitGatewayAttachmentId *string `type:"string"` + + // The ID of the transit gateway route table. + // + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTransitGatewayPrefixListReferenceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayPrefixListReferenceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTransitGatewayPrefixListReferenceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayPrefixListReferenceInput"} + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBlackhole sets the Blackhole field's value. +func (s *CreateTransitGatewayPrefixListReferenceInput) SetBlackhole(v bool) *CreateTransitGatewayPrefixListReferenceInput { + s.Blackhole = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateTransitGatewayPrefixListReferenceInput) SetDryRun(v bool) *CreateTransitGatewayPrefixListReferenceInput { + s.DryRun = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *CreateTransitGatewayPrefixListReferenceInput) SetPrefixListId(v string) *CreateTransitGatewayPrefixListReferenceInput { + s.PrefixListId = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *CreateTransitGatewayPrefixListReferenceInput) SetTransitGatewayAttachmentId(v string) *CreateTransitGatewayPrefixListReferenceInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *CreateTransitGatewayPrefixListReferenceInput) SetTransitGatewayRouteTableId(v string) *CreateTransitGatewayPrefixListReferenceInput { + s.TransitGatewayRouteTableId = &v + return s +} + +type CreateTransitGatewayPrefixListReferenceOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list reference. + TransitGatewayPrefixListReference *TransitGatewayPrefixListReference `locationName:"transitGatewayPrefixListReference" type:"structure"` +} + +// String returns the string representation +func (s CreateTransitGatewayPrefixListReferenceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransitGatewayPrefixListReferenceOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayPrefixListReference sets the TransitGatewayPrefixListReference field's value. +func (s *CreateTransitGatewayPrefixListReferenceOutput) SetTransitGatewayPrefixListReference(v *TransitGatewayPrefixListReference) *CreateTransitGatewayPrefixListReferenceOutput { + s.TransitGatewayPrefixListReference = v + return s +} + type CreateTransitGatewayRouteInput struct { _ struct{} `type:"structure"` @@ -49873,22 +52223,22 @@ type CreateVolumeInput struct { // Specifies whether the volume should be encrypted. The effect of setting the // encryption state to true depends on the volume origin (new or from a snapshot), // starting encryption state, ownership, and whether encryption by default is - // enabled. For more information, see Encryption by Default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) + // enabled. For more information, see Encryption by default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) // in the Amazon Elastic Compute Cloud User Guide. // // Encrypted Amazon EBS volumes must be attached to instances that support Amazon - // EBS encryption. For more information, see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + // EBS encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). Encrypted *bool `locationName:"encrypted" type:"boolean"` - // The number of I/O operations per second (IOPS) to provision for the volume, - // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes - // in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based - // instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // The number of I/O operations per second (IOPS) to provision for an io1 or + // io2 volume, with a maximum ratio of 50 IOPS/GiB for io1, and 500 IOPS/GiB + // for io2. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum + // IOPS of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // - // This parameter is valid only for Provisioned IOPS SSD (io1) volumes. + // This parameter is valid only for Provisioned IOPS SSD (io1 and io2) volumes. Iops *int64 `type:"integer"` // The identifier of the AWS Key Management Service (AWS KMS) customer master @@ -49924,9 +52274,9 @@ type CreateVolumeInput struct { // The size of the volume, in GiBs. You must specify either a snapshot ID or // a volume size. // - // Constraints: 1-16,384 for gp2, 4-16,384 for io1, 500-16,384 for st1, 500-16,384 - // for sc1, and 1-1,024 for standard. If you specify a snapshot, the volume - // size must be equal to or larger than the snapshot size. + // Constraints: 1-16,384 for gp2, 4-16,384 for io1 and io2, 500-16,384 for st1, + // 500-16,384 for sc1, and 1-1,024 for standard. If you specify a snapshot, + // the volume size must be equal to or larger than the snapshot size. // // Default: If you're creating the volume from a snapshot and don't specify // a volume size, the default is the snapshot size. @@ -49939,9 +52289,9 @@ type CreateVolumeInput struct { // The tags to apply to the volume during creation. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned - // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard - // for Magnetic volumes. + // The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for + // Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, + // or standard for Magnetic volumes. // // Default: gp2 VolumeType *string `type:"string" enum:"VolumeType"` @@ -50551,6 +52901,8 @@ type CreateVpcInput struct { AmazonProvidedIpv6CidrBlock *bool `locationName:"amazonProvidedIpv6CidrBlock" type:"boolean"` // The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. + // We modify the specified CIDR block to its canonical form; for example, if + // you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. // // CidrBlock is a required field CidrBlock *string `type:"string" required:"true"` @@ -50587,6 +52939,9 @@ type CreateVpcInput struct { // The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. Ipv6Pool *string `type:"string"` + + // The tags to assign to the VPC. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -50654,6 +53009,12 @@ func (s *CreateVpcInput) SetIpv6Pool(v string) *CreateVpcInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVpcInput) SetTagSpecifications(v []*TagSpecification) *CreateVpcInput { + s.TagSpecifications = v + return s +} + type CreateVpcOutput struct { _ struct{} `type:"structure"` @@ -50701,6 +53062,9 @@ type CreateVpcPeeringConnectionInput struct { // You must specify this parameter in the request. PeerVpcId *string `locationName:"peerVpcId" type:"string"` + // The tags to assign to the peering connection. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the requester VPC. You must specify this parameter in the request. VpcId *string `locationName:"vpcId" type:"string"` } @@ -50739,6 +53103,12 @@ func (s *CreateVpcPeeringConnectionInput) SetPeerVpcId(v string) *CreateVpcPeeri return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVpcPeeringConnectionInput) SetTagSpecifications(v []*TagSpecification) *CreateVpcPeeringConnectionInput { + s.TagSpecifications = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *CreateVpcPeeringConnectionInput) SetVpcId(v string) *CreateVpcPeeringConnectionInput { s.VpcId = &v @@ -50786,6 +53156,9 @@ type CreateVpnConnectionInput struct { // The options for the VPN connection. Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` + // The tags to apply to the VPN connection. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the transit gateway. If you specify a transit gateway, you cannot // specify a virtual private gateway. TransitGatewayId *string `type:"string"` @@ -50844,6 +53217,12 @@ func (s *CreateVpnConnectionInput) SetOptions(v *VpnConnectionOptionsSpecificati return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVpnConnectionInput) SetTagSpecifications(v []*TagSpecification) *CreateVpnConnectionInput { + s.TagSpecifications = v + return s +} + // SetTransitGatewayId sets the TransitGatewayId field's value. func (s *CreateVpnConnectionInput) SetTransitGatewayId(v string) *CreateVpnConnectionInput { s.TransitGatewayId = &v @@ -50973,6 +53352,9 @@ type CreateVpnGatewayInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The tags to apply to the virtual private gateway. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The type of VPN connection this virtual private gateway supports. // // Type is a required field @@ -51020,6 +53402,12 @@ func (s *CreateVpnGatewayInput) SetDryRun(v bool) *CreateVpnGatewayInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVpnGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateVpnGatewayInput { + s.TagSpecifications = v + return s +} + // SetType sets the Type field's value. func (s *CreateVpnGatewayInput) SetType(v string) *CreateVpnGatewayInput { s.Type = &v @@ -51050,12 +53438,12 @@ func (s *CreateVpnGatewayOutput) SetVpnGateway(v *VpnGateway) *CreateVpnGatewayO return s } -// Describes the credit option for CPU usage of a T2 or T3 instance. +// Describes the credit option for CPU usage of a T2, T3, or T3a instance. type CreditSpecification struct { _ struct{} `type:"structure"` - // The credit option for CPU usage of a T2 or T3 instance. Valid values are - // standard and unlimited. + // The credit option for CPU usage of a T2, T3, or T3a instance. Valid values + // are standard and unlimited. CpuCredits *string `locationName:"cpuCredits" type:"string"` } @@ -51075,12 +53463,12 @@ func (s *CreditSpecification) SetCpuCredits(v string) *CreditSpecification { return s } -// The credit option for CPU usage of a T2 or T3 instance. +// The credit option for CPU usage of a T2, T3, or T3a instance. type CreditSpecificationRequest struct { _ struct{} `type:"structure"` - // The credit option for CPU usage of a T2 or T3 instance. Valid values are - // standard and unlimited. + // The credit option for CPU usage of a T2, T3, or T3a instance. Valid values + // are standard and unlimited. // // CpuCredits is a required field CpuCredits *string `type:"string" required:"true"` @@ -51204,6 +53592,79 @@ func (s *CustomerGateway) SetType(v string) *CustomerGateway { return s } +type DeleteCarrierGatewayInput struct { + _ struct{} `type:"structure"` + + // The ID of the carrier gateway. + // + // CarrierGatewayId is a required field + CarrierGatewayId *string `type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` +} + +// String returns the string representation +func (s DeleteCarrierGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCarrierGatewayInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCarrierGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCarrierGatewayInput"} + if s.CarrierGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("CarrierGatewayId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCarrierGatewayId sets the CarrierGatewayId field's value. +func (s *DeleteCarrierGatewayInput) SetCarrierGatewayId(v string) *DeleteCarrierGatewayInput { + s.CarrierGatewayId = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteCarrierGatewayInput) SetDryRun(v bool) *DeleteCarrierGatewayInput { + s.DryRun = &v + return s +} + +type DeleteCarrierGatewayOutput struct { + _ struct{} `type:"structure"` + + // Information about the carrier gateway. + CarrierGateway *CarrierGateway `locationName:"carrierGateway" type:"structure"` +} + +// String returns the string representation +func (s DeleteCarrierGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCarrierGatewayOutput) GoString() string { + return s.String() +} + +// SetCarrierGateway sets the CarrierGateway field's value. +func (s *DeleteCarrierGatewayOutput) SetCarrierGateway(v *CarrierGateway) *DeleteCarrierGatewayOutput { + s.CarrierGateway = v + return s +} + type DeleteClientVpnEndpointInput struct { _ struct{} `type:"structure"` @@ -52490,6 +54951,79 @@ func (s *DeleteLocalGatewayRouteTableVpcAssociationOutput) SetLocalGatewayRouteT return s } +type DeleteManagedPrefixListInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteManagedPrefixListInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteManagedPrefixListInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteManagedPrefixListInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteManagedPrefixListInput"} + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteManagedPrefixListInput) SetDryRun(v bool) *DeleteManagedPrefixListInput { + s.DryRun = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *DeleteManagedPrefixListInput) SetPrefixListId(v string) *DeleteManagedPrefixListInput { + s.PrefixListId = &v + return s +} + +type DeleteManagedPrefixListOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list. + PrefixList *ManagedPrefixList `locationName:"prefixList" type:"structure"` +} + +// String returns the string representation +func (s DeleteManagedPrefixListOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteManagedPrefixListOutput) GoString() string { + return s.String() +} + +// SetPrefixList sets the PrefixList field's value. +func (s *DeleteManagedPrefixListOutput) SetPrefixList(v *ManagedPrefixList) *DeleteManagedPrefixListOutput { + s.PrefixList = v + return s +} + type DeleteNatGatewayInput struct { _ struct{} `type:"structure"` @@ -53063,6 +55597,9 @@ type DeleteRouteInput struct { // for the route exactly. DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` + // The ID of the prefix list for the route. + DestinationPrefixListId *string `type:"string"` + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -53110,6 +55647,12 @@ func (s *DeleteRouteInput) SetDestinationIpv6CidrBlock(v string) *DeleteRouteInp return s } +// SetDestinationPrefixListId sets the DestinationPrefixListId field's value. +func (s *DeleteRouteInput) SetDestinationPrefixListId(v string) *DeleteRouteInput { + s.DestinationPrefixListId = &v + return s +} + // SetDryRun sets the DryRun field's value. func (s *DeleteRouteInput) SetDryRun(v bool) *DeleteRouteInput { s.DryRun = &v @@ -54022,6 +56565,93 @@ func (s *DeleteTransitGatewayPeeringAttachmentOutput) SetTransitGatewayPeeringAt return s } +type DeleteTransitGatewayPrefixListReferenceInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` + + // The ID of the route table. + // + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTransitGatewayPrefixListReferenceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayPrefixListReferenceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTransitGatewayPrefixListReferenceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayPrefixListReferenceInput"} + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DeleteTransitGatewayPrefixListReferenceInput) SetDryRun(v bool) *DeleteTransitGatewayPrefixListReferenceInput { + s.DryRun = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *DeleteTransitGatewayPrefixListReferenceInput) SetPrefixListId(v string) *DeleteTransitGatewayPrefixListReferenceInput { + s.PrefixListId = &v + return s +} + +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *DeleteTransitGatewayPrefixListReferenceInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayPrefixListReferenceInput { + s.TransitGatewayRouteTableId = &v + return s +} + +type DeleteTransitGatewayPrefixListReferenceOutput struct { + _ struct{} `type:"structure"` + + // Information about the deleted prefix list reference. + TransitGatewayPrefixListReference *TransitGatewayPrefixListReference `locationName:"transitGatewayPrefixListReference" type:"structure"` +} + +// String returns the string representation +func (s DeleteTransitGatewayPrefixListReferenceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayPrefixListReferenceOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayPrefixListReference sets the TransitGatewayPrefixListReference field's value. +func (s *DeleteTransitGatewayPrefixListReferenceOutput) SetTransitGatewayPrefixListReference(v *TransitGatewayPrefixListReference) *DeleteTransitGatewayPrefixListReferenceOutput { + s.TransitGatewayPrefixListReference = v + return s +} + type DeleteTransitGatewayRouteInput struct { _ struct{} `type:"structure"` @@ -55342,7 +57972,8 @@ type DescribeAddressesInput struct { // * instance-id - The ID of the instance the address is associated with, // if any. // - // * network-border-group - The location from where the IP address is advertised. + // * network-border-group - A unique set of Availability Zones, Local Zones, + // or Wavelength Zones from where AWS advertises IP addresses. // // * network-interface-id - [EC2-VPC] The ID of the network interface that // the address is associated with, if any. @@ -55352,7 +57983,7 @@ type DescribeAddressesInput struct { // * private-ip-address - [EC2-VPC] The private IP address associated with // the Elastic IP address. // - // * public-ip - The Elastic IP address. + // * public-ip - The Elastic IP address, or the carrier IP address. // // * tag: - The key/value combination of a tag assigned to the resource. // Use the tag key in the filter name and the tag value as the filter value. @@ -55491,8 +58122,8 @@ func (s *DescribeAggregateIdFormatOutput) SetUseLongIdsAggregated(v bool) *Descr type DescribeAvailabilityZonesInput struct { _ struct{} `type:"structure"` - // Include all Availability Zones and Local Zones regardless of your opt in - // status. + // Include all Availability Zones, Local Zones, and Wavelength Zones regardless + // of your opt-in status. // // If you do not use this parameter, the results include only the zones for // the Regions where you have chosen the option to opt in. @@ -55508,29 +58139,41 @@ type DescribeAvailabilityZonesInput struct { // // * group-name - For Availability Zones, use the Region name. For Local // Zones, use the name of the group associated with the Local Zone (for example, - // us-west-2-lax-1). + // us-west-2-lax-1) For Wavelength Zones, use the name of the group associated + // with the Wavelength Zone (for example, us-east-1-wl1-bos-wlz-1). + // + // * message - The Zone message. + // + // * opt-in-status - The opt-in status (opted-in, and not-opted-in | opt-in-not-required). + // + // * parent-zoneID - The ID of the zone that handles some of the Local Zone + // and Wavelength Zone control plane operations, such as API calls. + // + // * parent-zoneName - The ID of the zone that handles some of the Local + // Zone and Wavelength Zone control plane operations, such as API calls. // - // * message - The Availability Zone or Local Zone message. + // * region-name - The name of the Region for the Zone (for example, us-east-1). // - // * opt-in-status - The opt in status (opted-in, and not-opted-in | opt-in-not-required). + // * state - The state of the Availability Zone, the Local Zone, or the Wavelength + // Zone (available | information | impaired | unavailable). // - // * region-name - The name of the Region for the Availability Zone or Local - // Zone (for example, us-east-1). + // * zone-id - The ID of the Availability Zone (for example, use1-az1), the + // Local Zone (for example, usw2-lax1-az1), or the Wavelength Zone (for example, + // us-east-1-wl1-bos-wlz-1). // - // * state - The state of the Availability Zone or Local Zone (available - // | information | impaired | unavailable). + // * zone-type - The type of zone, for example, local-zone. // - // * zone-id - The ID of the Availability Zone (for example, use1-az1) or - // the Local Zone (for example, use usw2-lax1-az1). + // * zone-name - The name of the Availability Zone (for example, us-east-1a), + // the Local Zone (for example, us-west-2-lax-1a), or the Wavelength Zone + // (for example, us-east-1-wl1-bos-wlz-1). // - // * zone-name - The name of the Availability Zone (for example, us-east-1a) - // or the Local Zone (for example, use us-west-2-lax-1a). + // * zone-type - The type of zone, for example, local-zone. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The IDs of the Availability Zones and Local Zones. + // The IDs of the Availability Zones, Local Zones, and Wavelength Zones. ZoneIds []*string `locationName:"ZoneId" locationNameList:"ZoneId" type:"list"` - // The names of the Availability Zones and Local Zones. + // The names of the Availability Zones, Local Zones, and Wavelength Zones. ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"` } @@ -55577,7 +58220,7 @@ func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvai type DescribeAvailabilityZonesOutput struct { _ struct{} `type:"structure"` - // Information about the Availability Zones and Local Zones. + // Information about the Availability Zones, Local Zones, and Wavelength Zones. AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` } @@ -55852,10 +58495,11 @@ type DescribeCapacityReservationsInput struct { // The maximum number of results to return for the request in a single page. // The remaining results can be seen by sending another request with the returned - // nextToken value. + // nextToken value. This value can be between 5 and 500. If maxResults is given + // a larger value than 500, you receive an error. MaxResults *int64 `min:"1" type:"integer"` - // The token to retrieve the next page of results. + // The token to use to retrieve the next page of results. NextToken *string `type:"string"` } @@ -55945,6 +58589,134 @@ func (s *DescribeCapacityReservationsOutput) SetNextToken(v string) *DescribeCap return s } +type DescribeCarrierGatewaysInput struct { + _ struct{} `type:"structure"` + + // One or more carrier gateway IDs. + CarrierGatewayIds []*string `locationName:"CarrierGatewayId" type:"list"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. + // + // * carrier-gateway-id - The ID of the carrier gateway. + // + // * state - The state of the carrier gateway (pending | failed | available + // | deleting | deleted). + // + // * owner-id - The AWS account ID of the owner of the carrier gateway. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + // + // * vpc-id - The ID of the VPC associated with the carrier gateway. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeCarrierGatewaysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCarrierGatewaysInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCarrierGatewaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCarrierGatewaysInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCarrierGatewayIds sets the CarrierGatewayIds field's value. +func (s *DescribeCarrierGatewaysInput) SetCarrierGatewayIds(v []*string) *DescribeCarrierGatewaysInput { + s.CarrierGatewayIds = v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeCarrierGatewaysInput) SetDryRun(v bool) *DescribeCarrierGatewaysInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeCarrierGatewaysInput) SetFilters(v []*Filter) *DescribeCarrierGatewaysInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeCarrierGatewaysInput) SetMaxResults(v int64) *DescribeCarrierGatewaysInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeCarrierGatewaysInput) SetNextToken(v string) *DescribeCarrierGatewaysInput { + s.NextToken = &v + return s +} + +type DescribeCarrierGatewaysOutput struct { + _ struct{} `type:"structure"` + + // Information about the carrier gateway. + CarrierGateways []*CarrierGateway `locationName:"carrierGatewaySet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s DescribeCarrierGatewaysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCarrierGatewaysOutput) GoString() string { + return s.String() +} + +// SetCarrierGateways sets the CarrierGateways field's value. +func (s *DescribeCarrierGatewaysOutput) SetCarrierGateways(v []*CarrierGateway) *DescribeCarrierGatewaysOutput { + s.CarrierGateways = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeCarrierGatewaysOutput) SetNextToken(v string) *DescribeCarrierGatewaysOutput { + s.NextToken = &v + return s +} + type DescribeClassicLinkInstancesInput struct { _ struct{} `type:"structure"` @@ -57518,10 +60290,11 @@ type DescribeFastSnapshotRestoreSuccessItem struct { // The time at which fast snapshot restores entered the optimizing state. OptimizingTime *time.Time `locationName:"optimizingTime" type:"timestamp"` - // The alias of the snapshot owner. + // The AWS owner alias that enabled fast snapshot restores on the snapshot. + // This is intended for future use. OwnerAlias *string `locationName:"ownerAlias" type:"string"` - // The ID of the AWS account that owns the snapshot. + // The ID of the AWS account that enabled fast snapshot restores on the snapshot. OwnerId *string `locationName:"ownerId" type:"string"` // The ID of the snapshot. @@ -57629,7 +60402,8 @@ type DescribeFastSnapshotRestoresInput struct { // // * availability-zone: The Availability Zone of the snapshot. // - // * owner-id: The ID of the AWS account that owns the snapshot. + // * owner-id: The ID of the AWS account that enabled fast snapshot restore + // on the snapshot. // // * snapshot-id: The ID of the snapshot. // @@ -59335,7 +62109,7 @@ type DescribeImagesInput struct { // in GiB. // // * block-device-mapping.volume-type - The volume type of the EBS volume - // (gp2 | io1 | st1 | sc1 | standard). + // (gp2 | io1 | io2 | st1 | sc1 | standard). // // * block-device-mapping.encrypted - A Boolean that indicates whether the // EBS volume is encrypted. @@ -59359,11 +62133,13 @@ type DescribeImagesInput struct { // // * name - The name of the AMI (provided during image creation). // - // * owner-alias - String value from an Amazon-maintained list (amazon | - // aws-marketplace | microsoft) of snapshot owners. Not to be confused with - // the user-configured AWS account alias, which is set from the IAM console. + // * owner-alias - The owner alias, from an Amazon-maintained list (amazon + // | aws-marketplace). This is not the user-configured AWS account alias + // set using the IAM console. We recommend that you use the related parameter + // instead of this filter. // - // * owner-id - The AWS account ID of the image owner. + // * owner-id - The AWS account ID of the owner. We recommend that you use + // the related parameter instead of this filter. // // * platform - The platform. To only list Windows-based AMIs, use windows. // @@ -59405,10 +62181,10 @@ type DescribeImagesInput struct { // Default: Describes all images available to you. ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` - // Filters the images by the owner. Specify an AWS account ID, self (owner is - // the sender of the request), or an AWS owner alias (valid values are amazon - // | aws-marketplace | microsoft). Omitting this option returns all images for - // which you have launch permissions, regardless of ownership. + // Scopes the results to images with the specified owners. You can specify a + // combination of AWS account IDs, self, amazon, and aws-marketplace. If you + // omit this parameter, the results include all images for which you have launch + // permissions, regardless of ownership. Owners []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` } @@ -60373,6 +63149,9 @@ type DescribeInstanceTypesInput struct { // * ebs-info.encryption-support - Indicates whether EBS encryption is supported. // (supported | unsupported) // + // * ebs-info.nvme-support - Indicates whether non-volatile memory express + // (NVMe) is supported or required. (required | supported | unsupported) + // // * free-tier-eligible - Indicates whether the instance type is eligible // to use in the free tier. (true | false) // @@ -61249,12 +64028,16 @@ type DescribeLaunchTemplateVersionsInput struct { // * ram-disk-id - The RAM disk ID. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. + // The ID of the launch template. To describe one or more versions of a specified + // launch template, you must specify either the launch template ID or the launch + // template name in the request. To describe all the latest or default launch + // template versions in your account, you must omit this parameter. LaunchTemplateId *string `type:"string"` - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. + // The name of the launch template. To describe one or more versions of a specified + // launch template, you must specify either the launch template ID or the launch + // template name in the request. To describe all the latest or default launch + // template versions in your account, you must omit this parameter. LaunchTemplateName *string `min:"3" type:"string"` // The maximum number of results to return in a single call. To retrieve the @@ -61271,7 +64054,18 @@ type DescribeLaunchTemplateVersionsInput struct { // The token to request the next page of results. NextToken *string `type:"string"` - // One or more versions of the launch template. + // One or more versions of the launch template. Valid values depend on whether + // you are describing a specified launch template (by ID or name) or all launch + // templates in your account. + // + // To describe one or more versions of a specified launch template, valid values + // are $Latest, $Default, and numbers. + // + // To describe all launch templates in your account that are defined as the + // latest version, the valid value is $Latest. To describe all launch templates + // in your account that are defined as the default version, the valid value + // is $Default. You can specify $Latest and $Default in the same call. You cannot + // specify numbers. Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list"` } @@ -62223,6 +65017,121 @@ func (s *DescribeLocalGatewaysOutput) SetNextToken(v string) *DescribeLocalGatew return s } +type DescribeManagedPrefixListsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. + // + // * owner-id - The ID of the prefix list owner. + // + // * prefix-list-id - The ID of the prefix list. + // + // * prefix-list-name - The name of the prefix list. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // One or more prefix list IDs. + PrefixListIds []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeManagedPrefixListsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeManagedPrefixListsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeManagedPrefixListsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeManagedPrefixListsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeManagedPrefixListsInput) SetDryRun(v bool) *DescribeManagedPrefixListsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeManagedPrefixListsInput) SetFilters(v []*Filter) *DescribeManagedPrefixListsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeManagedPrefixListsInput) SetMaxResults(v int64) *DescribeManagedPrefixListsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeManagedPrefixListsInput) SetNextToken(v string) *DescribeManagedPrefixListsInput { + s.NextToken = &v + return s +} + +// SetPrefixListIds sets the PrefixListIds field's value. +func (s *DescribeManagedPrefixListsInput) SetPrefixListIds(v []*string) *DescribeManagedPrefixListsInput { + s.PrefixListIds = v + return s +} + +type DescribeManagedPrefixListsOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the prefix lists. + PrefixLists []*ManagedPrefixList `locationName:"prefixListSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeManagedPrefixListsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeManagedPrefixListsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeManagedPrefixListsOutput) SetNextToken(v string) *DescribeManagedPrefixListsOutput { + s.NextToken = &v + return s +} + +// SetPrefixLists sets the PrefixLists field's value. +func (s *DescribeManagedPrefixListsOutput) SetPrefixLists(v []*ManagedPrefixList) *DescribeManagedPrefixListsOutput { + s.PrefixLists = v + return s +} + type DescribeMovingAddressesInput struct { _ struct{} `type:"structure"` @@ -62913,9 +65822,6 @@ type DescribeNetworkInterfacesInput struct { // * attachment.instance-owner-id - The owner ID of the instance to which // the network interface is attached. // - // * attachment.nat-gateway-id - The ID of the NAT gateway to which the network - // interface is attached. - // // * attachment.status - The status of the attachment (attaching | attached // | detaching | detached). // @@ -64205,8 +67111,6 @@ type DescribeRouteTablesInput struct { // to find all resources assigned a tag with a specific key, regardless of // the tag value. // - // * transit-gateway-id - The ID of a transit gateway. - // // * vpc-id - The ID of the VPC for the route table. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -64695,8 +67599,8 @@ type DescribeSecurityGroupsInput struct { // * egress.ip-permission.ipv6-cidr - An IPv6 CIDR block for an outbound // security group rule. // - // * egress.ip-permission.prefix-list-id - The ID (prefix) of the AWS service - // to which a security group rule allows outbound access. + // * egress.ip-permission.prefix-list-id - The ID of a prefix list to which + // a security group rule allows outbound access. // // * egress.ip-permission.protocol - The IP protocol for an outbound security // group rule (tcp | udp | icmp or a protocol number). @@ -64726,8 +67630,8 @@ type DescribeSecurityGroupsInput struct { // * ip-permission.ipv6-cidr - An IPv6 CIDR block for an inbound security // group rule. // - // * ip-permission.prefix-list-id - The ID (prefix) of the AWS service from - // which a security group rule allows inbound access. + // * ip-permission.prefix-list-id - The ID of a prefix list from which a + // security group rule allows inbound access. // // * ip-permission.protocol - The IP protocol for an inbound security group // rule (tcp | udp | icmp or a protocol number). @@ -64990,12 +67894,12 @@ type DescribeSnapshotsInput struct { // // * encrypted - Indicates whether the snapshot is encrypted (true | false) // - // * owner-alias - Value from an Amazon-maintained list (amazon | self | - // all | aws-marketplace | microsoft) of snapshot owners. Not to be confused - // with the user-configured AWS account alias, which is set from the IAM - // console. + // * owner-alias - The owner alias, from an Amazon-maintained list (amazon). + // This is not the user-configured AWS account alias set using the IAM console. + // We recommend that you use the related parameter instead of this filter. // - // * owner-id - The ID of the AWS account that owns the snapshot. + // * owner-id - The AWS account ID of the owner. We recommend that you use + // the related parameter instead of this filter. // // * progress - The progress of the snapshot, as a percentage (for example, // 80%). @@ -65039,7 +67943,8 @@ type DescribeSnapshotsInput struct { // to return. NextToken *string `type:"string"` - // Describes the snapshots owned by these owners. + // Scopes the results to snapshots with the specified owners. You can specify + // a combination of AWS account IDs, self, and amazon. OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` // The IDs of the AWS accounts that can create volumes from the snapshot. @@ -65595,8 +68500,8 @@ type DescribeSpotInstanceRequestsInput struct { // in GiB. // // * launch.block-device-mapping.volume-type - The type of EBS volume: gp2 - // for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput - // Optimized HDD, sc1for Cold HDD, or standard for Magnetic. + // for General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for + // Throughput Optimized HDD, sc1for Cold HDD, or standard for Magnetic. // // * launch.group-id - The ID of the security group for the instance. // @@ -65650,7 +68555,7 @@ type DescribeSpotInstanceRequestsInput struct { // * state - The state of the Spot Instance request (open | active | closed // | cancelled | failed). Spot request status information can help you track // your Amazon EC2 Spot Instance requests. For more information, see Spot - // Request Status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) + // request status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) // in the Amazon EC2 User Guide for Linux Instances. // // * status-code - The short code describing the most recent evaluation of @@ -66670,11 +69575,12 @@ type DescribeTransitGatewayAttachmentsInput struct { // // * resource-owner-id - The ID of the AWS account that owns the resource. // - // * resource-type - The resource type (vpc | vpn). + // * resource-type - The resource type. Valid values are vpc | vpn | direct-connect-gateway + // | peering. // - // * state - The state of the attachment (available | deleted | deleting - // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected - // | rejecting). + // * state - The state of the attachment. Valid values are available | deleted + // | deleting | failed | failing | initiatingRequest | modifying | pendingAcceptance + // | pending | rollingBack | rejected | rejecting. // // * transit-gateway-attachment-id - The ID of the attachment. // @@ -66916,9 +69822,9 @@ type DescribeTransitGatewayPeeringAttachmentsInput struct { // * remote-owner-id - The ID of the AWS account in the remote Region that // owns the transit gateway. // - // * state - The state of the peering attachment (available | deleted | deleting - // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected - // | rejecting). + // * state - The state of the peering attachment. Valid values are available + // | deleted | deleting | failed | failing | initiatingRequest | modifying + // | pendingAcceptance | pending | rollingBack | rejected | rejecting). // // * transit-gateway-id - The ID of the transit gateway. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -67037,9 +69943,8 @@ type DescribeTransitGatewayRouteTablesInput struct { // * default-propagation-route-table - Indicates whether this is the default // propagation route table for the transit gateway (true | false). // - // * state - The state of the attachment (available | deleted | deleting - // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected - // | rejecting). + // * state - The state of the route table (available | deleting | deleted + // | pending). // // * transit-gateway-id - The ID of the transit gateway. // @@ -67155,9 +70060,9 @@ type DescribeTransitGatewayVpcAttachmentsInput struct { // One or more filters. The possible values are: // - // * state - The state of the attachment (available | deleted | deleting - // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected - // | rejecting). + // * state - The state of the attachment. Valid values are available | deleted + // | deleting | failed | failing | initiatingRequest | modifying | pendingAcceptance + // | pending | rollingBack | rejected | rejecting. // // * transit-gateway-attachment-id - The ID of the attachment. // @@ -67302,9 +70207,8 @@ type DescribeTransitGatewaysInput struct { // // * owner-id - The ID of the AWS account that owns the transit gateway. // - // * state - The state of the attachment (available | deleted | deleting - // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected - // | rejecting). + // * state - The state of the transit gateway (available | deleted | deleting + // | modifying | pending). // // * transit-gateway-id - The ID of the transit gateway. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -67688,7 +70592,7 @@ type DescribeVolumesInput struct { // // * snapshot-id - The snapshot from which the volume was created. // - // * status - The status of the volume (creating | available | in-use | deleting + // * status - The state of the volume (creating | available | in-use | deleting // | deleted | error). // // * tag: - The key/value combination of a tag assigned to the resource. @@ -67704,7 +70608,7 @@ type DescribeVolumesInput struct { // * volume-id - The volume ID. // // * volume-type - The Amazon EBS volume type. This can be gp2 for General - // Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized + // Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for Throughput Optimized // HDD, sc1 for Cold HDD, or standard for Magnetic volumes. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -67778,9 +70682,34 @@ type DescribeVolumesModificationsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The filters. Supported filters: volume-id | modification-state | target-size - // | target-iops | target-volume-type | original-size | original-iops | original-volume-type - // | start-time | originalMultiAttachEnabled | targetMultiAttachEnabled. + // The filters. + // + // * modification-state - The current modification state (modifying | optimizing + // | completed | failed). + // + // * original-iops - The original IOPS rate of the volume. + // + // * original-size - The original size of the volume, in GiB. + // + // * original-volume-type - The original volume type of the volume (standard + // | io1 | io2 | gp2 | sc1 | st1). + // + // * originalMultiAttachEnabled - Indicates whether Multi-Attach support + // was enabled (true | false). + // + // * start-time - The modification start time. + // + // * target-iops - The target IOPS rate of the volume. + // + // * target-size - The target size of the volume, in GiB. + // + // * target-volume-type - The target volume type of the volume (standard + // | io1 | io2 | gp2 | sc1 | st1). + // + // * targetMultiAttachEnabled - Indicates whether Multi-Attach support is + // to be enabled (true | false). + // + // * volume-id - The ID of the volume. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // The maximum number of results (up to a limit of 500) to be returned in a @@ -67790,7 +70719,7 @@ type DescribeVolumesModificationsInput struct { // The nextToken value returned by a previous paginated request. NextToken *string `type:"string"` - // The IDs of the volumes for which in-progress modifications will be described. + // The IDs of the volumes. VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` } @@ -70101,10 +73030,11 @@ type DisableFastSnapshotRestoreSuccessItem struct { // The time at which fast snapshot restores entered the optimizing state. OptimizingTime *time.Time `locationName:"optimizingTime" type:"timestamp"` - // The alias of the snapshot owner. + // The AWS owner alias that enabled fast snapshot restores on the snapshot. + // This is intended for future use. OwnerAlias *string `locationName:"ownerAlias" type:"string"` - // The ID of the AWS account that owns the snapshot. + // The ID of the AWS account that enabled fast snapshot restores on the snapshot. OwnerId *string `locationName:"ownerId" type:"string"` // The ID of the snapshot. @@ -71517,7 +74447,7 @@ type EbsBlockDevice struct { _ struct{} `type:"structure"` // Indicates whether the EBS volume is deleted on instance termination. For - // more information, see Preserving Amazon EBS Volumes on Instance Termination + // more information, see Preserving Amazon EBS volumes on instance termination // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#preserving-volumes-on-termination) // in the Amazon Elastic Compute Cloud User Guide. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -71532,27 +74462,28 @@ type EbsBlockDevice struct { // In no case can you remove encryption from an encrypted volume. // // Encrypted volumes can only be attached to instances that support Amazon EBS - // encryption. For more information, see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + // encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). // // This parameter is not returned by . Encrypted *bool `locationName:"encrypted" type:"boolean"` // The number of I/O operations per second (IOPS) that the volume supports. - // For io1 volumes, this represents the number of IOPS that are provisioned + // For io1 and io2 volumes, this represents the number of IOPS that are provisioned // for the volume. For gp2 volumes, this represents the baseline performance // of the volume and the rate at which the volume accumulates I/O credits for - // bursting. For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // bursting. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS - // for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed - // only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS + // for io1 and io2 volumes in most Regions. Maximum io1 and io2 IOPS of 64,000 + // is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). // Other instance families guarantee performance up to 32,000 IOPS. For more // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. + // Condition: This parameter is required for requests to create io1 and io2 + // volumes; it is not used in requests to create gp2, st1, sc1, or standard + // volumes. Iops *int64 `locationName:"iops" type:"integer"` // Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed @@ -71573,15 +74504,15 @@ type EbsBlockDevice struct { // a volume size, the default is the snapshot size. // // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - // IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for - // Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify + // IOPS SSD (io1 and io2), 500-16384 for Throughput Optimized HDD (st1), 500-16384 + // for Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify // a snapshot, the volume size must be equal to or larger than the snapshot // size. VolumeSize *int64 `locationName:"volumeSize" type:"integer"` - // The volume type. If you set the type to io1, you must also specify the Iops - // parameter. If you set the type to gp2, st1, sc1, or standard, you must omit - // the Iops parameter. + // The volume type. If you set the type to io1 or io2, you must also specify + // the Iops parameter. If you set the type to gp2, st1, sc1, or standard, you + // must omit the Iops parameter. // // Default: gp2 VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` @@ -71653,6 +74584,9 @@ type EbsInfo struct { // Indicates whether Amazon EBS encryption is supported. EncryptionSupport *string `locationName:"encryptionSupport" type:"string" enum:"EbsEncryptionSupport"` + + // Indicates whether non-volatile memory express (NVMe) is supported. + NvmeSupport *string `locationName:"nvmeSupport" type:"string" enum:"EbsNvmeSupport"` } // String returns the string representation @@ -71683,6 +74617,12 @@ func (s *EbsInfo) SetEncryptionSupport(v string) *EbsInfo { return s } +// SetNvmeSupport sets the NvmeSupport field's value. +func (s *EbsInfo) SetNvmeSupport(v string) *EbsInfo { + s.NvmeSupport = &v + return s +} + // Describes a parameter used to set up an EBS volume in a block device mapping. type EbsInstanceBlockDevice struct { _ struct{} `type:"structure"` @@ -72115,7 +75055,7 @@ type ElasticInferenceAccelerator struct { Count *int64 `min:"1" type:"integer"` // The type of elastic inference accelerator. The possible values are eia1.medium, - // eia1.large, and eia1.xlarge. + // eia1.large, eia1.xlarge, eia2.medium, eia2.large, and eia2.xlarge. // // Type is a required field Type *string `type:"string" required:"true"` @@ -72383,10 +75323,11 @@ type EnableFastSnapshotRestoreSuccessItem struct { // The time at which fast snapshot restores entered the optimizing state. OptimizingTime *time.Time `locationName:"optimizingTime" type:"timestamp"` - // The alias of the snapshot owner. + // The AWS owner alias that enabled fast snapshot restores on the snapshot. + // This is intended for future use. OwnerAlias *string `locationName:"ownerAlias" type:"string"` - // The ID of the AWS account that owns the snapshot. + // The ID of the AWS account that enabled fast snapshot restores on the snapshot. OwnerId *string `locationName:"ownerId" type:"string"` // The ID of the snapshot. @@ -73198,7 +76139,7 @@ type ExportImageInput struct { // Token to enable idempotency for export image requests. ClientToken *string `type:"string" idempotencyToken:"true"` - // A description of the image being exported. The maximum length is 255 bytes. + // A description of the image being exported. The maximum length is 255 characters. Description *string `type:"string"` // The disk image format. @@ -73218,15 +76159,18 @@ type ExportImageInput struct { ImageId *string `type:"string" required:"true"` // The name of the role that grants VM Import/Export permission to export images - // to your S3 bucket. If this parameter is not specified, the default role is - // named 'vmimport'. + // to your Amazon S3 bucket. If this parameter is not specified, the default + // role is named 'vmimport'. RoleName *string `type:"string"` - // Information about the destination S3 bucket. The bucket must exist and grant - // WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. + // Information about the destination Amazon S3 bucket. The bucket must exist + // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. // // S3ExportLocation is a required field S3ExportLocation *ExportTaskS3LocationRequest `type:"structure" required:"true"` + + // The tags to apply to the image being exported. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -73305,6 +76249,12 @@ func (s *ExportImageInput) SetS3ExportLocation(v *ExportTaskS3LocationRequest) * return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *ExportImageInput) SetTagSpecifications(v []*TagSpecification) *ExportImageInput { + s.TagSpecifications = v + return s +} + type ExportImageOutput struct { _ struct{} `type:"structure"` @@ -73324,10 +76274,10 @@ type ExportImageOutput struct { Progress *string `locationName:"progress" type:"string"` // The name of the role that grants VM Import/Export permission to export images - // to your S3 bucket. + // to your Amazon S3 bucket. RoleName *string `locationName:"roleName" type:"string"` - // Information about the destination S3 bucket. + // Information about the destination Amazon S3 bucket. S3ExportLocation *ExportTaskS3Location `locationName:"s3ExportLocation" type:"structure"` // The status of the export image task. The possible values are active, completed, @@ -73336,6 +76286,9 @@ type ExportImageOutput struct { // The status message for the export image task. StatusMessage *string `locationName:"statusMessage" type:"string"` + + // Any tags assigned to the image being exported. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -73402,6 +76355,12 @@ func (s *ExportImageOutput) SetStatusMessage(v string) *ExportImageOutput { return s } +// SetTags sets the Tags field's value. +func (s *ExportImageOutput) SetTags(v []*Tag) *ExportImageOutput { + s.Tags = v + return s +} + // Describes an export image task. type ExportImageTask struct { _ struct{} `type:"structure"` @@ -73418,7 +76377,7 @@ type ExportImageTask struct { // The percent complete of the export image task. Progress *string `locationName:"progress" type:"string"` - // Information about the destination S3 bucket. + // Information about the destination Amazon S3 bucket. S3ExportLocation *ExportTaskS3Location `locationName:"s3ExportLocation" type:"structure"` // The status of the export image task. The possible values are active, completed, @@ -73427,6 +76386,9 @@ type ExportImageTask struct { // The status message for the export image task. StatusMessage *string `locationName:"statusMessage" type:"string"` + + // Any tags assigned to the image being exported. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -73481,6 +76443,12 @@ func (s *ExportImageTask) SetStatusMessage(v string) *ExportImageTask { return s } +// SetTags sets the Tags field's value. +func (s *ExportImageTask) SetTags(v []*Tag) *ExportImageTask { + s.Tags = v + return s +} + // Describes an instance export task. type ExportTask struct { _ struct{} `type:"structure"` @@ -73563,7 +76531,7 @@ func (s *ExportTask) SetTags(v []*Tag) *ExportTask { type ExportTaskS3Location struct { _ struct{} `type:"structure"` - // The destination S3 bucket. + // The destination Amazon S3 bucket. S3Bucket *string `locationName:"s3Bucket" type:"string"` // The prefix (logical hierarchy) in the bucket. @@ -73596,7 +76564,7 @@ func (s *ExportTaskS3Location) SetS3Prefix(v string) *ExportTaskS3Location { type ExportTaskS3LocationRequest struct { _ struct{} `type:"structure"` - // The destination S3 bucket. + // The destination Amazon S3 bucket. // // S3Bucket is a required field S3Bucket *string `type:"string" required:"true"` @@ -73651,8 +76619,8 @@ type ExportToS3Task struct { // The format for the exported image. DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` - // The S3 bucket for the destination image. The destination bucket must exist - // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. + // The Amazon S3 bucket for the destination image. The destination bucket must + // exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. S3Bucket *string `locationName:"s3Bucket" type:"string"` // The encryption key for your S3 bucket. @@ -73704,12 +76672,12 @@ type ExportToS3TaskSpecification struct { // The format for the exported image. DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` - // The S3 bucket for the destination image. The destination bucket must exist - // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. + // The Amazon S3 bucket for the destination image. The destination bucket must + // exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. S3Bucket *string `locationName:"s3Bucket" type:"string"` - // The image is written to a single object in the S3 bucket at the S3 key s3prefix - // + exportTaskId + '.' + diskImageFormat. + // The image is written to a single object in the Amazon S3 bucket at the S3 + // key s3prefix + exportTaskId + '.' + diskImageFormat. S3Prefix *string `locationName:"s3Prefix" type:"string"` } @@ -73776,13 +76744,11 @@ type ExportTransitGatewayRoutesInput struct { // routes in your route table and you specify supernet-of-match as 10.0.1.0/30, // then the result returns 10.0.1.0/29. // - // * state - The state of the attachment (available | deleted | deleting - // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected - // | rejecting). + // * state - The state of the route (active | blackhole). // // * transit-gateway-route-destination-cidr-block - The CIDR range. // - // * type - The type of route (active | blackhole). + // * type - The type of route (propagated | static). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // The name of the S3 bucket. @@ -75257,12 +78223,13 @@ type GetCapacityReservationUsageInput struct { // The maximum number of results to return for the request in a single page. // The remaining results can be seen by sending another request with the returned - // nextToken value. + // nextToken value. This value can be between 5 and 500. If maxResults is given + // a larger value than 500, you receive an error. // // Valid range: Minimum value of 1. Maximum value of 1000. MaxResults *int64 `min:"1" type:"integer"` - // The token to retrieve the next page of results. + // The token to use to retrieve the next page of results. NextToken *string `type:"string"` } @@ -75909,6 +78876,114 @@ func (s *GetEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) *Get return s } +type GetGroupsForCapacityReservationInput struct { + _ struct{} `type:"structure"` + + // The ID of the Capacity Reservation. + // + // CapacityReservationId is a required field + CapacityReservationId *string `type:"string" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The maximum number of results to return for the request in a single page. + // The remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given + // a larger value than 500, you receive an error. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s GetGroupsForCapacityReservationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupsForCapacityReservationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupsForCapacityReservationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupsForCapacityReservationInput"} + if s.CapacityReservationId == nil { + invalidParams.Add(request.NewErrParamRequired("CapacityReservationId")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCapacityReservationId sets the CapacityReservationId field's value. +func (s *GetGroupsForCapacityReservationInput) SetCapacityReservationId(v string) *GetGroupsForCapacityReservationInput { + s.CapacityReservationId = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *GetGroupsForCapacityReservationInput) SetDryRun(v bool) *GetGroupsForCapacityReservationInput { + s.DryRun = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetGroupsForCapacityReservationInput) SetMaxResults(v int64) *GetGroupsForCapacityReservationInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetGroupsForCapacityReservationInput) SetNextToken(v string) *GetGroupsForCapacityReservationInput { + s.NextToken = &v + return s +} + +type GetGroupsForCapacityReservationOutput struct { + _ struct{} `type:"structure"` + + // Information about the resource groups to which the Capacity Reservation has + // been added. + CapacityReservationGroups []*CapacityReservationGroup `locationName:"capacityReservationGroupSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s GetGroupsForCapacityReservationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupsForCapacityReservationOutput) GoString() string { + return s.String() +} + +// SetCapacityReservationGroups sets the CapacityReservationGroups field's value. +func (s *GetGroupsForCapacityReservationOutput) SetCapacityReservationGroups(v []*CapacityReservationGroup) *GetGroupsForCapacityReservationOutput { + s.CapacityReservationGroups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetGroupsForCapacityReservationOutput) SetNextToken(v string) *GetGroupsForCapacityReservationOutput { + s.NextToken = &v + return s +} + type GetHostReservationPurchasePreviewInput struct { _ struct{} `type:"structure"` @@ -76086,6 +79161,226 @@ func (s *GetLaunchTemplateDataOutput) SetLaunchTemplateData(v *ResponseLaunchTem return s } +type GetManagedPrefixListAssociationsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetManagedPrefixListAssociationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetManagedPrefixListAssociationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetManagedPrefixListAssociationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetManagedPrefixListAssociationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetManagedPrefixListAssociationsInput) SetDryRun(v bool) *GetManagedPrefixListAssociationsInput { + s.DryRun = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetManagedPrefixListAssociationsInput) SetMaxResults(v int64) *GetManagedPrefixListAssociationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetManagedPrefixListAssociationsInput) SetNextToken(v string) *GetManagedPrefixListAssociationsInput { + s.NextToken = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *GetManagedPrefixListAssociationsInput) SetPrefixListId(v string) *GetManagedPrefixListAssociationsInput { + s.PrefixListId = &v + return s +} + +type GetManagedPrefixListAssociationsOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the associations. + PrefixListAssociations []*PrefixListAssociation `locationName:"prefixListAssociationSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s GetManagedPrefixListAssociationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetManagedPrefixListAssociationsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetManagedPrefixListAssociationsOutput) SetNextToken(v string) *GetManagedPrefixListAssociationsOutput { + s.NextToken = &v + return s +} + +// SetPrefixListAssociations sets the PrefixListAssociations field's value. +func (s *GetManagedPrefixListAssociationsOutput) SetPrefixListAssociations(v []*PrefixListAssociation) *GetManagedPrefixListAssociationsOutput { + s.PrefixListAssociations = v + return s +} + +type GetManagedPrefixListEntriesInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` + + // The version of the prefix list for which to return the entries. The default + // is the current version. + TargetVersion *int64 `type:"long"` +} + +// String returns the string representation +func (s GetManagedPrefixListEntriesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetManagedPrefixListEntriesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetManagedPrefixListEntriesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetManagedPrefixListEntriesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetManagedPrefixListEntriesInput) SetDryRun(v bool) *GetManagedPrefixListEntriesInput { + s.DryRun = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetManagedPrefixListEntriesInput) SetMaxResults(v int64) *GetManagedPrefixListEntriesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetManagedPrefixListEntriesInput) SetNextToken(v string) *GetManagedPrefixListEntriesInput { + s.NextToken = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *GetManagedPrefixListEntriesInput) SetPrefixListId(v string) *GetManagedPrefixListEntriesInput { + s.PrefixListId = &v + return s +} + +// SetTargetVersion sets the TargetVersion field's value. +func (s *GetManagedPrefixListEntriesInput) SetTargetVersion(v int64) *GetManagedPrefixListEntriesInput { + s.TargetVersion = &v + return s +} + +type GetManagedPrefixListEntriesOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list entries. + Entries []*PrefixListEntry `locationName:"entrySet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s GetManagedPrefixListEntriesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetManagedPrefixListEntriesOutput) GoString() string { + return s.String() +} + +// SetEntries sets the Entries field's value. +func (s *GetManagedPrefixListEntriesOutput) SetEntries(v []*PrefixListEntry) *GetManagedPrefixListEntriesOutput { + s.Entries = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetManagedPrefixListEntriesOutput) SetNextToken(v string) *GetManagedPrefixListEntriesOutput { + s.NextToken = &v + return s +} + type GetPasswordDataInput struct { _ struct{} `type:"structure"` @@ -76582,6 +79877,137 @@ func (s *GetTransitGatewayMulticastDomainAssociationsOutput) SetNextToken(v stri return s } +type GetTransitGatewayPrefixListReferencesInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. The possible values are: + // + // * attachment.resource-id - The ID of the resource for the attachment. + // + // * attachment.resource-type - The type of resource for the attachment. + // Valid values are vpc | vpn | direct-connect-gateway | peering. + // + // * attachment.transit-gateway-attachment-id - The ID of the attachment. + // + // * is-blackhole - Whether traffic matching the route is blocked (true | + // false). + // + // * prefix-list-id - The ID of the prefix list. + // + // * prefix-list-owner-id - The ID of the owner of the prefix list. + // + // * state - The state of the prefix list reference (pending | available + // | modifying | deleting). + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the transit gateway route table. + // + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTransitGatewayPrefixListReferencesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTransitGatewayPrefixListReferencesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTransitGatewayPrefixListReferencesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTransitGatewayPrefixListReferencesInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetTransitGatewayPrefixListReferencesInput) SetDryRun(v bool) *GetTransitGatewayPrefixListReferencesInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *GetTransitGatewayPrefixListReferencesInput) SetFilters(v []*Filter) *GetTransitGatewayPrefixListReferencesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetTransitGatewayPrefixListReferencesInput) SetMaxResults(v int64) *GetTransitGatewayPrefixListReferencesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTransitGatewayPrefixListReferencesInput) SetNextToken(v string) *GetTransitGatewayPrefixListReferencesInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *GetTransitGatewayPrefixListReferencesInput) SetTransitGatewayRouteTableId(v string) *GetTransitGatewayPrefixListReferencesInput { + s.TransitGatewayRouteTableId = &v + return s +} + +type GetTransitGatewayPrefixListReferencesOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the prefix list references. + TransitGatewayPrefixListReferences []*TransitGatewayPrefixListReference `locationName:"transitGatewayPrefixListReferenceSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s GetTransitGatewayPrefixListReferencesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTransitGatewayPrefixListReferencesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTransitGatewayPrefixListReferencesOutput) SetNextToken(v string) *GetTransitGatewayPrefixListReferencesOutput { + s.NextToken = &v + return s +} + +// SetTransitGatewayPrefixListReferences sets the TransitGatewayPrefixListReferences field's value. +func (s *GetTransitGatewayPrefixListReferencesOutput) SetTransitGatewayPrefixListReferences(v []*TransitGatewayPrefixListReference) *GetTransitGatewayPrefixListReferencesOutput { + s.TransitGatewayPrefixListReferences = v + return s +} + type GetTransitGatewayRouteTableAssociationsInput struct { _ struct{} `type:"structure"` @@ -76595,7 +80021,8 @@ type GetTransitGatewayRouteTableAssociationsInput struct { // // * resource-id - The ID of the resource. // - // * resource-type - The resource type (vpc | vpn). + // * resource-type - The resource type. Valid values are vpc | vpn | direct-connect-gateway + // | peering. // // * transit-gateway-attachment-id - The ID of the attachment. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -76715,7 +80142,8 @@ type GetTransitGatewayRouteTablePropagationsInput struct { // // * resource-id - The ID of the resource. // - // * resource-type - The resource type (vpc | vpn). + // * resource-type - The resource type. Valid values are vpc | vpn | direct-connect-gateway + // | peering. // // * transit-gateway-attachment-id - The ID of the attachment. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -76965,7 +80393,7 @@ func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier { // Indicates whether your instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) +// For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. type HibernationOptions struct { _ struct{} `type:"structure"` @@ -76993,7 +80421,7 @@ func (s *HibernationOptions) SetConfigured(v bool) *HibernationOptions { // Indicates whether your instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) +// For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. type HibernationOptionsRequest struct { _ struct{} `type:"structure"` @@ -78143,7 +81571,7 @@ type ImageDiskContainer struct { // The format of the disk image being imported. // - // Valid values: VHD | VMDK | OVA + // Valid values: OVA | VHD | VHDX |VMDK Format *string `type:"string"` // The ID of the EBS snapshot to be used for importing the snapshot. @@ -78385,6 +81813,9 @@ type ImportImageInput struct { // The name of the role to use when not using the default role, 'vmimport'. RoleName *string `type:"string"` + + // The tags to apply to the image being imported. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -78475,6 +81906,12 @@ func (s *ImportImageInput) SetRoleName(v string) *ImportImageInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *ImportImageInput) SetTagSpecifications(v []*TagSpecification) *ImportImageInput { + s.TagSpecifications = v + return s +} + // The request information of license configurations. type ImportImageLicenseConfigurationRequest struct { _ struct{} `type:"structure"` @@ -78532,7 +81969,7 @@ type ImportImageOutput struct { // A description of the import task. Description *string `locationName:"description" type:"string"` - // Indicates whether the AMI is encypted. + // Indicates whether the AMI is encrypted. Encrypted *bool `locationName:"encrypted" type:"boolean"` // The target hypervisor of the import task. @@ -78568,6 +82005,9 @@ type ImportImageOutput struct { // A detailed status message of the import task. StatusMessage *string `locationName:"statusMessage" type:"string"` + + // Any tags assigned to the image being imported. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -78664,6 +82104,12 @@ func (s *ImportImageOutput) SetStatusMessage(v string) *ImportImageOutput { return s } +// SetTags sets the Tags field's value. +func (s *ImportImageOutput) SetTags(v []*Tag) *ImportImageOutput { + s.Tags = v + return s +} + // Describes an import image task. type ImportImageTask struct { _ struct{} `type:"structure"` @@ -79364,6 +82810,9 @@ type ImportSnapshotInput struct { // The name of the role to use when not using the default role, 'vmimport'. RoleName *string `type:"string"` + + // The tags to apply to the snapshot being imported. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -79424,6 +82873,12 @@ func (s *ImportSnapshotInput) SetRoleName(v string) *ImportSnapshotInput { return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *ImportSnapshotInput) SetTagSpecifications(v []*TagSpecification) *ImportSnapshotInput { + s.TagSpecifications = v + return s +} + type ImportSnapshotOutput struct { _ struct{} `type:"structure"` @@ -79435,6 +82890,9 @@ type ImportSnapshotOutput struct { // Information about the import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` + + // Any tags assigned to the snapshot being imported. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -79465,6 +82923,12 @@ func (s *ImportSnapshotOutput) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *Imp return s } +// SetTags sets the Tags field's value. +func (s *ImportSnapshotOutput) SetTags(v []*Tag) *ImportSnapshotOutput { + s.Tags = v + return s +} + // Describes an import snapshot task. type ImportSnapshotTask struct { _ struct{} `type:"structure"` @@ -79878,7 +83342,11 @@ type Instance struct { // name is only available if you've enabled DNS hostnames for your VPC. PublicDnsName *string `locationName:"dnsName" type:"string"` - // The public IPv4 address assigned to the instance, if applicable. + // The public IPv4 address, or the Carrier IP address assigned to the instance, + // if applicable. + // + // A Carrier IP address only applies to an instance launched in a subnet associated + // with a Wavelength Zone. PublicIpAddress *string `locationName:"ipAddress" type:"string"` // The RAM disk associated with this instance, if applicable. @@ -80943,6 +84411,9 @@ func (s *InstanceNetworkInterface) SetVpcId(v string) *InstanceNetworkInterface type InstanceNetworkInterfaceAssociation struct { _ struct{} `type:"structure"` + // The carrier IP address associated with the network interface. + CarrierIp *string `locationName:"carrierIp" type:"string"` + // The ID of the owner of the Elastic IP address. IpOwnerId *string `locationName:"ipOwnerId" type:"string"` @@ -80963,6 +84434,12 @@ func (s InstanceNetworkInterfaceAssociation) GoString() string { return s.String() } +// SetCarrierIp sets the CarrierIp field's value. +func (s *InstanceNetworkInterfaceAssociation) SetCarrierIp(v string) *InstanceNetworkInterfaceAssociation { + s.CarrierIp = &v + return s +} + // SetIpOwnerId sets the IpOwnerId field's value. func (s *InstanceNetworkInterfaceAssociation) SetIpOwnerId(v string) *InstanceNetworkInterfaceAssociation { s.IpOwnerId = &v @@ -81045,6 +84522,13 @@ func (s *InstanceNetworkInterfaceAttachment) SetStatus(v string) *InstanceNetwor type InstanceNetworkInterfaceSpecification struct { _ struct{} `type:"structure"` + // Indicates whether to assign a carrier IP address to the network interface. + // + // You can only assign a carrier IP address to a network interface that is in + // a subnet in a Wavelength Zone. For more information about carrier IP addresses, + // see Carrier IP addresses in the AWS Wavelength Developer Guide. + AssociateCarrierIpAddress *bool `type:"boolean"` + // Indicates whether to assign a public IPv4 address to an instance you launch // in a VPC. The public IP address can only be assigned to a network interface // for eth0, and can only be assigned to a new network interface, not an existing @@ -81135,6 +84619,12 @@ func (s InstanceNetworkInterfaceSpecification) GoString() string { return s.String() } +// SetAssociateCarrierIpAddress sets the AssociateCarrierIpAddress field's value. +func (s *InstanceNetworkInterfaceSpecification) SetAssociateCarrierIpAddress(v bool) *InstanceNetworkInterfaceSpecification { + s.AssociateCarrierIpAddress = &v + return s +} + // SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. func (s *InstanceNetworkInterfaceSpecification) SetAssociatePublicIpAddress(v bool) *InstanceNetworkInterfaceSpecification { s.AssociatePublicIpAddress = &v @@ -82110,9 +85600,7 @@ type IpPermission struct { // [VPC only] The IPv6 ranges. Ipv6Ranges []*Ipv6Range `locationName:"ipv6Ranges" locationNameList:"item" type:"list"` - // [VPC only] The prefix list IDs for an AWS service. With outbound rules, this - // is the AWS service to access through a VPC endpoint from instances associated - // with the security group. + // [VPC only] The prefix list IDs. PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"` // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. @@ -82899,7 +86387,7 @@ func (s *LaunchTemplateBlockDeviceMappingRequest) SetVirtualName(v string) *Laun // to configure the instance to run in On-Demand capacity or to run in any open // Capacity Reservation that has matching attributes (instance type, platform, // Availability Zone). Use the CapacityReservationTarget parameter to explicitly -// target a specific Capacity Reservation. +// target a specific Capacity Reservation or a Capacity Reservation group. type LaunchTemplateCapacityReservationSpecificationRequest struct { _ struct{} `type:"structure"` @@ -82913,7 +86401,8 @@ type LaunchTemplateCapacityReservationSpecificationRequest struct { // one is available. The instance runs in On-Demand capacity. CapacityReservationPreference *string `type:"string" enum:"CapacityReservationPreference"` - // Information about the target Capacity Reservation. + // Information about the target Capacity Reservation or Capacity Reservation + // group. CapacityReservationTarget *CapacityReservationTarget `type:"structure"` } @@ -82953,7 +86442,8 @@ type LaunchTemplateCapacityReservationSpecificationResponse struct { // one is available. The instance runs in On-Demand capacity. CapacityReservationPreference *string `locationName:"capacityReservationPreference" type:"string" enum:"CapacityReservationPreference"` - // Information about the target Capacity Reservation. + // Information about the target Capacity Reservation or Capacity Reservation + // group. CapacityReservationTarget *CapacityReservationTargetResponse `locationName:"capacityReservationTarget" type:"structure"` } @@ -83186,16 +86676,15 @@ type LaunchTemplateEbsBlockDeviceRequest struct { // a volume from a snapshot, you can't specify an encryption value. Encrypted *bool `type:"boolean"` - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // The number of I/O operations per second (IOPS) to provision for an io1 or + // io2 volume, with a maximum ratio of 50 IOPS/GiB for io1, and 500 IOPS/GiB + // for io2. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum + // IOPS of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. For more + // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. + // This parameter is valid only for Provisioned IOPS SSD (io1 and io2) volumes. Iops *int64 `type:"integer"` // The ARN of the symmetric AWS Key Management Service (AWS KMS) CMK used for @@ -83689,6 +87178,15 @@ func (s *LaunchTemplateInstanceMetadataOptionsRequest) SetHttpTokens(v string) * type LaunchTemplateInstanceNetworkInterfaceSpecification struct { _ struct{} `type:"structure"` + // Indicates whether to associate a Carrier IP address with eth0 for a new network + // interface. + // + // Use this option when you launch an instance in a Wavelength Zone and want + // to associate a Carrier IP address with the network interface. For more information + // about Carrier IP addresses, see Carrier IP addresses (https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#provider-owned-ip) + // in the AWS Wavelength Developer Guide. + AssociateCarrierIpAddress *bool `locationName:"associateCarrierIpAddress" type:"boolean"` + // Indicates whether to associate a public IPv4 address with eth0 for a new // network interface. AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` @@ -83740,6 +87238,12 @@ func (s LaunchTemplateInstanceNetworkInterfaceSpecification) GoString() string { return s.String() } +// SetAssociateCarrierIpAddress sets the AssociateCarrierIpAddress field's value. +func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetAssociateCarrierIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecification { + s.AssociateCarrierIpAddress = &v + return s +} + // SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetAssociatePublicIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecification { s.AssociatePublicIpAddress = &v @@ -83822,6 +87326,14 @@ func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetSubnetId(v stri type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct { _ struct{} `type:"structure"` + // Associates a Carrier IP address with eth0 for a new network interface. + // + // Use this option when you launch an instance in a Wavelength Zone and want + // to associate a Carrier IP address with the network interface. For more information + // about Carrier IP addresses, see Carrier IP addresses (https://docs.aws.amazon.com/wavelength/latest/developerguide/how-wavelengths-work.html#provider-owned-ip) + // in the AWS Wavelength Developer Guide. + AssociateCarrierIpAddress *bool `type:"boolean"` + // Associates a public IPv4 address with eth0 for a new network interface. AssociatePublicIpAddress *bool `type:"boolean"` @@ -83881,6 +87393,12 @@ func (s LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) GoString() s return s.String() } +// SetAssociateCarrierIpAddress sets the AssociateCarrierIpAddress field's value. +func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetAssociateCarrierIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { + s.AssociateCarrierIpAddress = &v + return s +} + // SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetAssociatePublicIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { s.AssociatePublicIpAddress = &v @@ -85301,6 +88819,111 @@ func (s *LocalGatewayVirtualInterfaceGroup) SetTags(v []*Tag) *LocalGatewayVirtu return s } +// Describes a managed prefix list. +type ManagedPrefixList struct { + _ struct{} `type:"structure"` + + // The IP address version. + AddressFamily *string `locationName:"addressFamily" type:"string"` + + // The maximum number of entries for the prefix list. + MaxEntries *int64 `locationName:"maxEntries" type:"integer"` + + // The ID of the owner of the prefix list. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The Amazon Resource Name (ARN) for the prefix list. + PrefixListArn *string `locationName:"prefixListArn" min:"1" type:"string"` + + // The ID of the prefix list. + PrefixListId *string `locationName:"prefixListId" type:"string"` + + // The name of the prefix list. + PrefixListName *string `locationName:"prefixListName" type:"string"` + + // The state of the prefix list. + State *string `locationName:"state" type:"string" enum:"PrefixListState"` + + // The state message. + StateMessage *string `locationName:"stateMessage" type:"string"` + + // The tags for the prefix list. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The version of the prefix list. + Version *int64 `locationName:"version" type:"long"` +} + +// String returns the string representation +func (s ManagedPrefixList) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedPrefixList) GoString() string { + return s.String() +} + +// SetAddressFamily sets the AddressFamily field's value. +func (s *ManagedPrefixList) SetAddressFamily(v string) *ManagedPrefixList { + s.AddressFamily = &v + return s +} + +// SetMaxEntries sets the MaxEntries field's value. +func (s *ManagedPrefixList) SetMaxEntries(v int64) *ManagedPrefixList { + s.MaxEntries = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *ManagedPrefixList) SetOwnerId(v string) *ManagedPrefixList { + s.OwnerId = &v + return s +} + +// SetPrefixListArn sets the PrefixListArn field's value. +func (s *ManagedPrefixList) SetPrefixListArn(v string) *ManagedPrefixList { + s.PrefixListArn = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *ManagedPrefixList) SetPrefixListId(v string) *ManagedPrefixList { + s.PrefixListId = &v + return s +} + +// SetPrefixListName sets the PrefixListName field's value. +func (s *ManagedPrefixList) SetPrefixListName(v string) *ManagedPrefixList { + s.PrefixListName = &v + return s +} + +// SetState sets the State field's value. +func (s *ManagedPrefixList) SetState(v string) *ManagedPrefixList { + s.State = &v + return s +} + +// SetStateMessage sets the StateMessage field's value. +func (s *ManagedPrefixList) SetStateMessage(v string) *ManagedPrefixList { + s.StateMessage = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ManagedPrefixList) SetTags(v []*Tag) *ManagedPrefixList { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *ManagedPrefixList) SetVersion(v int64) *ManagedPrefixList { + s.Version = &v + return s +} + // Describes the memory for the instance type. type MemoryInfo struct { _ struct{} `type:"structure"` @@ -85334,14 +88957,16 @@ type ModifyAvailabilityZoneGroupInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The name of the Availability Zone Group. + // The name of the Availability Zone group, Local Zone group, or Wavelength + // Zone group. // // GroupName is a required field GroupName *string `type:"string" required:"true"` - // Indicates whether to enable or disable membership. The valid values are opted-in. - // You must contact AWS Support (https://console.aws.amazon.com/support/home#/case/create%3FissueType=customer-service%26serviceCode=general-info%26getting-started%26categoryCode=using-aws%26services) - // to disable an Availability Zone group. + // Indicates whether you are opted in to the Local Zone group or Wavelength + // Zone group. The only valid value is opted-in. You must contact AWS Support + // (https://console.aws.amazon.com/support/home#/case/create%3FissueType=customer-service%26serviceCode=general-info%26getting-started%26categoryCode=using-aws%26services) + // to opt out of a Local Zone group, or Wavelength Zone group. // // OptInStatus is a required field OptInStatus *string `type:"string" required:"true" enum:"ModifyAvailabilityZoneOptInStatus"` @@ -85897,6 +89522,9 @@ type ModifyFleetInput struct { // FleetId is a required field FleetId *string `type:"string" required:"true"` + // The launch template and overrides. + LaunchTemplateConfigs []*FleetLaunchTemplateConfigRequest `locationName:"LaunchTemplateConfig" locationNameList:"item" type:"list"` + // The size of the EC2 Fleet. // // TargetCapacitySpecification is a required field @@ -85922,6 +89550,16 @@ func (s *ModifyFleetInput) Validate() error { if s.TargetCapacitySpecification == nil { invalidParams.Add(request.NewErrParamRequired("TargetCapacitySpecification")) } + if s.LaunchTemplateConfigs != nil { + for i, v := range s.LaunchTemplateConfigs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchTemplateConfigs", i), err.(request.ErrInvalidParams)) + } + } + } if s.TargetCapacitySpecification != nil { if err := s.TargetCapacitySpecification.Validate(); err != nil { invalidParams.AddNested("TargetCapacitySpecification", err.(request.ErrInvalidParams)) @@ -85952,6 +89590,12 @@ func (s *ModifyFleetInput) SetFleetId(v string) *ModifyFleetInput { return s } +// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. +func (s *ModifyFleetInput) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConfigRequest) *ModifyFleetInput { + s.LaunchTemplateConfigs = v + return s +} + // SetTargetCapacitySpecification sets the TargetCapacitySpecification field's value. func (s *ModifyFleetInput) SetTargetCapacitySpecification(v *TargetCapacitySpecificationRequest) *ModifyFleetInput { s.TargetCapacitySpecification = v @@ -86572,7 +90216,7 @@ type ModifyInstanceAttributeInput struct { // // To add instance store volumes to an Amazon EBS-backed instance, you must // add them when you launch the instance. For more information, see Updating - // the Block Device Mapping when Launching an Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM) + // the block device mapping when launching an instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM) // in the Amazon Elastic Compute Cloud User Guide. BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` @@ -86615,7 +90259,7 @@ type ModifyInstanceAttributeInput struct { InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"` // Changes the instance type to the specified value. For more information, see - // Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). + // Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). // If the instance type is not valid, the error returned is InvalidInstanceAttributeValue. InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` @@ -87423,6 +91067,135 @@ func (s *ModifyLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *Modif return s } +type ModifyManagedPrefixListInput struct { + _ struct{} `type:"structure"` + + // One or more entries to add to the prefix list. + AddEntries []*AddPrefixListEntry `locationName:"AddEntry" type:"list"` + + // The current version of the prefix list. + CurrentVersion *int64 `type:"long"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` + + // A name for the prefix list. + PrefixListName *string `type:"string"` + + // One or more entries to remove from the prefix list. + RemoveEntries []*RemovePrefixListEntry `locationName:"RemoveEntry" type:"list"` +} + +// String returns the string representation +func (s ModifyManagedPrefixListInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyManagedPrefixListInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyManagedPrefixListInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyManagedPrefixListInput"} + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + if s.AddEntries != nil { + for i, v := range s.AddEntries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AddEntries", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RemoveEntries != nil { + for i, v := range s.RemoveEntries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RemoveEntries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAddEntries sets the AddEntries field's value. +func (s *ModifyManagedPrefixListInput) SetAddEntries(v []*AddPrefixListEntry) *ModifyManagedPrefixListInput { + s.AddEntries = v + return s +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *ModifyManagedPrefixListInput) SetCurrentVersion(v int64) *ModifyManagedPrefixListInput { + s.CurrentVersion = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyManagedPrefixListInput) SetDryRun(v bool) *ModifyManagedPrefixListInput { + s.DryRun = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *ModifyManagedPrefixListInput) SetPrefixListId(v string) *ModifyManagedPrefixListInput { + s.PrefixListId = &v + return s +} + +// SetPrefixListName sets the PrefixListName field's value. +func (s *ModifyManagedPrefixListInput) SetPrefixListName(v string) *ModifyManagedPrefixListInput { + s.PrefixListName = &v + return s +} + +// SetRemoveEntries sets the RemoveEntries field's value. +func (s *ModifyManagedPrefixListInput) SetRemoveEntries(v []*RemovePrefixListEntry) *ModifyManagedPrefixListInput { + s.RemoveEntries = v + return s +} + +type ModifyManagedPrefixListOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list. + PrefixList *ManagedPrefixList `locationName:"prefixList" type:"structure"` +} + +// String returns the string representation +func (s ModifyManagedPrefixListOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyManagedPrefixListOutput) GoString() string { + return s.String() +} + +// SetPrefixList sets the PrefixList field's value. +func (s *ModifyManagedPrefixListOutput) SetPrefixList(v *ManagedPrefixList) *ModifyManagedPrefixListOutput { + s.PrefixList = v + return s +} + // Contains the parameters for ModifyNetworkInterfaceAttribute. type ModifyNetworkInterfaceAttributeInput struct { _ struct{} `type:"structure"` @@ -87738,6 +91511,12 @@ type ModifySpotFleetRequestInput struct { // the Spot Fleet. ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` + // The launch template and overrides. You can only use this parameter if you + // specified a launch template (LaunchTemplateConfigs) in your Spot Fleet request. + // If you specified LaunchSpecifications in your Spot Fleet request, then omit + // this parameter. + LaunchTemplateConfigs []*LaunchTemplateConfig `locationName:"LaunchTemplateConfig" locationNameList:"item" type:"list"` + // The number of On-Demand Instances in the fleet. OnDemandTargetCapacity *int64 `type:"integer"` @@ -87766,6 +91545,16 @@ func (s *ModifySpotFleetRequestInput) Validate() error { if s.SpotFleetRequestId == nil { invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) } + if s.LaunchTemplateConfigs != nil { + for i, v := range s.LaunchTemplateConfigs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchTemplateConfigs", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -87779,6 +91568,12 @@ func (s *ModifySpotFleetRequestInput) SetExcessCapacityTerminationPolicy(v strin return s } +// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. +func (s *ModifySpotFleetRequestInput) SetLaunchTemplateConfigs(v []*LaunchTemplateConfig) *ModifySpotFleetRequestInput { + s.LaunchTemplateConfigs = v + return s +} + // SetOnDemandTargetCapacity sets the OnDemandTargetCapacity field's value. func (s *ModifySpotFleetRequestInput) SetOnDemandTargetCapacity(v int64) *ModifySpotFleetRequestInput { s.OnDemandTargetCapacity = &v @@ -88330,6 +92125,282 @@ func (s *ModifyTrafficMirrorSessionOutput) SetTrafficMirrorSession(v *TrafficMir return s } +type ModifyTransitGatewayInput struct { + _ struct{} `type:"structure"` + + // The description for the transit gateway. + Description *string `type:"string"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The options to modify. + Options *ModifyTransitGatewayOptions `type:"structure"` + + // The ID of the transit gateway. + // + // TransitGatewayId is a required field + TransitGatewayId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyTransitGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyTransitGatewayInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyTransitGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyTransitGatewayInput"} + if s.TransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *ModifyTransitGatewayInput) SetDescription(v string) *ModifyTransitGatewayInput { + s.Description = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyTransitGatewayInput) SetDryRun(v bool) *ModifyTransitGatewayInput { + s.DryRun = &v + return s +} + +// SetOptions sets the Options field's value. +func (s *ModifyTransitGatewayInput) SetOptions(v *ModifyTransitGatewayOptions) *ModifyTransitGatewayInput { + s.Options = v + return s +} + +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *ModifyTransitGatewayInput) SetTransitGatewayId(v string) *ModifyTransitGatewayInput { + s.TransitGatewayId = &v + return s +} + +// The transit gateway options. +type ModifyTransitGatewayOptions struct { + _ struct{} `type:"structure"` + + // The ID of the default association route table. + AssociationDefaultRouteTableId *string `type:"string"` + + // Enable or disable automatic acceptance of attachment requests. + AutoAcceptSharedAttachments *string `type:"string" enum:"AutoAcceptSharedAttachmentsValue"` + + // Enable or disable automatic association with the default association route + // table. + DefaultRouteTableAssociation *string `type:"string" enum:"DefaultRouteTableAssociationValue"` + + // Enable or disable automatic propagation of routes to the default propagation + // route table. + DefaultRouteTablePropagation *string `type:"string" enum:"DefaultRouteTablePropagationValue"` + + // Enable or disable DNS support. + DnsSupport *string `type:"string" enum:"DnsSupportValue"` + + // The ID of the default propagation route table. + PropagationDefaultRouteTableId *string `type:"string"` + + // Enable or disable Equal Cost Multipath Protocol support. + VpnEcmpSupport *string `type:"string" enum:"VpnEcmpSupportValue"` +} + +// String returns the string representation +func (s ModifyTransitGatewayOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyTransitGatewayOptions) GoString() string { + return s.String() +} + +// SetAssociationDefaultRouteTableId sets the AssociationDefaultRouteTableId field's value. +func (s *ModifyTransitGatewayOptions) SetAssociationDefaultRouteTableId(v string) *ModifyTransitGatewayOptions { + s.AssociationDefaultRouteTableId = &v + return s +} + +// SetAutoAcceptSharedAttachments sets the AutoAcceptSharedAttachments field's value. +func (s *ModifyTransitGatewayOptions) SetAutoAcceptSharedAttachments(v string) *ModifyTransitGatewayOptions { + s.AutoAcceptSharedAttachments = &v + return s +} + +// SetDefaultRouteTableAssociation sets the DefaultRouteTableAssociation field's value. +func (s *ModifyTransitGatewayOptions) SetDefaultRouteTableAssociation(v string) *ModifyTransitGatewayOptions { + s.DefaultRouteTableAssociation = &v + return s +} + +// SetDefaultRouteTablePropagation sets the DefaultRouteTablePropagation field's value. +func (s *ModifyTransitGatewayOptions) SetDefaultRouteTablePropagation(v string) *ModifyTransitGatewayOptions { + s.DefaultRouteTablePropagation = &v + return s +} + +// SetDnsSupport sets the DnsSupport field's value. +func (s *ModifyTransitGatewayOptions) SetDnsSupport(v string) *ModifyTransitGatewayOptions { + s.DnsSupport = &v + return s +} + +// SetPropagationDefaultRouteTableId sets the PropagationDefaultRouteTableId field's value. +func (s *ModifyTransitGatewayOptions) SetPropagationDefaultRouteTableId(v string) *ModifyTransitGatewayOptions { + s.PropagationDefaultRouteTableId = &v + return s +} + +// SetVpnEcmpSupport sets the VpnEcmpSupport field's value. +func (s *ModifyTransitGatewayOptions) SetVpnEcmpSupport(v string) *ModifyTransitGatewayOptions { + s.VpnEcmpSupport = &v + return s +} + +type ModifyTransitGatewayOutput struct { + _ struct{} `type:"structure"` + + // Describes a transit gateway. + TransitGateway *TransitGateway `locationName:"transitGateway" type:"structure"` +} + +// String returns the string representation +func (s ModifyTransitGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyTransitGatewayOutput) GoString() string { + return s.String() +} + +// SetTransitGateway sets the TransitGateway field's value. +func (s *ModifyTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *ModifyTransitGatewayOutput { + s.TransitGateway = v + return s +} + +type ModifyTransitGatewayPrefixListReferenceInput struct { + _ struct{} `type:"structure"` + + // Indicates whether to drop traffic that matches this route. + Blackhole *bool `type:"boolean"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` + + // The ID of the attachment to which traffic is routed. + TransitGatewayAttachmentId *string `type:"string"` + + // The ID of the transit gateway route table. + // + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyTransitGatewayPrefixListReferenceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyTransitGatewayPrefixListReferenceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyTransitGatewayPrefixListReferenceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyTransitGatewayPrefixListReferenceInput"} + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBlackhole sets the Blackhole field's value. +func (s *ModifyTransitGatewayPrefixListReferenceInput) SetBlackhole(v bool) *ModifyTransitGatewayPrefixListReferenceInput { + s.Blackhole = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyTransitGatewayPrefixListReferenceInput) SetDryRun(v bool) *ModifyTransitGatewayPrefixListReferenceInput { + s.DryRun = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *ModifyTransitGatewayPrefixListReferenceInput) SetPrefixListId(v string) *ModifyTransitGatewayPrefixListReferenceInput { + s.PrefixListId = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *ModifyTransitGatewayPrefixListReferenceInput) SetTransitGatewayAttachmentId(v string) *ModifyTransitGatewayPrefixListReferenceInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *ModifyTransitGatewayPrefixListReferenceInput) SetTransitGatewayRouteTableId(v string) *ModifyTransitGatewayPrefixListReferenceInput { + s.TransitGatewayRouteTableId = &v + return s +} + +type ModifyTransitGatewayPrefixListReferenceOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list reference. + TransitGatewayPrefixListReference *TransitGatewayPrefixListReference `locationName:"transitGatewayPrefixListReference" type:"structure"` +} + +// String returns the string representation +func (s ModifyTransitGatewayPrefixListReferenceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyTransitGatewayPrefixListReferenceOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayPrefixListReference sets the TransitGatewayPrefixListReference field's value. +func (s *ModifyTransitGatewayPrefixListReferenceOutput) SetTransitGatewayPrefixListReference(v *TransitGatewayPrefixListReference) *ModifyTransitGatewayPrefixListReferenceOutput { + s.TransitGatewayPrefixListReference = v + return s +} + type ModifyTransitGatewayVpcAttachmentInput struct { _ struct{} `type:"structure"` @@ -88550,8 +92621,8 @@ type ModifyVolumeInput struct { // The target IOPS rate of the volume. // - // This is only valid for Provisioned IOPS SSD (io1) volumes. For more information, - // see Provisioned IOPS SSD (io1) Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops). + // This is only valid for Provisioned IOPS SSD (io1 and io2) volumes. For moreinformation, + // see Provisioned IOPS SSD (io1 and io2) volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops). // // Default: If no IOPS value is specified, the existing value is retained. Iops *int64 `type:"integer"` @@ -89463,6 +93534,123 @@ func (s *ModifyVpnConnectionInput) SetVpnGatewayId(v string) *ModifyVpnConnectio return s } +type ModifyVpnConnectionOptionsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. + // + // Default: 0.0.0.0/0 + LocalIpv4NetworkCidr *string `type:"string"` + + // The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. + // + // Default: ::/0 + LocalIpv6NetworkCidr *string `type:"string"` + + // The IPv4 CIDR on the AWS side of the VPN connection. + // + // Default: 0.0.0.0/0 + RemoteIpv4NetworkCidr *string `type:"string"` + + // The IPv6 CIDR on the AWS side of the VPN connection. + // + // Default: ::/0 + RemoteIpv6NetworkCidr *string `type:"string"` + + // The ID of the Site-to-Site VPN VPN connection. + // + // VpnConnectionId is a required field + VpnConnectionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyVpnConnectionOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpnConnectionOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyVpnConnectionOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyVpnConnectionOptionsInput"} + if s.VpnConnectionId == nil { + invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyVpnConnectionOptionsInput) SetDryRun(v bool) *ModifyVpnConnectionOptionsInput { + s.DryRun = &v + return s +} + +// SetLocalIpv4NetworkCidr sets the LocalIpv4NetworkCidr field's value. +func (s *ModifyVpnConnectionOptionsInput) SetLocalIpv4NetworkCidr(v string) *ModifyVpnConnectionOptionsInput { + s.LocalIpv4NetworkCidr = &v + return s +} + +// SetLocalIpv6NetworkCidr sets the LocalIpv6NetworkCidr field's value. +func (s *ModifyVpnConnectionOptionsInput) SetLocalIpv6NetworkCidr(v string) *ModifyVpnConnectionOptionsInput { + s.LocalIpv6NetworkCidr = &v + return s +} + +// SetRemoteIpv4NetworkCidr sets the RemoteIpv4NetworkCidr field's value. +func (s *ModifyVpnConnectionOptionsInput) SetRemoteIpv4NetworkCidr(v string) *ModifyVpnConnectionOptionsInput { + s.RemoteIpv4NetworkCidr = &v + return s +} + +// SetRemoteIpv6NetworkCidr sets the RemoteIpv6NetworkCidr field's value. +func (s *ModifyVpnConnectionOptionsInput) SetRemoteIpv6NetworkCidr(v string) *ModifyVpnConnectionOptionsInput { + s.RemoteIpv6NetworkCidr = &v + return s +} + +// SetVpnConnectionId sets the VpnConnectionId field's value. +func (s *ModifyVpnConnectionOptionsInput) SetVpnConnectionId(v string) *ModifyVpnConnectionOptionsInput { + s.VpnConnectionId = &v + return s +} + +type ModifyVpnConnectionOptionsOutput struct { + _ struct{} `type:"structure"` + + // Describes a VPN connection. + VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` +} + +// String returns the string representation +func (s ModifyVpnConnectionOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpnConnectionOptionsOutput) GoString() string { + return s.String() +} + +// SetVpnConnection sets the VpnConnection field's value. +func (s *ModifyVpnConnectionOptionsOutput) SetVpnConnection(v *VpnConnection) *ModifyVpnConnectionOptionsOutput { + s.VpnConnection = v + return s +} + type ModifyVpnConnectionOutput struct { _ struct{} `type:"structure"` @@ -89678,6 +93866,14 @@ func (s *ModifyVpnTunnelOptionsOutput) SetVpnConnection(v *VpnConnection) *Modif type ModifyVpnTunnelOptionsSpecification struct { _ struct{} `type:"structure"` + // The action to take after DPD timeout occurs. Specify restart to restart the + // IKE initiation. Specify clear to end the IKE session. + // + // Valid Values: clear | none | restart + // + // Default: clear + DPDTimeoutAction *string `type:"string"` + // The number of seconds after which a DPD timeout occurs. // // Constraints: A value between 0 and 30. @@ -89693,19 +93889,19 @@ type ModifyVpnTunnelOptionsSpecification struct { // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel // for phase 1 IKE negotiations. // - // Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 + // Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 Phase1DHGroupNumbers []*Phase1DHGroupNumbersRequestListValue `locationName:"Phase1DHGroupNumber" locationNameList:"item" type:"list"` // One or more encryption algorithms that are permitted for the VPN tunnel for // phase 1 IKE negotiations. // - // Valid values: AES128 | AES256 + // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 Phase1EncryptionAlgorithms []*Phase1EncryptionAlgorithmsRequestListValue `locationName:"Phase1EncryptionAlgorithm" locationNameList:"item" type:"list"` // One or more integrity algorithms that are permitted for the VPN tunnel for // phase 1 IKE negotiations. // - // Valid values: SHA1 | SHA2-256 + // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 Phase1IntegrityAlgorithms []*Phase1IntegrityAlgorithmsRequestListValue `locationName:"Phase1IntegrityAlgorithm" locationNameList:"item" type:"list"` // The lifetime for phase 1 of the IKE negotiation, in seconds. @@ -89718,19 +93914,19 @@ type ModifyVpnTunnelOptionsSpecification struct { // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel // for phase 2 IKE negotiations. // - // Valid values: 2 | 5 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 + // Valid values: 2 | 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 Phase2DHGroupNumbers []*Phase2DHGroupNumbersRequestListValue `locationName:"Phase2DHGroupNumber" locationNameList:"item" type:"list"` // One or more encryption algorithms that are permitted for the VPN tunnel for // phase 2 IKE negotiations. // - // Valid values: AES128 | AES256 + // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 Phase2EncryptionAlgorithms []*Phase2EncryptionAlgorithmsRequestListValue `locationName:"Phase2EncryptionAlgorithm" locationNameList:"item" type:"list"` // One or more integrity algorithms that are permitted for the VPN tunnel for // phase 2 IKE negotiations. // - // Valid values: SHA1 | SHA2-256 + // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 Phase2IntegrityAlgorithms []*Phase2IntegrityAlgorithmsRequestListValue `locationName:"Phase2IntegrityAlgorithm" locationNameList:"item" type:"list"` // The lifetime for phase 2 of the IKE negotiation, in seconds. @@ -89773,7 +93969,16 @@ type ModifyVpnTunnelOptionsSpecification struct { // Default: 1024 ReplayWindowSize *int64 `type:"integer"` - // The range of inside IP addresses for the tunnel. Any specified CIDR blocks + // The action to take when the establishing the tunnel for the VPN connection. + // By default, your customer gateway device must initiate the IKE negotiation + // and bring up the tunnel. Specify start for AWS to initiate the IKE negotiation. + // + // Valid Values: add | start + // + // Default: add + StartupAction *string `type:"string"` + + // The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks // must be unique across all VPN connections that use the same virtual private // gateway. // @@ -89794,6 +93999,12 @@ type ModifyVpnTunnelOptionsSpecification struct { // // * 169.254.169.252/30 TunnelInsideCidr *string `type:"string"` + + // The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks + // must be unique across all VPN connections that use the same transit gateway. + // + // Constraints: A size /126 CIDR block from the local fd00::/8 range. + TunnelInsideIpv6Cidr *string `type:"string"` } // String returns the string representation @@ -89806,6 +94017,12 @@ func (s ModifyVpnTunnelOptionsSpecification) GoString() string { return s.String() } +// SetDPDTimeoutAction sets the DPDTimeoutAction field's value. +func (s *ModifyVpnTunnelOptionsSpecification) SetDPDTimeoutAction(v string) *ModifyVpnTunnelOptionsSpecification { + s.DPDTimeoutAction = &v + return s +} + // SetDPDTimeoutSeconds sets the DPDTimeoutSeconds field's value. func (s *ModifyVpnTunnelOptionsSpecification) SetDPDTimeoutSeconds(v int64) *ModifyVpnTunnelOptionsSpecification { s.DPDTimeoutSeconds = &v @@ -89890,12 +94107,24 @@ func (s *ModifyVpnTunnelOptionsSpecification) SetReplayWindowSize(v int64) *Modi return s } +// SetStartupAction sets the StartupAction field's value. +func (s *ModifyVpnTunnelOptionsSpecification) SetStartupAction(v string) *ModifyVpnTunnelOptionsSpecification { + s.StartupAction = &v + return s +} + // SetTunnelInsideCidr sets the TunnelInsideCidr field's value. func (s *ModifyVpnTunnelOptionsSpecification) SetTunnelInsideCidr(v string) *ModifyVpnTunnelOptionsSpecification { s.TunnelInsideCidr = &v return s } +// SetTunnelInsideIpv6Cidr sets the TunnelInsideIpv6Cidr field's value. +func (s *ModifyVpnTunnelOptionsSpecification) SetTunnelInsideIpv6Cidr(v string) *ModifyVpnTunnelOptionsSpecification { + s.TunnelInsideIpv6Cidr = &v + return s +} + type MonitorInstancesInput struct { _ struct{} `type:"structure"` @@ -90809,7 +95038,9 @@ func (s *NetworkInterface) SetVpcId(v string) *NetworkInterface { return s } -// Describes association information for an Elastic IP address (IPv4 only). +// Describes association information for an Elastic IP address (IPv4 only), +// or a Carrier IP address (for a network interface which resides in a subnet +// in a Wavelength Zone). type NetworkInterfaceAssociation struct { _ struct{} `type:"structure"` @@ -90819,13 +95050,23 @@ type NetworkInterfaceAssociation struct { // The association ID. AssociationId *string `locationName:"associationId" type:"string"` + // The carrier IP address associated with the network interface. + // + // This option is only available when the network interface is in a subnet which + // is associated with a Wavelength Zone. + CarrierIp *string `locationName:"carrierIp" type:"string"` + + // The customer-owned IP address associated with the network interface. + CustomerOwnedIp *string `locationName:"customerOwnedIp" type:"string"` + // The ID of the Elastic IP address owner. IpOwnerId *string `locationName:"ipOwnerId" type:"string"` // The public DNS name. PublicDnsName *string `locationName:"publicDnsName" type:"string"` - // The address of the Elastic IP address bound to the network interface. + // The address of the Elastic IP address or Carrier IP address bound to the + // network interface. PublicIp *string `locationName:"publicIp" type:"string"` } @@ -90851,6 +95092,18 @@ func (s *NetworkInterfaceAssociation) SetAssociationId(v string) *NetworkInterfa return s } +// SetCarrierIp sets the CarrierIp field's value. +func (s *NetworkInterfaceAssociation) SetCarrierIp(v string) *NetworkInterfaceAssociation { + s.CarrierIp = &v + return s +} + +// SetCustomerOwnedIp sets the CustomerOwnedIp field's value. +func (s *NetworkInterfaceAssociation) SetCustomerOwnedIp(v string) *NetworkInterfaceAssociation { + s.CustomerOwnedIp = &v + return s +} + // SetIpOwnerId sets the IpOwnerId field's value. func (s *NetworkInterfaceAssociation) SetIpOwnerId(v string) *NetworkInterfaceAssociation { s.IpOwnerId = &v @@ -92184,6 +96437,72 @@ func (s *PrefixList) SetPrefixListName(v string) *PrefixList { return s } +// Describes the resource with which a prefix list is associated. +type PrefixListAssociation struct { + _ struct{} `type:"structure"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` + + // The owner of the resource. + ResourceOwner *string `locationName:"resourceOwner" type:"string"` +} + +// String returns the string representation +func (s PrefixListAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrefixListAssociation) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *PrefixListAssociation) SetResourceId(v string) *PrefixListAssociation { + s.ResourceId = &v + return s +} + +// SetResourceOwner sets the ResourceOwner field's value. +func (s *PrefixListAssociation) SetResourceOwner(v string) *PrefixListAssociation { + s.ResourceOwner = &v + return s +} + +// Describes a prefix list entry. +type PrefixListEntry struct { + _ struct{} `type:"structure"` + + // The CIDR block. + Cidr *string `locationName:"cidr" type:"string"` + + // The description. + Description *string `locationName:"description" type:"string"` +} + +// String returns the string representation +func (s PrefixListEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrefixListEntry) GoString() string { + return s.String() +} + +// SetCidr sets the Cidr field's value. +func (s *PrefixListEntry) SetCidr(v string) *PrefixListEntry { + s.Cidr = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *PrefixListEntry) SetDescription(v string) *PrefixListEntry { + s.Description = &v + return s +} + // Describes a prefix list ID. type PrefixListId struct { _ struct{} `type:"structure"` @@ -93017,6 +97336,9 @@ type PurchaseHostReservationInput struct { // // OfferingId is a required field OfferingId *string `type:"string" required:"true"` + + // The tags to apply to the Dedicated Host Reservation during purchase. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation @@ -93075,6 +97397,12 @@ func (s *PurchaseHostReservationInput) SetOfferingId(v string) *PurchaseHostRese return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *PurchaseHostReservationInput) SetTagSpecifications(v []*TagSpecification) *PurchaseHostReservationInput { + s.TagSpecifications = v + return s +} + type PurchaseHostReservationOutput struct { _ struct{} `type:"structure"` @@ -94303,7 +98631,8 @@ type ReleaseAddressInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The location that the IP address is released from. + // The set of Availability Zones, Local Zones, or Wavelength Zones from which + // AWS advertises IP addresses. // // If you provide an incorrect network border group, you will receive an InvalidAddress.NotFound // error. For more information, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). @@ -94436,6 +98765,45 @@ func (s *ReleaseHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ReleaseHost return s } +// An entry for a prefix list. +type RemovePrefixListEntry struct { + _ struct{} `type:"structure"` + + // The CIDR block. + // + // Cidr is a required field + Cidr *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RemovePrefixListEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemovePrefixListEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemovePrefixListEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemovePrefixListEntry"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCidr sets the Cidr field's value. +func (s *RemovePrefixListEntry) SetCidr(v string) *RemovePrefixListEntry { + s.Cidr = &v + return s +} + type ReplaceIamInstanceProfileAssociationInput struct { _ struct{} `type:"structure"` @@ -94768,6 +99136,9 @@ func (s ReplaceNetworkAclEntryOutput) GoString() string { type ReplaceRouteInput struct { _ struct{} `type:"structure"` + // [IPv4 traffic only] The ID of a carrier gateway. + CarrierGatewayId *string `type:"string"` + // The IPv4 CIDR address block used for the destination match. The value that // you provide must match the CIDR of an existing route in the table. DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` @@ -94776,6 +99147,9 @@ type ReplaceRouteInput struct { // you provide must match the CIDR of an existing route in the table. DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` + // The ID of the prefix list for the route. + DestinationPrefixListId *string `type:"string"` + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, @@ -94838,6 +99212,12 @@ func (s *ReplaceRouteInput) Validate() error { return nil } +// SetCarrierGatewayId sets the CarrierGatewayId field's value. +func (s *ReplaceRouteInput) SetCarrierGatewayId(v string) *ReplaceRouteInput { + s.CarrierGatewayId = &v + return s +} + // SetDestinationCidrBlock sets the DestinationCidrBlock field's value. func (s *ReplaceRouteInput) SetDestinationCidrBlock(v string) *ReplaceRouteInput { s.DestinationCidrBlock = &v @@ -94850,6 +99230,12 @@ func (s *ReplaceRouteInput) SetDestinationIpv6CidrBlock(v string) *ReplaceRouteI return s } +// SetDestinationPrefixListId sets the DestinationPrefixListId field's value. +func (s *ReplaceRouteInput) SetDestinationPrefixListId(v string) *ReplaceRouteInput { + s.DestinationPrefixListId = &v + return s +} + // SetDryRun sets the DryRun field's value. func (s *ReplaceRouteInput) SetDryRun(v bool) *ReplaceRouteInput { s.DryRun = &v @@ -95290,8 +99676,8 @@ type RequestLaunchTemplateData struct { // in the Amazon Elastic Compute Cloud User Guide. CpuOptions *LaunchTemplateCpuOptionsRequest `type:"structure"` - // The credit option for CPU usage of the instance. Valid for T2 or T3 instances - // only. + // The credit option for CPU usage of the instance. Valid for T2, T3, or T3a + // instances only. CreditSpecification *CreditSpecificationRequest `type:"structure"` // If you set this parameter to true, you can't terminate the instance using @@ -95753,6 +100139,12 @@ type RequestSpotInstancesInput struct { // The default is the On-Demand price. SpotPrice *string `locationName:"spotPrice" type:"string"` + // The key-value pair for tagging the Spot Instance request on creation. The + // value for ResourceType must be spot-instances-request, otherwise the Spot + // Instance request fails. To tag the Spot Instance request after it has been + // created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The Spot Instance request type. // // Default: one-time @@ -95856,6 +100248,12 @@ func (s *RequestSpotInstancesInput) SetSpotPrice(v string) *RequestSpotInstances return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *RequestSpotInstancesInput) SetTagSpecifications(v []*TagSpecification) *RequestSpotInstancesInput { + s.TagSpecifications = v + return s +} + // SetType sets the Type field's value. func (s *RequestSpotInstancesInput) SetType(v string) *RequestSpotInstancesInput { s.Type = &v @@ -97743,6 +102141,107 @@ func (s *RestoreAddressToClassicOutput) SetStatus(v string) *RestoreAddressToCla return s } +type RestoreManagedPrefixListVersionInput struct { + _ struct{} `type:"structure"` + + // The current version number for the prefix list. + // + // CurrentVersion is a required field + CurrentVersion *int64 `type:"long" required:"true"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The ID of the prefix list. + // + // PrefixListId is a required field + PrefixListId *string `type:"string" required:"true"` + + // The version to restore. + // + // PreviousVersion is a required field + PreviousVersion *int64 `type:"long" required:"true"` +} + +// String returns the string representation +func (s RestoreManagedPrefixListVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreManagedPrefixListVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RestoreManagedPrefixListVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RestoreManagedPrefixListVersionInput"} + if s.CurrentVersion == nil { + invalidParams.Add(request.NewErrParamRequired("CurrentVersion")) + } + if s.PrefixListId == nil { + invalidParams.Add(request.NewErrParamRequired("PrefixListId")) + } + if s.PreviousVersion == nil { + invalidParams.Add(request.NewErrParamRequired("PreviousVersion")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *RestoreManagedPrefixListVersionInput) SetCurrentVersion(v int64) *RestoreManagedPrefixListVersionInput { + s.CurrentVersion = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *RestoreManagedPrefixListVersionInput) SetDryRun(v bool) *RestoreManagedPrefixListVersionInput { + s.DryRun = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *RestoreManagedPrefixListVersionInput) SetPrefixListId(v string) *RestoreManagedPrefixListVersionInput { + s.PrefixListId = &v + return s +} + +// SetPreviousVersion sets the PreviousVersion field's value. +func (s *RestoreManagedPrefixListVersionInput) SetPreviousVersion(v int64) *RestoreManagedPrefixListVersionInput { + s.PreviousVersion = &v + return s +} + +type RestoreManagedPrefixListVersionOutput struct { + _ struct{} `type:"structure"` + + // Information about the prefix list. + PrefixList *ManagedPrefixList `locationName:"prefixList" type:"structure"` +} + +// String returns the string representation +func (s RestoreManagedPrefixListVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RestoreManagedPrefixListVersionOutput) GoString() string { + return s.String() +} + +// SetPrefixList sets the PrefixList field's value. +func (s *RestoreManagedPrefixListVersionOutput) SetPrefixList(v *ManagedPrefixList) *RestoreManagedPrefixListVersionOutput { + s.PrefixList = v + return s +} + type RevokeClientVpnIngressInput struct { _ struct{} `type:"structure"` @@ -98123,6 +102622,9 @@ func (s RevokeSecurityGroupIngressOutput) GoString() string { type Route struct { _ struct{} `type:"structure"` + // The ID of the carrier gateway. + CarrierGatewayId *string `locationName:"carrierGatewayId" type:"string"` + // The IPv4 CIDR block used for the destination match. DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` @@ -98185,6 +102687,12 @@ func (s Route) GoString() string { return s.String() } +// SetCarrierGatewayId sets the CarrierGatewayId field's value. +func (s *Route) SetCarrierGatewayId(v string) *Route { + s.CarrierGatewayId = &v + return s +} + // SetDestinationCidrBlock sets the DestinationCidrBlock field's value. func (s *Route) SetDestinationCidrBlock(v string) *Route { s.DestinationCidrBlock = &v @@ -98475,14 +102983,14 @@ type RunInstancesInput struct { ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` // The CPU options for the instance. For more information, see Optimizing CPU - // Options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) + // options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) // in the Amazon Elastic Compute Cloud User Guide. CpuOptions *CpuOptionsRequest `type:"structure"` // The credit option for CPU usage of the burstable performance instance. Valid // values are standard and unlimited. To change this attribute after launch, // use ModifyInstanceCreditSpecification (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html). - // For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) + // For more information, see Burstable performance instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) // in the Amazon Elastic Compute Cloud User Guide. // // Default: standard (T2 instances) or unlimited (T3/T3a instances) @@ -98526,7 +103034,7 @@ type RunInstancesInput struct { ElasticInferenceAccelerators []*ElasticInferenceAccelerator `locationName:"ElasticInferenceAccelerator" locationNameList:"item" type:"list"` // Indicates whether an instance is enabled for hibernation. For more information, - // see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) + // see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. HibernationOptions *HibernationOptionsRequest `type:"structure"` @@ -98549,7 +103057,7 @@ type RunInstancesInput struct { // InstanceInterruptionBehavior is set to either hibernate or stop. InstanceMarketOptions *InstanceMarketOptionsRequest `type:"structure"` - // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) // in the Amazon Elastic Compute Cloud User Guide. // // Default: m1.small @@ -98609,7 +103117,7 @@ type RunInstancesInput struct { MaxCount *int64 `type:"integer" required:"true"` // The metadata options for the instance. For more information, see Instance - // Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). + // metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). MetadataOptions *InstanceMetadataOptionsRequest `type:"structure"` // The minimum number of instances to launch. If you specify a minimum that @@ -98686,7 +103194,7 @@ type RunInstancesInput struct { TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` // The user data to make available to the instance. For more information, see - // Running Commands on Your Linux Instance at Launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) + // Running commands on your Linux instance at launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) // (Linux) and Adding User Data (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data) // (Windows). If you are using a command line tool, base64-encoding is performed // for you, and you can load the text from a file. Otherwise, you must provide @@ -99677,19 +104185,15 @@ type ScheduledInstancesEbs struct { // only to instances that support them. Encrypted *bool `type:"boolean"` - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1 volumes, this represents the number of IOPS that are provisioned - // for the volume. For gp2 volumes, this represents the baseline performance - // of the volume and the rate at which the volume accumulates I/O credits for - // bursting. For more information about gp2 baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // The number of I/O operations per second (IOPS) to provision for an io1 or + // io2 volume, with a maximum ratio of 50 IOPS/GiB for io1, and 500 IOPS/GiB + // for io2. Range is 100 to 64,000 IOPS for volumes in most Regions. Maximum + // IOPS of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. For more + // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. + // This parameter is valid only for Provisioned IOPS SSD (io1 and io2) volumes. Iops *int64 `type:"integer"` // The ID of the snapshot. @@ -99701,8 +104205,9 @@ type ScheduledInstancesEbs struct { // a volume size, the default is the snapshot size. VolumeSize *int64 `type:"integer"` - // The volume type. gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, - // Throughput Optimized HDD for st1, Cold HDD for sc1, or standard for Magnetic. + // The volume type. gp2 for General Purpose SSD, io1 or io2 for Provisioned + // IOPS SSD, Throughput Optimized HDD for st1, Cold HDD for sc1, or standard + // for Magnetic. // // Default: gp2 VolumeType *string `type:"string"` @@ -100461,7 +104966,10 @@ type SearchTransitGatewayRoutesInput struct { // // * attachment.resource-id - The resource id of the transit gateway attachment. // - // * attachment.resource-type - The attachment resource type (vpc | vpn). + // * attachment.resource-type - The attachment resource type. Valid values + // are vpc | vpn | direct-connect-gateway | peering. + // + // * prefix-list-id - The ID of the prefix list. // // * route-search.exact-match - The exact match of the specified filter. // @@ -101192,9 +105700,10 @@ type Snapshot struct { // key for the parent volume. KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - // Value from an Amazon-maintained list (amazon | self | all | aws-marketplace - // | microsoft) of snapshot owners. Not to be confused with the user-configured - // AWS account alias, which is set from the IAM console. + // The AWS owner alias, as maintained by Amazon. The possible values are: amazon + // | self | all | aws-marketplace | microsoft. This AWS owner alias is not to + // be confused with the user-configured AWS account alias, which is set from + // the IAM console. OwnerAlias *string `locationName:"ownerAlias" type:"string"` // The AWS account ID of the EBS snapshot owner. @@ -101357,7 +105866,7 @@ type SnapshotDetail struct { // The URL used to access the disk image. Url *string `locationName:"url" type:"string"` - // The S3 bucket for the disk image. + // The Amazon S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` } @@ -101447,7 +105956,7 @@ type SnapshotDiskContainer struct { // a https URL (https://..) or an Amazon S3 URL (s3://..). Url *string `type:"string"` - // The S3 bucket for the disk image. + // The Amazon S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` } @@ -101627,7 +106136,7 @@ type SnapshotTaskDetail struct { // The URL of the disk image from which the snapshot is created. Url *string `locationName:"url" type:"string"` - // The S3 bucket for the disk image. + // The Amazon S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` } @@ -102107,7 +106616,7 @@ type SpotFleetRequestConfigData struct { // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) // role that grants the Spot Fleet the permission to request, launch, terminate, - // and tag instances on your behalf. For more information, see Spot Fleet Prerequisites + // and tag instances on your behalf. For more information, see Spot Fleet prerequisites // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html#spot-fleet-prerequisites) // in the Amazon EC2 User Guide for Linux Instances. Spot Fleet can terminate // Spot Instances on your behalf when you cancel its Spot Fleet request using @@ -102499,7 +107008,7 @@ type SpotInstanceRequest struct { SpotPrice *string `locationName:"spotPrice" type:"string"` // The state of the Spot Instance request. Spot status information helps track - // your Spot Instance requests. For more information, see Spot Status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) + // your Spot Instance requests. For more information, see Spot status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) // in the Amazon EC2 User Guide for Linux Instances. State *string `locationName:"state" type:"string" enum:"SpotInstanceState"` @@ -102685,7 +107194,7 @@ func (s *SpotInstanceStateFault) SetMessage(v string) *SpotInstanceStateFault { type SpotInstanceStatus struct { _ struct{} `type:"structure"` - // The status code. For a list of status codes, see Spot Status Codes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand) + // The status code. For a list of status codes, see Spot status codes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand) // in the Amazon EC2 User Guide for Linux Instances. Code *string `locationName:"code" type:"string"` @@ -103109,8 +107618,7 @@ type StaleIpPermission struct { // The IP ranges. Not applicable for stale security group rules. IpRanges []*string `locationName:"ipRanges" locationNameList:"item" type:"list"` - // The prefix list IDs for an AWS service. Not applicable for stale security - // group rules. + // The prefix list IDs. Not applicable for stale security group rules. PrefixListIds []*string `locationName:"prefixListIds" locationNameList:"item" type:"list"` // The end of the port range for the TCP and UDP protocols, or an ICMP type @@ -103482,7 +107990,7 @@ type StopInstancesInput struct { // Hibernates the instance if the instance was enabled for hibernation at launch. // If the instance cannot hibernate successfully, a normal shutdown occurs. - // For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) + // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. // // Default: false @@ -104046,13 +108554,17 @@ type TagSpecification struct { _ struct{} `type:"structure"` // The type of resource to tag. Currently, the resource types that support tagging - // on creation are: capacity-reservation | client-vpn-endpoint | dedicated-host - // | fleet | fpga-image | instance | ipv4pool-ec2 | ipv6pool-ec2 | key-pair - // | launch-template | natgateway | spot-fleet-request | placement-group | snapshot - // | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target + // on creation are: capacity-reservation | client-vpn-endpoint | customer-gateway + // | dedicated-host | dhcp-options | export-image-task | export-instance-task + // | fleet | fpga-image | host-reservation | import-image-task | import-snapshot-task + // | instance | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | + // launch-template | placement-group | prefix-list | natgateway | network-acl + // | route-table | security-group | spot-fleet-request | spot-instances-request + // | snapshot | subnet | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target // | transit-gateway | transit-gateway-attachment | transit-gateway-route-table - // | vpc-endpoint (for interface VPC endpoints)| vpc-endpoint-service (for gateway - // VPC endpoints) | volume | vpc-flow-log. + // | volume |vpc | vpc-peering-connection | vpc-endpoint (for interface and + // gateway endpoints) | vpc-endpoint-service (for AWS PrivateLink) | vpc-flow-log + // | vpn-connection | vpn-gateway. // // To tag a resource after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` @@ -105250,7 +109762,7 @@ type TransitGatewayAssociation struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` - // The resource type. + // The resource type. Note that the tgw-peering resource type has been deprecated. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` // The state of the association. @@ -105319,10 +109831,10 @@ type TransitGatewayAttachment struct { // The ID of the AWS account that owns the resource. ResourceOwnerId *string `locationName:"resourceOwnerId" type:"string"` - // The resource type. + // The resource type. Note that the tgw-peering resource type has been deprecated. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` - // The attachment state. + // The attachment state. Note that the initiating state has been deprecated. State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"` // The tags for the attachment. @@ -106032,7 +110544,8 @@ type TransitGatewayPeeringAttachment struct { // Information about the requester transit gateway. RequesterTgwInfo *PeeringTgwInfo `locationName:"requesterTgwInfo" type:"structure"` - // The state of the transit gateway peering attachment. + // The state of the transit gateway peering attachment. Note that the initiating + // state has been deprecated. State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"` // The status of the transit gateway peering attachment. @@ -106097,6 +110610,117 @@ func (s *TransitGatewayPeeringAttachment) SetTransitGatewayAttachmentId(v string return s } +// Describes a transit gateway prefix list attachment. +type TransitGatewayPrefixListAttachment struct { + _ struct{} `type:"structure"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` + + // The resource type. Note that the tgw-peering resource type has been deprecated. + ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` + + // The ID of the attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayPrefixListAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayPrefixListAttachment) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *TransitGatewayPrefixListAttachment) SetResourceId(v string) *TransitGatewayPrefixListAttachment { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *TransitGatewayPrefixListAttachment) SetResourceType(v string) *TransitGatewayPrefixListAttachment { + s.ResourceType = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayPrefixListAttachment) SetTransitGatewayAttachmentId(v string) *TransitGatewayPrefixListAttachment { + s.TransitGatewayAttachmentId = &v + return s +} + +// Describes a prefix list reference. +type TransitGatewayPrefixListReference struct { + _ struct{} `type:"structure"` + + // Indicates whether traffic that matches this route is dropped. + Blackhole *bool `locationName:"blackhole" type:"boolean"` + + // The ID of the prefix list. + PrefixListId *string `locationName:"prefixListId" type:"string"` + + // The ID of the prefix list owner. + PrefixListOwnerId *string `locationName:"prefixListOwnerId" type:"string"` + + // The state of the prefix list reference. + State *string `locationName:"state" type:"string" enum:"TransitGatewayPrefixListReferenceState"` + + // Information about the transit gateway attachment. + TransitGatewayAttachment *TransitGatewayPrefixListAttachment `locationName:"transitGatewayAttachment" type:"structure"` + + // The ID of the transit gateway route table. + TransitGatewayRouteTableId *string `locationName:"transitGatewayRouteTableId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayPrefixListReference) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayPrefixListReference) GoString() string { + return s.String() +} + +// SetBlackhole sets the Blackhole field's value. +func (s *TransitGatewayPrefixListReference) SetBlackhole(v bool) *TransitGatewayPrefixListReference { + s.Blackhole = &v + return s +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *TransitGatewayPrefixListReference) SetPrefixListId(v string) *TransitGatewayPrefixListReference { + s.PrefixListId = &v + return s +} + +// SetPrefixListOwnerId sets the PrefixListOwnerId field's value. +func (s *TransitGatewayPrefixListReference) SetPrefixListOwnerId(v string) *TransitGatewayPrefixListReference { + s.PrefixListOwnerId = &v + return s +} + +// SetState sets the State field's value. +func (s *TransitGatewayPrefixListReference) SetState(v string) *TransitGatewayPrefixListReference { + s.State = &v + return s +} + +// SetTransitGatewayAttachment sets the TransitGatewayAttachment field's value. +func (s *TransitGatewayPrefixListReference) SetTransitGatewayAttachment(v *TransitGatewayPrefixListAttachment) *TransitGatewayPrefixListReference { + s.TransitGatewayAttachment = v + return s +} + +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *TransitGatewayPrefixListReference) SetTransitGatewayRouteTableId(v string) *TransitGatewayPrefixListReference { + s.TransitGatewayRouteTableId = &v + return s +} + // Describes route propagation. type TransitGatewayPropagation struct { _ struct{} `type:"structure"` @@ -106104,7 +110728,7 @@ type TransitGatewayPropagation struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` - // The resource type. + // The resource type. Note that the tgw-peering resource type has been deprecated. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` // The state. @@ -106163,28 +110787,28 @@ type TransitGatewayRequestOptions struct { // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. // The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 - // for 32-bit ASNs. + // for 32-bit ASNs. The default is 64512. AmazonSideAsn *int64 `type:"long"` - // Enable or disable automatic acceptance of attachment requests. The default - // is disable. + // Enable or disable automatic acceptance of attachment requests. Disabled by + // default. AutoAcceptSharedAttachments *string `type:"string" enum:"AutoAcceptSharedAttachmentsValue"` // Enable or disable automatic association with the default association route - // table. The default is enable. + // table. Enabled by default. DefaultRouteTableAssociation *string `type:"string" enum:"DefaultRouteTableAssociationValue"` // Enable or disable automatic propagation of routes to the default propagation - // route table. The default is enable. + // route table. Enabled by default. DefaultRouteTablePropagation *string `type:"string" enum:"DefaultRouteTablePropagationValue"` - // Enable or disable DNS support. + // Enable or disable DNS support. Enabled by default. DnsSupport *string `type:"string" enum:"DnsSupportValue"` // Indicates whether multicast is enabled on the transit gateway MulticastSupport *string `type:"string" enum:"MulticastSupportValue"` - // Enable or disable Equal Cost Multipath Protocol support. + // Enable or disable Equal Cost Multipath Protocol support. Enabled by default. VpnEcmpSupport *string `type:"string" enum:"VpnEcmpSupportValue"` } @@ -106247,6 +110871,9 @@ type TransitGatewayRoute struct { // The CIDR block used for destination matches. DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` + // The ID of the prefix list used for destination matches. + PrefixListId *string `locationName:"prefixListId" type:"string"` + // The state of the route. State *string `locationName:"state" type:"string" enum:"TransitGatewayRouteState"` @@ -106273,6 +110900,12 @@ func (s *TransitGatewayRoute) SetDestinationCidrBlock(v string) *TransitGatewayR return s } +// SetPrefixListId sets the PrefixListId field's value. +func (s *TransitGatewayRoute) SetPrefixListId(v string) *TransitGatewayRoute { + s.PrefixListId = &v + return s +} + // SetState sets the State field's value. func (s *TransitGatewayRoute) SetState(v string) *TransitGatewayRoute { s.State = &v @@ -106298,7 +110931,7 @@ type TransitGatewayRouteAttachment struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` - // The resource type. + // The resource type. Note that the tgw-peering resource type has been deprecated. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` // The ID of the attachment. @@ -106420,7 +111053,7 @@ type TransitGatewayRouteTableAssociation struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` - // The resource type. + // The resource type. Note that the tgw-peering resource type has been deprecated. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` // The state of the association. @@ -106471,7 +111104,7 @@ type TransitGatewayRouteTablePropagation struct { // The ID of the resource. ResourceId *string `locationName:"resourceId" type:"string"` - // The type of resource. + // The type of resource. Note that the tgw-peering resource type has been deprecated. ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` // The state of the resource. @@ -106525,7 +111158,8 @@ type TransitGatewayVpcAttachment struct { // The VPC attachment options. Options *TransitGatewayVpcAttachmentOptions `locationName:"options" type:"structure"` - // The state of the VPC attachment. + // The state of the VPC attachment. Note that the initiating state has been + // deprecated. State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"` // The IDs of the subnets. @@ -106648,6 +111282,9 @@ func (s *TransitGatewayVpcAttachmentOptions) SetIpv6Support(v string) *TransitGa type TunnelOption struct { _ struct{} `type:"structure"` + // The action to take after a DPD timeout occurs. + DpdTimeoutAction *string `locationName:"dpdTimeoutAction" type:"string"` + // The number of seconds after which a DPD timeout occurs. DpdTimeoutSeconds *int64 `locationName:"dpdTimeoutSeconds" type:"integer"` @@ -106698,8 +111335,14 @@ type TunnelOption struct { // The number of packets in an IKE replay window. ReplayWindowSize *int64 `locationName:"replayWindowSize" type:"integer"` - // The range of inside IP addresses for the tunnel. + // The action to take when the establishing the VPN tunnels for a VPN connection. + StartupAction *string `locationName:"startupAction" type:"string"` + + // The range of inside IPv4 addresses for the tunnel. TunnelInsideCidr *string `locationName:"tunnelInsideCidr" type:"string"` + + // The range of inside IPv6 addresses for the tunnel. + TunnelInsideIpv6Cidr *string `locationName:"tunnelInsideIpv6Cidr" type:"string"` } // String returns the string representation @@ -106712,6 +111355,12 @@ func (s TunnelOption) GoString() string { return s.String() } +// SetDpdTimeoutAction sets the DpdTimeoutAction field's value. +func (s *TunnelOption) SetDpdTimeoutAction(v string) *TunnelOption { + s.DpdTimeoutAction = &v + return s +} + // SetDpdTimeoutSeconds sets the DpdTimeoutSeconds field's value. func (s *TunnelOption) SetDpdTimeoutSeconds(v int64) *TunnelOption { s.DpdTimeoutSeconds = &v @@ -106802,12 +111451,24 @@ func (s *TunnelOption) SetReplayWindowSize(v int64) *TunnelOption { return s } +// SetStartupAction sets the StartupAction field's value. +func (s *TunnelOption) SetStartupAction(v string) *TunnelOption { + s.StartupAction = &v + return s +} + // SetTunnelInsideCidr sets the TunnelInsideCidr field's value. func (s *TunnelOption) SetTunnelInsideCidr(v string) *TunnelOption { s.TunnelInsideCidr = &v return s } +// SetTunnelInsideIpv6Cidr sets the TunnelInsideIpv6Cidr field's value. +func (s *TunnelOption) SetTunnelInsideIpv6Cidr(v string) *TunnelOption { + s.TunnelInsideIpv6Cidr = &v + return s +} + type UnassignIpv6AddressesInput struct { _ struct{} `type:"structure"` @@ -107357,11 +112018,11 @@ func (s *UpdateSecurityGroupRuleDescriptionsIngressOutput) SetReturn(v bool) *Up return s } -// Describes the S3 bucket for the disk image. +// Describes the Amazon S3 bucket for the disk image. type UserBucket struct { _ struct{} `type:"structure"` - // The name of the S3 bucket where the disk image is located. + // The name of the Amazon S3 bucket where the disk image is located. S3Bucket *string `type:"string"` // The file name of the disk image. @@ -107390,11 +112051,11 @@ func (s *UserBucket) SetS3Key(v string) *UserBucket { return s } -// Describes the S3 bucket for the disk image. +// Describes the Amazon S3 bucket for the disk image. type UserBucketDetails struct { _ struct{} `type:"structure"` - // The S3 bucket from which the disk image was created. + // The Amazon S3 bucket from which the disk image was created. S3Bucket *string `locationName:"s3Bucket" type:"string"` // The file name of the disk image. @@ -107762,17 +112423,18 @@ type Volume struct { // For Provisioned IOPS SSD volumes, this represents the number of IOPS that // are provisioned for the volume. For General Purpose SSD volumes, this represents // the baseline performance of the volume and the rate at which the volume accumulates - // I/O credits for bursting. For more information, see Amazon EBS Volume Types + // I/O credits for bursting. For more information, see Amazon EBS volume types // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS - // for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed - // only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS + // for io1 and io2 volumes, in most Regions. The maximum IOPS for io1 and io2 + // of 64,000 is guaranteed only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). // Other instance families guarantee performance up to 32,000 IOPS. // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. + // Condition: This parameter is required for requests to create io1 and io2 + // volumes; it is not used in requests to create gp2, st1, sc1, or standard + // volumes. Iops *int64 `locationName:"iops" type:"integer"` // The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) @@ -107801,9 +112463,9 @@ type Volume struct { // The ID of the volume. VolumeId *string `locationName:"volumeId" type:"string"` - // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned - // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard - // for Magnetic volumes. + // The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for + // Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, + // or standard for Magnetic volumes. VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` } @@ -108031,7 +112693,7 @@ type VolumeModification struct { // The original IOPS rate of the volume. OriginalIops *int64 `locationName:"originalIops" type:"integer"` - // The original size of the volume. + // The original size of the volume, in GiB. OriginalSize *int64 `locationName:"originalSize" type:"integer"` // The original EBS volume type of the volume. @@ -108448,8 +113110,7 @@ type Vpc struct { // Information about the IPv4 CIDR blocks associated with the VPC. CidrBlockAssociationSet []*VpcCidrBlockAssociation `locationName:"cidrBlockAssociationSet" locationNameList:"item" type:"list"` - // The ID of the set of DHCP options you've associated with the VPC (or default - // if the default options are associated with the VPC). + // The ID of the set of DHCP options you've associated with the VPC. DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` // The allowed tenancy of instances launched into the VPC. @@ -108958,7 +113619,8 @@ type VpcIpv6CidrBlockAssociation struct { // The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. Ipv6Pool *string `locationName:"ipv6Pool" type:"string"` - // The name of the location from which we advertise the IPV6 CIDR block. + // The name of the unique set of Availability Zones, Local Zones, or Wavelength + // Zones from which AWS advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1. NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` } @@ -109364,10 +114026,25 @@ type VpnConnectionOptions struct { // Indicates whether acceleration is enabled for the VPN connection. EnableAcceleration *bool `locationName:"enableAcceleration" type:"boolean"` + // The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. + LocalIpv4NetworkCidr *string `locationName:"localIpv4NetworkCidr" type:"string"` + + // The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. + LocalIpv6NetworkCidr *string `locationName:"localIpv6NetworkCidr" type:"string"` + + // The IPv4 CIDR on the AWS side of the VPN connection. + RemoteIpv4NetworkCidr *string `locationName:"remoteIpv4NetworkCidr" type:"string"` + + // The IPv6 CIDR on the AWS side of the VPN connection. + RemoteIpv6NetworkCidr *string `locationName:"remoteIpv6NetworkCidr" type:"string"` + // Indicates whether the VPN connection uses static routes only. Static routes // must be used for devices that don't support BGP. StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` + // Indicates whether the VPN tunnels process IPv4 or IPv6 traffic. + TunnelInsideIpVersion *string `locationName:"tunnelInsideIpVersion" type:"string" enum:"TunnelInsideIpVersion"` + // Indicates the VPN tunnel options. TunnelOptions []*TunnelOption `locationName:"tunnelOptionSet" locationNameList:"item" type:"list"` } @@ -109388,12 +114065,42 @@ func (s *VpnConnectionOptions) SetEnableAcceleration(v bool) *VpnConnectionOptio return s } +// SetLocalIpv4NetworkCidr sets the LocalIpv4NetworkCidr field's value. +func (s *VpnConnectionOptions) SetLocalIpv4NetworkCidr(v string) *VpnConnectionOptions { + s.LocalIpv4NetworkCidr = &v + return s +} + +// SetLocalIpv6NetworkCidr sets the LocalIpv6NetworkCidr field's value. +func (s *VpnConnectionOptions) SetLocalIpv6NetworkCidr(v string) *VpnConnectionOptions { + s.LocalIpv6NetworkCidr = &v + return s +} + +// SetRemoteIpv4NetworkCidr sets the RemoteIpv4NetworkCidr field's value. +func (s *VpnConnectionOptions) SetRemoteIpv4NetworkCidr(v string) *VpnConnectionOptions { + s.RemoteIpv4NetworkCidr = &v + return s +} + +// SetRemoteIpv6NetworkCidr sets the RemoteIpv6NetworkCidr field's value. +func (s *VpnConnectionOptions) SetRemoteIpv6NetworkCidr(v string) *VpnConnectionOptions { + s.RemoteIpv6NetworkCidr = &v + return s +} + // SetStaticRoutesOnly sets the StaticRoutesOnly field's value. func (s *VpnConnectionOptions) SetStaticRoutesOnly(v bool) *VpnConnectionOptions { s.StaticRoutesOnly = &v return s } +// SetTunnelInsideIpVersion sets the TunnelInsideIpVersion field's value. +func (s *VpnConnectionOptions) SetTunnelInsideIpVersion(v string) *VpnConnectionOptions { + s.TunnelInsideIpVersion = &v + return s +} + // SetTunnelOptions sets the TunnelOptions field's value. func (s *VpnConnectionOptions) SetTunnelOptions(v []*TunnelOption) *VpnConnectionOptions { s.TunnelOptions = v @@ -109409,6 +114116,26 @@ type VpnConnectionOptionsSpecification struct { // Default: false EnableAcceleration *bool `type:"boolean"` + // The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. + // + // Default: 0.0.0.0/0 + LocalIpv4NetworkCidr *string `type:"string"` + + // The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. + // + // Default: ::/0 + LocalIpv6NetworkCidr *string `type:"string"` + + // The IPv4 CIDR on the AWS side of the VPN connection. + // + // Default: 0.0.0.0/0 + RemoteIpv4NetworkCidr *string `type:"string"` + + // The IPv6 CIDR on the AWS side of the VPN connection. + // + // Default: ::/0 + RemoteIpv6NetworkCidr *string `type:"string"` + // Indicate whether the VPN connection uses static routes only. If you are creating // a VPN connection for a device that does not support BGP, you must specify // true. Use CreateVpnConnectionRoute to create a static route. @@ -109416,6 +114143,11 @@ type VpnConnectionOptionsSpecification struct { // Default: false StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` + // Indicate whether the VPN tunnels process IPv4 or IPv6 traffic. + // + // Default: ipv4 + TunnelInsideIpVersion *string `type:"string" enum:"TunnelInsideIpVersion"` + // The tunnel options for the VPN connection. TunnelOptions []*VpnTunnelOptionsSpecification `type:"list"` } @@ -109436,12 +114168,42 @@ func (s *VpnConnectionOptionsSpecification) SetEnableAcceleration(v bool) *VpnCo return s } +// SetLocalIpv4NetworkCidr sets the LocalIpv4NetworkCidr field's value. +func (s *VpnConnectionOptionsSpecification) SetLocalIpv4NetworkCidr(v string) *VpnConnectionOptionsSpecification { + s.LocalIpv4NetworkCidr = &v + return s +} + +// SetLocalIpv6NetworkCidr sets the LocalIpv6NetworkCidr field's value. +func (s *VpnConnectionOptionsSpecification) SetLocalIpv6NetworkCidr(v string) *VpnConnectionOptionsSpecification { + s.LocalIpv6NetworkCidr = &v + return s +} + +// SetRemoteIpv4NetworkCidr sets the RemoteIpv4NetworkCidr field's value. +func (s *VpnConnectionOptionsSpecification) SetRemoteIpv4NetworkCidr(v string) *VpnConnectionOptionsSpecification { + s.RemoteIpv4NetworkCidr = &v + return s +} + +// SetRemoteIpv6NetworkCidr sets the RemoteIpv6NetworkCidr field's value. +func (s *VpnConnectionOptionsSpecification) SetRemoteIpv6NetworkCidr(v string) *VpnConnectionOptionsSpecification { + s.RemoteIpv6NetworkCidr = &v + return s +} + // SetStaticRoutesOnly sets the StaticRoutesOnly field's value. func (s *VpnConnectionOptionsSpecification) SetStaticRoutesOnly(v bool) *VpnConnectionOptionsSpecification { s.StaticRoutesOnly = &v return s } +// SetTunnelInsideIpVersion sets the TunnelInsideIpVersion field's value. +func (s *VpnConnectionOptionsSpecification) SetTunnelInsideIpVersion(v string) *VpnConnectionOptionsSpecification { + s.TunnelInsideIpVersion = &v + return s +} + // SetTunnelOptions sets the TunnelOptions field's value. func (s *VpnConnectionOptionsSpecification) SetTunnelOptions(v []*VpnTunnelOptionsSpecification) *VpnConnectionOptionsSpecification { s.TunnelOptions = v @@ -109573,6 +114335,14 @@ func (s *VpnStaticRoute) SetState(v string) *VpnStaticRoute { type VpnTunnelOptionsSpecification struct { _ struct{} `type:"structure"` + // The action to take after DPD timeout occurs. Specify restart to restart the + // IKE initiation. Specify clear to end the IKE session. + // + // Valid Values: clear | none | restart + // + // Default: clear + DPDTimeoutAction *string `type:"string"` + // The number of seconds after which a DPD timeout occurs. // // Constraints: A value between 0 and 30. @@ -109588,19 +114358,19 @@ type VpnTunnelOptionsSpecification struct { // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel // for phase 1 IKE negotiations. // - // Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 + // Valid values: 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 Phase1DHGroupNumbers []*Phase1DHGroupNumbersRequestListValue `locationName:"Phase1DHGroupNumber" locationNameList:"item" type:"list"` // One or more encryption algorithms that are permitted for the VPN tunnel for // phase 1 IKE negotiations. // - // Valid values: AES128 | AES256 + // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 Phase1EncryptionAlgorithms []*Phase1EncryptionAlgorithmsRequestListValue `locationName:"Phase1EncryptionAlgorithm" locationNameList:"item" type:"list"` // One or more integrity algorithms that are permitted for the VPN tunnel for // phase 1 IKE negotiations. // - // Valid values: SHA1 | SHA2-256 + // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 Phase1IntegrityAlgorithms []*Phase1IntegrityAlgorithmsRequestListValue `locationName:"Phase1IntegrityAlgorithm" locationNameList:"item" type:"list"` // The lifetime for phase 1 of the IKE negotiation, in seconds. @@ -109613,19 +114383,19 @@ type VpnTunnelOptionsSpecification struct { // One or more Diffie-Hellman group numbers that are permitted for the VPN tunnel // for phase 2 IKE negotiations. // - // Valid values: 2 | 5 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 + // Valid values: 2 | 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 Phase2DHGroupNumbers []*Phase2DHGroupNumbersRequestListValue `locationName:"Phase2DHGroupNumber" locationNameList:"item" type:"list"` // One or more encryption algorithms that are permitted for the VPN tunnel for // phase 2 IKE negotiations. // - // Valid values: AES128 | AES256 + // Valid values: AES128 | AES256 | AES128-GCM-16 | AES256-GCM-16 Phase2EncryptionAlgorithms []*Phase2EncryptionAlgorithmsRequestListValue `locationName:"Phase2EncryptionAlgorithm" locationNameList:"item" type:"list"` // One or more integrity algorithms that are permitted for the VPN tunnel for // phase 2 IKE negotiations. // - // Valid values: SHA1 | SHA2-256 + // Valid values: SHA1 | SHA2-256 | SHA2-384 | SHA2-512 Phase2IntegrityAlgorithms []*Phase2IntegrityAlgorithmsRequestListValue `locationName:"Phase2IntegrityAlgorithm" locationNameList:"item" type:"list"` // The lifetime for phase 2 of the IKE negotiation, in seconds. @@ -109668,7 +114438,16 @@ type VpnTunnelOptionsSpecification struct { // Default: 1024 ReplayWindowSize *int64 `type:"integer"` - // The range of inside IP addresses for the tunnel. Any specified CIDR blocks + // The action to take when the establishing the tunnel for the VPN connection. + // By default, your customer gateway device must initiate the IKE negotiation + // and bring up the tunnel. Specify start for AWS to initiate the IKE negotiation. + // + // Valid Values: add | start + // + // Default: add + StartupAction *string `type:"string"` + + // The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks // must be unique across all VPN connections that use the same virtual private // gateway. // @@ -109689,6 +114468,12 @@ type VpnTunnelOptionsSpecification struct { // // * 169.254.169.252/30 TunnelInsideCidr *string `type:"string"` + + // The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks + // must be unique across all VPN connections that use the same transit gateway. + // + // Constraints: A size /126 CIDR block from the local fd00::/8 range. + TunnelInsideIpv6Cidr *string `type:"string"` } // String returns the string representation @@ -109701,6 +114486,12 @@ func (s VpnTunnelOptionsSpecification) GoString() string { return s.String() } +// SetDPDTimeoutAction sets the DPDTimeoutAction field's value. +func (s *VpnTunnelOptionsSpecification) SetDPDTimeoutAction(v string) *VpnTunnelOptionsSpecification { + s.DPDTimeoutAction = &v + return s +} + // SetDPDTimeoutSeconds sets the DPDTimeoutSeconds field's value. func (s *VpnTunnelOptionsSpecification) SetDPDTimeoutSeconds(v int64) *VpnTunnelOptionsSpecification { s.DPDTimeoutSeconds = &v @@ -109785,12 +114576,24 @@ func (s *VpnTunnelOptionsSpecification) SetReplayWindowSize(v int64) *VpnTunnelO return s } +// SetStartupAction sets the StartupAction field's value. +func (s *VpnTunnelOptionsSpecification) SetStartupAction(v string) *VpnTunnelOptionsSpecification { + s.StartupAction = &v + return s +} + // SetTunnelInsideCidr sets the TunnelInsideCidr field's value. func (s *VpnTunnelOptionsSpecification) SetTunnelInsideCidr(v string) *VpnTunnelOptionsSpecification { s.TunnelInsideCidr = &v return s } +// SetTunnelInsideIpv6Cidr sets the TunnelInsideIpv6Cidr field's value. +func (s *VpnTunnelOptionsSpecification) SetTunnelInsideIpv6Cidr(v string) *VpnTunnelOptionsSpecification { + s.TunnelInsideIpv6Cidr = &v + return s +} + type WithdrawByoipCidrInput struct { _ struct{} `type:"structure"` @@ -109872,6 +114675,14 @@ const ( AccountAttributeNameDefaultVpc = "default-vpc" ) +// AccountAttributeName_Values returns all elements of the AccountAttributeName enum +func AccountAttributeName_Values() []string { + return []string{ + AccountAttributeNameSupportedPlatforms, + AccountAttributeNameDefaultVpc, + } +} + const ( // ActivityStatusError is a ActivityStatus enum value ActivityStatusError = "error" @@ -109886,6 +114697,16 @@ const ( ActivityStatusFulfilled = "fulfilled" ) +// ActivityStatus_Values returns all elements of the ActivityStatus enum +func ActivityStatus_Values() []string { + return []string{ + ActivityStatusError, + ActivityStatusPendingFulfillment, + ActivityStatusPendingTermination, + ActivityStatusFulfilled, + } +} + const ( // AffinityDefault is a Affinity enum value AffinityDefault = "default" @@ -109894,6 +114715,14 @@ const ( AffinityHost = "host" ) +// Affinity_Values returns all elements of the Affinity enum +func Affinity_Values() []string { + return []string{ + AffinityDefault, + AffinityHost, + } +} + const ( // AllocationStateAvailable is a AllocationState enum value AllocationStateAvailable = "available" @@ -109914,6 +114743,18 @@ const ( AllocationStatePending = "pending" ) +// AllocationState_Values returns all elements of the AllocationState enum +func AllocationState_Values() []string { + return []string{ + AllocationStateAvailable, + AllocationStateUnderAssessment, + AllocationStatePermanentFailure, + AllocationStateReleased, + AllocationStateReleasedPermanentFailure, + AllocationStatePending, + } +} + const ( // AllocationStrategyLowestPrice is a AllocationStrategy enum value AllocationStrategyLowestPrice = "lowestPrice" @@ -109925,6 +114766,15 @@ const ( AllocationStrategyCapacityOptimized = "capacityOptimized" ) +// AllocationStrategy_Values returns all elements of the AllocationStrategy enum +func AllocationStrategy_Values() []string { + return []string{ + AllocationStrategyLowestPrice, + AllocationStrategyDiversified, + AllocationStrategyCapacityOptimized, + } +} + const ( // AllowsMultipleInstanceTypesOn is a AllowsMultipleInstanceTypes enum value AllowsMultipleInstanceTypesOn = "on" @@ -109933,6 +114783,14 @@ const ( AllowsMultipleInstanceTypesOff = "off" ) +// AllowsMultipleInstanceTypes_Values returns all elements of the AllowsMultipleInstanceTypes enum +func AllowsMultipleInstanceTypes_Values() []string { + return []string{ + AllowsMultipleInstanceTypesOn, + AllowsMultipleInstanceTypesOff, + } +} + const ( // ArchitectureTypeI386 is a ArchitectureType enum value ArchitectureTypeI386 = "i386" @@ -109944,6 +114802,15 @@ const ( ArchitectureTypeArm64 = "arm64" ) +// ArchitectureType_Values returns all elements of the ArchitectureType enum +func ArchitectureType_Values() []string { + return []string{ + ArchitectureTypeI386, + ArchitectureTypeX8664, + ArchitectureTypeArm64, + } +} + const ( // ArchitectureValuesI386 is a ArchitectureValues enum value ArchitectureValuesI386 = "i386" @@ -109955,11 +114822,27 @@ const ( ArchitectureValuesArm64 = "arm64" ) +// ArchitectureValues_Values returns all elements of the ArchitectureValues enum +func ArchitectureValues_Values() []string { + return []string{ + ArchitectureValuesI386, + ArchitectureValuesX8664, + ArchitectureValuesArm64, + } +} + const ( // AssociatedNetworkTypeVpc is a AssociatedNetworkType enum value AssociatedNetworkTypeVpc = "vpc" ) +// AssociatedNetworkType_Values returns all elements of the AssociatedNetworkType enum +func AssociatedNetworkType_Values() []string { + return []string{ + AssociatedNetworkTypeVpc, + } +} + const ( // AssociationStatusCodeAssociating is a AssociationStatusCode enum value AssociationStatusCodeAssociating = "associating" @@ -109977,6 +114860,17 @@ const ( AssociationStatusCodeDisassociated = "disassociated" ) +// AssociationStatusCode_Values returns all elements of the AssociationStatusCode enum +func AssociationStatusCode_Values() []string { + return []string{ + AssociationStatusCodeAssociating, + AssociationStatusCodeAssociated, + AssociationStatusCodeAssociationFailed, + AssociationStatusCodeDisassociating, + AssociationStatusCodeDisassociated, + } +} + const ( // AttachmentStatusAttaching is a AttachmentStatus enum value AttachmentStatusAttaching = "attaching" @@ -109991,6 +114885,16 @@ const ( AttachmentStatusDetached = "detached" ) +// AttachmentStatus_Values returns all elements of the AttachmentStatus enum +func AttachmentStatus_Values() []string { + return []string{ + AttachmentStatusAttaching, + AttachmentStatusAttached, + AttachmentStatusDetaching, + AttachmentStatusDetached, + } +} + const ( // AutoAcceptSharedAttachmentsValueEnable is a AutoAcceptSharedAttachmentsValue enum value AutoAcceptSharedAttachmentsValueEnable = "enable" @@ -109999,6 +114903,14 @@ const ( AutoAcceptSharedAttachmentsValueDisable = "disable" ) +// AutoAcceptSharedAttachmentsValue_Values returns all elements of the AutoAcceptSharedAttachmentsValue enum +func AutoAcceptSharedAttachmentsValue_Values() []string { + return []string{ + AutoAcceptSharedAttachmentsValueEnable, + AutoAcceptSharedAttachmentsValueDisable, + } +} + const ( // AutoPlacementOn is a AutoPlacement enum value AutoPlacementOn = "on" @@ -110007,6 +114919,14 @@ const ( AutoPlacementOff = "off" ) +// AutoPlacement_Values returns all elements of the AutoPlacement enum +func AutoPlacement_Values() []string { + return []string{ + AutoPlacementOn, + AutoPlacementOff, + } +} + const ( // AvailabilityZoneOptInStatusOptInNotRequired is a AvailabilityZoneOptInStatus enum value AvailabilityZoneOptInStatusOptInNotRequired = "opt-in-not-required" @@ -110018,6 +114938,15 @@ const ( AvailabilityZoneOptInStatusNotOptedIn = "not-opted-in" ) +// AvailabilityZoneOptInStatus_Values returns all elements of the AvailabilityZoneOptInStatus enum +func AvailabilityZoneOptInStatus_Values() []string { + return []string{ + AvailabilityZoneOptInStatusOptInNotRequired, + AvailabilityZoneOptInStatusOptedIn, + AvailabilityZoneOptInStatusNotOptedIn, + } +} + const ( // AvailabilityZoneStateAvailable is a AvailabilityZoneState enum value AvailabilityZoneStateAvailable = "available" @@ -110032,6 +114961,16 @@ const ( AvailabilityZoneStateUnavailable = "unavailable" ) +// AvailabilityZoneState_Values returns all elements of the AvailabilityZoneState enum +func AvailabilityZoneState_Values() []string { + return []string{ + AvailabilityZoneStateAvailable, + AvailabilityZoneStateInformation, + AvailabilityZoneStateImpaired, + AvailabilityZoneStateUnavailable, + } +} + const ( // BatchStateSubmitted is a BatchState enum value BatchStateSubmitted = "submitted" @@ -110055,6 +114994,19 @@ const ( BatchStateModifying = "modifying" ) +// BatchState_Values returns all elements of the BatchState enum +func BatchState_Values() []string { + return []string{ + BatchStateSubmitted, + BatchStateActive, + BatchStateCancelled, + BatchStateFailed, + BatchStateCancelledRunning, + BatchStateCancelledTerminating, + BatchStateModifying, + } +} + const ( // BundleTaskStatePending is a BundleTaskState enum value BundleTaskStatePending = "pending" @@ -110078,6 +115030,19 @@ const ( BundleTaskStateFailed = "failed" ) +// BundleTaskState_Values returns all elements of the BundleTaskState enum +func BundleTaskState_Values() []string { + return []string{ + BundleTaskStatePending, + BundleTaskStateWaitingForShutdown, + BundleTaskStateBundling, + BundleTaskStateStoring, + BundleTaskStateCancelling, + BundleTaskStateComplete, + BundleTaskStateFailed, + } +} + const ( // ByoipCidrStateAdvertised is a ByoipCidrState enum value ByoipCidrStateAdvertised = "advertised" @@ -110104,6 +115069,20 @@ const ( ByoipCidrStateProvisionedNotPubliclyAdvertisable = "provisioned-not-publicly-advertisable" ) +// ByoipCidrState_Values returns all elements of the ByoipCidrState enum +func ByoipCidrState_Values() []string { + return []string{ + ByoipCidrStateAdvertised, + ByoipCidrStateDeprovisioned, + ByoipCidrStateFailedDeprovision, + ByoipCidrStateFailedProvision, + ByoipCidrStatePendingDeprovision, + ByoipCidrStatePendingProvision, + ByoipCidrStateProvisioned, + ByoipCidrStateProvisionedNotPubliclyAdvertisable, + } +} + const ( // CancelBatchErrorCodeFleetRequestIdDoesNotExist is a CancelBatchErrorCode enum value CancelBatchErrorCodeFleetRequestIdDoesNotExist = "fleetRequestIdDoesNotExist" @@ -110118,6 +115097,16 @@ const ( CancelBatchErrorCodeUnexpectedError = "unexpectedError" ) +// CancelBatchErrorCode_Values returns all elements of the CancelBatchErrorCode enum +func CancelBatchErrorCode_Values() []string { + return []string{ + CancelBatchErrorCodeFleetRequestIdDoesNotExist, + CancelBatchErrorCodeFleetRequestIdMalformed, + CancelBatchErrorCodeFleetRequestNotInCancellableState, + CancelBatchErrorCodeUnexpectedError, + } +} + const ( // CancelSpotInstanceRequestStateActive is a CancelSpotInstanceRequestState enum value CancelSpotInstanceRequestStateActive = "active" @@ -110135,6 +115124,17 @@ const ( CancelSpotInstanceRequestStateCompleted = "completed" ) +// CancelSpotInstanceRequestState_Values returns all elements of the CancelSpotInstanceRequestState enum +func CancelSpotInstanceRequestState_Values() []string { + return []string{ + CancelSpotInstanceRequestStateActive, + CancelSpotInstanceRequestStateOpen, + CancelSpotInstanceRequestStateClosed, + CancelSpotInstanceRequestStateCancelled, + CancelSpotInstanceRequestStateCompleted, + } +} + const ( // CapacityReservationInstancePlatformLinuxUnix is a CapacityReservationInstancePlatform enum value CapacityReservationInstancePlatformLinuxUnix = "Linux/UNIX" @@ -110170,6 +115170,23 @@ const ( CapacityReservationInstancePlatformLinuxwithSqlserverEnterprise = "Linux with SQL Server Enterprise" ) +// CapacityReservationInstancePlatform_Values returns all elements of the CapacityReservationInstancePlatform enum +func CapacityReservationInstancePlatform_Values() []string { + return []string{ + CapacityReservationInstancePlatformLinuxUnix, + CapacityReservationInstancePlatformRedHatEnterpriseLinux, + CapacityReservationInstancePlatformSuselinux, + CapacityReservationInstancePlatformWindows, + CapacityReservationInstancePlatformWindowswithSqlserver, + CapacityReservationInstancePlatformWindowswithSqlserverEnterprise, + CapacityReservationInstancePlatformWindowswithSqlserverStandard, + CapacityReservationInstancePlatformWindowswithSqlserverWeb, + CapacityReservationInstancePlatformLinuxwithSqlserverStandard, + CapacityReservationInstancePlatformLinuxwithSqlserverWeb, + CapacityReservationInstancePlatformLinuxwithSqlserverEnterprise, + } +} + const ( // CapacityReservationPreferenceOpen is a CapacityReservationPreference enum value CapacityReservationPreferenceOpen = "open" @@ -110178,6 +115195,14 @@ const ( CapacityReservationPreferenceNone = "none" ) +// CapacityReservationPreference_Values returns all elements of the CapacityReservationPreference enum +func CapacityReservationPreference_Values() []string { + return []string{ + CapacityReservationPreferenceOpen, + CapacityReservationPreferenceNone, + } +} + const ( // CapacityReservationStateActive is a CapacityReservationState enum value CapacityReservationStateActive = "active" @@ -110195,6 +115220,17 @@ const ( CapacityReservationStateFailed = "failed" ) +// CapacityReservationState_Values returns all elements of the CapacityReservationState enum +func CapacityReservationState_Values() []string { + return []string{ + CapacityReservationStateActive, + CapacityReservationStateExpired, + CapacityReservationStateCancelled, + CapacityReservationStatePending, + CapacityReservationStateFailed, + } +} + const ( // CapacityReservationTenancyDefault is a CapacityReservationTenancy enum value CapacityReservationTenancyDefault = "default" @@ -110203,6 +115239,38 @@ const ( CapacityReservationTenancyDedicated = "dedicated" ) +// CapacityReservationTenancy_Values returns all elements of the CapacityReservationTenancy enum +func CapacityReservationTenancy_Values() []string { + return []string{ + CapacityReservationTenancyDefault, + CapacityReservationTenancyDedicated, + } +} + +const ( + // CarrierGatewayStatePending is a CarrierGatewayState enum value + CarrierGatewayStatePending = "pending" + + // CarrierGatewayStateAvailable is a CarrierGatewayState enum value + CarrierGatewayStateAvailable = "available" + + // CarrierGatewayStateDeleting is a CarrierGatewayState enum value + CarrierGatewayStateDeleting = "deleting" + + // CarrierGatewayStateDeleted is a CarrierGatewayState enum value + CarrierGatewayStateDeleted = "deleted" +) + +// CarrierGatewayState_Values returns all elements of the CarrierGatewayState enum +func CarrierGatewayState_Values() []string { + return []string{ + CarrierGatewayStatePending, + CarrierGatewayStateAvailable, + CarrierGatewayStateDeleting, + CarrierGatewayStateDeleted, + } +} + const ( // ClientCertificateRevocationListStatusCodePending is a ClientCertificateRevocationListStatusCode enum value ClientCertificateRevocationListStatusCodePending = "pending" @@ -110211,6 +115279,14 @@ const ( ClientCertificateRevocationListStatusCodeActive = "active" ) +// ClientCertificateRevocationListStatusCode_Values returns all elements of the ClientCertificateRevocationListStatusCode enum +func ClientCertificateRevocationListStatusCode_Values() []string { + return []string{ + ClientCertificateRevocationListStatusCodePending, + ClientCertificateRevocationListStatusCodeActive, + } +} + const ( // ClientVpnAuthenticationTypeCertificateAuthentication is a ClientVpnAuthenticationType enum value ClientVpnAuthenticationTypeCertificateAuthentication = "certificate-authentication" @@ -110222,6 +115298,15 @@ const ( ClientVpnAuthenticationTypeFederatedAuthentication = "federated-authentication" ) +// ClientVpnAuthenticationType_Values returns all elements of the ClientVpnAuthenticationType enum +func ClientVpnAuthenticationType_Values() []string { + return []string{ + ClientVpnAuthenticationTypeCertificateAuthentication, + ClientVpnAuthenticationTypeDirectoryServiceAuthentication, + ClientVpnAuthenticationTypeFederatedAuthentication, + } +} + const ( // ClientVpnAuthorizationRuleStatusCodeAuthorizing is a ClientVpnAuthorizationRuleStatusCode enum value ClientVpnAuthorizationRuleStatusCodeAuthorizing = "authorizing" @@ -110236,6 +115321,16 @@ const ( ClientVpnAuthorizationRuleStatusCodeRevoking = "revoking" ) +// ClientVpnAuthorizationRuleStatusCode_Values returns all elements of the ClientVpnAuthorizationRuleStatusCode enum +func ClientVpnAuthorizationRuleStatusCode_Values() []string { + return []string{ + ClientVpnAuthorizationRuleStatusCodeAuthorizing, + ClientVpnAuthorizationRuleStatusCodeActive, + ClientVpnAuthorizationRuleStatusCodeFailed, + ClientVpnAuthorizationRuleStatusCodeRevoking, + } +} + const ( // ClientVpnConnectionStatusCodeActive is a ClientVpnConnectionStatusCode enum value ClientVpnConnectionStatusCodeActive = "active" @@ -110250,6 +115345,16 @@ const ( ClientVpnConnectionStatusCodeTerminated = "terminated" ) +// ClientVpnConnectionStatusCode_Values returns all elements of the ClientVpnConnectionStatusCode enum +func ClientVpnConnectionStatusCode_Values() []string { + return []string{ + ClientVpnConnectionStatusCodeActive, + ClientVpnConnectionStatusCodeFailedToTerminate, + ClientVpnConnectionStatusCodeTerminating, + ClientVpnConnectionStatusCodeTerminated, + } +} + const ( // ClientVpnEndpointStatusCodePendingAssociate is a ClientVpnEndpointStatusCode enum value ClientVpnEndpointStatusCodePendingAssociate = "pending-associate" @@ -110264,6 +115369,16 @@ const ( ClientVpnEndpointStatusCodeDeleted = "deleted" ) +// ClientVpnEndpointStatusCode_Values returns all elements of the ClientVpnEndpointStatusCode enum +func ClientVpnEndpointStatusCode_Values() []string { + return []string{ + ClientVpnEndpointStatusCodePendingAssociate, + ClientVpnEndpointStatusCodeAvailable, + ClientVpnEndpointStatusCodeDeleting, + ClientVpnEndpointStatusCodeDeleted, + } +} + const ( // ClientVpnRouteStatusCodeCreating is a ClientVpnRouteStatusCode enum value ClientVpnRouteStatusCodeCreating = "creating" @@ -110278,6 +115393,16 @@ const ( ClientVpnRouteStatusCodeDeleting = "deleting" ) +// ClientVpnRouteStatusCode_Values returns all elements of the ClientVpnRouteStatusCode enum +func ClientVpnRouteStatusCode_Values() []string { + return []string{ + ClientVpnRouteStatusCodeCreating, + ClientVpnRouteStatusCodeActive, + ClientVpnRouteStatusCodeFailed, + ClientVpnRouteStatusCodeDeleting, + } +} + const ( // ConnectionNotificationStateEnabled is a ConnectionNotificationState enum value ConnectionNotificationStateEnabled = "Enabled" @@ -110286,16 +115411,38 @@ const ( ConnectionNotificationStateDisabled = "Disabled" ) +// ConnectionNotificationState_Values returns all elements of the ConnectionNotificationState enum +func ConnectionNotificationState_Values() []string { + return []string{ + ConnectionNotificationStateEnabled, + ConnectionNotificationStateDisabled, + } +} + const ( // ConnectionNotificationTypeTopic is a ConnectionNotificationType enum value ConnectionNotificationTypeTopic = "Topic" ) +// ConnectionNotificationType_Values returns all elements of the ConnectionNotificationType enum +func ConnectionNotificationType_Values() []string { + return []string{ + ConnectionNotificationTypeTopic, + } +} + const ( // ContainerFormatOva is a ContainerFormat enum value ContainerFormatOva = "ova" ) +// ContainerFormat_Values returns all elements of the ContainerFormat enum +func ContainerFormat_Values() []string { + return []string{ + ContainerFormatOva, + } +} + const ( // ConversionTaskStateActive is a ConversionTaskState enum value ConversionTaskStateActive = "active" @@ -110310,16 +115457,40 @@ const ( ConversionTaskStateCompleted = "completed" ) +// ConversionTaskState_Values returns all elements of the ConversionTaskState enum +func ConversionTaskState_Values() []string { + return []string{ + ConversionTaskStateActive, + ConversionTaskStateCancelling, + ConversionTaskStateCancelled, + ConversionTaskStateCompleted, + } +} + const ( // CopyTagsFromSourceVolume is a CopyTagsFromSource enum value CopyTagsFromSourceVolume = "volume" ) +// CopyTagsFromSource_Values returns all elements of the CopyTagsFromSource enum +func CopyTagsFromSource_Values() []string { + return []string{ + CopyTagsFromSourceVolume, + } +} + const ( // CurrencyCodeValuesUsd is a CurrencyCodeValues enum value CurrencyCodeValuesUsd = "USD" ) +// CurrencyCodeValues_Values returns all elements of the CurrencyCodeValues enum +func CurrencyCodeValues_Values() []string { + return []string{ + CurrencyCodeValuesUsd, + } +} + const ( // DatafeedSubscriptionStateActive is a DatafeedSubscriptionState enum value DatafeedSubscriptionStateActive = "Active" @@ -110328,6 +115499,14 @@ const ( DatafeedSubscriptionStateInactive = "Inactive" ) +// DatafeedSubscriptionState_Values returns all elements of the DatafeedSubscriptionState enum +func DatafeedSubscriptionState_Values() []string { + return []string{ + DatafeedSubscriptionStateActive, + DatafeedSubscriptionStateInactive, + } +} + const ( // DefaultRouteTableAssociationValueEnable is a DefaultRouteTableAssociationValue enum value DefaultRouteTableAssociationValueEnable = "enable" @@ -110336,6 +115515,14 @@ const ( DefaultRouteTableAssociationValueDisable = "disable" ) +// DefaultRouteTableAssociationValue_Values returns all elements of the DefaultRouteTableAssociationValue enum +func DefaultRouteTableAssociationValue_Values() []string { + return []string{ + DefaultRouteTableAssociationValueEnable, + DefaultRouteTableAssociationValueDisable, + } +} + const ( // DefaultRouteTablePropagationValueEnable is a DefaultRouteTablePropagationValue enum value DefaultRouteTablePropagationValueEnable = "enable" @@ -110344,6 +115531,14 @@ const ( DefaultRouteTablePropagationValueDisable = "disable" ) +// DefaultRouteTablePropagationValue_Values returns all elements of the DefaultRouteTablePropagationValue enum +func DefaultRouteTablePropagationValue_Values() []string { + return []string{ + DefaultRouteTablePropagationValueEnable, + DefaultRouteTablePropagationValueDisable, + } +} + const ( // DefaultTargetCapacityTypeSpot is a DefaultTargetCapacityType enum value DefaultTargetCapacityTypeSpot = "spot" @@ -110352,6 +115547,14 @@ const ( DefaultTargetCapacityTypeOnDemand = "on-demand" ) +// DefaultTargetCapacityType_Values returns all elements of the DefaultTargetCapacityType enum +func DefaultTargetCapacityType_Values() []string { + return []string{ + DefaultTargetCapacityTypeSpot, + DefaultTargetCapacityTypeOnDemand, + } +} + const ( // DeleteFleetErrorCodeFleetIdDoesNotExist is a DeleteFleetErrorCode enum value DeleteFleetErrorCodeFleetIdDoesNotExist = "fleetIdDoesNotExist" @@ -110366,6 +115569,16 @@ const ( DeleteFleetErrorCodeUnexpectedError = "unexpectedError" ) +// DeleteFleetErrorCode_Values returns all elements of the DeleteFleetErrorCode enum +func DeleteFleetErrorCode_Values() []string { + return []string{ + DeleteFleetErrorCodeFleetIdDoesNotExist, + DeleteFleetErrorCodeFleetIdMalformed, + DeleteFleetErrorCodeFleetNotInDeletableState, + DeleteFleetErrorCodeUnexpectedError, + } +} + const ( // DeleteQueuedReservedInstancesErrorCodeReservedInstancesIdInvalid is a DeleteQueuedReservedInstancesErrorCode enum value DeleteQueuedReservedInstancesErrorCodeReservedInstancesIdInvalid = "reserved-instances-id-invalid" @@ -110377,6 +115590,15 @@ const ( DeleteQueuedReservedInstancesErrorCodeUnexpectedError = "unexpected-error" ) +// DeleteQueuedReservedInstancesErrorCode_Values returns all elements of the DeleteQueuedReservedInstancesErrorCode enum +func DeleteQueuedReservedInstancesErrorCode_Values() []string { + return []string{ + DeleteQueuedReservedInstancesErrorCodeReservedInstancesIdInvalid, + DeleteQueuedReservedInstancesErrorCodeReservedInstancesNotInQueuedState, + DeleteQueuedReservedInstancesErrorCodeUnexpectedError, + } +} + const ( // DeviceTypeEbs is a DeviceType enum value DeviceTypeEbs = "ebs" @@ -110385,6 +115607,14 @@ const ( DeviceTypeInstanceStore = "instance-store" ) +// DeviceType_Values returns all elements of the DeviceType enum +func DeviceType_Values() []string { + return []string{ + DeviceTypeEbs, + DeviceTypeInstanceStore, + } +} + const ( // DiskImageFormatVmdk is a DiskImageFormat enum value DiskImageFormatVmdk = "VMDK" @@ -110396,6 +115626,15 @@ const ( DiskImageFormatVhd = "VHD" ) +// DiskImageFormat_Values returns all elements of the DiskImageFormat enum +func DiskImageFormat_Values() []string { + return []string{ + DiskImageFormatVmdk, + DiskImageFormatRaw, + DiskImageFormatVhd, + } +} + const ( // DiskTypeHdd is a DiskType enum value DiskTypeHdd = "hdd" @@ -110404,6 +115643,14 @@ const ( DiskTypeSsd = "ssd" ) +// DiskType_Values returns all elements of the DiskType enum +func DiskType_Values() []string { + return []string{ + DiskTypeHdd, + DiskTypeSsd, + } +} + const ( // DnsNameStatePendingVerification is a DnsNameState enum value DnsNameStatePendingVerification = "pendingVerification" @@ -110415,6 +115662,15 @@ const ( DnsNameStateFailed = "failed" ) +// DnsNameState_Values returns all elements of the DnsNameState enum +func DnsNameState_Values() []string { + return []string{ + DnsNameStatePendingVerification, + DnsNameStateVerified, + DnsNameStateFailed, + } +} + const ( // DnsSupportValueEnable is a DnsSupportValue enum value DnsSupportValueEnable = "enable" @@ -110423,6 +115679,14 @@ const ( DnsSupportValueDisable = "disable" ) +// DnsSupportValue_Values returns all elements of the DnsSupportValue enum +func DnsSupportValue_Values() []string { + return []string{ + DnsSupportValueEnable, + DnsSupportValueDisable, + } +} + const ( // DomainTypeVpc is a DomainType enum value DomainTypeVpc = "vpc" @@ -110431,6 +115695,14 @@ const ( DomainTypeStandard = "standard" ) +// DomainType_Values returns all elements of the DomainType enum +func DomainType_Values() []string { + return []string{ + DomainTypeVpc, + DomainTypeStandard, + } +} + const ( // EbsEncryptionSupportUnsupported is a EbsEncryptionSupport enum value EbsEncryptionSupportUnsupported = "unsupported" @@ -110439,6 +115711,34 @@ const ( EbsEncryptionSupportSupported = "supported" ) +// EbsEncryptionSupport_Values returns all elements of the EbsEncryptionSupport enum +func EbsEncryptionSupport_Values() []string { + return []string{ + EbsEncryptionSupportUnsupported, + EbsEncryptionSupportSupported, + } +} + +const ( + // EbsNvmeSupportUnsupported is a EbsNvmeSupport enum value + EbsNvmeSupportUnsupported = "unsupported" + + // EbsNvmeSupportSupported is a EbsNvmeSupport enum value + EbsNvmeSupportSupported = "supported" + + // EbsNvmeSupportRequired is a EbsNvmeSupport enum value + EbsNvmeSupportRequired = "required" +) + +// EbsNvmeSupport_Values returns all elements of the EbsNvmeSupport enum +func EbsNvmeSupport_Values() []string { + return []string{ + EbsNvmeSupportUnsupported, + EbsNvmeSupportSupported, + EbsNvmeSupportRequired, + } +} + const ( // EbsOptimizedSupportUnsupported is a EbsOptimizedSupport enum value EbsOptimizedSupportUnsupported = "unsupported" @@ -110450,11 +115750,27 @@ const ( EbsOptimizedSupportDefault = "default" ) +// EbsOptimizedSupport_Values returns all elements of the EbsOptimizedSupport enum +func EbsOptimizedSupport_Values() []string { + return []string{ + EbsOptimizedSupportUnsupported, + EbsOptimizedSupportSupported, + EbsOptimizedSupportDefault, + } +} + const ( // ElasticGpuStateAttached is a ElasticGpuState enum value ElasticGpuStateAttached = "ATTACHED" ) +// ElasticGpuState_Values returns all elements of the ElasticGpuState enum +func ElasticGpuState_Values() []string { + return []string{ + ElasticGpuStateAttached, + } +} + const ( // ElasticGpuStatusOk is a ElasticGpuStatus enum value ElasticGpuStatusOk = "OK" @@ -110463,6 +115779,14 @@ const ( ElasticGpuStatusImpaired = "IMPAIRED" ) +// ElasticGpuStatus_Values returns all elements of the ElasticGpuStatus enum +func ElasticGpuStatus_Values() []string { + return []string{ + ElasticGpuStatusOk, + ElasticGpuStatusImpaired, + } +} + const ( // EnaSupportUnsupported is a EnaSupport enum value EnaSupportUnsupported = "unsupported" @@ -110474,6 +115798,15 @@ const ( EnaSupportRequired = "required" ) +// EnaSupport_Values returns all elements of the EnaSupport enum +func EnaSupport_Values() []string { + return []string{ + EnaSupportUnsupported, + EnaSupportSupported, + EnaSupportRequired, + } +} + const ( // EndDateTypeUnlimited is a EndDateType enum value EndDateTypeUnlimited = "unlimited" @@ -110482,6 +115815,14 @@ const ( EndDateTypeLimited = "limited" ) +// EndDateType_Values returns all elements of the EndDateType enum +func EndDateType_Values() []string { + return []string{ + EndDateTypeUnlimited, + EndDateTypeLimited, + } +} + const ( // EventCodeInstanceReboot is a EventCode enum value EventCodeInstanceReboot = "instance-reboot" @@ -110499,6 +115840,17 @@ const ( EventCodeInstanceStop = "instance-stop" ) +// EventCode_Values returns all elements of the EventCode enum +func EventCode_Values() []string { + return []string{ + EventCodeInstanceReboot, + EventCodeSystemReboot, + EventCodeSystemMaintenance, + EventCodeInstanceRetirement, + EventCodeInstanceStop, + } +} + const ( // EventTypeInstanceChange is a EventType enum value EventTypeInstanceChange = "instanceChange" @@ -110513,6 +115865,16 @@ const ( EventTypeInformation = "information" ) +// EventType_Values returns all elements of the EventType enum +func EventType_Values() []string { + return []string{ + EventTypeInstanceChange, + EventTypeFleetRequestChange, + EventTypeError, + EventTypeInformation, + } +} + const ( // ExcessCapacityTerminationPolicyNoTermination is a ExcessCapacityTerminationPolicy enum value ExcessCapacityTerminationPolicyNoTermination = "noTermination" @@ -110521,6 +115883,14 @@ const ( ExcessCapacityTerminationPolicyDefault = "default" ) +// ExcessCapacityTerminationPolicy_Values returns all elements of the ExcessCapacityTerminationPolicy enum +func ExcessCapacityTerminationPolicy_Values() []string { + return []string{ + ExcessCapacityTerminationPolicyNoTermination, + ExcessCapacityTerminationPolicyDefault, + } +} + const ( // ExportEnvironmentCitrix is a ExportEnvironment enum value ExportEnvironmentCitrix = "citrix" @@ -110532,6 +115902,15 @@ const ( ExportEnvironmentMicrosoft = "microsoft" ) +// ExportEnvironment_Values returns all elements of the ExportEnvironment enum +func ExportEnvironment_Values() []string { + return []string{ + ExportEnvironmentCitrix, + ExportEnvironmentVmware, + ExportEnvironmentMicrosoft, + } +} + const ( // ExportTaskStateActive is a ExportTaskState enum value ExportTaskStateActive = "active" @@ -110546,6 +115925,16 @@ const ( ExportTaskStateCompleted = "completed" ) +// ExportTaskState_Values returns all elements of the ExportTaskState enum +func ExportTaskState_Values() []string { + return []string{ + ExportTaskStateActive, + ExportTaskStateCancelling, + ExportTaskStateCancelled, + ExportTaskStateCompleted, + } +} + const ( // FastSnapshotRestoreStateCodeEnabling is a FastSnapshotRestoreStateCode enum value FastSnapshotRestoreStateCodeEnabling = "enabling" @@ -110563,6 +115952,17 @@ const ( FastSnapshotRestoreStateCodeDisabled = "disabled" ) +// FastSnapshotRestoreStateCode_Values returns all elements of the FastSnapshotRestoreStateCode enum +func FastSnapshotRestoreStateCode_Values() []string { + return []string{ + FastSnapshotRestoreStateCodeEnabling, + FastSnapshotRestoreStateCodeOptimizing, + FastSnapshotRestoreStateCodeEnabled, + FastSnapshotRestoreStateCodeDisabling, + FastSnapshotRestoreStateCodeDisabled, + } +} + const ( // FleetActivityStatusError is a FleetActivityStatus enum value FleetActivityStatusError = "error" @@ -110577,11 +115977,28 @@ const ( FleetActivityStatusFulfilled = "fulfilled" ) +// FleetActivityStatus_Values returns all elements of the FleetActivityStatus enum +func FleetActivityStatus_Values() []string { + return []string{ + FleetActivityStatusError, + FleetActivityStatusPendingFulfillment, + FleetActivityStatusPendingTermination, + FleetActivityStatusFulfilled, + } +} + const ( // FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst is a FleetCapacityReservationUsageStrategy enum value FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst = "use-capacity-reservations-first" ) +// FleetCapacityReservationUsageStrategy_Values returns all elements of the FleetCapacityReservationUsageStrategy enum +func FleetCapacityReservationUsageStrategy_Values() []string { + return []string{ + FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst, + } +} + const ( // FleetEventTypeInstanceChange is a FleetEventType enum value FleetEventTypeInstanceChange = "instance-change" @@ -110593,6 +116010,15 @@ const ( FleetEventTypeServiceError = "service-error" ) +// FleetEventType_Values returns all elements of the FleetEventType enum +func FleetEventType_Values() []string { + return []string{ + FleetEventTypeInstanceChange, + FleetEventTypeFleetChange, + FleetEventTypeServiceError, + } +} + const ( // FleetExcessCapacityTerminationPolicyNoTermination is a FleetExcessCapacityTerminationPolicy enum value FleetExcessCapacityTerminationPolicyNoTermination = "no-termination" @@ -110601,6 +116027,14 @@ const ( FleetExcessCapacityTerminationPolicyTermination = "termination" ) +// FleetExcessCapacityTerminationPolicy_Values returns all elements of the FleetExcessCapacityTerminationPolicy enum +func FleetExcessCapacityTerminationPolicy_Values() []string { + return []string{ + FleetExcessCapacityTerminationPolicyNoTermination, + FleetExcessCapacityTerminationPolicyTermination, + } +} + const ( // FleetOnDemandAllocationStrategyLowestPrice is a FleetOnDemandAllocationStrategy enum value FleetOnDemandAllocationStrategyLowestPrice = "lowest-price" @@ -110609,6 +116043,14 @@ const ( FleetOnDemandAllocationStrategyPrioritized = "prioritized" ) +// FleetOnDemandAllocationStrategy_Values returns all elements of the FleetOnDemandAllocationStrategy enum +func FleetOnDemandAllocationStrategy_Values() []string { + return []string{ + FleetOnDemandAllocationStrategyLowestPrice, + FleetOnDemandAllocationStrategyPrioritized, + } +} + const ( // FleetStateCodeSubmitted is a FleetStateCode enum value FleetStateCodeSubmitted = "submitted" @@ -110632,6 +116074,19 @@ const ( FleetStateCodeModifying = "modifying" ) +// FleetStateCode_Values returns all elements of the FleetStateCode enum +func FleetStateCode_Values() []string { + return []string{ + FleetStateCodeSubmitted, + FleetStateCodeActive, + FleetStateCodeDeleted, + FleetStateCodeFailed, + FleetStateCodeDeletedRunning, + FleetStateCodeDeletedTerminating, + FleetStateCodeModifying, + } +} + const ( // FleetTypeRequest is a FleetType enum value FleetTypeRequest = "request" @@ -110643,6 +116098,15 @@ const ( FleetTypeInstant = "instant" ) +// FleetType_Values returns all elements of the FleetType enum +func FleetType_Values() []string { + return []string{ + FleetTypeRequest, + FleetTypeMaintain, + FleetTypeInstant, + } +} + const ( // FlowLogsResourceTypeVpc is a FlowLogsResourceType enum value FlowLogsResourceTypeVpc = "VPC" @@ -110654,6 +116118,15 @@ const ( FlowLogsResourceTypeNetworkInterface = "NetworkInterface" ) +// FlowLogsResourceType_Values returns all elements of the FlowLogsResourceType enum +func FlowLogsResourceType_Values() []string { + return []string{ + FlowLogsResourceTypeVpc, + FlowLogsResourceTypeSubnet, + FlowLogsResourceTypeNetworkInterface, + } +} + const ( // FpgaImageAttributeNameDescription is a FpgaImageAttributeName enum value FpgaImageAttributeNameDescription = "description" @@ -110668,6 +116141,16 @@ const ( FpgaImageAttributeNameProductCodes = "productCodes" ) +// FpgaImageAttributeName_Values returns all elements of the FpgaImageAttributeName enum +func FpgaImageAttributeName_Values() []string { + return []string{ + FpgaImageAttributeNameDescription, + FpgaImageAttributeNameName, + FpgaImageAttributeNameLoadPermission, + FpgaImageAttributeNameProductCodes, + } +} + const ( // FpgaImageStateCodePending is a FpgaImageStateCode enum value FpgaImageStateCodePending = "pending" @@ -110682,11 +116165,28 @@ const ( FpgaImageStateCodeUnavailable = "unavailable" ) +// FpgaImageStateCode_Values returns all elements of the FpgaImageStateCode enum +func FpgaImageStateCode_Values() []string { + return []string{ + FpgaImageStateCodePending, + FpgaImageStateCodeFailed, + FpgaImageStateCodeAvailable, + FpgaImageStateCodeUnavailable, + } +} + const ( // GatewayTypeIpsec1 is a GatewayType enum value GatewayTypeIpsec1 = "ipsec.1" ) +// GatewayType_Values returns all elements of the GatewayType enum +func GatewayType_Values() []string { + return []string{ + GatewayTypeIpsec1, + } +} + const ( // HostRecoveryOn is a HostRecovery enum value HostRecoveryOn = "on" @@ -110695,6 +116195,14 @@ const ( HostRecoveryOff = "off" ) +// HostRecovery_Values returns all elements of the HostRecovery enum +func HostRecovery_Values() []string { + return []string{ + HostRecoveryOn, + HostRecoveryOff, + } +} + const ( // HostTenancyDedicated is a HostTenancy enum value HostTenancyDedicated = "dedicated" @@ -110703,6 +116211,14 @@ const ( HostTenancyHost = "host" ) +// HostTenancy_Values returns all elements of the HostTenancy enum +func HostTenancy_Values() []string { + return []string{ + HostTenancyDedicated, + HostTenancyHost, + } +} + const ( // HttpTokensStateOptional is a HttpTokensState enum value HttpTokensStateOptional = "optional" @@ -110711,6 +116227,14 @@ const ( HttpTokensStateRequired = "required" ) +// HttpTokensState_Values returns all elements of the HttpTokensState enum +func HttpTokensState_Values() []string { + return []string{ + HttpTokensStateOptional, + HttpTokensStateRequired, + } +} + const ( // HypervisorTypeOvm is a HypervisorType enum value HypervisorTypeOvm = "ovm" @@ -110719,6 +116243,14 @@ const ( HypervisorTypeXen = "xen" ) +// HypervisorType_Values returns all elements of the HypervisorType enum +func HypervisorType_Values() []string { + return []string{ + HypervisorTypeOvm, + HypervisorTypeXen, + } +} + const ( // IamInstanceProfileAssociationStateAssociating is a IamInstanceProfileAssociationState enum value IamInstanceProfileAssociationStateAssociating = "associating" @@ -110733,6 +116265,16 @@ const ( IamInstanceProfileAssociationStateDisassociated = "disassociated" ) +// IamInstanceProfileAssociationState_Values returns all elements of the IamInstanceProfileAssociationState enum +func IamInstanceProfileAssociationState_Values() []string { + return []string{ + IamInstanceProfileAssociationStateAssociating, + IamInstanceProfileAssociationStateAssociated, + IamInstanceProfileAssociationStateDisassociating, + IamInstanceProfileAssociationStateDisassociated, + } +} + const ( // ImageAttributeNameDescription is a ImageAttributeName enum value ImageAttributeNameDescription = "description" @@ -110756,6 +116298,19 @@ const ( ImageAttributeNameSriovNetSupport = "sriovNetSupport" ) +// ImageAttributeName_Values returns all elements of the ImageAttributeName enum +func ImageAttributeName_Values() []string { + return []string{ + ImageAttributeNameDescription, + ImageAttributeNameKernel, + ImageAttributeNameRamdisk, + ImageAttributeNameLaunchPermission, + ImageAttributeNameProductCodes, + ImageAttributeNameBlockDeviceMapping, + ImageAttributeNameSriovNetSupport, + } +} + const ( // ImageStatePending is a ImageState enum value ImageStatePending = "pending" @@ -110779,6 +116334,19 @@ const ( ImageStateError = "error" ) +// ImageState_Values returns all elements of the ImageState enum +func ImageState_Values() []string { + return []string{ + ImageStatePending, + ImageStateAvailable, + ImageStateInvalid, + ImageStateDeregistered, + ImageStateTransient, + ImageStateFailed, + ImageStateError, + } +} + const ( // ImageTypeValuesMachine is a ImageTypeValues enum value ImageTypeValuesMachine = "machine" @@ -110790,6 +116358,15 @@ const ( ImageTypeValuesRamdisk = "ramdisk" ) +// ImageTypeValues_Values returns all elements of the ImageTypeValues enum +func ImageTypeValues_Values() []string { + return []string{ + ImageTypeValuesMachine, + ImageTypeValuesKernel, + ImageTypeValuesRamdisk, + } +} + const ( // InstanceAttributeNameInstanceType is a InstanceAttributeName enum value InstanceAttributeNameInstanceType = "instanceType" @@ -110834,6 +116411,26 @@ const ( InstanceAttributeNameEnaSupport = "enaSupport" ) +// InstanceAttributeName_Values returns all elements of the InstanceAttributeName enum +func InstanceAttributeName_Values() []string { + return []string{ + InstanceAttributeNameInstanceType, + InstanceAttributeNameKernel, + InstanceAttributeNameRamdisk, + InstanceAttributeNameUserData, + InstanceAttributeNameDisableApiTermination, + InstanceAttributeNameInstanceInitiatedShutdownBehavior, + InstanceAttributeNameRootDeviceName, + InstanceAttributeNameBlockDeviceMapping, + InstanceAttributeNameProductCodes, + InstanceAttributeNameSourceDestCheck, + InstanceAttributeNameGroupSet, + InstanceAttributeNameEbsOptimized, + InstanceAttributeNameSriovNetSupport, + InstanceAttributeNameEnaSupport, + } +} + const ( // InstanceHealthStatusHealthy is a InstanceHealthStatus enum value InstanceHealthStatusHealthy = "healthy" @@ -110842,6 +116439,14 @@ const ( InstanceHealthStatusUnhealthy = "unhealthy" ) +// InstanceHealthStatus_Values returns all elements of the InstanceHealthStatus enum +func InstanceHealthStatus_Values() []string { + return []string{ + InstanceHealthStatusHealthy, + InstanceHealthStatusUnhealthy, + } +} + const ( // InstanceInterruptionBehaviorHibernate is a InstanceInterruptionBehavior enum value InstanceInterruptionBehaviorHibernate = "hibernate" @@ -110853,6 +116458,15 @@ const ( InstanceInterruptionBehaviorTerminate = "terminate" ) +// InstanceInterruptionBehavior_Values returns all elements of the InstanceInterruptionBehavior enum +func InstanceInterruptionBehavior_Values() []string { + return []string{ + InstanceInterruptionBehaviorHibernate, + InstanceInterruptionBehaviorStop, + InstanceInterruptionBehaviorTerminate, + } +} + const ( // InstanceLifecycleSpot is a InstanceLifecycle enum value InstanceLifecycleSpot = "spot" @@ -110861,6 +116475,14 @@ const ( InstanceLifecycleOnDemand = "on-demand" ) +// InstanceLifecycle_Values returns all elements of the InstanceLifecycle enum +func InstanceLifecycle_Values() []string { + return []string{ + InstanceLifecycleSpot, + InstanceLifecycleOnDemand, + } +} + const ( // InstanceLifecycleTypeSpot is a InstanceLifecycleType enum value InstanceLifecycleTypeSpot = "spot" @@ -110869,6 +116491,14 @@ const ( InstanceLifecycleTypeScheduled = "scheduled" ) +// InstanceLifecycleType_Values returns all elements of the InstanceLifecycleType enum +func InstanceLifecycleType_Values() []string { + return []string{ + InstanceLifecycleTypeSpot, + InstanceLifecycleTypeScheduled, + } +} + const ( // InstanceMatchCriteriaOpen is a InstanceMatchCriteria enum value InstanceMatchCriteriaOpen = "open" @@ -110877,6 +116507,14 @@ const ( InstanceMatchCriteriaTargeted = "targeted" ) +// InstanceMatchCriteria_Values returns all elements of the InstanceMatchCriteria enum +func InstanceMatchCriteria_Values() []string { + return []string{ + InstanceMatchCriteriaOpen, + InstanceMatchCriteriaTargeted, + } +} + const ( // InstanceMetadataEndpointStateDisabled is a InstanceMetadataEndpointState enum value InstanceMetadataEndpointStateDisabled = "disabled" @@ -110885,6 +116523,14 @@ const ( InstanceMetadataEndpointStateEnabled = "enabled" ) +// InstanceMetadataEndpointState_Values returns all elements of the InstanceMetadataEndpointState enum +func InstanceMetadataEndpointState_Values() []string { + return []string{ + InstanceMetadataEndpointStateDisabled, + InstanceMetadataEndpointStateEnabled, + } +} + const ( // InstanceMetadataOptionsStatePending is a InstanceMetadataOptionsState enum value InstanceMetadataOptionsStatePending = "pending" @@ -110893,6 +116539,14 @@ const ( InstanceMetadataOptionsStateApplied = "applied" ) +// InstanceMetadataOptionsState_Values returns all elements of the InstanceMetadataOptionsState enum +func InstanceMetadataOptionsState_Values() []string { + return []string{ + InstanceMetadataOptionsStatePending, + InstanceMetadataOptionsStateApplied, + } +} + const ( // InstanceStateNamePending is a InstanceStateName enum value InstanceStateNamePending = "pending" @@ -110913,6 +116567,18 @@ const ( InstanceStateNameStopped = "stopped" ) +// InstanceStateName_Values returns all elements of the InstanceStateName enum +func InstanceStateName_Values() []string { + return []string{ + InstanceStateNamePending, + InstanceStateNameRunning, + InstanceStateNameShuttingDown, + InstanceStateNameTerminated, + InstanceStateNameStopping, + InstanceStateNameStopped, + } +} + const ( // InstanceTypeT1Micro is a InstanceType enum value InstanceTypeT1Micro = "t1.micro" @@ -111196,6 +116862,33 @@ const ( // InstanceTypeR6g16xlarge is a InstanceType enum value InstanceTypeR6g16xlarge = "r6g.16xlarge" + // InstanceTypeR6gdMetal is a InstanceType enum value + InstanceTypeR6gdMetal = "r6gd.metal" + + // InstanceTypeR6gdMedium is a InstanceType enum value + InstanceTypeR6gdMedium = "r6gd.medium" + + // InstanceTypeR6gdLarge is a InstanceType enum value + InstanceTypeR6gdLarge = "r6gd.large" + + // InstanceTypeR6gdXlarge is a InstanceType enum value + InstanceTypeR6gdXlarge = "r6gd.xlarge" + + // InstanceTypeR6gd2xlarge is a InstanceType enum value + InstanceTypeR6gd2xlarge = "r6gd.2xlarge" + + // InstanceTypeR6gd4xlarge is a InstanceType enum value + InstanceTypeR6gd4xlarge = "r6gd.4xlarge" + + // InstanceTypeR6gd8xlarge is a InstanceType enum value + InstanceTypeR6gd8xlarge = "r6gd.8xlarge" + + // InstanceTypeR6gd12xlarge is a InstanceType enum value + InstanceTypeR6gd12xlarge = "r6gd.12xlarge" + + // InstanceTypeR6gd16xlarge is a InstanceType enum value + InstanceTypeR6gd16xlarge = "r6gd.16xlarge" + // InstanceTypeX116xlarge is a InstanceType enum value InstanceTypeX116xlarge = "x1.16xlarge" @@ -111370,6 +117063,30 @@ const ( // InstanceTypeC5a24xlarge is a InstanceType enum value InstanceTypeC5a24xlarge = "c5a.24xlarge" + // InstanceTypeC5adLarge is a InstanceType enum value + InstanceTypeC5adLarge = "c5ad.large" + + // InstanceTypeC5adXlarge is a InstanceType enum value + InstanceTypeC5adXlarge = "c5ad.xlarge" + + // InstanceTypeC5ad2xlarge is a InstanceType enum value + InstanceTypeC5ad2xlarge = "c5ad.2xlarge" + + // InstanceTypeC5ad4xlarge is a InstanceType enum value + InstanceTypeC5ad4xlarge = "c5ad.4xlarge" + + // InstanceTypeC5ad8xlarge is a InstanceType enum value + InstanceTypeC5ad8xlarge = "c5ad.8xlarge" + + // InstanceTypeC5ad12xlarge is a InstanceType enum value + InstanceTypeC5ad12xlarge = "c5ad.12xlarge" + + // InstanceTypeC5ad16xlarge is a InstanceType enum value + InstanceTypeC5ad16xlarge = "c5ad.16xlarge" + + // InstanceTypeC5ad24xlarge is a InstanceType enum value + InstanceTypeC5ad24xlarge = "c5ad.24xlarge" + // InstanceTypeC5dLarge is a InstanceType enum value InstanceTypeC5dLarge = "c5d.large" @@ -111442,6 +117159,33 @@ const ( // InstanceTypeC6g16xlarge is a InstanceType enum value InstanceTypeC6g16xlarge = "c6g.16xlarge" + // InstanceTypeC6gdMetal is a InstanceType enum value + InstanceTypeC6gdMetal = "c6gd.metal" + + // InstanceTypeC6gdMedium is a InstanceType enum value + InstanceTypeC6gdMedium = "c6gd.medium" + + // InstanceTypeC6gdLarge is a InstanceType enum value + InstanceTypeC6gdLarge = "c6gd.large" + + // InstanceTypeC6gdXlarge is a InstanceType enum value + InstanceTypeC6gdXlarge = "c6gd.xlarge" + + // InstanceTypeC6gd2xlarge is a InstanceType enum value + InstanceTypeC6gd2xlarge = "c6gd.2xlarge" + + // InstanceTypeC6gd4xlarge is a InstanceType enum value + InstanceTypeC6gd4xlarge = "c6gd.4xlarge" + + // InstanceTypeC6gd8xlarge is a InstanceType enum value + InstanceTypeC6gd8xlarge = "c6gd.8xlarge" + + // InstanceTypeC6gd12xlarge is a InstanceType enum value + InstanceTypeC6gd12xlarge = "c6gd.12xlarge" + + // InstanceTypeC6gd16xlarge is a InstanceType enum value + InstanceTypeC6gd16xlarge = "c6gd.16xlarge" + // InstanceTypeCc14xlarge is a InstanceType enum value InstanceTypeCc14xlarge = "cc1.4xlarge" @@ -111834,8 +117578,383 @@ const ( // InstanceTypeM6g16xlarge is a InstanceType enum value InstanceTypeM6g16xlarge = "m6g.16xlarge" + + // InstanceTypeM6gdMetal is a InstanceType enum value + InstanceTypeM6gdMetal = "m6gd.metal" + + // InstanceTypeM6gdMedium is a InstanceType enum value + InstanceTypeM6gdMedium = "m6gd.medium" + + // InstanceTypeM6gdLarge is a InstanceType enum value + InstanceTypeM6gdLarge = "m6gd.large" + + // InstanceTypeM6gdXlarge is a InstanceType enum value + InstanceTypeM6gdXlarge = "m6gd.xlarge" + + // InstanceTypeM6gd2xlarge is a InstanceType enum value + InstanceTypeM6gd2xlarge = "m6gd.2xlarge" + + // InstanceTypeM6gd4xlarge is a InstanceType enum value + InstanceTypeM6gd4xlarge = "m6gd.4xlarge" + + // InstanceTypeM6gd8xlarge is a InstanceType enum value + InstanceTypeM6gd8xlarge = "m6gd.8xlarge" + + // InstanceTypeM6gd12xlarge is a InstanceType enum value + InstanceTypeM6gd12xlarge = "m6gd.12xlarge" + + // InstanceTypeM6gd16xlarge is a InstanceType enum value + InstanceTypeM6gd16xlarge = "m6gd.16xlarge" ) +// InstanceType_Values returns all elements of the InstanceType enum +func InstanceType_Values() []string { + return []string{ + InstanceTypeT1Micro, + InstanceTypeT2Nano, + InstanceTypeT2Micro, + InstanceTypeT2Small, + InstanceTypeT2Medium, + InstanceTypeT2Large, + InstanceTypeT2Xlarge, + InstanceTypeT22xlarge, + InstanceTypeT3Nano, + InstanceTypeT3Micro, + InstanceTypeT3Small, + InstanceTypeT3Medium, + InstanceTypeT3Large, + InstanceTypeT3Xlarge, + InstanceTypeT32xlarge, + InstanceTypeT3aNano, + InstanceTypeT3aMicro, + InstanceTypeT3aSmall, + InstanceTypeT3aMedium, + InstanceTypeT3aLarge, + InstanceTypeT3aXlarge, + InstanceTypeT3a2xlarge, + InstanceTypeM1Small, + InstanceTypeM1Medium, + InstanceTypeM1Large, + InstanceTypeM1Xlarge, + InstanceTypeM3Medium, + InstanceTypeM3Large, + InstanceTypeM3Xlarge, + InstanceTypeM32xlarge, + InstanceTypeM4Large, + InstanceTypeM4Xlarge, + InstanceTypeM42xlarge, + InstanceTypeM44xlarge, + InstanceTypeM410xlarge, + InstanceTypeM416xlarge, + InstanceTypeM2Xlarge, + InstanceTypeM22xlarge, + InstanceTypeM24xlarge, + InstanceTypeCr18xlarge, + InstanceTypeR3Large, + InstanceTypeR3Xlarge, + InstanceTypeR32xlarge, + InstanceTypeR34xlarge, + InstanceTypeR38xlarge, + InstanceTypeR4Large, + InstanceTypeR4Xlarge, + InstanceTypeR42xlarge, + InstanceTypeR44xlarge, + InstanceTypeR48xlarge, + InstanceTypeR416xlarge, + InstanceTypeR5Large, + InstanceTypeR5Xlarge, + InstanceTypeR52xlarge, + InstanceTypeR54xlarge, + InstanceTypeR58xlarge, + InstanceTypeR512xlarge, + InstanceTypeR516xlarge, + InstanceTypeR524xlarge, + InstanceTypeR5Metal, + InstanceTypeR5aLarge, + InstanceTypeR5aXlarge, + InstanceTypeR5a2xlarge, + InstanceTypeR5a4xlarge, + InstanceTypeR5a8xlarge, + InstanceTypeR5a12xlarge, + InstanceTypeR5a16xlarge, + InstanceTypeR5a24xlarge, + InstanceTypeR5dLarge, + InstanceTypeR5dXlarge, + InstanceTypeR5d2xlarge, + InstanceTypeR5d4xlarge, + InstanceTypeR5d8xlarge, + InstanceTypeR5d12xlarge, + InstanceTypeR5d16xlarge, + InstanceTypeR5d24xlarge, + InstanceTypeR5dMetal, + InstanceTypeR5adLarge, + InstanceTypeR5adXlarge, + InstanceTypeR5ad2xlarge, + InstanceTypeR5ad4xlarge, + InstanceTypeR5ad8xlarge, + InstanceTypeR5ad12xlarge, + InstanceTypeR5ad16xlarge, + InstanceTypeR5ad24xlarge, + InstanceTypeR6gMetal, + InstanceTypeR6gMedium, + InstanceTypeR6gLarge, + InstanceTypeR6gXlarge, + InstanceTypeR6g2xlarge, + InstanceTypeR6g4xlarge, + InstanceTypeR6g8xlarge, + InstanceTypeR6g12xlarge, + InstanceTypeR6g16xlarge, + InstanceTypeR6gdMetal, + InstanceTypeR6gdMedium, + InstanceTypeR6gdLarge, + InstanceTypeR6gdXlarge, + InstanceTypeR6gd2xlarge, + InstanceTypeR6gd4xlarge, + InstanceTypeR6gd8xlarge, + InstanceTypeR6gd12xlarge, + InstanceTypeR6gd16xlarge, + InstanceTypeX116xlarge, + InstanceTypeX132xlarge, + InstanceTypeX1eXlarge, + InstanceTypeX1e2xlarge, + InstanceTypeX1e4xlarge, + InstanceTypeX1e8xlarge, + InstanceTypeX1e16xlarge, + InstanceTypeX1e32xlarge, + InstanceTypeI2Xlarge, + InstanceTypeI22xlarge, + InstanceTypeI24xlarge, + InstanceTypeI28xlarge, + InstanceTypeI3Large, + InstanceTypeI3Xlarge, + InstanceTypeI32xlarge, + InstanceTypeI34xlarge, + InstanceTypeI38xlarge, + InstanceTypeI316xlarge, + InstanceTypeI3Metal, + InstanceTypeI3enLarge, + InstanceTypeI3enXlarge, + InstanceTypeI3en2xlarge, + InstanceTypeI3en3xlarge, + InstanceTypeI3en6xlarge, + InstanceTypeI3en12xlarge, + InstanceTypeI3en24xlarge, + InstanceTypeI3enMetal, + InstanceTypeHi14xlarge, + InstanceTypeHs18xlarge, + InstanceTypeC1Medium, + InstanceTypeC1Xlarge, + InstanceTypeC3Large, + InstanceTypeC3Xlarge, + InstanceTypeC32xlarge, + InstanceTypeC34xlarge, + InstanceTypeC38xlarge, + InstanceTypeC4Large, + InstanceTypeC4Xlarge, + InstanceTypeC42xlarge, + InstanceTypeC44xlarge, + InstanceTypeC48xlarge, + InstanceTypeC5Large, + InstanceTypeC5Xlarge, + InstanceTypeC52xlarge, + InstanceTypeC54xlarge, + InstanceTypeC59xlarge, + InstanceTypeC512xlarge, + InstanceTypeC518xlarge, + InstanceTypeC524xlarge, + InstanceTypeC5Metal, + InstanceTypeC5aLarge, + InstanceTypeC5aXlarge, + InstanceTypeC5a2xlarge, + InstanceTypeC5a4xlarge, + InstanceTypeC5a8xlarge, + InstanceTypeC5a12xlarge, + InstanceTypeC5a16xlarge, + InstanceTypeC5a24xlarge, + InstanceTypeC5adLarge, + InstanceTypeC5adXlarge, + InstanceTypeC5ad2xlarge, + InstanceTypeC5ad4xlarge, + InstanceTypeC5ad8xlarge, + InstanceTypeC5ad12xlarge, + InstanceTypeC5ad16xlarge, + InstanceTypeC5ad24xlarge, + InstanceTypeC5dLarge, + InstanceTypeC5dXlarge, + InstanceTypeC5d2xlarge, + InstanceTypeC5d4xlarge, + InstanceTypeC5d9xlarge, + InstanceTypeC5d12xlarge, + InstanceTypeC5d18xlarge, + InstanceTypeC5d24xlarge, + InstanceTypeC5dMetal, + InstanceTypeC5nLarge, + InstanceTypeC5nXlarge, + InstanceTypeC5n2xlarge, + InstanceTypeC5n4xlarge, + InstanceTypeC5n9xlarge, + InstanceTypeC5n18xlarge, + InstanceTypeC6gMetal, + InstanceTypeC6gMedium, + InstanceTypeC6gLarge, + InstanceTypeC6gXlarge, + InstanceTypeC6g2xlarge, + InstanceTypeC6g4xlarge, + InstanceTypeC6g8xlarge, + InstanceTypeC6g12xlarge, + InstanceTypeC6g16xlarge, + InstanceTypeC6gdMetal, + InstanceTypeC6gdMedium, + InstanceTypeC6gdLarge, + InstanceTypeC6gdXlarge, + InstanceTypeC6gd2xlarge, + InstanceTypeC6gd4xlarge, + InstanceTypeC6gd8xlarge, + InstanceTypeC6gd12xlarge, + InstanceTypeC6gd16xlarge, + InstanceTypeCc14xlarge, + InstanceTypeCc28xlarge, + InstanceTypeG22xlarge, + InstanceTypeG28xlarge, + InstanceTypeG34xlarge, + InstanceTypeG38xlarge, + InstanceTypeG316xlarge, + InstanceTypeG3sXlarge, + InstanceTypeG4dnXlarge, + InstanceTypeG4dn2xlarge, + InstanceTypeG4dn4xlarge, + InstanceTypeG4dn8xlarge, + InstanceTypeG4dn12xlarge, + InstanceTypeG4dn16xlarge, + InstanceTypeG4dnMetal, + InstanceTypeCg14xlarge, + InstanceTypeP2Xlarge, + InstanceTypeP28xlarge, + InstanceTypeP216xlarge, + InstanceTypeP32xlarge, + InstanceTypeP38xlarge, + InstanceTypeP316xlarge, + InstanceTypeP3dn24xlarge, + InstanceTypeD2Xlarge, + InstanceTypeD22xlarge, + InstanceTypeD24xlarge, + InstanceTypeD28xlarge, + InstanceTypeF12xlarge, + InstanceTypeF14xlarge, + InstanceTypeF116xlarge, + InstanceTypeM5Large, + InstanceTypeM5Xlarge, + InstanceTypeM52xlarge, + InstanceTypeM54xlarge, + InstanceTypeM58xlarge, + InstanceTypeM512xlarge, + InstanceTypeM516xlarge, + InstanceTypeM524xlarge, + InstanceTypeM5Metal, + InstanceTypeM5aLarge, + InstanceTypeM5aXlarge, + InstanceTypeM5a2xlarge, + InstanceTypeM5a4xlarge, + InstanceTypeM5a8xlarge, + InstanceTypeM5a12xlarge, + InstanceTypeM5a16xlarge, + InstanceTypeM5a24xlarge, + InstanceTypeM5dLarge, + InstanceTypeM5dXlarge, + InstanceTypeM5d2xlarge, + InstanceTypeM5d4xlarge, + InstanceTypeM5d8xlarge, + InstanceTypeM5d12xlarge, + InstanceTypeM5d16xlarge, + InstanceTypeM5d24xlarge, + InstanceTypeM5dMetal, + InstanceTypeM5adLarge, + InstanceTypeM5adXlarge, + InstanceTypeM5ad2xlarge, + InstanceTypeM5ad4xlarge, + InstanceTypeM5ad8xlarge, + InstanceTypeM5ad12xlarge, + InstanceTypeM5ad16xlarge, + InstanceTypeM5ad24xlarge, + InstanceTypeH12xlarge, + InstanceTypeH14xlarge, + InstanceTypeH18xlarge, + InstanceTypeH116xlarge, + InstanceTypeZ1dLarge, + InstanceTypeZ1dXlarge, + InstanceTypeZ1d2xlarge, + InstanceTypeZ1d3xlarge, + InstanceTypeZ1d6xlarge, + InstanceTypeZ1d12xlarge, + InstanceTypeZ1dMetal, + InstanceTypeU6tb1Metal, + InstanceTypeU9tb1Metal, + InstanceTypeU12tb1Metal, + InstanceTypeU18tb1Metal, + InstanceTypeU24tb1Metal, + InstanceTypeA1Medium, + InstanceTypeA1Large, + InstanceTypeA1Xlarge, + InstanceTypeA12xlarge, + InstanceTypeA14xlarge, + InstanceTypeA1Metal, + InstanceTypeM5dnLarge, + InstanceTypeM5dnXlarge, + InstanceTypeM5dn2xlarge, + InstanceTypeM5dn4xlarge, + InstanceTypeM5dn8xlarge, + InstanceTypeM5dn12xlarge, + InstanceTypeM5dn16xlarge, + InstanceTypeM5dn24xlarge, + InstanceTypeM5nLarge, + InstanceTypeM5nXlarge, + InstanceTypeM5n2xlarge, + InstanceTypeM5n4xlarge, + InstanceTypeM5n8xlarge, + InstanceTypeM5n12xlarge, + InstanceTypeM5n16xlarge, + InstanceTypeM5n24xlarge, + InstanceTypeR5dnLarge, + InstanceTypeR5dnXlarge, + InstanceTypeR5dn2xlarge, + InstanceTypeR5dn4xlarge, + InstanceTypeR5dn8xlarge, + InstanceTypeR5dn12xlarge, + InstanceTypeR5dn16xlarge, + InstanceTypeR5dn24xlarge, + InstanceTypeR5nLarge, + InstanceTypeR5nXlarge, + InstanceTypeR5n2xlarge, + InstanceTypeR5n4xlarge, + InstanceTypeR5n8xlarge, + InstanceTypeR5n12xlarge, + InstanceTypeR5n16xlarge, + InstanceTypeR5n24xlarge, + InstanceTypeInf1Xlarge, + InstanceTypeInf12xlarge, + InstanceTypeInf16xlarge, + InstanceTypeInf124xlarge, + InstanceTypeM6gMetal, + InstanceTypeM6gMedium, + InstanceTypeM6gLarge, + InstanceTypeM6gXlarge, + InstanceTypeM6g2xlarge, + InstanceTypeM6g4xlarge, + InstanceTypeM6g8xlarge, + InstanceTypeM6g12xlarge, + InstanceTypeM6g16xlarge, + InstanceTypeM6gdMetal, + InstanceTypeM6gdMedium, + InstanceTypeM6gdLarge, + InstanceTypeM6gdXlarge, + InstanceTypeM6gd2xlarge, + InstanceTypeM6gd4xlarge, + InstanceTypeM6gd8xlarge, + InstanceTypeM6gd12xlarge, + InstanceTypeM6gd16xlarge, + } +} + const ( // InstanceTypeHypervisorNitro is a InstanceTypeHypervisor enum value InstanceTypeHypervisorNitro = "nitro" @@ -111844,6 +117963,14 @@ const ( InstanceTypeHypervisorXen = "xen" ) +// InstanceTypeHypervisor_Values returns all elements of the InstanceTypeHypervisor enum +func InstanceTypeHypervisor_Values() []string { + return []string{ + InstanceTypeHypervisorNitro, + InstanceTypeHypervisorXen, + } +} + const ( // InterfacePermissionTypeInstanceAttach is a InterfacePermissionType enum value InterfacePermissionTypeInstanceAttach = "INSTANCE-ATTACH" @@ -111852,6 +117979,14 @@ const ( InterfacePermissionTypeEipAssociate = "EIP-ASSOCIATE" ) +// InterfacePermissionType_Values returns all elements of the InterfacePermissionType enum +func InterfacePermissionType_Values() []string { + return []string{ + InterfacePermissionTypeInstanceAttach, + InterfacePermissionTypeEipAssociate, + } +} + const ( // Ipv6SupportValueEnable is a Ipv6SupportValue enum value Ipv6SupportValueEnable = "enable" @@ -111860,6 +117995,14 @@ const ( Ipv6SupportValueDisable = "disable" ) +// Ipv6SupportValue_Values returns all elements of the Ipv6SupportValue enum +func Ipv6SupportValue_Values() []string { + return []string{ + Ipv6SupportValueEnable, + Ipv6SupportValueDisable, + } +} + const ( // LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist is a LaunchTemplateErrorCode enum value LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist = "launchTemplateIdDoesNotExist" @@ -111880,6 +118023,18 @@ const ( LaunchTemplateErrorCodeUnexpectedError = "unexpectedError" ) +// LaunchTemplateErrorCode_Values returns all elements of the LaunchTemplateErrorCode enum +func LaunchTemplateErrorCode_Values() []string { + return []string{ + LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist, + LaunchTemplateErrorCodeLaunchTemplateIdMalformed, + LaunchTemplateErrorCodeLaunchTemplateNameDoesNotExist, + LaunchTemplateErrorCodeLaunchTemplateNameMalformed, + LaunchTemplateErrorCodeLaunchTemplateVersionDoesNotExist, + LaunchTemplateErrorCodeUnexpectedError, + } +} + const ( // LaunchTemplateHttpTokensStateOptional is a LaunchTemplateHttpTokensState enum value LaunchTemplateHttpTokensStateOptional = "optional" @@ -111888,6 +118043,14 @@ const ( LaunchTemplateHttpTokensStateRequired = "required" ) +// LaunchTemplateHttpTokensState_Values returns all elements of the LaunchTemplateHttpTokensState enum +func LaunchTemplateHttpTokensState_Values() []string { + return []string{ + LaunchTemplateHttpTokensStateOptional, + LaunchTemplateHttpTokensStateRequired, + } +} + const ( // LaunchTemplateInstanceMetadataEndpointStateDisabled is a LaunchTemplateInstanceMetadataEndpointState enum value LaunchTemplateInstanceMetadataEndpointStateDisabled = "disabled" @@ -111896,6 +118059,14 @@ const ( LaunchTemplateInstanceMetadataEndpointStateEnabled = "enabled" ) +// LaunchTemplateInstanceMetadataEndpointState_Values returns all elements of the LaunchTemplateInstanceMetadataEndpointState enum +func LaunchTemplateInstanceMetadataEndpointState_Values() []string { + return []string{ + LaunchTemplateInstanceMetadataEndpointStateDisabled, + LaunchTemplateInstanceMetadataEndpointStateEnabled, + } +} + const ( // LaunchTemplateInstanceMetadataOptionsStatePending is a LaunchTemplateInstanceMetadataOptionsState enum value LaunchTemplateInstanceMetadataOptionsStatePending = "pending" @@ -111904,6 +118075,14 @@ const ( LaunchTemplateInstanceMetadataOptionsStateApplied = "applied" ) +// LaunchTemplateInstanceMetadataOptionsState_Values returns all elements of the LaunchTemplateInstanceMetadataOptionsState enum +func LaunchTemplateInstanceMetadataOptionsState_Values() []string { + return []string{ + LaunchTemplateInstanceMetadataOptionsStatePending, + LaunchTemplateInstanceMetadataOptionsStateApplied, + } +} + const ( // ListingStateAvailable is a ListingState enum value ListingStateAvailable = "available" @@ -111918,6 +118097,16 @@ const ( ListingStatePending = "pending" ) +// ListingState_Values returns all elements of the ListingState enum +func ListingState_Values() []string { + return []string{ + ListingStateAvailable, + ListingStateSold, + ListingStateCancelled, + ListingStatePending, + } +} + const ( // ListingStatusActive is a ListingStatus enum value ListingStatusActive = "active" @@ -111932,6 +118121,16 @@ const ( ListingStatusClosed = "closed" ) +// ListingStatus_Values returns all elements of the ListingStatus enum +func ListingStatus_Values() []string { + return []string{ + ListingStatusActive, + ListingStatusPending, + ListingStatusCancelled, + ListingStatusClosed, + } +} + const ( // LocalGatewayRouteStatePending is a LocalGatewayRouteState enum value LocalGatewayRouteStatePending = "pending" @@ -111949,6 +118148,17 @@ const ( LocalGatewayRouteStateDeleted = "deleted" ) +// LocalGatewayRouteState_Values returns all elements of the LocalGatewayRouteState enum +func LocalGatewayRouteState_Values() []string { + return []string{ + LocalGatewayRouteStatePending, + LocalGatewayRouteStateActive, + LocalGatewayRouteStateBlackhole, + LocalGatewayRouteStateDeleting, + LocalGatewayRouteStateDeleted, + } +} + const ( // LocalGatewayRouteTypeStatic is a LocalGatewayRouteType enum value LocalGatewayRouteTypeStatic = "static" @@ -111957,6 +118167,14 @@ const ( LocalGatewayRouteTypePropagated = "propagated" ) +// LocalGatewayRouteType_Values returns all elements of the LocalGatewayRouteType enum +func LocalGatewayRouteType_Values() []string { + return []string{ + LocalGatewayRouteTypeStatic, + LocalGatewayRouteTypePropagated, + } +} + const ( // LocationTypeRegion is a LocationType enum value LocationTypeRegion = "region" @@ -111968,6 +118186,15 @@ const ( LocationTypeAvailabilityZoneId = "availability-zone-id" ) +// LocationType_Values returns all elements of the LocationType enum +func LocationType_Values() []string { + return []string{ + LocationTypeRegion, + LocationTypeAvailabilityZone, + LocationTypeAvailabilityZoneId, + } +} + const ( // LogDestinationTypeCloudWatchLogs is a LogDestinationType enum value LogDestinationTypeCloudWatchLogs = "cloud-watch-logs" @@ -111976,11 +118203,26 @@ const ( LogDestinationTypeS3 = "s3" ) +// LogDestinationType_Values returns all elements of the LogDestinationType enum +func LogDestinationType_Values() []string { + return []string{ + LogDestinationTypeCloudWatchLogs, + LogDestinationTypeS3, + } +} + const ( // MarketTypeSpot is a MarketType enum value MarketTypeSpot = "spot" ) +// MarketType_Values returns all elements of the MarketType enum +func MarketType_Values() []string { + return []string{ + MarketTypeSpot, + } +} + const ( // MembershipTypeStatic is a MembershipType enum value MembershipTypeStatic = "static" @@ -111989,6 +118231,14 @@ const ( MembershipTypeIgmp = "igmp" ) +// MembershipType_Values returns all elements of the MembershipType enum +func MembershipType_Values() []string { + return []string{ + MembershipTypeStatic, + MembershipTypeIgmp, + } +} + const ( // ModifyAvailabilityZoneOptInStatusOptedIn is a ModifyAvailabilityZoneOptInStatus enum value ModifyAvailabilityZoneOptInStatusOptedIn = "opted-in" @@ -111997,6 +118247,14 @@ const ( ModifyAvailabilityZoneOptInStatusNotOptedIn = "not-opted-in" ) +// ModifyAvailabilityZoneOptInStatus_Values returns all elements of the ModifyAvailabilityZoneOptInStatus enum +func ModifyAvailabilityZoneOptInStatus_Values() []string { + return []string{ + ModifyAvailabilityZoneOptInStatusOptedIn, + ModifyAvailabilityZoneOptInStatusNotOptedIn, + } +} + const ( // MonitoringStateDisabled is a MonitoringState enum value MonitoringStateDisabled = "disabled" @@ -112011,6 +118269,16 @@ const ( MonitoringStatePending = "pending" ) +// MonitoringState_Values returns all elements of the MonitoringState enum +func MonitoringState_Values() []string { + return []string{ + MonitoringStateDisabled, + MonitoringStateDisabling, + MonitoringStateEnabled, + MonitoringStatePending, + } +} + const ( // MoveStatusMovingToVpc is a MoveStatus enum value MoveStatusMovingToVpc = "movingToVpc" @@ -112019,6 +118287,14 @@ const ( MoveStatusRestoringToClassic = "restoringToClassic" ) +// MoveStatus_Values returns all elements of the MoveStatus enum +func MoveStatus_Values() []string { + return []string{ + MoveStatusMovingToVpc, + MoveStatusRestoringToClassic, + } +} + const ( // MulticastSupportValueEnable is a MulticastSupportValue enum value MulticastSupportValueEnable = "enable" @@ -112027,6 +118303,14 @@ const ( MulticastSupportValueDisable = "disable" ) +// MulticastSupportValue_Values returns all elements of the MulticastSupportValue enum +func MulticastSupportValue_Values() []string { + return []string{ + MulticastSupportValueEnable, + MulticastSupportValueDisable, + } +} + const ( // NatGatewayStatePending is a NatGatewayState enum value NatGatewayStatePending = "pending" @@ -112044,6 +118328,17 @@ const ( NatGatewayStateDeleted = "deleted" ) +// NatGatewayState_Values returns all elements of the NatGatewayState enum +func NatGatewayState_Values() []string { + return []string{ + NatGatewayStatePending, + NatGatewayStateFailed, + NatGatewayStateAvailable, + NatGatewayStateDeleting, + NatGatewayStateDeleted, + } +} + const ( // NetworkInterfaceAttributeDescription is a NetworkInterfaceAttribute enum value NetworkInterfaceAttributeDescription = "description" @@ -112058,11 +118353,28 @@ const ( NetworkInterfaceAttributeAttachment = "attachment" ) +// NetworkInterfaceAttribute_Values returns all elements of the NetworkInterfaceAttribute enum +func NetworkInterfaceAttribute_Values() []string { + return []string{ + NetworkInterfaceAttributeDescription, + NetworkInterfaceAttributeGroupSet, + NetworkInterfaceAttributeSourceDestCheck, + NetworkInterfaceAttributeAttachment, + } +} + const ( // NetworkInterfaceCreationTypeEfa is a NetworkInterfaceCreationType enum value NetworkInterfaceCreationTypeEfa = "efa" ) +// NetworkInterfaceCreationType_Values returns all elements of the NetworkInterfaceCreationType enum +func NetworkInterfaceCreationType_Values() []string { + return []string{ + NetworkInterfaceCreationTypeEfa, + } +} + const ( // NetworkInterfacePermissionStateCodePending is a NetworkInterfacePermissionStateCode enum value NetworkInterfacePermissionStateCodePending = "pending" @@ -112077,6 +118389,16 @@ const ( NetworkInterfacePermissionStateCodeRevoked = "revoked" ) +// NetworkInterfacePermissionStateCode_Values returns all elements of the NetworkInterfacePermissionStateCode enum +func NetworkInterfacePermissionStateCode_Values() []string { + return []string{ + NetworkInterfacePermissionStateCodePending, + NetworkInterfacePermissionStateCodeGranted, + NetworkInterfacePermissionStateCodeRevoking, + NetworkInterfacePermissionStateCodeRevoked, + } +} + const ( // NetworkInterfaceStatusAvailable is a NetworkInterfaceStatus enum value NetworkInterfaceStatusAvailable = "available" @@ -112094,6 +118416,17 @@ const ( NetworkInterfaceStatusDetaching = "detaching" ) +// NetworkInterfaceStatus_Values returns all elements of the NetworkInterfaceStatus enum +func NetworkInterfaceStatus_Values() []string { + return []string{ + NetworkInterfaceStatusAvailable, + NetworkInterfaceStatusAssociated, + NetworkInterfaceStatusAttaching, + NetworkInterfaceStatusInUse, + NetworkInterfaceStatusDetaching, + } +} + const ( // NetworkInterfaceTypeInterface is a NetworkInterfaceType enum value NetworkInterfaceTypeInterface = "interface" @@ -112105,6 +118438,15 @@ const ( NetworkInterfaceTypeEfa = "efa" ) +// NetworkInterfaceType_Values returns all elements of the NetworkInterfaceType enum +func NetworkInterfaceType_Values() []string { + return []string{ + NetworkInterfaceTypeInterface, + NetworkInterfaceTypeNatGateway, + NetworkInterfaceTypeEfa, + } +} + const ( // OfferingClassTypeStandard is a OfferingClassType enum value OfferingClassTypeStandard = "standard" @@ -112113,6 +118455,14 @@ const ( OfferingClassTypeConvertible = "convertible" ) +// OfferingClassType_Values returns all elements of the OfferingClassType enum +func OfferingClassType_Values() []string { + return []string{ + OfferingClassTypeStandard, + OfferingClassTypeConvertible, + } +} + const ( // OfferingTypeValuesHeavyUtilization is a OfferingTypeValues enum value OfferingTypeValuesHeavyUtilization = "Heavy Utilization" @@ -112133,6 +118483,18 @@ const ( OfferingTypeValuesAllUpfront = "All Upfront" ) +// OfferingTypeValues_Values returns all elements of the OfferingTypeValues enum +func OfferingTypeValues_Values() []string { + return []string{ + OfferingTypeValuesHeavyUtilization, + OfferingTypeValuesMediumUtilization, + OfferingTypeValuesLightUtilization, + OfferingTypeValuesNoUpfront, + OfferingTypeValuesPartialUpfront, + OfferingTypeValuesAllUpfront, + } +} + const ( // OnDemandAllocationStrategyLowestPrice is a OnDemandAllocationStrategy enum value OnDemandAllocationStrategyLowestPrice = "lowestPrice" @@ -112141,6 +118503,14 @@ const ( OnDemandAllocationStrategyPrioritized = "prioritized" ) +// OnDemandAllocationStrategy_Values returns all elements of the OnDemandAllocationStrategy enum +func OnDemandAllocationStrategy_Values() []string { + return []string{ + OnDemandAllocationStrategyLowestPrice, + OnDemandAllocationStrategyPrioritized, + } +} + const ( // OperationTypeAdd is a OperationType enum value OperationTypeAdd = "add" @@ -112149,6 +118519,14 @@ const ( OperationTypeRemove = "remove" ) +// OperationType_Values returns all elements of the OperationType enum +func OperationType_Values() []string { + return []string{ + OperationTypeAdd, + OperationTypeRemove, + } +} + const ( // PaymentOptionAllUpfront is a PaymentOption enum value PaymentOptionAllUpfront = "AllUpfront" @@ -112160,11 +118538,27 @@ const ( PaymentOptionNoUpfront = "NoUpfront" ) +// PaymentOption_Values returns all elements of the PaymentOption enum +func PaymentOption_Values() []string { + return []string{ + PaymentOptionAllUpfront, + PaymentOptionPartialUpfront, + PaymentOptionNoUpfront, + } +} + const ( // PermissionGroupAll is a PermissionGroup enum value PermissionGroupAll = "all" ) +// PermissionGroup_Values returns all elements of the PermissionGroup enum +func PermissionGroup_Values() []string { + return []string{ + PermissionGroupAll, + } +} + const ( // PlacementGroupStatePending is a PlacementGroupState enum value PlacementGroupStatePending = "pending" @@ -112179,6 +118573,16 @@ const ( PlacementGroupStateDeleted = "deleted" ) +// PlacementGroupState_Values returns all elements of the PlacementGroupState enum +func PlacementGroupState_Values() []string { + return []string{ + PlacementGroupStatePending, + PlacementGroupStateAvailable, + PlacementGroupStateDeleting, + PlacementGroupStateDeleted, + } +} + const ( // PlacementGroupStrategyCluster is a PlacementGroupStrategy enum value PlacementGroupStrategyCluster = "cluster" @@ -112190,6 +118594,15 @@ const ( PlacementGroupStrategySpread = "spread" ) +// PlacementGroupStrategy_Values returns all elements of the PlacementGroupStrategy enum +func PlacementGroupStrategy_Values() []string { + return []string{ + PlacementGroupStrategyCluster, + PlacementGroupStrategyPartition, + PlacementGroupStrategySpread, + } +} + const ( // PlacementStrategyCluster is a PlacementStrategy enum value PlacementStrategyCluster = "cluster" @@ -112201,11 +118614,83 @@ const ( PlacementStrategyPartition = "partition" ) +// PlacementStrategy_Values returns all elements of the PlacementStrategy enum +func PlacementStrategy_Values() []string { + return []string{ + PlacementStrategyCluster, + PlacementStrategySpread, + PlacementStrategyPartition, + } +} + const ( // PlatformValuesWindows is a PlatformValues enum value PlatformValuesWindows = "Windows" ) +// PlatformValues_Values returns all elements of the PlatformValues enum +func PlatformValues_Values() []string { + return []string{ + PlatformValuesWindows, + } +} + +const ( + // PrefixListStateCreateInProgress is a PrefixListState enum value + PrefixListStateCreateInProgress = "create-in-progress" + + // PrefixListStateCreateComplete is a PrefixListState enum value + PrefixListStateCreateComplete = "create-complete" + + // PrefixListStateCreateFailed is a PrefixListState enum value + PrefixListStateCreateFailed = "create-failed" + + // PrefixListStateModifyInProgress is a PrefixListState enum value + PrefixListStateModifyInProgress = "modify-in-progress" + + // PrefixListStateModifyComplete is a PrefixListState enum value + PrefixListStateModifyComplete = "modify-complete" + + // PrefixListStateModifyFailed is a PrefixListState enum value + PrefixListStateModifyFailed = "modify-failed" + + // PrefixListStateRestoreInProgress is a PrefixListState enum value + PrefixListStateRestoreInProgress = "restore-in-progress" + + // PrefixListStateRestoreComplete is a PrefixListState enum value + PrefixListStateRestoreComplete = "restore-complete" + + // PrefixListStateRestoreFailed is a PrefixListState enum value + PrefixListStateRestoreFailed = "restore-failed" + + // PrefixListStateDeleteInProgress is a PrefixListState enum value + PrefixListStateDeleteInProgress = "delete-in-progress" + + // PrefixListStateDeleteComplete is a PrefixListState enum value + PrefixListStateDeleteComplete = "delete-complete" + + // PrefixListStateDeleteFailed is a PrefixListState enum value + PrefixListStateDeleteFailed = "delete-failed" +) + +// PrefixListState_Values returns all elements of the PrefixListState enum +func PrefixListState_Values() []string { + return []string{ + PrefixListStateCreateInProgress, + PrefixListStateCreateComplete, + PrefixListStateCreateFailed, + PrefixListStateModifyInProgress, + PrefixListStateModifyComplete, + PrefixListStateModifyFailed, + PrefixListStateRestoreInProgress, + PrefixListStateRestoreComplete, + PrefixListStateRestoreFailed, + PrefixListStateDeleteInProgress, + PrefixListStateDeleteComplete, + PrefixListStateDeleteFailed, + } +} + const ( // PrincipalTypeAll is a PrincipalType enum value PrincipalTypeAll = "All" @@ -112226,6 +118711,18 @@ const ( PrincipalTypeRole = "Role" ) +// PrincipalType_Values returns all elements of the PrincipalType enum +func PrincipalType_Values() []string { + return []string{ + PrincipalTypeAll, + PrincipalTypeService, + PrincipalTypeOrganizationUnit, + PrincipalTypeAccount, + PrincipalTypeUser, + PrincipalTypeRole, + } +} + const ( // ProductCodeValuesDevpay is a ProductCodeValues enum value ProductCodeValuesDevpay = "devpay" @@ -112234,6 +118731,14 @@ const ( ProductCodeValuesMarketplace = "marketplace" ) +// ProductCodeValues_Values returns all elements of the ProductCodeValues enum +func ProductCodeValues_Values() []string { + return []string{ + ProductCodeValuesDevpay, + ProductCodeValuesMarketplace, + } +} + const ( // RIProductDescriptionLinuxUnix is a RIProductDescription enum value RIProductDescriptionLinuxUnix = "Linux/UNIX" @@ -112248,11 +118753,28 @@ const ( RIProductDescriptionWindowsAmazonVpc = "Windows (Amazon VPC)" ) +// RIProductDescription_Values returns all elements of the RIProductDescription enum +func RIProductDescription_Values() []string { + return []string{ + RIProductDescriptionLinuxUnix, + RIProductDescriptionLinuxUnixamazonVpc, + RIProductDescriptionWindows, + RIProductDescriptionWindowsAmazonVpc, + } +} + const ( // RecurringChargeFrequencyHourly is a RecurringChargeFrequency enum value RecurringChargeFrequencyHourly = "Hourly" ) +// RecurringChargeFrequency_Values returns all elements of the RecurringChargeFrequency enum +func RecurringChargeFrequency_Values() []string { + return []string{ + RecurringChargeFrequencyHourly, + } +} + const ( // ReportInstanceReasonCodesInstanceStuckInState is a ReportInstanceReasonCodes enum value ReportInstanceReasonCodesInstanceStuckInState = "instance-stuck-in-state" @@ -112282,6 +118804,21 @@ const ( ReportInstanceReasonCodesOther = "other" ) +// ReportInstanceReasonCodes_Values returns all elements of the ReportInstanceReasonCodes enum +func ReportInstanceReasonCodes_Values() []string { + return []string{ + ReportInstanceReasonCodesInstanceStuckInState, + ReportInstanceReasonCodesUnresponsive, + ReportInstanceReasonCodesNotAcceptingCredentials, + ReportInstanceReasonCodesPasswordNotAvailable, + ReportInstanceReasonCodesPerformanceNetwork, + ReportInstanceReasonCodesPerformanceInstanceStore, + ReportInstanceReasonCodesPerformanceEbsVolume, + ReportInstanceReasonCodesPerformanceOther, + ReportInstanceReasonCodesOther, + } +} + const ( // ReportStatusTypeOk is a ReportStatusType enum value ReportStatusTypeOk = "ok" @@ -112290,6 +118827,14 @@ const ( ReportStatusTypeImpaired = "impaired" ) +// ReportStatusType_Values returns all elements of the ReportStatusType enum +func ReportStatusType_Values() []string { + return []string{ + ReportStatusTypeOk, + ReportStatusTypeImpaired, + } +} + const ( // ReservationStatePaymentPending is a ReservationState enum value ReservationStatePaymentPending = "payment-pending" @@ -112304,6 +118849,16 @@ const ( ReservationStateRetired = "retired" ) +// ReservationState_Values returns all elements of the ReservationState enum +func ReservationState_Values() []string { + return []string{ + ReservationStatePaymentPending, + ReservationStatePaymentFailed, + ReservationStateActive, + ReservationStateRetired, + } +} + const ( // ReservedInstanceStatePaymentPending is a ReservedInstanceState enum value ReservedInstanceStatePaymentPending = "payment-pending" @@ -112324,16 +118879,42 @@ const ( ReservedInstanceStateQueuedDeleted = "queued-deleted" ) +// ReservedInstanceState_Values returns all elements of the ReservedInstanceState enum +func ReservedInstanceState_Values() []string { + return []string{ + ReservedInstanceStatePaymentPending, + ReservedInstanceStateActive, + ReservedInstanceStatePaymentFailed, + ReservedInstanceStateRetired, + ReservedInstanceStateQueued, + ReservedInstanceStateQueuedDeleted, + } +} + const ( // ResetFpgaImageAttributeNameLoadPermission is a ResetFpgaImageAttributeName enum value ResetFpgaImageAttributeNameLoadPermission = "loadPermission" ) +// ResetFpgaImageAttributeName_Values returns all elements of the ResetFpgaImageAttributeName enum +func ResetFpgaImageAttributeName_Values() []string { + return []string{ + ResetFpgaImageAttributeNameLoadPermission, + } +} + const ( // ResetImageAttributeNameLaunchPermission is a ResetImageAttributeName enum value ResetImageAttributeNameLaunchPermission = "launchPermission" ) +// ResetImageAttributeName_Values returns all elements of the ResetImageAttributeName enum +func ResetImageAttributeName_Values() []string { + return []string{ + ResetImageAttributeNameLaunchPermission, + } +} + const ( // ResourceTypeClientVpnEndpoint is a ResourceType enum value ResourceTypeClientVpnEndpoint = "client-vpn-endpoint" @@ -112347,9 +118928,21 @@ const ( // ResourceTypeDhcpOptions is a ResourceType enum value ResourceTypeDhcpOptions = "dhcp-options" + // ResourceTypeEgressOnlyInternetGateway is a ResourceType enum value + ResourceTypeEgressOnlyInternetGateway = "egress-only-internet-gateway" + // ResourceTypeElasticIp is a ResourceType enum value ResourceTypeElasticIp = "elastic-ip" + // ResourceTypeElasticGpu is a ResourceType enum value + ResourceTypeElasticGpu = "elastic-gpu" + + // ResourceTypeExportImageTask is a ResourceType enum value + ResourceTypeExportImageTask = "export-image-task" + + // ResourceTypeExportInstanceTask is a ResourceType enum value + ResourceTypeExportInstanceTask = "export-instance-task" + // ResourceTypeFleet is a ResourceType enum value ResourceTypeFleet = "fleet" @@ -112362,6 +118955,12 @@ const ( // ResourceTypeImage is a ResourceType enum value ResourceTypeImage = "image" + // ResourceTypeImportImageTask is a ResourceType enum value + ResourceTypeImportImageTask = "import-image-task" + + // ResourceTypeImportSnapshotTask is a ResourceType enum value + ResourceTypeImportSnapshotTask = "import-snapshot-task" + // ResourceTypeInstance is a ResourceType enum value ResourceTypeInstance = "instance" @@ -112374,6 +118973,9 @@ const ( // ResourceTypeLaunchTemplate is a ResourceType enum value ResourceTypeLaunchTemplate = "launch-template" + // ResourceTypeLocalGatewayRouteTableVpcAssociation is a ResourceType enum value + ResourceTypeLocalGatewayRouteTableVpcAssociation = "local-gateway-route-table-vpc-association" + // ResourceTypeNatgateway is a ResourceType enum value ResourceTypeNatgateway = "natgateway" @@ -112447,6 +119049,56 @@ const ( ResourceTypeVpcFlowLog = "vpc-flow-log" ) +// ResourceType_Values returns all elements of the ResourceType enum +func ResourceType_Values() []string { + return []string{ + ResourceTypeClientVpnEndpoint, + ResourceTypeCustomerGateway, + ResourceTypeDedicatedHost, + ResourceTypeDhcpOptions, + ResourceTypeEgressOnlyInternetGateway, + ResourceTypeElasticIp, + ResourceTypeElasticGpu, + ResourceTypeExportImageTask, + ResourceTypeExportInstanceTask, + ResourceTypeFleet, + ResourceTypeFpgaImage, + ResourceTypeHostReservation, + ResourceTypeImage, + ResourceTypeImportImageTask, + ResourceTypeImportSnapshotTask, + ResourceTypeInstance, + ResourceTypeInternetGateway, + ResourceTypeKeyPair, + ResourceTypeLaunchTemplate, + ResourceTypeLocalGatewayRouteTableVpcAssociation, + ResourceTypeNatgateway, + ResourceTypeNetworkAcl, + ResourceTypeNetworkInterface, + ResourceTypePlacementGroup, + ResourceTypeReservedInstances, + ResourceTypeRouteTable, + ResourceTypeSecurityGroup, + ResourceTypeSnapshot, + ResourceTypeSpotFleetRequest, + ResourceTypeSpotInstancesRequest, + ResourceTypeSubnet, + ResourceTypeTrafficMirrorFilter, + ResourceTypeTrafficMirrorSession, + ResourceTypeTrafficMirrorTarget, + ResourceTypeTransitGateway, + ResourceTypeTransitGatewayAttachment, + ResourceTypeTransitGatewayMulticastDomain, + ResourceTypeTransitGatewayRouteTable, + ResourceTypeVolume, + ResourceTypeVpc, + ResourceTypeVpcPeeringConnection, + ResourceTypeVpnConnection, + ResourceTypeVpnGateway, + ResourceTypeVpcFlowLog, + } +} + const ( // RootDeviceTypeEbs is a RootDeviceType enum value RootDeviceTypeEbs = "ebs" @@ -112455,6 +119107,14 @@ const ( RootDeviceTypeInstanceStore = "instance-store" ) +// RootDeviceType_Values returns all elements of the RootDeviceType enum +func RootDeviceType_Values() []string { + return []string{ + RootDeviceTypeEbs, + RootDeviceTypeInstanceStore, + } +} + const ( // RouteOriginCreateRouteTable is a RouteOrigin enum value RouteOriginCreateRouteTable = "CreateRouteTable" @@ -112466,6 +119126,15 @@ const ( RouteOriginEnableVgwRoutePropagation = "EnableVgwRoutePropagation" ) +// RouteOrigin_Values returns all elements of the RouteOrigin enum +func RouteOrigin_Values() []string { + return []string{ + RouteOriginCreateRouteTable, + RouteOriginCreateRoute, + RouteOriginEnableVgwRoutePropagation, + } +} + const ( // RouteStateActive is a RouteState enum value RouteStateActive = "active" @@ -112474,6 +119143,14 @@ const ( RouteStateBlackhole = "blackhole" ) +// RouteState_Values returns all elements of the RouteState enum +func RouteState_Values() []string { + return []string{ + RouteStateActive, + RouteStateBlackhole, + } +} + const ( // RouteTableAssociationStateCodeAssociating is a RouteTableAssociationStateCode enum value RouteTableAssociationStateCodeAssociating = "associating" @@ -112491,6 +119168,17 @@ const ( RouteTableAssociationStateCodeFailed = "failed" ) +// RouteTableAssociationStateCode_Values returns all elements of the RouteTableAssociationStateCode enum +func RouteTableAssociationStateCode_Values() []string { + return []string{ + RouteTableAssociationStateCodeAssociating, + RouteTableAssociationStateCodeAssociated, + RouteTableAssociationStateCodeDisassociating, + RouteTableAssociationStateCodeDisassociated, + RouteTableAssociationStateCodeFailed, + } +} + const ( // RuleActionAllow is a RuleAction enum value RuleActionAllow = "allow" @@ -112499,6 +119187,14 @@ const ( RuleActionDeny = "deny" ) +// RuleAction_Values returns all elements of the RuleAction enum +func RuleAction_Values() []string { + return []string{ + RuleActionAllow, + RuleActionDeny, + } +} + const ( // ScopeAvailabilityZone is a Scope enum value ScopeAvailabilityZone = "Availability Zone" @@ -112507,6 +119203,14 @@ const ( ScopeRegion = "Region" ) +// Scope_Values returns all elements of the Scope enum +func Scope_Values() []string { + return []string{ + ScopeAvailabilityZone, + ScopeRegion, + } +} + const ( // ServiceStatePending is a ServiceState enum value ServiceStatePending = "Pending" @@ -112524,6 +119228,17 @@ const ( ServiceStateFailed = "Failed" ) +// ServiceState_Values returns all elements of the ServiceState enum +func ServiceState_Values() []string { + return []string{ + ServiceStatePending, + ServiceStateAvailable, + ServiceStateDeleting, + ServiceStateDeleted, + ServiceStateFailed, + } +} + const ( // ServiceTypeInterface is a ServiceType enum value ServiceTypeInterface = "Interface" @@ -112532,6 +119247,14 @@ const ( ServiceTypeGateway = "Gateway" ) +// ServiceType_Values returns all elements of the ServiceType enum +func ServiceType_Values() []string { + return []string{ + ServiceTypeInterface, + ServiceTypeGateway, + } +} + const ( // ShutdownBehaviorStop is a ShutdownBehavior enum value ShutdownBehaviorStop = "stop" @@ -112540,6 +119263,14 @@ const ( ShutdownBehaviorTerminate = "terminate" ) +// ShutdownBehavior_Values returns all elements of the ShutdownBehavior enum +func ShutdownBehavior_Values() []string { + return []string{ + ShutdownBehaviorStop, + ShutdownBehaviorTerminate, + } +} + const ( // SnapshotAttributeNameProductCodes is a SnapshotAttributeName enum value SnapshotAttributeNameProductCodes = "productCodes" @@ -112548,6 +119279,14 @@ const ( SnapshotAttributeNameCreateVolumePermission = "createVolumePermission" ) +// SnapshotAttributeName_Values returns all elements of the SnapshotAttributeName enum +func SnapshotAttributeName_Values() []string { + return []string{ + SnapshotAttributeNameProductCodes, + SnapshotAttributeNameCreateVolumePermission, + } +} + const ( // SnapshotStatePending is a SnapshotState enum value SnapshotStatePending = "pending" @@ -112559,6 +119298,15 @@ const ( SnapshotStateError = "error" ) +// SnapshotState_Values returns all elements of the SnapshotState enum +func SnapshotState_Values() []string { + return []string{ + SnapshotStatePending, + SnapshotStateCompleted, + SnapshotStateError, + } +} + const ( // SpotAllocationStrategyLowestPrice is a SpotAllocationStrategy enum value SpotAllocationStrategyLowestPrice = "lowest-price" @@ -112570,6 +119318,15 @@ const ( SpotAllocationStrategyCapacityOptimized = "capacity-optimized" ) +// SpotAllocationStrategy_Values returns all elements of the SpotAllocationStrategy enum +func SpotAllocationStrategy_Values() []string { + return []string{ + SpotAllocationStrategyLowestPrice, + SpotAllocationStrategyDiversified, + SpotAllocationStrategyCapacityOptimized, + } +} + const ( // SpotInstanceInterruptionBehaviorHibernate is a SpotInstanceInterruptionBehavior enum value SpotInstanceInterruptionBehaviorHibernate = "hibernate" @@ -112581,6 +119338,15 @@ const ( SpotInstanceInterruptionBehaviorTerminate = "terminate" ) +// SpotInstanceInterruptionBehavior_Values returns all elements of the SpotInstanceInterruptionBehavior enum +func SpotInstanceInterruptionBehavior_Values() []string { + return []string{ + SpotInstanceInterruptionBehaviorHibernate, + SpotInstanceInterruptionBehaviorStop, + SpotInstanceInterruptionBehaviorTerminate, + } +} + const ( // SpotInstanceStateOpen is a SpotInstanceState enum value SpotInstanceStateOpen = "open" @@ -112598,6 +119364,17 @@ const ( SpotInstanceStateFailed = "failed" ) +// SpotInstanceState_Values returns all elements of the SpotInstanceState enum +func SpotInstanceState_Values() []string { + return []string{ + SpotInstanceStateOpen, + SpotInstanceStateActive, + SpotInstanceStateClosed, + SpotInstanceStateCancelled, + SpotInstanceStateFailed, + } +} + const ( // SpotInstanceTypeOneTime is a SpotInstanceType enum value SpotInstanceTypeOneTime = "one-time" @@ -112606,6 +119383,14 @@ const ( SpotInstanceTypePersistent = "persistent" ) +// SpotInstanceType_Values returns all elements of the SpotInstanceType enum +func SpotInstanceType_Values() []string { + return []string{ + SpotInstanceTypeOneTime, + SpotInstanceTypePersistent, + } +} + const ( // StatePendingAcceptance is a State enum value StatePendingAcceptance = "PendingAcceptance" @@ -112632,6 +119417,20 @@ const ( StateExpired = "Expired" ) +// State_Values returns all elements of the State enum +func State_Values() []string { + return []string{ + StatePendingAcceptance, + StatePending, + StateAvailable, + StateDeleting, + StateDeleted, + StateRejected, + StateFailed, + StateExpired, + } +} + const ( // StatusMoveInProgress is a Status enum value StatusMoveInProgress = "MoveInProgress" @@ -112643,11 +119442,27 @@ const ( StatusInClassic = "InClassic" ) +// Status_Values returns all elements of the Status enum +func Status_Values() []string { + return []string{ + StatusMoveInProgress, + StatusInVpc, + StatusInClassic, + } +} + const ( // StatusNameReachability is a StatusName enum value StatusNameReachability = "reachability" ) +// StatusName_Values returns all elements of the StatusName enum +func StatusName_Values() []string { + return []string{ + StatusNameReachability, + } +} + const ( // StatusTypePassed is a StatusType enum value StatusTypePassed = "passed" @@ -112662,6 +119477,16 @@ const ( StatusTypeInitializing = "initializing" ) +// StatusType_Values returns all elements of the StatusType enum +func StatusType_Values() []string { + return []string{ + StatusTypePassed, + StatusTypeFailed, + StatusTypeInsufficientData, + StatusTypeInitializing, + } +} + const ( // SubnetCidrBlockStateCodeAssociating is a SubnetCidrBlockStateCode enum value SubnetCidrBlockStateCodeAssociating = "associating" @@ -112682,6 +119507,18 @@ const ( SubnetCidrBlockStateCodeFailed = "failed" ) +// SubnetCidrBlockStateCode_Values returns all elements of the SubnetCidrBlockStateCode enum +func SubnetCidrBlockStateCode_Values() []string { + return []string{ + SubnetCidrBlockStateCodeAssociating, + SubnetCidrBlockStateCodeAssociated, + SubnetCidrBlockStateCodeDisassociating, + SubnetCidrBlockStateCodeDisassociated, + SubnetCidrBlockStateCodeFailing, + SubnetCidrBlockStateCodeFailed, + } +} + const ( // SubnetStatePending is a SubnetState enum value SubnetStatePending = "pending" @@ -112690,6 +119527,14 @@ const ( SubnetStateAvailable = "available" ) +// SubnetState_Values returns all elements of the SubnetState enum +func SubnetState_Values() []string { + return []string{ + SubnetStatePending, + SubnetStateAvailable, + } +} + const ( // SummaryStatusOk is a SummaryStatus enum value SummaryStatusOk = "ok" @@ -112707,6 +119552,17 @@ const ( SummaryStatusInitializing = "initializing" ) +// SummaryStatus_Values returns all elements of the SummaryStatus enum +func SummaryStatus_Values() []string { + return []string{ + SummaryStatusOk, + SummaryStatusImpaired, + SummaryStatusInsufficientData, + SummaryStatusNotApplicable, + SummaryStatusInitializing, + } +} + const ( // TelemetryStatusUp is a TelemetryStatus enum value TelemetryStatusUp = "UP" @@ -112715,6 +119571,14 @@ const ( TelemetryStatusDown = "DOWN" ) +// TelemetryStatus_Values returns all elements of the TelemetryStatus enum +func TelemetryStatus_Values() []string { + return []string{ + TelemetryStatusUp, + TelemetryStatusDown, + } +} + const ( // TenancyDefault is a Tenancy enum value TenancyDefault = "default" @@ -112726,6 +119590,15 @@ const ( TenancyHost = "host" ) +// Tenancy_Values returns all elements of the Tenancy enum +func Tenancy_Values() []string { + return []string{ + TenancyDefault, + TenancyDedicated, + TenancyHost, + } +} + const ( // TrafficDirectionIngress is a TrafficDirection enum value TrafficDirectionIngress = "ingress" @@ -112734,6 +119607,14 @@ const ( TrafficDirectionEgress = "egress" ) +// TrafficDirection_Values returns all elements of the TrafficDirection enum +func TrafficDirection_Values() []string { + return []string{ + TrafficDirectionIngress, + TrafficDirectionEgress, + } +} + const ( // TrafficMirrorFilterRuleFieldDestinationPortRange is a TrafficMirrorFilterRuleField enum value TrafficMirrorFilterRuleFieldDestinationPortRange = "destination-port-range" @@ -112748,11 +119629,28 @@ const ( TrafficMirrorFilterRuleFieldDescription = "description" ) +// TrafficMirrorFilterRuleField_Values returns all elements of the TrafficMirrorFilterRuleField enum +func TrafficMirrorFilterRuleField_Values() []string { + return []string{ + TrafficMirrorFilterRuleFieldDestinationPortRange, + TrafficMirrorFilterRuleFieldSourcePortRange, + TrafficMirrorFilterRuleFieldProtocol, + TrafficMirrorFilterRuleFieldDescription, + } +} + const ( // TrafficMirrorNetworkServiceAmazonDns is a TrafficMirrorNetworkService enum value TrafficMirrorNetworkServiceAmazonDns = "amazon-dns" ) +// TrafficMirrorNetworkService_Values returns all elements of the TrafficMirrorNetworkService enum +func TrafficMirrorNetworkService_Values() []string { + return []string{ + TrafficMirrorNetworkServiceAmazonDns, + } +} + const ( // TrafficMirrorRuleActionAccept is a TrafficMirrorRuleAction enum value TrafficMirrorRuleActionAccept = "accept" @@ -112761,6 +119659,14 @@ const ( TrafficMirrorRuleActionReject = "reject" ) +// TrafficMirrorRuleAction_Values returns all elements of the TrafficMirrorRuleAction enum +func TrafficMirrorRuleAction_Values() []string { + return []string{ + TrafficMirrorRuleActionAccept, + TrafficMirrorRuleActionReject, + } +} + const ( // TrafficMirrorSessionFieldPacketLength is a TrafficMirrorSessionField enum value TrafficMirrorSessionFieldPacketLength = "packet-length" @@ -112772,6 +119678,15 @@ const ( TrafficMirrorSessionFieldVirtualNetworkId = "virtual-network-id" ) +// TrafficMirrorSessionField_Values returns all elements of the TrafficMirrorSessionField enum +func TrafficMirrorSessionField_Values() []string { + return []string{ + TrafficMirrorSessionFieldPacketLength, + TrafficMirrorSessionFieldDescription, + TrafficMirrorSessionFieldVirtualNetworkId, + } +} + const ( // TrafficMirrorTargetTypeNetworkInterface is a TrafficMirrorTargetType enum value TrafficMirrorTargetTypeNetworkInterface = "network-interface" @@ -112780,6 +119695,14 @@ const ( TrafficMirrorTargetTypeNetworkLoadBalancer = "network-load-balancer" ) +// TrafficMirrorTargetType_Values returns all elements of the TrafficMirrorTargetType enum +func TrafficMirrorTargetType_Values() []string { + return []string{ + TrafficMirrorTargetTypeNetworkInterface, + TrafficMirrorTargetTypeNetworkLoadBalancer, + } +} + const ( // TrafficTypeAccept is a TrafficType enum value TrafficTypeAccept = "ACCEPT" @@ -112791,6 +119714,15 @@ const ( TrafficTypeAll = "ALL" ) +// TrafficType_Values returns all elements of the TrafficType enum +func TrafficType_Values() []string { + return []string{ + TrafficTypeAccept, + TrafficTypeReject, + TrafficTypeAll, + } +} + const ( // TransitGatewayAssociationStateAssociating is a TransitGatewayAssociationState enum value TransitGatewayAssociationStateAssociating = "associating" @@ -112805,6 +119737,16 @@ const ( TransitGatewayAssociationStateDisassociated = "disassociated" ) +// TransitGatewayAssociationState_Values returns all elements of the TransitGatewayAssociationState enum +func TransitGatewayAssociationState_Values() []string { + return []string{ + TransitGatewayAssociationStateAssociating, + TransitGatewayAssociationStateAssociated, + TransitGatewayAssociationStateDisassociating, + TransitGatewayAssociationStateDisassociated, + } +} + const ( // TransitGatewayAttachmentResourceTypeVpc is a TransitGatewayAttachmentResourceType enum value TransitGatewayAttachmentResourceTypeVpc = "vpc" @@ -112815,14 +119757,31 @@ const ( // TransitGatewayAttachmentResourceTypeDirectConnectGateway is a TransitGatewayAttachmentResourceType enum value TransitGatewayAttachmentResourceTypeDirectConnectGateway = "direct-connect-gateway" + // TransitGatewayAttachmentResourceTypePeering is a TransitGatewayAttachmentResourceType enum value + TransitGatewayAttachmentResourceTypePeering = "peering" + // TransitGatewayAttachmentResourceTypeTgwPeering is a TransitGatewayAttachmentResourceType enum value TransitGatewayAttachmentResourceTypeTgwPeering = "tgw-peering" ) +// TransitGatewayAttachmentResourceType_Values returns all elements of the TransitGatewayAttachmentResourceType enum +func TransitGatewayAttachmentResourceType_Values() []string { + return []string{ + TransitGatewayAttachmentResourceTypeVpc, + TransitGatewayAttachmentResourceTypeVpn, + TransitGatewayAttachmentResourceTypeDirectConnectGateway, + TransitGatewayAttachmentResourceTypePeering, + TransitGatewayAttachmentResourceTypeTgwPeering, + } +} + const ( // TransitGatewayAttachmentStateInitiating is a TransitGatewayAttachmentState enum value TransitGatewayAttachmentStateInitiating = "initiating" + // TransitGatewayAttachmentStateInitiatingRequest is a TransitGatewayAttachmentState enum value + TransitGatewayAttachmentStateInitiatingRequest = "initiatingRequest" + // TransitGatewayAttachmentStatePendingAcceptance is a TransitGatewayAttachmentState enum value TransitGatewayAttachmentStatePendingAcceptance = "pendingAcceptance" @@ -112857,6 +119816,25 @@ const ( TransitGatewayAttachmentStateFailing = "failing" ) +// TransitGatewayAttachmentState_Values returns all elements of the TransitGatewayAttachmentState enum +func TransitGatewayAttachmentState_Values() []string { + return []string{ + TransitGatewayAttachmentStateInitiating, + TransitGatewayAttachmentStateInitiatingRequest, + TransitGatewayAttachmentStatePendingAcceptance, + TransitGatewayAttachmentStateRollingBack, + TransitGatewayAttachmentStatePending, + TransitGatewayAttachmentStateAvailable, + TransitGatewayAttachmentStateModifying, + TransitGatewayAttachmentStateDeleting, + TransitGatewayAttachmentStateDeleted, + TransitGatewayAttachmentStateFailed, + TransitGatewayAttachmentStateRejected, + TransitGatewayAttachmentStateRejecting, + TransitGatewayAttachmentStateFailing, + } +} + const ( // TransitGatewayMulitcastDomainAssociationStateAssociating is a TransitGatewayMulitcastDomainAssociationState enum value TransitGatewayMulitcastDomainAssociationStateAssociating = "associating" @@ -112871,6 +119849,16 @@ const ( TransitGatewayMulitcastDomainAssociationStateDisassociated = "disassociated" ) +// TransitGatewayMulitcastDomainAssociationState_Values returns all elements of the TransitGatewayMulitcastDomainAssociationState enum +func TransitGatewayMulitcastDomainAssociationState_Values() []string { + return []string{ + TransitGatewayMulitcastDomainAssociationStateAssociating, + TransitGatewayMulitcastDomainAssociationStateAssociated, + TransitGatewayMulitcastDomainAssociationStateDisassociating, + TransitGatewayMulitcastDomainAssociationStateDisassociated, + } +} + const ( // TransitGatewayMulticastDomainStatePending is a TransitGatewayMulticastDomainState enum value TransitGatewayMulticastDomainStatePending = "pending" @@ -112885,6 +119873,40 @@ const ( TransitGatewayMulticastDomainStateDeleted = "deleted" ) +// TransitGatewayMulticastDomainState_Values returns all elements of the TransitGatewayMulticastDomainState enum +func TransitGatewayMulticastDomainState_Values() []string { + return []string{ + TransitGatewayMulticastDomainStatePending, + TransitGatewayMulticastDomainStateAvailable, + TransitGatewayMulticastDomainStateDeleting, + TransitGatewayMulticastDomainStateDeleted, + } +} + +const ( + // TransitGatewayPrefixListReferenceStatePending is a TransitGatewayPrefixListReferenceState enum value + TransitGatewayPrefixListReferenceStatePending = "pending" + + // TransitGatewayPrefixListReferenceStateAvailable is a TransitGatewayPrefixListReferenceState enum value + TransitGatewayPrefixListReferenceStateAvailable = "available" + + // TransitGatewayPrefixListReferenceStateModifying is a TransitGatewayPrefixListReferenceState enum value + TransitGatewayPrefixListReferenceStateModifying = "modifying" + + // TransitGatewayPrefixListReferenceStateDeleting is a TransitGatewayPrefixListReferenceState enum value + TransitGatewayPrefixListReferenceStateDeleting = "deleting" +) + +// TransitGatewayPrefixListReferenceState_Values returns all elements of the TransitGatewayPrefixListReferenceState enum +func TransitGatewayPrefixListReferenceState_Values() []string { + return []string{ + TransitGatewayPrefixListReferenceStatePending, + TransitGatewayPrefixListReferenceStateAvailable, + TransitGatewayPrefixListReferenceStateModifying, + TransitGatewayPrefixListReferenceStateDeleting, + } +} + const ( // TransitGatewayPropagationStateEnabling is a TransitGatewayPropagationState enum value TransitGatewayPropagationStateEnabling = "enabling" @@ -112899,6 +119921,16 @@ const ( TransitGatewayPropagationStateDisabled = "disabled" ) +// TransitGatewayPropagationState_Values returns all elements of the TransitGatewayPropagationState enum +func TransitGatewayPropagationState_Values() []string { + return []string{ + TransitGatewayPropagationStateEnabling, + TransitGatewayPropagationStateEnabled, + TransitGatewayPropagationStateDisabling, + TransitGatewayPropagationStateDisabled, + } +} + const ( // TransitGatewayRouteStatePending is a TransitGatewayRouteState enum value TransitGatewayRouteStatePending = "pending" @@ -112916,6 +119948,17 @@ const ( TransitGatewayRouteStateDeleted = "deleted" ) +// TransitGatewayRouteState_Values returns all elements of the TransitGatewayRouteState enum +func TransitGatewayRouteState_Values() []string { + return []string{ + TransitGatewayRouteStatePending, + TransitGatewayRouteStateActive, + TransitGatewayRouteStateBlackhole, + TransitGatewayRouteStateDeleting, + TransitGatewayRouteStateDeleted, + } +} + const ( // TransitGatewayRouteTableStatePending is a TransitGatewayRouteTableState enum value TransitGatewayRouteTableStatePending = "pending" @@ -112930,6 +119973,16 @@ const ( TransitGatewayRouteTableStateDeleted = "deleted" ) +// TransitGatewayRouteTableState_Values returns all elements of the TransitGatewayRouteTableState enum +func TransitGatewayRouteTableState_Values() []string { + return []string{ + TransitGatewayRouteTableStatePending, + TransitGatewayRouteTableStateAvailable, + TransitGatewayRouteTableStateDeleting, + TransitGatewayRouteTableStateDeleted, + } +} + const ( // TransitGatewayRouteTypeStatic is a TransitGatewayRouteType enum value TransitGatewayRouteTypeStatic = "static" @@ -112938,6 +119991,14 @@ const ( TransitGatewayRouteTypePropagated = "propagated" ) +// TransitGatewayRouteType_Values returns all elements of the TransitGatewayRouteType enum +func TransitGatewayRouteType_Values() []string { + return []string{ + TransitGatewayRouteTypeStatic, + TransitGatewayRouteTypePropagated, + } +} + const ( // TransitGatewayStatePending is a TransitGatewayState enum value TransitGatewayStatePending = "pending" @@ -112955,6 +120016,17 @@ const ( TransitGatewayStateDeleted = "deleted" ) +// TransitGatewayState_Values returns all elements of the TransitGatewayState enum +func TransitGatewayState_Values() []string { + return []string{ + TransitGatewayStatePending, + TransitGatewayStateAvailable, + TransitGatewayStateModifying, + TransitGatewayStateDeleting, + TransitGatewayStateDeleted, + } +} + const ( // TransportProtocolTcp is a TransportProtocol enum value TransportProtocolTcp = "tcp" @@ -112963,6 +120035,30 @@ const ( TransportProtocolUdp = "udp" ) +// TransportProtocol_Values returns all elements of the TransportProtocol enum +func TransportProtocol_Values() []string { + return []string{ + TransportProtocolTcp, + TransportProtocolUdp, + } +} + +const ( + // TunnelInsideIpVersionIpv4 is a TunnelInsideIpVersion enum value + TunnelInsideIpVersionIpv4 = "ipv4" + + // TunnelInsideIpVersionIpv6 is a TunnelInsideIpVersion enum value + TunnelInsideIpVersionIpv6 = "ipv6" +) + +// TunnelInsideIpVersion_Values returns all elements of the TunnelInsideIpVersion enum +func TunnelInsideIpVersion_Values() []string { + return []string{ + TunnelInsideIpVersionIpv4, + TunnelInsideIpVersionIpv6, + } +} + const ( // UnlimitedSupportedInstanceFamilyT2 is a UnlimitedSupportedInstanceFamily enum value UnlimitedSupportedInstanceFamilyT2 = "t2" @@ -112974,6 +120070,15 @@ const ( UnlimitedSupportedInstanceFamilyT3a = "t3a" ) +// UnlimitedSupportedInstanceFamily_Values returns all elements of the UnlimitedSupportedInstanceFamily enum +func UnlimitedSupportedInstanceFamily_Values() []string { + return []string{ + UnlimitedSupportedInstanceFamilyT2, + UnlimitedSupportedInstanceFamilyT3, + UnlimitedSupportedInstanceFamilyT3a, + } +} + const ( // UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed = "InvalidInstanceID.Malformed" @@ -112988,6 +120093,16 @@ const ( UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceCreditSpecificationNotSupported = "InstanceCreditSpecification.NotSupported" ) +// UnsuccessfulInstanceCreditSpecificationErrorCode_Values returns all elements of the UnsuccessfulInstanceCreditSpecificationErrorCode enum +func UnsuccessfulInstanceCreditSpecificationErrorCode_Values() []string { + return []string{ + UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed, + UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdNotFound, + UnsuccessfulInstanceCreditSpecificationErrorCodeIncorrectInstanceState, + UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceCreditSpecificationNotSupported, + } +} + const ( // UsageClassTypeSpot is a UsageClassType enum value UsageClassTypeSpot = "spot" @@ -112996,6 +120111,14 @@ const ( UsageClassTypeOnDemand = "on-demand" ) +// UsageClassType_Values returns all elements of the UsageClassType enum +func UsageClassType_Values() []string { + return []string{ + UsageClassTypeSpot, + UsageClassTypeOnDemand, + } +} + const ( // VirtualizationTypeHvm is a VirtualizationType enum value VirtualizationTypeHvm = "hvm" @@ -113004,6 +120127,14 @@ const ( VirtualizationTypeParavirtual = "paravirtual" ) +// VirtualizationType_Values returns all elements of the VirtualizationType enum +func VirtualizationType_Values() []string { + return []string{ + VirtualizationTypeHvm, + VirtualizationTypeParavirtual, + } +} + const ( // VolumeAttachmentStateAttaching is a VolumeAttachmentState enum value VolumeAttachmentStateAttaching = "attaching" @@ -113021,6 +120152,17 @@ const ( VolumeAttachmentStateBusy = "busy" ) +// VolumeAttachmentState_Values returns all elements of the VolumeAttachmentState enum +func VolumeAttachmentState_Values() []string { + return []string{ + VolumeAttachmentStateAttaching, + VolumeAttachmentStateAttached, + VolumeAttachmentStateDetaching, + VolumeAttachmentStateDetached, + VolumeAttachmentStateBusy, + } +} + const ( // VolumeAttributeNameAutoEnableIo is a VolumeAttributeName enum value VolumeAttributeNameAutoEnableIo = "autoEnableIO" @@ -113029,6 +120171,14 @@ const ( VolumeAttributeNameProductCodes = "productCodes" ) +// VolumeAttributeName_Values returns all elements of the VolumeAttributeName enum +func VolumeAttributeName_Values() []string { + return []string{ + VolumeAttributeNameAutoEnableIo, + VolumeAttributeNameProductCodes, + } +} + const ( // VolumeModificationStateModifying is a VolumeModificationState enum value VolumeModificationStateModifying = "modifying" @@ -113043,6 +120193,16 @@ const ( VolumeModificationStateFailed = "failed" ) +// VolumeModificationState_Values returns all elements of the VolumeModificationState enum +func VolumeModificationState_Values() []string { + return []string{ + VolumeModificationStateModifying, + VolumeModificationStateOptimizing, + VolumeModificationStateCompleted, + VolumeModificationStateFailed, + } +} + const ( // VolumeStateCreating is a VolumeState enum value VolumeStateCreating = "creating" @@ -113063,6 +120223,18 @@ const ( VolumeStateError = "error" ) +// VolumeState_Values returns all elements of the VolumeState enum +func VolumeState_Values() []string { + return []string{ + VolumeStateCreating, + VolumeStateAvailable, + VolumeStateInUse, + VolumeStateDeleting, + VolumeStateDeleted, + VolumeStateError, + } +} + const ( // VolumeStatusInfoStatusOk is a VolumeStatusInfoStatus enum value VolumeStatusInfoStatusOk = "ok" @@ -113074,6 +120246,15 @@ const ( VolumeStatusInfoStatusInsufficientData = "insufficient-data" ) +// VolumeStatusInfoStatus_Values returns all elements of the VolumeStatusInfoStatus enum +func VolumeStatusInfoStatus_Values() []string { + return []string{ + VolumeStatusInfoStatusOk, + VolumeStatusInfoStatusImpaired, + VolumeStatusInfoStatusInsufficientData, + } +} + const ( // VolumeStatusNameIoEnabled is a VolumeStatusName enum value VolumeStatusNameIoEnabled = "io-enabled" @@ -113082,6 +120263,14 @@ const ( VolumeStatusNameIoPerformance = "io-performance" ) +// VolumeStatusName_Values returns all elements of the VolumeStatusName enum +func VolumeStatusName_Values() []string { + return []string{ + VolumeStatusNameIoEnabled, + VolumeStatusNameIoPerformance, + } +} + const ( // VolumeTypeStandard is a VolumeType enum value VolumeTypeStandard = "standard" @@ -113089,6 +120278,9 @@ const ( // VolumeTypeIo1 is a VolumeType enum value VolumeTypeIo1 = "io1" + // VolumeTypeIo2 is a VolumeType enum value + VolumeTypeIo2 = "io2" + // VolumeTypeGp2 is a VolumeType enum value VolumeTypeGp2 = "gp2" @@ -113099,6 +120291,18 @@ const ( VolumeTypeSt1 = "st1" ) +// VolumeType_Values returns all elements of the VolumeType enum +func VolumeType_Values() []string { + return []string{ + VolumeTypeStandard, + VolumeTypeIo1, + VolumeTypeIo2, + VolumeTypeGp2, + VolumeTypeSc1, + VolumeTypeSt1, + } +} + const ( // VpcAttributeNameEnableDnsSupport is a VpcAttributeName enum value VpcAttributeNameEnableDnsSupport = "enableDnsSupport" @@ -113107,6 +120311,14 @@ const ( VpcAttributeNameEnableDnsHostnames = "enableDnsHostnames" ) +// VpcAttributeName_Values returns all elements of the VpcAttributeName enum +func VpcAttributeName_Values() []string { + return []string{ + VpcAttributeNameEnableDnsSupport, + VpcAttributeNameEnableDnsHostnames, + } +} + const ( // VpcCidrBlockStateCodeAssociating is a VpcCidrBlockStateCode enum value VpcCidrBlockStateCodeAssociating = "associating" @@ -113127,6 +120339,18 @@ const ( VpcCidrBlockStateCodeFailed = "failed" ) +// VpcCidrBlockStateCode_Values returns all elements of the VpcCidrBlockStateCode enum +func VpcCidrBlockStateCode_Values() []string { + return []string{ + VpcCidrBlockStateCodeAssociating, + VpcCidrBlockStateCodeAssociated, + VpcCidrBlockStateCodeDisassociating, + VpcCidrBlockStateCodeDisassociated, + VpcCidrBlockStateCodeFailing, + VpcCidrBlockStateCodeFailed, + } +} + const ( // VpcEndpointTypeInterface is a VpcEndpointType enum value VpcEndpointTypeInterface = "Interface" @@ -113135,6 +120359,14 @@ const ( VpcEndpointTypeGateway = "Gateway" ) +// VpcEndpointType_Values returns all elements of the VpcEndpointType enum +func VpcEndpointType_Values() []string { + return []string{ + VpcEndpointTypeInterface, + VpcEndpointTypeGateway, + } +} + const ( // VpcPeeringConnectionStateReasonCodeInitiatingRequest is a VpcPeeringConnectionStateReasonCode enum value VpcPeeringConnectionStateReasonCodeInitiatingRequest = "initiating-request" @@ -113164,6 +120396,21 @@ const ( VpcPeeringConnectionStateReasonCodeDeleting = "deleting" ) +// VpcPeeringConnectionStateReasonCode_Values returns all elements of the VpcPeeringConnectionStateReasonCode enum +func VpcPeeringConnectionStateReasonCode_Values() []string { + return []string{ + VpcPeeringConnectionStateReasonCodeInitiatingRequest, + VpcPeeringConnectionStateReasonCodePendingAcceptance, + VpcPeeringConnectionStateReasonCodeActive, + VpcPeeringConnectionStateReasonCodeDeleted, + VpcPeeringConnectionStateReasonCodeRejected, + VpcPeeringConnectionStateReasonCodeFailed, + VpcPeeringConnectionStateReasonCodeExpired, + VpcPeeringConnectionStateReasonCodeProvisioning, + VpcPeeringConnectionStateReasonCodeDeleting, + } +} + const ( // VpcStatePending is a VpcState enum value VpcStatePending = "pending" @@ -113172,11 +120419,26 @@ const ( VpcStateAvailable = "available" ) +// VpcState_Values returns all elements of the VpcState enum +func VpcState_Values() []string { + return []string{ + VpcStatePending, + VpcStateAvailable, + } +} + const ( // VpcTenancyDefault is a VpcTenancy enum value VpcTenancyDefault = "default" ) +// VpcTenancy_Values returns all elements of the VpcTenancy enum +func VpcTenancy_Values() []string { + return []string{ + VpcTenancyDefault, + } +} + const ( // VpnEcmpSupportValueEnable is a VpnEcmpSupportValue enum value VpnEcmpSupportValueEnable = "enable" @@ -113185,11 +120447,26 @@ const ( VpnEcmpSupportValueDisable = "disable" ) +// VpnEcmpSupportValue_Values returns all elements of the VpnEcmpSupportValue enum +func VpnEcmpSupportValue_Values() []string { + return []string{ + VpnEcmpSupportValueEnable, + VpnEcmpSupportValueDisable, + } +} + const ( // VpnProtocolOpenvpn is a VpnProtocol enum value VpnProtocolOpenvpn = "openvpn" ) +// VpnProtocol_Values returns all elements of the VpnProtocol enum +func VpnProtocol_Values() []string { + return []string{ + VpnProtocolOpenvpn, + } +} + const ( // VpnStatePending is a VpnState enum value VpnStatePending = "pending" @@ -113204,7 +120481,24 @@ const ( VpnStateDeleted = "deleted" ) +// VpnState_Values returns all elements of the VpnState enum +func VpnState_Values() []string { + return []string{ + VpnStatePending, + VpnStateAvailable, + VpnStateDeleting, + VpnStateDeleted, + } +} + const ( // VpnStaticRouteSourceStatic is a VpnStaticRouteSource enum value VpnStaticRouteSourceStatic = "Static" ) + +// VpnStaticRouteSource_Values returns all elements of the VpnStaticRouteSource enum +func VpnStaticRouteSource_Values() []string { + return []string{ + VpnStaticRouteSourceStatic, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go index efec8d8a94e..3ad30591894 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go @@ -26,8 +26,12 @@ func init() { // only set the retryer on request if config doesn't have a retryer if r.Config.Retryer == nil && (r.Operation.Name == opModifyNetworkInterfaceAttribute || r.Operation.Name == opAssignPrivateIpAddresses) { + maxRetries := client.DefaultRetryerMaxNumRetries + if m := r.Config.MaxRetries; m != nil && *m != aws.UseServiceDefaultRetries { + maxRetries = *m + } r.Retryer = client.DefaultRetryer{ - NumMaxRetries: client.DefaultRetryerMaxNumRetries, + NumMaxRetries: maxRetries, MinRetryDelay: customRetryerMinRetryDelay, MinThrottleDelay: customRetryerMinRetryDelay, MaxRetryDelay: customRetryerMaxRetryDelay, diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go index 8cfda3d6cd9..6e1ae78f1b5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go @@ -228,6 +228,10 @@ type EC2API interface { CreateCapacityReservationWithContext(aws.Context, *ec2.CreateCapacityReservationInput, ...request.Option) (*ec2.CreateCapacityReservationOutput, error) CreateCapacityReservationRequest(*ec2.CreateCapacityReservationInput) (*request.Request, *ec2.CreateCapacityReservationOutput) + CreateCarrierGateway(*ec2.CreateCarrierGatewayInput) (*ec2.CreateCarrierGatewayOutput, error) + CreateCarrierGatewayWithContext(aws.Context, *ec2.CreateCarrierGatewayInput, ...request.Option) (*ec2.CreateCarrierGatewayOutput, error) + CreateCarrierGatewayRequest(*ec2.CreateCarrierGatewayInput) (*request.Request, *ec2.CreateCarrierGatewayOutput) + CreateClientVpnEndpoint(*ec2.CreateClientVpnEndpointInput) (*ec2.CreateClientVpnEndpointOutput, error) CreateClientVpnEndpointWithContext(aws.Context, *ec2.CreateClientVpnEndpointInput, ...request.Option) (*ec2.CreateClientVpnEndpointOutput, error) CreateClientVpnEndpointRequest(*ec2.CreateClientVpnEndpointInput) (*request.Request, *ec2.CreateClientVpnEndpointOutput) @@ -300,6 +304,10 @@ type EC2API interface { CreateLocalGatewayRouteTableVpcAssociationWithContext(aws.Context, *ec2.CreateLocalGatewayRouteTableVpcAssociationInput, ...request.Option) (*ec2.CreateLocalGatewayRouteTableVpcAssociationOutput, error) CreateLocalGatewayRouteTableVpcAssociationRequest(*ec2.CreateLocalGatewayRouteTableVpcAssociationInput) (*request.Request, *ec2.CreateLocalGatewayRouteTableVpcAssociationOutput) + CreateManagedPrefixList(*ec2.CreateManagedPrefixListInput) (*ec2.CreateManagedPrefixListOutput, error) + CreateManagedPrefixListWithContext(aws.Context, *ec2.CreateManagedPrefixListInput, ...request.Option) (*ec2.CreateManagedPrefixListOutput, error) + CreateManagedPrefixListRequest(*ec2.CreateManagedPrefixListInput) (*request.Request, *ec2.CreateManagedPrefixListOutput) + CreateNatGateway(*ec2.CreateNatGatewayInput) (*ec2.CreateNatGatewayOutput, error) CreateNatGatewayWithContext(aws.Context, *ec2.CreateNatGatewayInput, ...request.Option) (*ec2.CreateNatGatewayOutput, error) CreateNatGatewayRequest(*ec2.CreateNatGatewayInput) (*request.Request, *ec2.CreateNatGatewayOutput) @@ -388,6 +396,10 @@ type EC2API interface { CreateTransitGatewayPeeringAttachmentWithContext(aws.Context, *ec2.CreateTransitGatewayPeeringAttachmentInput, ...request.Option) (*ec2.CreateTransitGatewayPeeringAttachmentOutput, error) CreateTransitGatewayPeeringAttachmentRequest(*ec2.CreateTransitGatewayPeeringAttachmentInput) (*request.Request, *ec2.CreateTransitGatewayPeeringAttachmentOutput) + CreateTransitGatewayPrefixListReference(*ec2.CreateTransitGatewayPrefixListReferenceInput) (*ec2.CreateTransitGatewayPrefixListReferenceOutput, error) + CreateTransitGatewayPrefixListReferenceWithContext(aws.Context, *ec2.CreateTransitGatewayPrefixListReferenceInput, ...request.Option) (*ec2.CreateTransitGatewayPrefixListReferenceOutput, error) + CreateTransitGatewayPrefixListReferenceRequest(*ec2.CreateTransitGatewayPrefixListReferenceInput) (*request.Request, *ec2.CreateTransitGatewayPrefixListReferenceOutput) + CreateTransitGatewayRoute(*ec2.CreateTransitGatewayRouteInput) (*ec2.CreateTransitGatewayRouteOutput, error) CreateTransitGatewayRouteWithContext(aws.Context, *ec2.CreateTransitGatewayRouteInput, ...request.Option) (*ec2.CreateTransitGatewayRouteOutput, error) CreateTransitGatewayRouteRequest(*ec2.CreateTransitGatewayRouteInput) (*request.Request, *ec2.CreateTransitGatewayRouteOutput) @@ -436,6 +448,10 @@ type EC2API interface { CreateVpnGatewayWithContext(aws.Context, *ec2.CreateVpnGatewayInput, ...request.Option) (*ec2.CreateVpnGatewayOutput, error) CreateVpnGatewayRequest(*ec2.CreateVpnGatewayInput) (*request.Request, *ec2.CreateVpnGatewayOutput) + DeleteCarrierGateway(*ec2.DeleteCarrierGatewayInput) (*ec2.DeleteCarrierGatewayOutput, error) + DeleteCarrierGatewayWithContext(aws.Context, *ec2.DeleteCarrierGatewayInput, ...request.Option) (*ec2.DeleteCarrierGatewayOutput, error) + DeleteCarrierGatewayRequest(*ec2.DeleteCarrierGatewayInput) (*request.Request, *ec2.DeleteCarrierGatewayOutput) + DeleteClientVpnEndpoint(*ec2.DeleteClientVpnEndpointInput) (*ec2.DeleteClientVpnEndpointOutput, error) DeleteClientVpnEndpointWithContext(aws.Context, *ec2.DeleteClientVpnEndpointInput, ...request.Option) (*ec2.DeleteClientVpnEndpointOutput, error) DeleteClientVpnEndpointRequest(*ec2.DeleteClientVpnEndpointInput) (*request.Request, *ec2.DeleteClientVpnEndpointOutput) @@ -492,6 +508,10 @@ type EC2API interface { DeleteLocalGatewayRouteTableVpcAssociationWithContext(aws.Context, *ec2.DeleteLocalGatewayRouteTableVpcAssociationInput, ...request.Option) (*ec2.DeleteLocalGatewayRouteTableVpcAssociationOutput, error) DeleteLocalGatewayRouteTableVpcAssociationRequest(*ec2.DeleteLocalGatewayRouteTableVpcAssociationInput) (*request.Request, *ec2.DeleteLocalGatewayRouteTableVpcAssociationOutput) + DeleteManagedPrefixList(*ec2.DeleteManagedPrefixListInput) (*ec2.DeleteManagedPrefixListOutput, error) + DeleteManagedPrefixListWithContext(aws.Context, *ec2.DeleteManagedPrefixListInput, ...request.Option) (*ec2.DeleteManagedPrefixListOutput, error) + DeleteManagedPrefixListRequest(*ec2.DeleteManagedPrefixListInput) (*request.Request, *ec2.DeleteManagedPrefixListOutput) + DeleteNatGateway(*ec2.DeleteNatGatewayInput) (*ec2.DeleteNatGatewayOutput, error) DeleteNatGatewayWithContext(aws.Context, *ec2.DeleteNatGatewayInput, ...request.Option) (*ec2.DeleteNatGatewayOutput, error) DeleteNatGatewayRequest(*ec2.DeleteNatGatewayInput) (*request.Request, *ec2.DeleteNatGatewayOutput) @@ -576,6 +596,10 @@ type EC2API interface { DeleteTransitGatewayPeeringAttachmentWithContext(aws.Context, *ec2.DeleteTransitGatewayPeeringAttachmentInput, ...request.Option) (*ec2.DeleteTransitGatewayPeeringAttachmentOutput, error) DeleteTransitGatewayPeeringAttachmentRequest(*ec2.DeleteTransitGatewayPeeringAttachmentInput) (*request.Request, *ec2.DeleteTransitGatewayPeeringAttachmentOutput) + DeleteTransitGatewayPrefixListReference(*ec2.DeleteTransitGatewayPrefixListReferenceInput) (*ec2.DeleteTransitGatewayPrefixListReferenceOutput, error) + DeleteTransitGatewayPrefixListReferenceWithContext(aws.Context, *ec2.DeleteTransitGatewayPrefixListReferenceInput, ...request.Option) (*ec2.DeleteTransitGatewayPrefixListReferenceOutput, error) + DeleteTransitGatewayPrefixListReferenceRequest(*ec2.DeleteTransitGatewayPrefixListReferenceInput) (*request.Request, *ec2.DeleteTransitGatewayPrefixListReferenceOutput) + DeleteTransitGatewayRoute(*ec2.DeleteTransitGatewayRouteInput) (*ec2.DeleteTransitGatewayRouteOutput, error) DeleteTransitGatewayRouteWithContext(aws.Context, *ec2.DeleteTransitGatewayRouteInput, ...request.Option) (*ec2.DeleteTransitGatewayRouteOutput, error) DeleteTransitGatewayRouteRequest(*ec2.DeleteTransitGatewayRouteInput) (*request.Request, *ec2.DeleteTransitGatewayRouteOutput) @@ -678,6 +702,13 @@ type EC2API interface { DescribeCapacityReservationsPages(*ec2.DescribeCapacityReservationsInput, func(*ec2.DescribeCapacityReservationsOutput, bool) bool) error DescribeCapacityReservationsPagesWithContext(aws.Context, *ec2.DescribeCapacityReservationsInput, func(*ec2.DescribeCapacityReservationsOutput, bool) bool, ...request.Option) error + DescribeCarrierGateways(*ec2.DescribeCarrierGatewaysInput) (*ec2.DescribeCarrierGatewaysOutput, error) + DescribeCarrierGatewaysWithContext(aws.Context, *ec2.DescribeCarrierGatewaysInput, ...request.Option) (*ec2.DescribeCarrierGatewaysOutput, error) + DescribeCarrierGatewaysRequest(*ec2.DescribeCarrierGatewaysInput) (*request.Request, *ec2.DescribeCarrierGatewaysOutput) + + DescribeCarrierGatewaysPages(*ec2.DescribeCarrierGatewaysInput, func(*ec2.DescribeCarrierGatewaysOutput, bool) bool) error + DescribeCarrierGatewaysPagesWithContext(aws.Context, *ec2.DescribeCarrierGatewaysInput, func(*ec2.DescribeCarrierGatewaysOutput, bool) bool, ...request.Option) error + DescribeClassicLinkInstances(*ec2.DescribeClassicLinkInstancesInput) (*ec2.DescribeClassicLinkInstancesOutput, error) DescribeClassicLinkInstancesWithContext(aws.Context, *ec2.DescribeClassicLinkInstancesInput, ...request.Option) (*ec2.DescribeClassicLinkInstancesOutput, error) DescribeClassicLinkInstancesRequest(*ec2.DescribeClassicLinkInstancesInput) (*request.Request, *ec2.DescribeClassicLinkInstancesOutput) @@ -979,6 +1010,13 @@ type EC2API interface { DescribeLocalGatewaysPages(*ec2.DescribeLocalGatewaysInput, func(*ec2.DescribeLocalGatewaysOutput, bool) bool) error DescribeLocalGatewaysPagesWithContext(aws.Context, *ec2.DescribeLocalGatewaysInput, func(*ec2.DescribeLocalGatewaysOutput, bool) bool, ...request.Option) error + DescribeManagedPrefixLists(*ec2.DescribeManagedPrefixListsInput) (*ec2.DescribeManagedPrefixListsOutput, error) + DescribeManagedPrefixListsWithContext(aws.Context, *ec2.DescribeManagedPrefixListsInput, ...request.Option) (*ec2.DescribeManagedPrefixListsOutput, error) + DescribeManagedPrefixListsRequest(*ec2.DescribeManagedPrefixListsInput) (*request.Request, *ec2.DescribeManagedPrefixListsOutput) + + DescribeManagedPrefixListsPages(*ec2.DescribeManagedPrefixListsInput, func(*ec2.DescribeManagedPrefixListsOutput, bool) bool) error + DescribeManagedPrefixListsPagesWithContext(aws.Context, *ec2.DescribeManagedPrefixListsInput, func(*ec2.DescribeManagedPrefixListsOutput, bool) bool, ...request.Option) error + DescribeMovingAddresses(*ec2.DescribeMovingAddressesInput) (*ec2.DescribeMovingAddressesOutput, error) DescribeMovingAddressesWithContext(aws.Context, *ec2.DescribeMovingAddressesInput, ...request.Option) (*ec2.DescribeMovingAddressesOutput, error) DescribeMovingAddressesRequest(*ec2.DescribeMovingAddressesInput) (*request.Request, *ec2.DescribeMovingAddressesOutput) @@ -1485,6 +1523,13 @@ type EC2API interface { GetEbsEncryptionByDefaultWithContext(aws.Context, *ec2.GetEbsEncryptionByDefaultInput, ...request.Option) (*ec2.GetEbsEncryptionByDefaultOutput, error) GetEbsEncryptionByDefaultRequest(*ec2.GetEbsEncryptionByDefaultInput) (*request.Request, *ec2.GetEbsEncryptionByDefaultOutput) + GetGroupsForCapacityReservation(*ec2.GetGroupsForCapacityReservationInput) (*ec2.GetGroupsForCapacityReservationOutput, error) + GetGroupsForCapacityReservationWithContext(aws.Context, *ec2.GetGroupsForCapacityReservationInput, ...request.Option) (*ec2.GetGroupsForCapacityReservationOutput, error) + GetGroupsForCapacityReservationRequest(*ec2.GetGroupsForCapacityReservationInput) (*request.Request, *ec2.GetGroupsForCapacityReservationOutput) + + GetGroupsForCapacityReservationPages(*ec2.GetGroupsForCapacityReservationInput, func(*ec2.GetGroupsForCapacityReservationOutput, bool) bool) error + GetGroupsForCapacityReservationPagesWithContext(aws.Context, *ec2.GetGroupsForCapacityReservationInput, func(*ec2.GetGroupsForCapacityReservationOutput, bool) bool, ...request.Option) error + GetHostReservationPurchasePreview(*ec2.GetHostReservationPurchasePreviewInput) (*ec2.GetHostReservationPurchasePreviewOutput, error) GetHostReservationPurchasePreviewWithContext(aws.Context, *ec2.GetHostReservationPurchasePreviewInput, ...request.Option) (*ec2.GetHostReservationPurchasePreviewOutput, error) GetHostReservationPurchasePreviewRequest(*ec2.GetHostReservationPurchasePreviewInput) (*request.Request, *ec2.GetHostReservationPurchasePreviewOutput) @@ -1493,6 +1538,20 @@ type EC2API interface { GetLaunchTemplateDataWithContext(aws.Context, *ec2.GetLaunchTemplateDataInput, ...request.Option) (*ec2.GetLaunchTemplateDataOutput, error) GetLaunchTemplateDataRequest(*ec2.GetLaunchTemplateDataInput) (*request.Request, *ec2.GetLaunchTemplateDataOutput) + GetManagedPrefixListAssociations(*ec2.GetManagedPrefixListAssociationsInput) (*ec2.GetManagedPrefixListAssociationsOutput, error) + GetManagedPrefixListAssociationsWithContext(aws.Context, *ec2.GetManagedPrefixListAssociationsInput, ...request.Option) (*ec2.GetManagedPrefixListAssociationsOutput, error) + GetManagedPrefixListAssociationsRequest(*ec2.GetManagedPrefixListAssociationsInput) (*request.Request, *ec2.GetManagedPrefixListAssociationsOutput) + + GetManagedPrefixListAssociationsPages(*ec2.GetManagedPrefixListAssociationsInput, func(*ec2.GetManagedPrefixListAssociationsOutput, bool) bool) error + GetManagedPrefixListAssociationsPagesWithContext(aws.Context, *ec2.GetManagedPrefixListAssociationsInput, func(*ec2.GetManagedPrefixListAssociationsOutput, bool) bool, ...request.Option) error + + GetManagedPrefixListEntries(*ec2.GetManagedPrefixListEntriesInput) (*ec2.GetManagedPrefixListEntriesOutput, error) + GetManagedPrefixListEntriesWithContext(aws.Context, *ec2.GetManagedPrefixListEntriesInput, ...request.Option) (*ec2.GetManagedPrefixListEntriesOutput, error) + GetManagedPrefixListEntriesRequest(*ec2.GetManagedPrefixListEntriesInput) (*request.Request, *ec2.GetManagedPrefixListEntriesOutput) + + GetManagedPrefixListEntriesPages(*ec2.GetManagedPrefixListEntriesInput, func(*ec2.GetManagedPrefixListEntriesOutput, bool) bool) error + GetManagedPrefixListEntriesPagesWithContext(aws.Context, *ec2.GetManagedPrefixListEntriesInput, func(*ec2.GetManagedPrefixListEntriesOutput, bool) bool, ...request.Option) error + GetPasswordData(*ec2.GetPasswordDataInput) (*ec2.GetPasswordDataOutput, error) GetPasswordDataWithContext(aws.Context, *ec2.GetPasswordDataInput, ...request.Option) (*ec2.GetPasswordDataOutput, error) GetPasswordDataRequest(*ec2.GetPasswordDataInput) (*request.Request, *ec2.GetPasswordDataOutput) @@ -1515,6 +1574,13 @@ type EC2API interface { GetTransitGatewayMulticastDomainAssociationsPages(*ec2.GetTransitGatewayMulticastDomainAssociationsInput, func(*ec2.GetTransitGatewayMulticastDomainAssociationsOutput, bool) bool) error GetTransitGatewayMulticastDomainAssociationsPagesWithContext(aws.Context, *ec2.GetTransitGatewayMulticastDomainAssociationsInput, func(*ec2.GetTransitGatewayMulticastDomainAssociationsOutput, bool) bool, ...request.Option) error + GetTransitGatewayPrefixListReferences(*ec2.GetTransitGatewayPrefixListReferencesInput) (*ec2.GetTransitGatewayPrefixListReferencesOutput, error) + GetTransitGatewayPrefixListReferencesWithContext(aws.Context, *ec2.GetTransitGatewayPrefixListReferencesInput, ...request.Option) (*ec2.GetTransitGatewayPrefixListReferencesOutput, error) + GetTransitGatewayPrefixListReferencesRequest(*ec2.GetTransitGatewayPrefixListReferencesInput) (*request.Request, *ec2.GetTransitGatewayPrefixListReferencesOutput) + + GetTransitGatewayPrefixListReferencesPages(*ec2.GetTransitGatewayPrefixListReferencesInput, func(*ec2.GetTransitGatewayPrefixListReferencesOutput, bool) bool) error + GetTransitGatewayPrefixListReferencesPagesWithContext(aws.Context, *ec2.GetTransitGatewayPrefixListReferencesInput, func(*ec2.GetTransitGatewayPrefixListReferencesOutput, bool) bool, ...request.Option) error + GetTransitGatewayRouteTableAssociations(*ec2.GetTransitGatewayRouteTableAssociationsInput) (*ec2.GetTransitGatewayRouteTableAssociationsOutput, error) GetTransitGatewayRouteTableAssociationsWithContext(aws.Context, *ec2.GetTransitGatewayRouteTableAssociationsInput, ...request.Option) (*ec2.GetTransitGatewayRouteTableAssociationsOutput, error) GetTransitGatewayRouteTableAssociationsRequest(*ec2.GetTransitGatewayRouteTableAssociationsInput) (*request.Request, *ec2.GetTransitGatewayRouteTableAssociationsOutput) @@ -1625,6 +1691,10 @@ type EC2API interface { ModifyLaunchTemplateWithContext(aws.Context, *ec2.ModifyLaunchTemplateInput, ...request.Option) (*ec2.ModifyLaunchTemplateOutput, error) ModifyLaunchTemplateRequest(*ec2.ModifyLaunchTemplateInput) (*request.Request, *ec2.ModifyLaunchTemplateOutput) + ModifyManagedPrefixList(*ec2.ModifyManagedPrefixListInput) (*ec2.ModifyManagedPrefixListOutput, error) + ModifyManagedPrefixListWithContext(aws.Context, *ec2.ModifyManagedPrefixListInput, ...request.Option) (*ec2.ModifyManagedPrefixListOutput, error) + ModifyManagedPrefixListRequest(*ec2.ModifyManagedPrefixListInput) (*request.Request, *ec2.ModifyManagedPrefixListOutput) + ModifyNetworkInterfaceAttribute(*ec2.ModifyNetworkInterfaceAttributeInput) (*ec2.ModifyNetworkInterfaceAttributeOutput, error) ModifyNetworkInterfaceAttributeWithContext(aws.Context, *ec2.ModifyNetworkInterfaceAttributeInput, ...request.Option) (*ec2.ModifyNetworkInterfaceAttributeOutput, error) ModifyNetworkInterfaceAttributeRequest(*ec2.ModifyNetworkInterfaceAttributeInput) (*request.Request, *ec2.ModifyNetworkInterfaceAttributeOutput) @@ -1657,6 +1727,14 @@ type EC2API interface { ModifyTrafficMirrorSessionWithContext(aws.Context, *ec2.ModifyTrafficMirrorSessionInput, ...request.Option) (*ec2.ModifyTrafficMirrorSessionOutput, error) ModifyTrafficMirrorSessionRequest(*ec2.ModifyTrafficMirrorSessionInput) (*request.Request, *ec2.ModifyTrafficMirrorSessionOutput) + ModifyTransitGateway(*ec2.ModifyTransitGatewayInput) (*ec2.ModifyTransitGatewayOutput, error) + ModifyTransitGatewayWithContext(aws.Context, *ec2.ModifyTransitGatewayInput, ...request.Option) (*ec2.ModifyTransitGatewayOutput, error) + ModifyTransitGatewayRequest(*ec2.ModifyTransitGatewayInput) (*request.Request, *ec2.ModifyTransitGatewayOutput) + + ModifyTransitGatewayPrefixListReference(*ec2.ModifyTransitGatewayPrefixListReferenceInput) (*ec2.ModifyTransitGatewayPrefixListReferenceOutput, error) + ModifyTransitGatewayPrefixListReferenceWithContext(aws.Context, *ec2.ModifyTransitGatewayPrefixListReferenceInput, ...request.Option) (*ec2.ModifyTransitGatewayPrefixListReferenceOutput, error) + ModifyTransitGatewayPrefixListReferenceRequest(*ec2.ModifyTransitGatewayPrefixListReferenceInput) (*request.Request, *ec2.ModifyTransitGatewayPrefixListReferenceOutput) + ModifyTransitGatewayVpcAttachment(*ec2.ModifyTransitGatewayVpcAttachmentInput) (*ec2.ModifyTransitGatewayVpcAttachmentOutput, error) ModifyTransitGatewayVpcAttachmentWithContext(aws.Context, *ec2.ModifyTransitGatewayVpcAttachmentInput, ...request.Option) (*ec2.ModifyTransitGatewayVpcAttachmentOutput, error) ModifyTransitGatewayVpcAttachmentRequest(*ec2.ModifyTransitGatewayVpcAttachmentInput) (*request.Request, *ec2.ModifyTransitGatewayVpcAttachmentOutput) @@ -1701,6 +1779,10 @@ type EC2API interface { ModifyVpnConnectionWithContext(aws.Context, *ec2.ModifyVpnConnectionInput, ...request.Option) (*ec2.ModifyVpnConnectionOutput, error) ModifyVpnConnectionRequest(*ec2.ModifyVpnConnectionInput) (*request.Request, *ec2.ModifyVpnConnectionOutput) + ModifyVpnConnectionOptions(*ec2.ModifyVpnConnectionOptionsInput) (*ec2.ModifyVpnConnectionOptionsOutput, error) + ModifyVpnConnectionOptionsWithContext(aws.Context, *ec2.ModifyVpnConnectionOptionsInput, ...request.Option) (*ec2.ModifyVpnConnectionOptionsOutput, error) + ModifyVpnConnectionOptionsRequest(*ec2.ModifyVpnConnectionOptionsInput) (*request.Request, *ec2.ModifyVpnConnectionOptionsOutput) + ModifyVpnTunnelCertificate(*ec2.ModifyVpnTunnelCertificateInput) (*ec2.ModifyVpnTunnelCertificateOutput, error) ModifyVpnTunnelCertificateWithContext(aws.Context, *ec2.ModifyVpnTunnelCertificateInput, ...request.Option) (*ec2.ModifyVpnTunnelCertificateOutput, error) ModifyVpnTunnelCertificateRequest(*ec2.ModifyVpnTunnelCertificateInput) (*request.Request, *ec2.ModifyVpnTunnelCertificateOutput) @@ -1841,6 +1923,10 @@ type EC2API interface { RestoreAddressToClassicWithContext(aws.Context, *ec2.RestoreAddressToClassicInput, ...request.Option) (*ec2.RestoreAddressToClassicOutput, error) RestoreAddressToClassicRequest(*ec2.RestoreAddressToClassicInput) (*request.Request, *ec2.RestoreAddressToClassicOutput) + RestoreManagedPrefixListVersion(*ec2.RestoreManagedPrefixListVersionInput) (*ec2.RestoreManagedPrefixListVersionOutput, error) + RestoreManagedPrefixListVersionWithContext(aws.Context, *ec2.RestoreManagedPrefixListVersionInput, ...request.Option) (*ec2.RestoreManagedPrefixListVersionOutput, error) + RestoreManagedPrefixListVersionRequest(*ec2.RestoreManagedPrefixListVersionInput) (*request.Request, *ec2.RestoreManagedPrefixListVersionOutput) + RevokeClientVpnIngress(*ec2.RevokeClientVpnIngressInput) (*ec2.RevokeClientVpnIngressOutput, error) RevokeClientVpnIngressWithContext(aws.Context, *ec2.RevokeClientVpnIngressInput, ...request.Option) (*ec2.RevokeClientVpnIngressOutput, error) RevokeClientVpnIngressRequest(*ec2.RevokeClientVpnIngressInput) (*request.Request, *ec2.RevokeClientVpnIngressOutput) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go index c2e93fa72d3..00eba43323a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go @@ -64,7 +64,7 @@ func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output // Each tag consists of a key and an optional value. If a tag with the same // key is already associated with the load balancer, AddTags updates its value. // -// For more information, see Tag Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) +// For more information, see Tag Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -155,7 +155,7 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroup // private cloud (VPC). The specified security groups override the previously // associated security groups. // -// For more information, see Security Groups for Load Balancers in a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups) +// For more information, see Security Groups for Load Balancers in a VPC (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -246,7 +246,7 @@ func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubn // // The load balancer evenly distributes requests across all registered subnets. // For more information, see Add or Remove Subnets for Your Load Balancer in -// a VPC (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html) +// a VPC (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -339,7 +339,7 @@ func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req // of your EC2 instances. // // For more information, see Configure Health Checks for Your Load Balancer -// (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html) +// (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -433,7 +433,7 @@ func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStick // If the application cookie is explicitly removed or expires, the session stops // being sticky until a new application cookie is issued. // -// For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) +// For more information, see Application-Controlled Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -538,7 +538,7 @@ func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickin // the same user to that server. The validity of the cookie is based on the // cookie expiration time, which is specified in the policy configuration. // -// For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration) +// For more information, see Duration-Based Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -638,7 +638,7 @@ func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *re // // You can create up to 20 load balancers per region per account. You can request // an increase for the number of load balancers for your account. For more information, -// see Limits for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) +// see Limits for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -762,7 +762,7 @@ func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListen // the properties of the new listener must match the properties of the existing // listener. // -// For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +// For more information, see Listeners for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1209,7 +1209,7 @@ func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstan // You can use DescribeLoadBalancers to verify that the instance is deregistered // from the load balancer. // -// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) +// For more information, see Register or De-Register EC2 Instances (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1295,7 +1295,7 @@ func (c *ELB) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (r // Describes the current Elastic Load Balancing resource limits for your AWS // account. // -// For more information, see Limits for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) +// For more information, see Limits for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2037,7 +2037,7 @@ func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvail // the OutOfService state. Then, the load balancer attempts to equally balance // the traffic among its remaining Availability Zones. // -// For more information, see Add or Remove Availability Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) +// For more information, see Add or Remove Availability Zones (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2127,7 +2127,7 @@ func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailab // // The load balancer evenly distributes requests across all its registered Availability // Zones that contain instances. For more information, see Add or Remove Availability -// Zones (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) +// Zones (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2216,13 +2216,13 @@ func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttri // // For more information, see the following in the Classic Load Balancers Guide: // -// * Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) +// * Cross-Zone Load Balancing (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) // -// * Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) +// * Connection Draining (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) // -// * Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) +// * Access Logs (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html) // -// * Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) +// * Idle Connection Timeout (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2328,7 +2328,7 @@ func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesW // // To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer. // -// For more information, see Register or De-Register EC2 Instances (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) +// For more information, see Register or De-Register EC2 Instances (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2497,7 +2497,7 @@ func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalance // the same load balancer and port. // // For more information about updating your SSL certificate, see Replace the -// SSL Certificate for Your Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html) +// SSL Certificate for Your Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2605,9 +2605,9 @@ func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalan // that the policy is associated with the EC2 instance. // // For more information about enabling back-end instance authentication, see -// Configure Back-end Instance Authentication (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt) +// Configure Back-end Instance Authentication (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt) // in the Classic Load Balancers Guide. For more information about Proxy Protocol, -// see Configure Proxy Protocol Support (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html) +// see Configure Proxy Protocol Support (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2700,9 +2700,9 @@ func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPol // To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer. // // For more information about setting policies, see Update the SSL Negotiation -// Configuration (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html), -// Duration-Based Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration), -// and Application-Controlled Session Stickiness (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) +// Configuration (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html), +// Duration-Based Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration), +// and Application-Controlled Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) // in the Classic Load Balancers Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2899,14 +2899,20 @@ func (s AddTagsOutput) GoString() string { return s.String() } -// This data type is reserved. +// Information about additional load balancer attributes. type AdditionalAttribute struct { _ struct{} `type:"structure"` - // This parameter is reserved. + // The name of the attribute. + // + // The following attribute is supported. + // + // * elb.http.desyncmitigationmode - Determines how the load balancer handles + // requests that might pose a security risk to your application. The possible + // values are monitor, defensive, and strictest. The default is defensive. Key *string `type:"string"` - // This parameter is reserved. + // This value of the attribute. Value *string `type:"string"` } @@ -3509,7 +3515,7 @@ type CreateLoadBalancerInput struct { // The listeners. // - // For more information, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) + // For more information, see Listeners for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) // in the Classic Load Balancers Guide. // // Listeners is a required field @@ -3529,7 +3535,7 @@ type CreateLoadBalancerInput struct { // By default, Elastic Load Balancing creates an Internet-facing load balancer // with a DNS name that resolves to public IP addresses. For more information // about Internet-facing and Internal load balancers, see Load Balancer Scheme - // (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#load-balancer-scheme) + // (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#load-balancer-scheme) // in the Elastic Load Balancing User Guide. // // Specify internal to create a load balancer with a DNS name that resolves @@ -3546,7 +3552,7 @@ type CreateLoadBalancerInput struct { // A list of tags to assign to the load balancer. // // For more information about tagging your load balancer, see Tag Your Classic - // Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) + // Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) // in the Classic Load Balancers Guide. Tags []*Tag `min:"1" type:"list"` } @@ -5166,7 +5172,7 @@ func (s *Limit) SetName(v string) *Limit { // Information about a listener. // // For information about the protocols and the ports supported by Elastic Load -// Balancing, see Listeners for Your Classic Load Balancer (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +// Balancing, see Listeners for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) // in the Classic Load Balancers Guide. type Listener struct { _ struct{} `type:"structure"` @@ -5179,8 +5185,9 @@ type Listener struct { // The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or // SSL. // - // If the front-end protocol is HTTP, HTTPS, TCP, or SSL, InstanceProtocol must - // be at the same protocol. + // If the front-end protocol is TCP or SSL, the back-end protocol must be TCP + // or SSL. If the front-end protocol is HTTP or HTTPS, the back-end protocol + // must be HTTP or HTTPS. // // If there is another listener with the same InstancePort whose InstanceProtocol // is secure, (HTTPS or SSL), the listener's InstanceProtocol must also be secure. @@ -5308,17 +5315,17 @@ type LoadBalancerAttributes struct { // If enabled, the load balancer captures detailed information of all requests // and delivers the information to the Amazon S3 bucket that you specify. // - // For more information, see Enable Access Logs (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html) + // For more information, see Enable Access Logs (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html) // in the Classic Load Balancers Guide. AccessLog *AccessLog `type:"structure"` - // This parameter is reserved. + // Any additional attributes. AdditionalAttributes []*AdditionalAttribute `type:"list"` // If enabled, the load balancer allows existing requests to complete before // the load balancer shifts traffic away from a deregistered or unhealthy instance. // - // For more information, see Configure Connection Draining (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) + // For more information, see Configure Connection Draining (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) // in the Classic Load Balancers Guide. ConnectionDraining *ConnectionDraining `type:"structure"` @@ -5327,14 +5334,14 @@ type LoadBalancerAttributes struct { // // By default, Elastic Load Balancing maintains a 60-second idle connection // timeout for both front-end and back-end connections of your load balancer. - // For more information, see Configure Idle Connection Timeout (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) + // For more information, see Configure Idle Connection Timeout (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) // in the Classic Load Balancers Guide. ConnectionSettings *ConnectionSettings `type:"structure"` // If enabled, the load balancer routes the request traffic evenly across all // instances regardless of the Availability Zones. // - // For more information, see Configure Cross-Zone Load Balancing (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) + // For more information, see Configure Cross-Zone Load Balancing (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) // in the Classic Load Balancers Guide. CrossZoneLoadBalancing *CrossZoneLoadBalancing `type:"structure"` } @@ -5421,7 +5428,7 @@ type LoadBalancerDescription struct { // The DNS name of the load balancer. // - // For more information, see Configure a Custom Domain Name (http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html) + // For more information, see Configure a Custom Domain Name (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-domain-names-with-elb.html) // in the Classic Load Balancers Guide. CanonicalHostedZoneName *string `type:"string"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go b/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go index 0b93ed4740b..5fa8e5154e5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/doc.go @@ -15,7 +15,7 @@ // Elastic Load Balancing supports three types of load balancers: Application // Load Balancers, Network Load Balancers, and Classic Load Balancers. You can // select a load balancer based on your application needs. For more information, -// see the Elastic Load Balancing User Guide (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). +// see the Elastic Load Balancing User Guide (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/). // // This reference covers the 2012-06-01 API, which supports Classic Load Balancers. // The 2015-12-01 API supports Application Load Balancers and Network Load Balancers. diff --git a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go index f64920d3153..f75d8a12874 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go @@ -533,6 +533,7 @@ func (c *ELBV2) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, // Creates a rule for the specified listener. The listener must be associated // with an Application Load Balancer. // +// Each rule consists of a priority, one or more actions, and one or more conditions. // Rules are evaluated in priority order, from the lowest value to the highest // value. When the conditions for a rule are met, its actions are performed. // If the conditions for no rules are met, the actions for the default rule @@ -947,6 +948,8 @@ func (c *ELBV2) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, // // Deletes the specified rule. // +// You can't delete the default rule. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3432,6 +3435,9 @@ func (c *ELBV2) SetSubnetsWithContext(ctx aws.Context, input *SetSubnetsInput, o } // Information about an action. +// +// Each rule must include exactly one of the following types of actions: forward, +// fixed-response, or redirect, and it must be the last action to be performed. type Action struct { _ struct{} `type:"structure"` @@ -3455,9 +3461,7 @@ type Action struct { ForwardConfig *ForwardActionConfig `type:"structure"` // The order for the action. This value is required for rules with multiple - // actions. The action with the lowest value for order is performed first. The - // last action to be performed must be one of the following types of actions: - // a forward, fixed-response, or redirect. + // actions. The action with the lowest value for order is performed first. Order *int64 `min:"1" type:"integer"` // [Application Load Balancer] Information for creating a redirect action. Specify @@ -4042,6 +4046,9 @@ type AvailabilityZone struct { // a private IP address from the IPv4 range of the subnet. LoadBalancerAddresses []*LoadBalancerAddress `type:"list"` + // [Application Load Balancers on Outposts] The ID of the Outpost. + OutpostId *string `type:"string"` + // The ID of the subnet. You can specify one subnet per Availability Zone. SubnetId *string `type:"string"` @@ -4065,6 +4072,12 @@ func (s *AvailabilityZone) SetLoadBalancerAddresses(v []*LoadBalancerAddress) *A return s } +// SetOutpostId sets the OutpostId field's value. +func (s *AvailabilityZone) SetOutpostId(v string) *AvailabilityZone { + s.OutpostId = &v + return s +} + // SetSubnetId sets the SubnetId field's value. func (s *AvailabilityZone) SetSubnetId(v string) *AvailabilityZone { s.SubnetId = &v @@ -4353,6 +4366,10 @@ func (s *CreateListenerOutput) SetListeners(v []*Listener) *CreateListenerOutput type CreateLoadBalancerInput struct { _ struct{} `type:"structure"` + // [Application Load Balancers on Outposts] The ID of the customer-owned address + // pool (CoIP pool). + CustomerOwnedIpv4Pool *string `type:"string"` + // [Application Load Balancers] The type of IP addresses used by the subnets // for your load balancer. The possible values are ipv4 (for IPv4 addresses) // and dualstack (for IPv4 and IPv6 addresses). Internal load balancers must @@ -4391,6 +4408,11 @@ type CreateLoadBalancerInput struct { // [Application Load Balancers] You must specify subnets from at least two Availability // Zones. You cannot specify Elastic IP addresses for your subnets. // + // [Application Load Balancers on Outposts] You must specify one Outpost subnet. + // + // [Application Load Balancers on Local Zones] You can specify subnets from + // one or more Local Zones. + // // [Network Load Balancers] You can specify subnets from one or more Availability // Zones. You can specify one Elastic IP address per subnet if you need static // IP addresses for your internet-facing load balancer. For internal load balancers, @@ -4404,6 +4426,11 @@ type CreateLoadBalancerInput struct { // [Application Load Balancers] You must specify subnets from at least two Availability // Zones. // + // [Application Load Balancers on Outposts] You must specify one Outpost subnet. + // + // [Application Load Balancers on Local Zones] You can specify subnets from + // one or more Local Zones. + // // [Network Load Balancers] You can specify subnets from one or more Availability // Zones. Subnets []*string `type:"list"` @@ -4451,6 +4478,12 @@ func (s *CreateLoadBalancerInput) Validate() error { return nil } +// SetCustomerOwnedIpv4Pool sets the CustomerOwnedIpv4Pool field's value. +func (s *CreateLoadBalancerInput) SetCustomerOwnedIpv4Pool(v string) *CreateLoadBalancerInput { + s.CustomerOwnedIpv4Pool = &v + return s +} + // SetIpAddressType sets the IpAddressType field's value. func (s *CreateLoadBalancerInput) SetIpAddressType(v string) *CreateLoadBalancerInput { s.IpAddressType = &v @@ -4549,9 +4582,10 @@ type CreateRuleInput struct { // Actions is a required field Actions []*Action `type:"list" required:"true"` - // The conditions. Each rule can include zero or one of the following conditions: - // http-request-method, host-header, path-pattern, and source-ip, and zero or - // more of the following conditions: http-header and query-string. + // The conditions. Each rule can optionally include up to one of each of the + // following conditions: http-request-method, host-header, path-pattern, and + // source-ip. Each rule can also optionally include one or more of each of the + // following conditions: http-header and query-string. // // Conditions is a required field Conditions []*RuleCondition `type:"list" required:"true"` @@ -4734,8 +4768,7 @@ type CreateTargetGroupInput struct { // one target type. // // * instance - Targets are specified by instance ID. This is the default - // value. If the target group protocol is UDP or TCP_UDP, the target type - // must be instance. + // value. // // * ip - Targets are specified by IP address. You can specify IP addresses // from the subnets of the virtual private cloud (VPC) for the target group, @@ -6478,7 +6511,7 @@ func (s *Listener) SetSslPolicy(v string) *Listener { type LoadBalancer struct { _ struct{} `type:"structure"` - // The Availability Zones for the load balancer. + // The subnets for the load balancer. AvailabilityZones []*AvailabilityZone `type:"list"` // The ID of the Amazon Route 53 hosted zone associated with the load balancer. @@ -6487,6 +6520,10 @@ type LoadBalancer struct { // The date and time the load balancer was created. CreatedTime *time.Time `type:"timestamp"` + // [Application Load Balancers on Outposts] The ID of the customer-owned address + // pool. + CustomerOwnedIpv4Pool *string `type:"string"` + // The public DNS name of the load balancer. DNSName *string `type:"string"` @@ -6553,6 +6590,12 @@ func (s *LoadBalancer) SetCreatedTime(v time.Time) *LoadBalancer { return s } +// SetCustomerOwnedIpv4Pool sets the CustomerOwnedIpv4Pool field's value. +func (s *LoadBalancer) SetCustomerOwnedIpv4Pool(v string) *LoadBalancer { + s.CustomerOwnedIpv4Pool = &v + return s +} + // SetDNSName sets the DNSName field's value. func (s *LoadBalancer) SetDNSName(v string) *LoadBalancer { s.DNSName = &v @@ -6678,6 +6721,11 @@ type LoadBalancerAttribute struct { // * idle_timeout.timeout_seconds - The idle timeout value, in seconds. The // valid range is 1-4000 seconds. The default is 60 seconds. // + // * routing.http.desync_mitigation_mode - Determines how the load balancer + // handles requests that might pose a security risk to your application. + // The possible values are monitor, defensive, and strictest. The default + // is defensive. + // // * routing.http.drop_invalid_header_fields.enabled - Indicates whether // HTTP headers with invalid header fields are removed by the load balancer // (true) or routed to targets (false). The default is false. @@ -7286,7 +7334,9 @@ type ModifyTargetGroupInput struct { HealthyThresholdCount *int64 `min:"2" type:"integer"` // [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful - // response from a target. + // response from a target. The possible values are from 200 to 499. You can + // specify multiple values (for example, "200,202") or a range of values (for + // example, "200-299"). The default is 200. // // With Network Load Balancers, you can't modify this setting. Matcher *Matcher `type:"structure"` @@ -7925,6 +7975,11 @@ func (s *Rule) SetRuleArn(v string) *Rule { } // Information about a condition for a rule. +// +// Each rule can optionally include up to one of each of the following conditions: +// http-request-method, host-header, path-pattern, and source-ip. Each rule +// can also optionally include one or more of each of the following conditions: +// http-header and query-string. type RuleCondition struct { _ struct{} `type:"structure"` @@ -7961,13 +8016,14 @@ type RuleCondition struct { // Information for a source IP condition. Specify only when Field is source-ip. SourceIpConfig *SourceIpConditionConfig `type:"structure"` - // The condition value. You can use Values if the rule contains only host-header - // and path-pattern conditions. Otherwise, you can use HostHeaderConfig for - // host-header conditions and PathPatternConfig for path-pattern conditions. + // The condition value. Specify only when Field is host-header or path-pattern. + // Alternatively, to specify multiple host names or multiple path patterns, + // use HostHeaderConfig or PathPatternConfig. // - // If Field is host-header, you can specify a single host name (for example, - // my.example.com). A host name is case insensitive, can be up to 128 characters - // in length, and can contain any of the following characters. + // If Field is host-header and you are not using HostHeaderConfig, you can specify + // a single host name (for example, my.example.com) in Values. A host name is + // case insensitive, can be up to 128 characters in length, and can contain + // any of the following characters. // // * A-Z, a-z, 0-9 // @@ -7977,9 +8033,10 @@ type RuleCondition struct { // // * ? (matches exactly 1 character) // - // If Field is path-pattern, you can specify a single path pattern (for example, - // /img/*). A path pattern is case-sensitive, can be up to 128 characters in - // length, and can contain any of the following characters. + // If Field is path-pattern and you are not using PathPatternConfig, you can + // specify a single path pattern (for example, /img/*) in Values. A path pattern + // is case-sensitive, can be up to 128 characters in length, and can contain + // any of the following characters. // // * A-Z, a-z, 0-9 // @@ -8391,7 +8448,7 @@ func (s *SetSubnetsInput) SetSubnets(v []*string) *SetSubnetsInput { type SetSubnetsOutput struct { _ struct{} `type:"structure"` - // Information about the subnet and Availability Zone. + // Information about the subnets. AvailabilityZones []*AvailabilityZone `type:"list"` } @@ -8892,8 +8949,8 @@ type TargetGroupAttribute struct { // * slow_start.duration_seconds - The time period, in seconds, during which // a newly registered target receives an increasing share of the traffic // to the target group. After this time period ends, the target receives - // its full share of traffic. The range is 30-900 seconds (15 minutes). Slow - // start mode is disabled by default. + // its full share of traffic. The range is 30-900 seconds (15 minutes). The + // default is 0 seconds (disabled). // // * stickiness.lb_cookie.duration_seconds - The time period, in seconds, // during which requests from a client should be routed to the same target. @@ -9168,6 +9225,17 @@ const ( ActionTypeEnumFixedResponse = "fixed-response" ) +// ActionTypeEnum_Values returns all elements of the ActionTypeEnum enum +func ActionTypeEnum_Values() []string { + return []string{ + ActionTypeEnumForward, + ActionTypeEnumAuthenticateOidc, + ActionTypeEnumAuthenticateCognito, + ActionTypeEnumRedirect, + ActionTypeEnumFixedResponse, + } +} + const ( // AuthenticateCognitoActionConditionalBehaviorEnumDeny is a AuthenticateCognitoActionConditionalBehaviorEnum enum value AuthenticateCognitoActionConditionalBehaviorEnumDeny = "deny" @@ -9179,6 +9247,15 @@ const ( AuthenticateCognitoActionConditionalBehaviorEnumAuthenticate = "authenticate" ) +// AuthenticateCognitoActionConditionalBehaviorEnum_Values returns all elements of the AuthenticateCognitoActionConditionalBehaviorEnum enum +func AuthenticateCognitoActionConditionalBehaviorEnum_Values() []string { + return []string{ + AuthenticateCognitoActionConditionalBehaviorEnumDeny, + AuthenticateCognitoActionConditionalBehaviorEnumAllow, + AuthenticateCognitoActionConditionalBehaviorEnumAuthenticate, + } +} + const ( // AuthenticateOidcActionConditionalBehaviorEnumDeny is a AuthenticateOidcActionConditionalBehaviorEnum enum value AuthenticateOidcActionConditionalBehaviorEnumDeny = "deny" @@ -9190,6 +9267,15 @@ const ( AuthenticateOidcActionConditionalBehaviorEnumAuthenticate = "authenticate" ) +// AuthenticateOidcActionConditionalBehaviorEnum_Values returns all elements of the AuthenticateOidcActionConditionalBehaviorEnum enum +func AuthenticateOidcActionConditionalBehaviorEnum_Values() []string { + return []string{ + AuthenticateOidcActionConditionalBehaviorEnumDeny, + AuthenticateOidcActionConditionalBehaviorEnumAllow, + AuthenticateOidcActionConditionalBehaviorEnumAuthenticate, + } +} + const ( // IpAddressTypeIpv4 is a IpAddressType enum value IpAddressTypeIpv4 = "ipv4" @@ -9198,6 +9284,14 @@ const ( IpAddressTypeDualstack = "dualstack" ) +// IpAddressType_Values returns all elements of the IpAddressType enum +func IpAddressType_Values() []string { + return []string{ + IpAddressTypeIpv4, + IpAddressTypeDualstack, + } +} + const ( // LoadBalancerSchemeEnumInternetFacing is a LoadBalancerSchemeEnum enum value LoadBalancerSchemeEnumInternetFacing = "internet-facing" @@ -9206,6 +9300,14 @@ const ( LoadBalancerSchemeEnumInternal = "internal" ) +// LoadBalancerSchemeEnum_Values returns all elements of the LoadBalancerSchemeEnum enum +func LoadBalancerSchemeEnum_Values() []string { + return []string{ + LoadBalancerSchemeEnumInternetFacing, + LoadBalancerSchemeEnumInternal, + } +} + const ( // LoadBalancerStateEnumActive is a LoadBalancerStateEnum enum value LoadBalancerStateEnumActive = "active" @@ -9220,6 +9322,16 @@ const ( LoadBalancerStateEnumFailed = "failed" ) +// LoadBalancerStateEnum_Values returns all elements of the LoadBalancerStateEnum enum +func LoadBalancerStateEnum_Values() []string { + return []string{ + LoadBalancerStateEnumActive, + LoadBalancerStateEnumProvisioning, + LoadBalancerStateEnumActiveImpaired, + LoadBalancerStateEnumFailed, + } +} + const ( // LoadBalancerTypeEnumApplication is a LoadBalancerTypeEnum enum value LoadBalancerTypeEnumApplication = "application" @@ -9228,6 +9340,14 @@ const ( LoadBalancerTypeEnumNetwork = "network" ) +// LoadBalancerTypeEnum_Values returns all elements of the LoadBalancerTypeEnum enum +func LoadBalancerTypeEnum_Values() []string { + return []string{ + LoadBalancerTypeEnumApplication, + LoadBalancerTypeEnumNetwork, + } +} + const ( // ProtocolEnumHttp is a ProtocolEnum enum value ProtocolEnumHttp = "HTTP" @@ -9248,6 +9368,18 @@ const ( ProtocolEnumTcpUdp = "TCP_UDP" ) +// ProtocolEnum_Values returns all elements of the ProtocolEnum enum +func ProtocolEnum_Values() []string { + return []string{ + ProtocolEnumHttp, + ProtocolEnumHttps, + ProtocolEnumTcp, + ProtocolEnumTls, + ProtocolEnumUdp, + ProtocolEnumTcpUdp, + } +} + const ( // RedirectActionStatusCodeEnumHttp301 is a RedirectActionStatusCodeEnum enum value RedirectActionStatusCodeEnumHttp301 = "HTTP_301" @@ -9256,6 +9388,14 @@ const ( RedirectActionStatusCodeEnumHttp302 = "HTTP_302" ) +// RedirectActionStatusCodeEnum_Values returns all elements of the RedirectActionStatusCodeEnum enum +func RedirectActionStatusCodeEnum_Values() []string { + return []string{ + RedirectActionStatusCodeEnumHttp301, + RedirectActionStatusCodeEnumHttp302, + } +} + const ( // TargetHealthReasonEnumElbRegistrationInProgress is a TargetHealthReasonEnum enum value TargetHealthReasonEnumElbRegistrationInProgress = "Elb.RegistrationInProgress" @@ -9294,6 +9434,24 @@ const ( TargetHealthReasonEnumElbInternalError = "Elb.InternalError" ) +// TargetHealthReasonEnum_Values returns all elements of the TargetHealthReasonEnum enum +func TargetHealthReasonEnum_Values() []string { + return []string{ + TargetHealthReasonEnumElbRegistrationInProgress, + TargetHealthReasonEnumElbInitialHealthChecking, + TargetHealthReasonEnumTargetResponseCodeMismatch, + TargetHealthReasonEnumTargetTimeout, + TargetHealthReasonEnumTargetFailedHealthChecks, + TargetHealthReasonEnumTargetNotRegistered, + TargetHealthReasonEnumTargetNotInUse, + TargetHealthReasonEnumTargetDeregistrationInProgress, + TargetHealthReasonEnumTargetInvalidState, + TargetHealthReasonEnumTargetIpUnusable, + TargetHealthReasonEnumTargetHealthCheckDisabled, + TargetHealthReasonEnumElbInternalError, + } +} + const ( // TargetHealthStateEnumInitial is a TargetHealthStateEnum enum value TargetHealthStateEnumInitial = "initial" @@ -9314,6 +9472,18 @@ const ( TargetHealthStateEnumUnavailable = "unavailable" ) +// TargetHealthStateEnum_Values returns all elements of the TargetHealthStateEnum enum +func TargetHealthStateEnum_Values() []string { + return []string{ + TargetHealthStateEnumInitial, + TargetHealthStateEnumHealthy, + TargetHealthStateEnumUnhealthy, + TargetHealthStateEnumUnused, + TargetHealthStateEnumDraining, + TargetHealthStateEnumUnavailable, + } +} + const ( // TargetTypeEnumInstance is a TargetTypeEnum enum value TargetTypeEnumInstance = "instance" @@ -9324,3 +9494,12 @@ const ( // TargetTypeEnumLambda is a TargetTypeEnum enum value TargetTypeEnumLambda = "lambda" ) + +// TargetTypeEnum_Values returns all elements of the TargetTypeEnum enum +func TargetTypeEnum_Values() []string { + return []string{ + TargetTypeEnumInstance, + TargetTypeEnumIp, + TargetTypeEnumLambda, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go index 1a854732b6b..7c3a5dd0dc9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go @@ -82,7 +82,8 @@ func (c *IAM) AddClientIDToOpenIDConnectProviderRequest(input *AddClientIDToOpen // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -156,10 +157,12 @@ func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInp // AddRoleToInstanceProfile API operation for AWS Identity and Access Management. // // Adds the specified IAM role to the specified instance profile. An instance -// profile can contain only one role, and this limit cannot be increased. You -// can remove the existing role and then add a different role to an instance -// profile. You must then wait for the change to appear across all of AWS because -// of eventual consistency (https://en.wikipedia.org/wiki/Eventual_consistency). +// profile can contain only one role. (The number and size of IAM resources +// in an AWS account are limited. For more information, see IAM and STS Quotas +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) +// in the IAM User Guide.) You can remove the existing role and then add a different +// role to an instance profile. You must then wait for the change to appear +// across all of AWS because of eventual consistency (https://en.wikipedia.org/wiki/Eventual_consistency). // To force the change, you must disassociate the instance profile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DisassociateIamInstanceProfile.html) // and then associate the instance profile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateIamInstanceProfile.html), // or you can stop your instance and then restart it. @@ -189,7 +192,8 @@ func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInp // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" // The request was rejected because only the service that depends on the service-linked @@ -284,7 +288,8 @@ func (c *IAM) AddUserToGroupRequest(input *AddUserToGroupInput) (req *request.Re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -380,7 +385,8 @@ func (c *IAM) AttachGroupPolicyRequest(input *AttachGroupPolicyInput) (req *requ // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -488,7 +494,8 @@ func (c *IAM) AttachRolePolicyRequest(input *AttachRolePolicyInput) (req *reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -598,7 +605,8 @@ func (c *IAM) AttachUserPolicyRequest(input *AttachUserPolicyInput) (req *reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -704,7 +712,8 @@ func (c *IAM) ChangePasswordRequest(input *ChangePasswordInput) (req *request.Re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" // The request was rejected because it referenced an entity that is temporarily @@ -795,8 +804,8 @@ func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) (req *request. // to manage AWS account root user credentials. This is true even if the AWS // account has no associated users. // -// For information about limits on the number of keys you can create, see Limitations -// on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // To ensure the security of your AWS account, the secret access key is accessible @@ -819,7 +828,8 @@ func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) (req *request. // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -910,7 +920,8 @@ func (c *IAM) CreateAccountAliasRequest(input *CreateAccountAliasInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -984,8 +995,8 @@ func (c *IAM) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, // // Creates a new group. // -// For information about the number of groups you can create, see Limitations -// on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -998,7 +1009,8 @@ func (c *IAM) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -1081,8 +1093,8 @@ func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) (r // Creates a new instance profile. For information about instance profiles, // go to About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html). // -// For information about the number of instance profiles you can create, see -// Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1099,7 +1111,8 @@ func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) (r // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -1198,7 +1211,8 @@ func (c *IAM) CreateLoginProfileRequest(input *CreateLoginProfileInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -1312,7 +1326,8 @@ func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProvi // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -1409,7 +1424,8 @@ func (c *IAM) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -1524,7 +1540,8 @@ func (c *IAM) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req * // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -1598,8 +1615,8 @@ func (c *IAM) CreateRoleRequest(input *CreateRoleInput) (req *request.Request, o // // Creates a new role for your AWS account. For more information about roles, // go to IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). -// For information about limitations on role names and the number of roles you -// can create, go to Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1612,7 +1629,8 @@ func (c *IAM) CreateRoleRequest(input *CreateRoleInput) (req *request.Request, o // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -1742,7 +1760,8 @@ func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -1840,7 +1859,8 @@ func (c *IAM) CreateServiceLinkedRoleRequest(input *CreateServiceLinkedRoleInput // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeNoSuchEntityException "NoSuchEntity" // The request was rejected because it referenced a resource entity that does @@ -1941,7 +1961,8 @@ func (c *IAM) CreateServiceSpecificCredentialRequest(input *CreateServiceSpecifi // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeNoSuchEntityException "NoSuchEntity" // The request was rejected because it referenced a resource entity that does @@ -2018,8 +2039,8 @@ func (c *IAM) CreateUserRequest(input *CreateUserInput) (req *request.Request, o // // Creates a new IAM user for your AWS account. // -// For information about limitations on the number of IAM users you can create, -// see Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2032,7 +2053,8 @@ func (c *IAM) CreateUserRequest(input *CreateUserInput) (req *request.Request, o // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -2127,8 +2149,8 @@ func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) // go to Using a Virtual MFA Device (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) // in the IAM User Guide. // -// For information about limits on the number of MFA devices you can create, -// see Limitations on Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // The seed information contained in the QR code and the Base32 string should @@ -2147,7 +2169,8 @@ func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -2251,7 +2274,8 @@ func (c *IAM) DeactivateMFADeviceRequest(input *DeactivateMFADeviceInput) (req * // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2346,7 +2370,8 @@ func (c *IAM) DeleteAccessKeyRequest(input *DeleteAccessKeyInput) (req *request. // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2437,7 +2462,8 @@ func (c *IAM) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2526,7 +2552,8 @@ func (c *IAM) DeleteAccountPasswordPolicyRequest(input *DeleteAccountPasswordPol // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2620,7 +2647,8 @@ func (c *IAM) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2715,7 +2743,8 @@ func (c *IAM) DeleteGroupPolicyRequest(input *DeleteGroupPolicyInput) (req *requ // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2817,7 +2846,8 @@ func (c *IAM) DeleteInstanceProfileRequest(input *DeleteInstanceProfileInput) (r // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -2918,7 +2948,8 @@ func (c *IAM) DeleteLoginProfileRequest(input *DeleteLoginProfileInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -3125,7 +3156,8 @@ func (c *IAM) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -3230,7 +3262,8 @@ func (c *IAM) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req * // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -3337,7 +3370,8 @@ func (c *IAM) DeleteRoleRequest(input *DeleteRoleInput) (req *request.Request, o // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" // The request was rejected because only the service that depends on the service-linked @@ -3538,7 +3572,8 @@ func (c *IAM) DeleteRolePolicyRequest(input *DeleteRolePolicyInput) (req *reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" // The request was rejected because only the service that depends on the service-linked @@ -3640,7 +3675,8 @@ func (c *IAM) DeleteSAMLProviderRequest(input *DeleteSAMLProviderInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeNoSuchEntityException "NoSuchEntity" // The request was rejected because it referenced a resource entity that does @@ -3839,7 +3875,8 @@ func (c *IAM) DeleteServerCertificateRequest(input *DeleteServerCertificateInput // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -3946,7 +3983,8 @@ func (c *IAM) DeleteServiceLinkedRoleRequest(input *DeleteServiceLinkedRoleInput // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -4122,7 +4160,8 @@ func (c *IAM) DeleteSigningCertificateRequest(input *DeleteSigningCertificateInp // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -4229,7 +4268,8 @@ func (c *IAM) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, o // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeNoSuchEntityException "NoSuchEntity" // The request was rejected because it referenced a resource entity that does @@ -4426,7 +4466,8 @@ func (c *IAM) DeleteUserPolicyRequest(input *DeleteUserPolicyInput) (req *reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -4522,7 +4563,8 @@ func (c *IAM) DeleteVirtualMFADeviceRequest(input *DeleteVirtualMFADeviceInput) // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -4616,7 +4658,8 @@ func (c *IAM) DetachGroupPolicyRequest(input *DetachGroupPolicyInput) (req *requ // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -4714,7 +4757,8 @@ func (c *IAM) DetachRolePolicyRequest(input *DetachRolePolicyInput) (req *reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -4818,7 +4862,8 @@ func (c *IAM) DetachUserPolicyRequest(input *DetachUserPolicyInput) (req *reques // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -4923,7 +4968,8 @@ func (c *IAM) EnableMFADeviceRequest(input *EnableMFADeviceInput) (req *request. // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeNoSuchEntityException "NoSuchEntity" // The request was rejected because it referenced a resource entity that does @@ -5013,7 +5059,8 @@ func (c *IAM) GenerateCredentialReportRequest(input *GenerateCredentialReportInp // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -5726,8 +5773,8 @@ func (c *IAM) GetAccountSummaryRequest(input *GetAccountSummaryInput) (req *requ // // Retrieves information about IAM entity usage and IAM quotas in the AWS account. // -// For information about limitations on IAM entities, see Limitations on IAM -// Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) +// The number and size of IAM resources in an AWS account are limited. For more +// information, see IAM and STS Quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -11724,7 +11771,8 @@ func (c *IAM) PutGroupPolicyRequest(input *PutGroupPolicyInput) (req *request.Re // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" // The request was rejected because the policy document was malformed. The error @@ -11950,7 +11998,8 @@ func (c *IAM) PutRolePolicyRequest(input *PutRolePolicyInput) (req *request.Requ // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" // The request was rejected because the policy document was malformed. The error @@ -12168,7 +12217,8 @@ func (c *IAM) PutUserPolicyRequest(input *PutUserPolicyInput) (req *request.Requ // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" // The request was rejected because the policy document was malformed. The error @@ -12368,7 +12418,8 @@ func (c *IAM) RemoveRoleFromInstanceProfileRequest(input *RemoveRoleFromInstance // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" // The request was rejected because only the service that depends on the service-linked @@ -12463,7 +12514,8 @@ func (c *IAM) RemoveUserFromGroupRequest(input *RemoveUserFromGroupInput) (req * // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -12644,7 +12696,8 @@ func (c *IAM) ResyncMFADeviceRequest(input *ResyncMFADeviceInput) (req *request. // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -12746,7 +12799,8 @@ func (c *IAM) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -13301,7 +13355,8 @@ func (c *IAM) TagRoleRequest(input *TagRoleInput) (req *request.Request, output // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -13431,7 +13486,8 @@ func (c *IAM) TagUserRequest(input *TagUserInput) (req *request.Request, output // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeInvalidInputException "InvalidInput" // The request was rejected because an invalid or out-of-range value was supplied @@ -13724,7 +13780,8 @@ func (c *IAM) UpdateAccessKeyRequest(input *UpdateAccessKeyInput) (req *request. // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -13828,7 +13885,8 @@ func (c *IAM) UpdateAccountPasswordPolicyRequest(input *UpdateAccountPasswordPol // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -13924,7 +13982,8 @@ func (c *IAM) UpdateAssumeRolePolicyRequest(input *UpdateAssumeRolePolicyInput) // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeUnmodifiableEntityException "UnmodifiableEntity" // The request was rejected because only the service that depends on the service-linked @@ -14034,7 +14093,8 @@ func (c *IAM) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -14137,7 +14197,8 @@ func (c *IAM) UpdateLoginProfileRequest(input *UpdateLoginProfileInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -14518,7 +14579,8 @@ func (c *IAM) UpdateSAMLProviderRequest(input *UpdateSAMLProviderInput) (req *re // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -14720,7 +14782,8 @@ func (c *IAM) UpdateServerCertificateRequest(input *UpdateServerCertificateInput // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -14901,7 +14964,8 @@ func (c *IAM) UpdateSigningCertificateRequest(input *UpdateSigningCertificateInp // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeServiceFailureException "ServiceFailure" // The request processing has failed because of an unknown error, exception @@ -15001,7 +15065,8 @@ func (c *IAM) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, o // // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -15106,7 +15171,8 @@ func (c *IAM) UploadSSHPublicKeyRequest(input *UploadSSHPublicKeyInput) (req *re // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeNoSuchEntityException "NoSuchEntity" // The request was rejected because it referenced a resource entity that does @@ -15227,7 +15293,8 @@ func (c *IAM) UploadServerCertificateRequest(input *UploadServerCertificateInput // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -15340,7 +15407,8 @@ func (c *IAM) UploadSigningCertificateRequest(input *UploadSigningCertificateInp // Returned Error Codes: // * ErrCodeLimitExceededException "LimitExceeded" // The request was rejected because it attempted to create resources beyond -// the current AWS account limits. The error message describes the limit exceeded. +// the current AWS account limitations. The error message describes the limit +// exceeded. // // * ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" // The request was rejected because it attempted to create a resource that already @@ -33206,6 +33274,14 @@ const ( AccessAdvisorUsageGranularityTypeActionLevel = "ACTION_LEVEL" ) +// AccessAdvisorUsageGranularityType_Values returns all elements of the AccessAdvisorUsageGranularityType enum +func AccessAdvisorUsageGranularityType_Values() []string { + return []string{ + AccessAdvisorUsageGranularityTypeServiceLevel, + AccessAdvisorUsageGranularityTypeActionLevel, + } +} + const ( // AssignmentStatusTypeAssigned is a AssignmentStatusType enum value AssignmentStatusTypeAssigned = "Assigned" @@ -33217,6 +33293,15 @@ const ( AssignmentStatusTypeAny = "Any" ) +// AssignmentStatusType_Values returns all elements of the AssignmentStatusType enum +func AssignmentStatusType_Values() []string { + return []string{ + AssignmentStatusTypeAssigned, + AssignmentStatusTypeUnassigned, + AssignmentStatusTypeAny, + } +} + const ( // ContextKeyTypeEnumString is a ContextKeyTypeEnum enum value ContextKeyTypeEnumString = "string" @@ -33255,6 +33340,24 @@ const ( ContextKeyTypeEnumDateList = "dateList" ) +// ContextKeyTypeEnum_Values returns all elements of the ContextKeyTypeEnum enum +func ContextKeyTypeEnum_Values() []string { + return []string{ + ContextKeyTypeEnumString, + ContextKeyTypeEnumStringList, + ContextKeyTypeEnumNumeric, + ContextKeyTypeEnumNumericList, + ContextKeyTypeEnumBoolean, + ContextKeyTypeEnumBooleanList, + ContextKeyTypeEnumIp, + ContextKeyTypeEnumIpList, + ContextKeyTypeEnumBinary, + ContextKeyTypeEnumBinaryList, + ContextKeyTypeEnumDate, + ContextKeyTypeEnumDateList, + } +} + const ( // DeletionTaskStatusTypeSucceeded is a DeletionTaskStatusType enum value DeletionTaskStatusTypeSucceeded = "SUCCEEDED" @@ -33269,6 +33372,16 @@ const ( DeletionTaskStatusTypeNotStarted = "NOT_STARTED" ) +// DeletionTaskStatusType_Values returns all elements of the DeletionTaskStatusType enum +func DeletionTaskStatusType_Values() []string { + return []string{ + DeletionTaskStatusTypeSucceeded, + DeletionTaskStatusTypeInProgress, + DeletionTaskStatusTypeFailed, + DeletionTaskStatusTypeNotStarted, + } +} + const ( // EncodingTypeSsh is a EncodingType enum value EncodingTypeSsh = "SSH" @@ -33277,6 +33390,14 @@ const ( EncodingTypePem = "PEM" ) +// EncodingType_Values returns all elements of the EncodingType enum +func EncodingType_Values() []string { + return []string{ + EncodingTypeSsh, + EncodingTypePem, + } +} + const ( // EntityTypeUser is a EntityType enum value EntityTypeUser = "User" @@ -33294,6 +33415,17 @@ const ( EntityTypeAwsmanagedPolicy = "AWSManagedPolicy" ) +// EntityType_Values returns all elements of the EntityType enum +func EntityType_Values() []string { + return []string{ + EntityTypeUser, + EntityTypeRole, + EntityTypeGroup, + EntityTypeLocalManagedPolicy, + EntityTypeAwsmanagedPolicy, + } +} + const ( // GlobalEndpointTokenVersionV1token is a GlobalEndpointTokenVersion enum value GlobalEndpointTokenVersionV1token = "v1Token" @@ -33302,6 +33434,14 @@ const ( GlobalEndpointTokenVersionV2token = "v2Token" ) +// GlobalEndpointTokenVersion_Values returns all elements of the GlobalEndpointTokenVersion enum +func GlobalEndpointTokenVersion_Values() []string { + return []string{ + GlobalEndpointTokenVersionV1token, + GlobalEndpointTokenVersionV2token, + } +} + const ( // JobStatusTypeInProgress is a JobStatusType enum value JobStatusTypeInProgress = "IN_PROGRESS" @@ -33313,11 +33453,27 @@ const ( JobStatusTypeFailed = "FAILED" ) +// JobStatusType_Values returns all elements of the JobStatusType enum +func JobStatusType_Values() []string { + return []string{ + JobStatusTypeInProgress, + JobStatusTypeCompleted, + JobStatusTypeFailed, + } +} + const ( // PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy is a PermissionsBoundaryAttachmentType enum value PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy = "PermissionsBoundaryPolicy" ) +// PermissionsBoundaryAttachmentType_Values returns all elements of the PermissionsBoundaryAttachmentType enum +func PermissionsBoundaryAttachmentType_Values() []string { + return []string{ + PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy, + } +} + const ( // PolicyEvaluationDecisionTypeAllowed is a PolicyEvaluationDecisionType enum value PolicyEvaluationDecisionTypeAllowed = "allowed" @@ -33329,6 +33485,15 @@ const ( PolicyEvaluationDecisionTypeImplicitDeny = "implicitDeny" ) +// PolicyEvaluationDecisionType_Values returns all elements of the PolicyEvaluationDecisionType enum +func PolicyEvaluationDecisionType_Values() []string { + return []string{ + PolicyEvaluationDecisionTypeAllowed, + PolicyEvaluationDecisionTypeExplicitDeny, + PolicyEvaluationDecisionTypeImplicitDeny, + } +} + const ( // PolicyOwnerEntityTypeUser is a PolicyOwnerEntityType enum value PolicyOwnerEntityTypeUser = "USER" @@ -33340,6 +33505,15 @@ const ( PolicyOwnerEntityTypeGroup = "GROUP" ) +// PolicyOwnerEntityType_Values returns all elements of the PolicyOwnerEntityType enum +func PolicyOwnerEntityType_Values() []string { + return []string{ + PolicyOwnerEntityTypeUser, + PolicyOwnerEntityTypeRole, + PolicyOwnerEntityTypeGroup, + } +} + const ( // PolicyScopeTypeAll is a PolicyScopeType enum value PolicyScopeTypeAll = "All" @@ -33351,6 +33525,15 @@ const ( PolicyScopeTypeLocal = "Local" ) +// PolicyScopeType_Values returns all elements of the PolicyScopeType enum +func PolicyScopeType_Values() []string { + return []string{ + PolicyScopeTypeAll, + PolicyScopeTypeAws, + PolicyScopeTypeLocal, + } +} + const ( // PolicySourceTypeUser is a PolicySourceType enum value PolicySourceTypeUser = "user" @@ -33374,6 +33557,19 @@ const ( PolicySourceTypeNone = "none" ) +// PolicySourceType_Values returns all elements of the PolicySourceType enum +func PolicySourceType_Values() []string { + return []string{ + PolicySourceTypeUser, + PolicySourceTypeGroup, + PolicySourceTypeRole, + PolicySourceTypeAwsManaged, + PolicySourceTypeUserManaged, + PolicySourceTypeResource, + PolicySourceTypeNone, + } +} + const ( // PolicyTypeInline is a PolicyType enum value PolicyTypeInline = "INLINE" @@ -33382,6 +33578,14 @@ const ( PolicyTypeManaged = "MANAGED" ) +// PolicyType_Values returns all elements of the PolicyType enum +func PolicyType_Values() []string { + return []string{ + PolicyTypeInline, + PolicyTypeManaged, + } +} + // The policy usage type that indicates whether the policy is used as a permissions // policy or as the permissions boundary for an entity. // @@ -33396,11 +33600,26 @@ const ( PolicyUsageTypePermissionsBoundary = "PermissionsBoundary" ) +// PolicyUsageType_Values returns all elements of the PolicyUsageType enum +func PolicyUsageType_Values() []string { + return []string{ + PolicyUsageTypePermissionsPolicy, + PolicyUsageTypePermissionsBoundary, + } +} + const ( // ReportFormatTypeTextCsv is a ReportFormatType enum value ReportFormatTypeTextCsv = "text/csv" ) +// ReportFormatType_Values returns all elements of the ReportFormatType enum +func ReportFormatType_Values() []string { + return []string{ + ReportFormatTypeTextCsv, + } +} + const ( // ReportStateTypeStarted is a ReportStateType enum value ReportStateTypeStarted = "STARTED" @@ -33412,6 +33631,15 @@ const ( ReportStateTypeComplete = "COMPLETE" ) +// ReportStateType_Values returns all elements of the ReportStateType enum +func ReportStateType_Values() []string { + return []string{ + ReportStateTypeStarted, + ReportStateTypeInprogress, + ReportStateTypeComplete, + } +} + const ( // SortKeyTypeServiceNamespaceAscending is a SortKeyType enum value SortKeyTypeServiceNamespaceAscending = "SERVICE_NAMESPACE_ASCENDING" @@ -33426,6 +33654,16 @@ const ( SortKeyTypeLastAuthenticatedTimeDescending = "LAST_AUTHENTICATED_TIME_DESCENDING" ) +// SortKeyType_Values returns all elements of the SortKeyType enum +func SortKeyType_Values() []string { + return []string{ + SortKeyTypeServiceNamespaceAscending, + SortKeyTypeServiceNamespaceDescending, + SortKeyTypeLastAuthenticatedTimeAscending, + SortKeyTypeLastAuthenticatedTimeDescending, + } +} + const ( // StatusTypeActive is a StatusType enum value StatusTypeActive = "Active" @@ -33434,6 +33672,14 @@ const ( StatusTypeInactive = "Inactive" ) +// StatusType_Values returns all elements of the StatusType enum +func StatusType_Values() []string { + return []string{ + StatusTypeActive, + StatusTypeInactive, + } +} + const ( // SummaryKeyTypeUsers is a SummaryKeyType enum value SummaryKeyTypeUsers = "Users" @@ -33513,3 +33759,35 @@ const ( // SummaryKeyTypeGlobalEndpointTokenVersion is a SummaryKeyType enum value SummaryKeyTypeGlobalEndpointTokenVersion = "GlobalEndpointTokenVersion" ) + +// SummaryKeyType_Values returns all elements of the SummaryKeyType enum +func SummaryKeyType_Values() []string { + return []string{ + SummaryKeyTypeUsers, + SummaryKeyTypeUsersQuota, + SummaryKeyTypeGroups, + SummaryKeyTypeGroupsQuota, + SummaryKeyTypeServerCertificates, + SummaryKeyTypeServerCertificatesQuota, + SummaryKeyTypeUserPolicySizeQuota, + SummaryKeyTypeGroupPolicySizeQuota, + SummaryKeyTypeGroupsPerUserQuota, + SummaryKeyTypeSigningCertificatesPerUserQuota, + SummaryKeyTypeAccessKeysPerUserQuota, + SummaryKeyTypeMfadevices, + SummaryKeyTypeMfadevicesInUse, + SummaryKeyTypeAccountMfaenabled, + SummaryKeyTypeAccountAccessKeysPresent, + SummaryKeyTypeAccountSigningCertificatesPresent, + SummaryKeyTypeAttachedPoliciesPerGroupQuota, + SummaryKeyTypeAttachedPoliciesPerRoleQuota, + SummaryKeyTypeAttachedPoliciesPerUserQuota, + SummaryKeyTypePolicies, + SummaryKeyTypePoliciesQuota, + SummaryKeyTypePolicySizeQuota, + SummaryKeyTypePolicyVersionsInUse, + SummaryKeyTypePolicyVersionsInUseQuota, + SummaryKeyTypeVersionsPerPolicyQuota, + SummaryKeyTypeGlobalEndpointTokenVersion, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go index 30a85b3b44d..74afac25e08 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/errors.go @@ -117,7 +117,8 @@ const ( // "LimitExceeded". // // The request was rejected because it attempted to create resources beyond - // the current AWS account limits. The error message describes the limit exceeded. + // the current AWS account limitations. The error message describes the limit + // exceeded. ErrCodeLimitExceededException = "LimitExceeded" // ErrCodeMalformedCertificateException for service response error code diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go index 273a861b403..4df9efecb85 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go @@ -1003,6 +1003,11 @@ func (c *ResourceGroupsTaggingAPI) TagResourcesRequest(input *TagResourcesInput) // service that the resource belongs to as well as permissions for adding // tags. For more information, see this list (http://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/Welcome.html). // +// Do not store personally identifiable information (PII) or other confidential +// or sensitive information in tags. We use tags to provide you with billing +// and administration services. Tags are not intended to be used for private +// or sensitive data. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2668,6 +2673,14 @@ const ( ErrorCodeInvalidParameterException = "InvalidParameterException" ) +// ErrorCode_Values returns all elements of the ErrorCode enum +func ErrorCode_Values() []string { + return []string{ + ErrorCodeInternalServiceException, + ErrorCodeInvalidParameterException, + } +} + const ( // GroupByAttributeTargetId is a GroupByAttribute enum value GroupByAttributeTargetId = "TARGET_ID" @@ -2679,6 +2692,15 @@ const ( GroupByAttributeResourceType = "RESOURCE_TYPE" ) +// GroupByAttribute_Values returns all elements of the GroupByAttribute enum +func GroupByAttribute_Values() []string { + return []string{ + GroupByAttributeTargetId, + GroupByAttributeRegion, + GroupByAttributeResourceType, + } +} + const ( // TargetIdTypeAccount is a TargetIdType enum value TargetIdTypeAccount = "ACCOUNT" @@ -2689,3 +2711,12 @@ const ( // TargetIdTypeRoot is a TargetIdType enum value TargetIdTypeRoot = "ROOT" ) + +// TargetIdType_Values returns all elements of the TargetIdType enum +func TargetIdType_Values() []string { + return []string{ + TargetIdTypeAccount, + TargetIdTypeOu, + TargetIdTypeRoot, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go index b444e46c526..1c60a1c7c14 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go @@ -10,6 +10,11 @@ // EC2 instances, you might assign both a tag key of "Stack." But the value // of "Stack" might be "Testing" for one and "Production" for the other. // +// Do not store personally identifiable information (PII) or other confidential +// or sensitive information in tags. We use tags to provide you with billing +// and administration services. Tags are not intended to be used for private +// or sensitive data. +// // Tagging can help you organize your resources and enables you to simplify // resource management, access management and cost allocation. // @@ -46,202 +51,242 @@ // For more information on IAM policies, see Managing IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage.html) // in the IAM User Guide. // +// Services that support the Resource Groups Tagging API +// // You can use the Resource Groups Tagging API to tag resources for the following // AWS services. // -// * Alexa for Business (a4b) +// * Alexa for Business (a4b) (https://docs.aws.amazon.com/a4b) +// +// * API Gateway (https://docs.aws.amazon.com/apigateway) +// +// * Amazon AppStream (https://docs.aws.amazon.com/appstream2) +// +// * AWS AppSync (https://docs.aws.amazon.com/appsync) +// +// * AWS App Mesh (https://docs.aws.amazon.com/app-mesh) +// +// * Amazon Athena (https://docs.aws.amazon.com/athena) +// +// * Amazon Aurora (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide) +// +// * AWS Backup (https://docs.aws.amazon.com/aws-backup) +// +// * AWS Certificate Manager (https://docs.aws.amazon.com/acm) +// +// * AWS Certificate Manager Private CA (https://docs.aws.amazon.com/acm) +// +// * Amazon Cloud Directory (https://docs.aws.amazon.com/clouddirectory) +// +// * AWS Cloud Map (https://docs.aws.amazon.com/cloud-map) +// +// * AWS CloudFormation (https://docs.aws.amazon.com/cloudformation) +// +// * Amazon CloudFront (https://docs.aws.amazon.com/cloudfront) +// +// * AWS CloudHSM (https://docs.aws.amazon.com/cloudhsm) +// +// * AWS CloudTrail (https://docs.aws.amazon.com/cloudtrail) +// +// * Amazon CloudWatch (alarms only) (https://docs.aws.amazon.com/cloudwatch) +// +// * Amazon CloudWatch Events (https://docs.aws.amazon.com/cloudwatch/?id=docs_gateway#amazon-cloudwatch-events) +// +// * Amazon CloudWatch Logs (https://docs.aws.amazon.com/cloudwatch/?id=docs_gateway#amazon-cloudwatch-logs) +// +// * Amazon Cloudwatch Synthetics (https://docs.aws.amazon.com/cloudwatch) // -// * API Gateway +// * AWS CodeBuild (https://docs.aws.amazon.com/codebuild) // -// * Amazon AppStream +// * AWS CodeCommit (https://docs.aws.amazon.com/codecommit) // -// * AWS AppSync +// * AWS CodePipeline (https://docs.aws.amazon.com/codepipeline) // -// * AWS App Mesh +// * AWS CodeStar (https://docs.aws.amazon.com/codestar) // -// * Amazon Athena +// * AWS CodeStar Connections (https://docs.aws.amazon.com/codestar-connections/latest/APIReference/) // -// * Amazon Aurora +// * Amazon Cognito Identity (https://docs.aws.amazon.com/cognito) // -// * AWS Backup +// * Amazon Cognito User Pools (https://docs.aws.amazon.com/cognito) // -// * AWS Certificate Manager +// * Amazon Comprehend (https://docs.aws.amazon.com/comprehend) // -// * AWS Certificate Manager Private CA +// * AWS Config (https://docs.aws.amazon.com/config) // -// * Amazon Cloud Directory +// * Amazon Connect (http://aws.amazon.com/connect/resources/?whats-new-cards#Documentation) // -// * AWS CloudFormation +// * AWS Data Exchange (https://docs.aws.amazon.com/data-exchange) // -// * Amazon CloudFront +// * AWS Data Pipeline (https://docs.aws.amazon.com/data-pipeline) // -// * AWS CloudHSM +// * AWS Database Migration Service (https://docs.aws.amazon.com/dms) // -// * AWS CloudTrail +// * AWS DataSync (https://docs.aws.amazon.com/datasync) // -// * Amazon CloudWatch (alarms only) +// * AWS Device Farm (https://docs.aws.amazon.com/devicefarm) // -// * Amazon CloudWatch Events +// * AWS Direct Connect (https://docs.aws.amazon.com/directconnect) // -// * Amazon CloudWatch Logs +// * AWS Directory Service (https://docs.aws.amazon.com/directory-service) // -// * AWS CodeBuild +// * Amazon DynamoDB (https://docs.aws.amazon.com/dynamodb) // -// * AWS CodeCommit +// * Amazon EBS (https://docs.aws.amazon.com/ebs) // -// * AWS CodePipeline +// * Amazon EC2 (https://docs.aws.amazon.com/ec2) // -// * AWS CodeStar +// * EC2 Image Builder (https://docs.aws.amazon.com/imagebuilder) // -// * Amazon Cognito Identity +// * Amazon ECR (https://docs.aws.amazon.com/ecr) // -// * Amazon Cognito User Pools +// * Amazon ECS (https://docs.aws.amazon.com/ecs) // -// * Amazon Comprehend +// * Amazon EKS (https://docs.aws.amazon.com/eks) // -// * AWS Config +// * AWS Elastic Beanstalk (https://docs.aws.amazon.com/elastic-beanstalk) // -// * AWS Data Exchange +// * Amazon Elastic File System (https://docs.aws.amazon.com/efs) // -// * AWS Data Pipeline +// * Elastic Load Balancing (https://docs.aws.amazon.com/elasticloadbalancing) // -// * AWS Database Migration Service +// * Amazon ElastiCache (https://docs.aws.amazon.com/elasticache) // -// * AWS DataSync +// * Amazon Elasticsearch Service (https://docs.aws.amazon.com/elasticsearch-service) // -// * AWS Device Farm +// * AWS Elemental MediaLive (https://docs.aws.amazon.com/medialive) // -// * AWS Direct Connect +// * AWS Elemental MediaPackage (https://docs.aws.amazon.com/mediapackage) // -// * AWS Directory Service +// * AWS Elemental MediaPackage VoD (https://docs.aws.amazon.com/mediapackage) // -// * Amazon DynamoDB +// * AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor) // -// * Amazon EBS +// * Amazon EMR (https://docs.aws.amazon.com/emr) // -// * Amazon EC2 +// * Amazon EventBridge Schema (https://docs.aws.amazon.com/eventbridge) // -// * Amazon ECR +// * AWS Firewall Manager (https://docs.aws.amazon.com/firewall-manager) // -// * Amazon ECS +// * Amazon FSx (https://docs.aws.amazon.com/fsx) // -// * Amazon EKS +// * Amazon S3 Glacier (https://docs.aws.amazon.com/s3/?id=docs_gateway#amazon-s3-glacier) // -// * AWS Elastic Beanstalk +// * AWS Global Accelerator (https://docs.aws.amazon.com/global-accelerator) // -// * Amazon Elastic File System +// * AWS Ground Station (https://docs.aws.amazon.com/ground-station) // -// * Elastic Load Balancing +// * AWS Glue (https://docs.aws.amazon.com/glue) // -// * Amazon ElastiCache +// * Amazon GuardDuty (https://docs.aws.amazon.com/guardduty) // -// * Amazon Elasticsearch Service +// * Amazon Inspector (https://docs.aws.amazon.com/inspector) // -// * AWS Elemental MediaLive +// * AWS IoT Analytics (https://docs.aws.amazon.com/iotanalytics) // -// * AWS Elemental MediaPackage +// * AWS IoT Core (https://docs.aws.amazon.com/iot) // -// * AWS Elemental MediaTailor +// * AWS IoT Device Defender (https://docs.aws.amazon.com/iot-device-defender) // -// * Amazon EMR +// * AWS IoT Device Management (https://docs.aws.amazon.com/iot-device-management) // -// * Amazon FSx +// * AWS IoT Events (https://docs.aws.amazon.com/iotevents) // -// * Amazon S3 Glacier +// * AWS IoT Greengrass (https://docs.aws.amazon.com/greengrass) // -// * AWS Glue +// * AWS IoT 1-Click (https://docs.aws.amazon.com/iot-1-click) // -// * Amazon GuardDuty +// * AWS IoT Sitewise (https://docs.aws.amazon.com/iot-sitewise) // -// * Amazon Inspector +// * AWS IoT Things Graph (https://docs.aws.amazon.com/thingsgraph) // -// * AWS IoT Analytics +// * Amazon Kendra (https://docs.aws.amazon.com/kendra) // -// * AWS IoT Core +// * AWS Key Management Service (https://docs.aws.amazon.com/kms) // -// * AWS IoT Device Defender +// * Amazon Kinesis (https://docs.aws.amazon.com/kinesis) // -// * AWS IoT Device Management +// * Amazon Kinesis Data Analytics (https://docs.aws.amazon.com/kinesis/?id=docs_gateway#amazon-kinesis-data-analytics) // -// * AWS IoT Events +// * Amazon Kinesis Data Firehose (https://docs.aws.amazon.com/kinesis/?id=docs_gateway#amazon-kinesis-data-firehose) // -// * AWS IoT Greengrass +// * AWS Lambda (https://docs.aws.amazon.com/lambda) // -// * AWS IoT 1-Click +// * Amazon Lex (https://docs.aws.amazon.com/lex) // -// * AWS IoT Things Graph +// * AWS License Manager (https://docs.aws.amazon.com/license-manager) // -// * AWS Key Management Service +// * Amazon Macie (https://docs.aws.amazon.com/macie) // -// * Amazon Kinesis +// * Amazon Machine Learning (https://docs.aws.amazon.com/machine-learning) // -// * Amazon Kinesis Data Analytics +// * Amazon MQ (https://docs.aws.amazon.com/amazon-mq) // -// * Amazon Kinesis Data Firehose +// * Amazon MSK (https://docs.aws.amazon.com/msk) // -// * AWS Lambda +// * Amazon Neptune (https://docs.aws.amazon.com/neptune) // -// * AWS License Manager +// * AWS OpsWorks (https://docs.aws.amazon.com/opsworks) // -// * Amazon Machine Learning +// * AWS OpsWorks CM (https://docs.aws.amazon.com/opsworks) // -// * Amazon MQ +// * AWS Organizations (https://docs.aws.amazon.com/organizations) // -// * Amazon MSK +// * Amazon Pinpoint (https://docs.aws.amazon.com/pinpoint) // -// * Amazon Neptune +// * Amazon Quantum Ledger Database (QLDB) (https://docs.aws.amazon.com/qldb) // -// * AWS OpsWorks +// * Amazon RDS (https://docs.aws.amazon.com/rds) // -// * AWS Organizations +// * Amazon Redshift (https://docs.aws.amazon.com/redshift) // -// * Amazon Quantum Ledger Database (QLDB) +// * AWS Resource Access Manager (https://docs.aws.amazon.com/ram) // -// * Amazon RDS +// * AWS Resource Groups (https://docs.aws.amazon.com/ARG) // -// * Amazon Redshift +// * AWS RoboMaker (https://docs.aws.amazon.com/robomaker) // -// * AWS Resource Access Manager +// * Amazon Route 53 (https://docs.aws.amazon.com/route53) // -// * AWS Resource Groups +// * Amazon Route 53 Resolver (https://docs.aws.amazon.com/route53) // -// * AWS RoboMaker +// * Amazon S3 (buckets only) (https://docs.aws.amazon.com/s3) // -// * Amazon Route 53 +// * Amazon SageMaker (https://docs.aws.amazon.com/sagemaker) // -// * Amazon Route 53 Resolver +// * Savings Plans (https://docs.aws.amazon.com/savingsplans) // -// * Amazon S3 (buckets only) +// * AWS Secrets Manager (https://docs.aws.amazon.com/secretsmanager) // -// * Amazon SageMaker +// * AWS Security Hub (https://docs.aws.amazon.com/securityhub) // -// * AWS Secrets Manager +// * AWS Service Catalog (https://docs.aws.amazon.com/servicecatalog) // -// * AWS Security Hub +// * Amazon Simple Email Service (SES) (https://docs.aws.amazon.com/ses) // -// * AWS Service Catalog +// * Amazon Simple Notification Service (SNS) (https://docs.aws.amazon.com/sns) // -// * Amazon Simple Email Service (SES) +// * Amazon Simple Queue Service (SQS) (https://docs.aws.amazon.com/sqs) // -// * Amazon Simple Notification Service (SNS) +// * Amazon Simple Workflow Service (https://docs.aws.amazon.com/swf) // -// * Amazon Simple Queue Service (SQS) +// * AWS Step Functions (https://docs.aws.amazon.com/step-functions) // -// * Amazon Simple Workflow Service +// * AWS Storage Gateway (https://docs.aws.amazon.com/storagegateway) // -// * AWS Step Functions +// * AWS Systems Manager (https://docs.aws.amazon.com/systems-manager) // -// * AWS Storage Gateway +// * AWS Transfer for SFTP (https://docs.aws.amazon.com/transfer) // -// * AWS Systems Manager +// * Amazon VPC (https://docs.aws.amazon.com/vpc) // -// * AWS Transfer for SFTP +// * AWS WAFv2 (https://docs.aws.amazon.com/waf) // -// * AWS WAF Regional +// * AWS WAF Regional (https://docs.aws.amazon.com/waf) // -// * Amazon VPC +// * Amazon WorkLink (https://docs.aws.amazon.com/worklink) // -// * Amazon WorkSpaces +// * Amazon WorkSpaces (https://docs.aws.amazon.com/workspaces) // // See https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go index 6a1693133e0..8a778400673 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go @@ -60,22 +60,13 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste // Associates an Amazon VPC with a private hosted zone. // // To perform the association, the VPC and the private hosted zone must already -// exist. Also, you can't convert a public hosted zone into a private hosted -// zone. -// -// If you want to associate a VPC that was created by one AWS account with a -// private hosted zone that was created by a different account, do one of the -// following: -// -// * Use the AWS account that created the private hosted zone to submit a -// CreateVPCAssociationAuthorization (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateVPCAssociationAuthorization.html) -// request. Then use the account that created the VPC to submit an AssociateVPCWithHostedZone -// request. +// exist. You can't convert a public hosted zone into a private hosted zone. // -// * If a subnet in the VPC was shared with another account, you can use -// the account that the subnet was shared with to submit an AssociateVPCWithHostedZone -// request. For more information about sharing subnets, see Working with -// Shared VPCs (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-sharing.html). +// If you want to associate a VPC that was created by using one AWS account +// with a private hosted zone that was created by using a different account, +// the AWS account that created the private hosted zone must first submit a +// CreateVPCAssociationAuthorization request. Then the account that created +// the VPC must submit an AssociateVPCWithHostedZone request. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -132,6 +123,13 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste // To request a higher limit, create a case (http://aws.amazon.com/route53-request) // with the AWS Support Center. // +// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" +// If Amazon Route 53 can't process a request before the next request arrives, +// it will reject subsequent requests for the same hosted zone and return an +// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for +// the same request, we recommend that you wait, in intervals of increasing +// duration, before you try the request again. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZone func (c *Route53) AssociateVPCWithHostedZone(input *AssociateVPCWithHostedZoneInput) (*AssociateVPCWithHostedZoneOutput, error) { req, out := c.AssociateVPCWithHostedZoneRequest(input) @@ -2005,6 +2003,19 @@ func (c *Route53) DeleteTrafficPolicyRequest(input *DeleteTrafficPolicyInput) (r // // Deletes a traffic policy. // +// When you delete a traffic policy, Route 53 sets a flag on the policy to indicate +// that it has been deleted. However, Route 53 never fully deletes the traffic +// policy. Note the following: +// +// * Deleted traffic policies aren't listed if you run ListTrafficPolicies +// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListTrafficPolicies.html). +// +// * There's no way to get a list of deleted policies. +// +// * If you retain the ID of the policy, you can get information about the +// policy, including the traffic policy document, by running GetTrafficPolicy +// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetTrafficPolicy.html). +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2290,16 +2301,25 @@ func (c *Route53) DisassociateVPCFromHostedZoneRequest(input *DisassociateVPCFro // DisassociateVPCFromHostedZone API operation for Amazon Route 53. // -// Disassociates a VPC from a Amazon Route 53 private hosted zone. Note the -// following: +// Disassociates an Amazon Virtual Private Cloud (Amazon VPC) from an Amazon +// Route 53 private hosted zone. Note the following: // -// * You can't disassociate the last VPC from a private hosted zone. +// * You can't disassociate the last Amazon VPC from a private hosted zone. // // * You can't convert a private hosted zone into a public hosted zone. // // * You can submit a DisassociateVPCFromHostedZone request using either // the account that created the hosted zone or the account that created the -// VPC. +// Amazon VPC. +// +// * Some services, such as AWS Cloud Map and Amazon Elastic File System +// (Amazon EFS) automatically create hosted zones and associate VPCs with +// the hosted zones. A service can create a hosted zone using your account +// or using its own account. You can disassociate a VPC from a hosted zone +// only if the service created the hosted zone using your account. When you +// run DisassociateVPCFromHostedZone (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListHostedZonesByVPC.html), +// if the hosted zone has a value for OwningAccount, you can use DisassociateVPCFromHostedZone. +// If the hosted zone has a value for OwningService, you can't use DisassociateVPCFromHostedZone. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3589,6 +3609,9 @@ func (c *Route53) GetTrafficPolicyRequest(input *GetTrafficPolicyInput) (req *re // // Gets information about a specific traffic policy version. // +// For information about how of deleting a traffic policy affects the response +// from GetTrafficPolicy, see DeleteTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicy.html). +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4297,6 +4320,99 @@ func (c *Route53) ListHostedZonesByNameWithContext(ctx aws.Context, input *ListH return out, req.Send() } +const opListHostedZonesByVPC = "ListHostedZonesByVPC" + +// ListHostedZonesByVPCRequest generates a "aws/request.Request" representing the +// client's request for the ListHostedZonesByVPC operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListHostedZonesByVPC for more information on using the ListHostedZonesByVPC +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListHostedZonesByVPCRequest method. +// req, resp := client.ListHostedZonesByVPCRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByVPC +func (c *Route53) ListHostedZonesByVPCRequest(input *ListHostedZonesByVPCInput) (req *request.Request, output *ListHostedZonesByVPCOutput) { + op := &request.Operation{ + Name: opListHostedZonesByVPC, + HTTPMethod: "GET", + HTTPPath: "/2013-04-01/hostedzonesbyvpc", + } + + if input == nil { + input = &ListHostedZonesByVPCInput{} + } + + output = &ListHostedZonesByVPCOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListHostedZonesByVPC API operation for Amazon Route 53. +// +// Lists all the private hosted zones that a specified VPC is associated with, +// regardless of which AWS account or AWS service owns the hosted zones. The +// HostedZoneOwner structure in the response contains one of the following values: +// +// * An OwningAccount element, which contains the account number of either +// the current AWS account or another AWS account. Some services, such as +// AWS Cloud Map, create hosted zones using the current account. +// +// * An OwningService element, which identifies the AWS service that created +// and owns the hosted zone. For example, if a hosted zone was created by +// Amazon Elastic File System (Amazon EFS), the value of Owner is efs.amazonaws.com. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Route 53's +// API operation ListHostedZonesByVPC for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidInput "InvalidInput" +// The input is not valid. +// +// * ErrCodeInvalidPaginationToken "InvalidPaginationToken" +// The value that you specified to get the second or subsequent page of results +// is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByVPC +func (c *Route53) ListHostedZonesByVPC(input *ListHostedZonesByVPCInput) (*ListHostedZonesByVPCOutput, error) { + req, out := c.ListHostedZonesByVPCRequest(input) + return out, req.Send() +} + +// ListHostedZonesByVPCWithContext is the same as ListHostedZonesByVPC with the addition of +// the ability to pass a context and additional request options. +// +// See ListHostedZonesByVPC for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Route53) ListHostedZonesByVPCWithContext(ctx aws.Context, input *ListHostedZonesByVPCInput, opts ...request.Option) (*ListHostedZonesByVPCOutput, error) { + req, out := c.ListHostedZonesByVPCRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListQueryLoggingConfigs = "ListQueryLoggingConfigs" // ListQueryLoggingConfigsRequest generates a "aws/request.Request" representing the @@ -4978,6 +5094,9 @@ func (c *Route53) ListTrafficPoliciesRequest(input *ListTrafficPoliciesInput) (r // associated with the current AWS account. Policies are listed in the order // that they were created in. // +// For information about how of deleting a traffic policy affects the response +// from ListTrafficPolicies, see DeleteTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicy.html). +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -10776,6 +10895,103 @@ func (s *HostedZoneLimit) SetValue(v int64) *HostedZoneLimit { return s } +// A complex type that identifies a hosted zone that a specified Amazon VPC +// is associated with and the owner of the hosted zone. If there is a value +// for OwningAccount, there is no value for OwningService, and vice versa. +type HostedZoneOwner struct { + _ struct{} `type:"structure"` + + // If the hosted zone was created by an AWS account, or was created by an AWS + // service that creates hosted zones using the current account, OwningAccount + // contains the account ID of that account. For example, when you use AWS Cloud + // Map to create a hosted zone, Cloud Map creates the hosted zone using the + // current AWS account. + OwningAccount *string `type:"string"` + + // If an AWS service uses its own account to create a hosted zone and associate + // the specified VPC with that hosted zone, OwningService contains an abbreviation + // that identifies the service. For example, if Amazon Elastic File System (Amazon + // EFS) created a hosted zone and associated a VPC with the hosted zone, the + // value of OwningService is efs.amazonaws.com. + OwningService *string `type:"string"` +} + +// String returns the string representation +func (s HostedZoneOwner) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostedZoneOwner) GoString() string { + return s.String() +} + +// SetOwningAccount sets the OwningAccount field's value. +func (s *HostedZoneOwner) SetOwningAccount(v string) *HostedZoneOwner { + s.OwningAccount = &v + return s +} + +// SetOwningService sets the OwningService field's value. +func (s *HostedZoneOwner) SetOwningService(v string) *HostedZoneOwner { + s.OwningService = &v + return s +} + +// In the response to a ListHostedZonesByVPC request, the HostedZoneSummaries +// element contains one HostedZoneSummary element for each hosted zone that +// the specified Amazon VPC is associated with. Each HostedZoneSummary element +// contains the hosted zone name and ID, and information about who owns the +// hosted zone. +type HostedZoneSummary struct { + _ struct{} `type:"structure"` + + // The Route 53 hosted zone ID of a private hosted zone that the specified VPC + // is associated with. + // + // HostedZoneId is a required field + HostedZoneId *string `type:"string" required:"true"` + + // The name of the private hosted zone, such as example.com. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The owner of a private hosted zone that the specified VPC is associated with. + // The owner can be either an AWS account or an AWS service. + // + // Owner is a required field + Owner *HostedZoneOwner `type:"structure" required:"true"` +} + +// String returns the string representation +func (s HostedZoneSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HostedZoneSummary) GoString() string { + return s.String() +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *HostedZoneSummary) SetHostedZoneId(v string) *HostedZoneSummary { + s.HostedZoneId = &v + return s +} + +// SetName sets the Name field's value. +func (s *HostedZoneSummary) SetName(v string) *HostedZoneSummary { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *HostedZoneSummary) SetOwner(v *HostedZoneOwner) *HostedZoneSummary { + s.Owner = v + return s +} + // If a health check or hosted zone was created by another service, LinkedService // is a complex type that describes the service that created the resource. When // a resource is created by another service, you can't edit or delete it using @@ -11278,6 +11494,144 @@ func (s *ListHostedZonesByNameOutput) SetNextHostedZoneId(v string) *ListHostedZ return s } +// Lists all the private hosted zones that a specified VPC is associated with, +// regardless of which AWS account created the hosted zones. +type ListHostedZonesByVPCInput struct { + _ struct{} `locationName:"ListHostedZonesByVPCRequest" type:"structure"` + + // (Optional) The maximum number of hosted zones that you want Amazon Route + // 53 to return. If the specified VPC is associated with more than MaxItems + // hosted zones, the response includes a NextToken element. NextToken contains + // an encrypted token that identifies the first hosted zone that Route 53 will + // return if you submit another request. + MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` + + // If the previous response included a NextToken element, the specified VPC + // is associated with more hosted zones. To get more hosted zones, submit another + // ListHostedZonesByVPC request. + // + // For the value of NextToken, specify the value of NextToken from the previous + // response. + // + // If the previous response didn't include a NextToken element, there are no + // more hosted zones to get. + NextToken *string `location:"querystring" locationName:"nexttoken" type:"string"` + + // The ID of the Amazon VPC that you want to list hosted zones for. + // + // VPCId is a required field + VPCId *string `location:"querystring" locationName:"vpcid" type:"string" required:"true"` + + // For the Amazon VPC that you specified for VPCId, the AWS Region that you + // created the VPC in. + // + // VPCRegion is a required field + VPCRegion *string `location:"querystring" locationName:"vpcregion" min:"1" type:"string" required:"true" enum:"VPCRegion"` +} + +// String returns the string representation +func (s ListHostedZonesByVPCInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHostedZonesByVPCInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListHostedZonesByVPCInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListHostedZonesByVPCInput"} + if s.VPCId == nil { + invalidParams.Add(request.NewErrParamRequired("VPCId")) + } + if s.VPCRegion == nil { + invalidParams.Add(request.NewErrParamRequired("VPCRegion")) + } + if s.VPCRegion != nil && len(*s.VPCRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VPCRegion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHostedZonesByVPCInput) SetMaxItems(v string) *ListHostedZonesByVPCInput { + s.MaxItems = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListHostedZonesByVPCInput) SetNextToken(v string) *ListHostedZonesByVPCInput { + s.NextToken = &v + return s +} + +// SetVPCId sets the VPCId field's value. +func (s *ListHostedZonesByVPCInput) SetVPCId(v string) *ListHostedZonesByVPCInput { + s.VPCId = &v + return s +} + +// SetVPCRegion sets the VPCRegion field's value. +func (s *ListHostedZonesByVPCInput) SetVPCRegion(v string) *ListHostedZonesByVPCInput { + s.VPCRegion = &v + return s +} + +type ListHostedZonesByVPCOutput struct { + _ struct{} `type:"structure"` + + // A list that contains one HostedZoneSummary element for each hosted zone that + // the specified Amazon VPC is associated with. Each HostedZoneSummary element + // contains the hosted zone name and ID, and information about who owns the + // hosted zone. + // + // HostedZoneSummaries is a required field + HostedZoneSummaries []*HostedZoneSummary `locationNameList:"HostedZoneSummary" type:"list" required:"true"` + + // The value that you specified for MaxItems in the most recent ListHostedZonesByVPC + // request. + // + // MaxItems is a required field + MaxItems *string `type:"string" required:"true"` + + // The value that you specified for NextToken in the most recent ListHostedZonesByVPC + // request. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListHostedZonesByVPCOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListHostedZonesByVPCOutput) GoString() string { + return s.String() +} + +// SetHostedZoneSummaries sets the HostedZoneSummaries field's value. +func (s *ListHostedZonesByVPCOutput) SetHostedZoneSummaries(v []*HostedZoneSummary) *ListHostedZonesByVPCOutput { + s.HostedZoneSummaries = v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListHostedZonesByVPCOutput) SetMaxItems(v string) *ListHostedZonesByVPCOutput { + s.MaxItems = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListHostedZonesByVPCOutput) SetNextToken(v string) *ListHostedZonesByVPCOutput { + s.NextToken = &v + return s +} + // A request to retrieve a list of the public and private hosted zones that // are associated with the current AWS account. type ListHostedZonesInput struct { @@ -15108,6 +15462,17 @@ const ( AccountLimitTypeMaxTrafficPoliciesByOwner = "MAX_TRAFFIC_POLICIES_BY_OWNER" ) +// AccountLimitType_Values returns all elements of the AccountLimitType enum +func AccountLimitType_Values() []string { + return []string{ + AccountLimitTypeMaxHealthChecksByOwner, + AccountLimitTypeMaxHostedZonesByOwner, + AccountLimitTypeMaxTrafficPolicyInstancesByOwner, + AccountLimitTypeMaxReusableDelegationSetsByOwner, + AccountLimitTypeMaxTrafficPoliciesByOwner, + } +} + const ( // ChangeActionCreate is a ChangeAction enum value ChangeActionCreate = "CREATE" @@ -15119,6 +15484,15 @@ const ( ChangeActionUpsert = "UPSERT" ) +// ChangeAction_Values returns all elements of the ChangeAction enum +func ChangeAction_Values() []string { + return []string{ + ChangeActionCreate, + ChangeActionDelete, + ChangeActionUpsert, + } +} + const ( // ChangeStatusPending is a ChangeStatus enum value ChangeStatusPending = "PENDING" @@ -15127,6 +15501,14 @@ const ( ChangeStatusInsync = "INSYNC" ) +// ChangeStatus_Values returns all elements of the ChangeStatus enum +func ChangeStatus_Values() []string { + return []string{ + ChangeStatusPending, + ChangeStatusInsync, + } +} + const ( // CloudWatchRegionUsEast1 is a CloudWatchRegion enum value CloudWatchRegionUsEast1 = "us-east-1" @@ -15210,6 +15592,39 @@ const ( CloudWatchRegionUsIsobEast1 = "us-isob-east-1" ) +// CloudWatchRegion_Values returns all elements of the CloudWatchRegion enum +func CloudWatchRegion_Values() []string { + return []string{ + CloudWatchRegionUsEast1, + CloudWatchRegionUsEast2, + CloudWatchRegionUsWest1, + CloudWatchRegionUsWest2, + CloudWatchRegionCaCentral1, + CloudWatchRegionEuCentral1, + CloudWatchRegionEuWest1, + CloudWatchRegionEuWest2, + CloudWatchRegionEuWest3, + CloudWatchRegionApEast1, + CloudWatchRegionMeSouth1, + CloudWatchRegionApSouth1, + CloudWatchRegionApSoutheast1, + CloudWatchRegionApSoutheast2, + CloudWatchRegionApNortheast1, + CloudWatchRegionApNortheast2, + CloudWatchRegionApNortheast3, + CloudWatchRegionEuNorth1, + CloudWatchRegionSaEast1, + CloudWatchRegionCnNorthwest1, + CloudWatchRegionCnNorth1, + CloudWatchRegionAfSouth1, + CloudWatchRegionEuSouth1, + CloudWatchRegionUsGovWest1, + CloudWatchRegionUsGovEast1, + CloudWatchRegionUsIsoEast1, + CloudWatchRegionUsIsobEast1, + } +} + const ( // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold" @@ -15224,6 +15639,16 @@ const ( ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold" ) +// ComparisonOperator_Values returns all elements of the ComparisonOperator enum +func ComparisonOperator_Values() []string { + return []string{ + ComparisonOperatorGreaterThanOrEqualToThreshold, + ComparisonOperatorGreaterThanThreshold, + ComparisonOperatorLessThanThreshold, + ComparisonOperatorLessThanOrEqualToThreshold, + } +} + const ( // HealthCheckRegionUsEast1 is a HealthCheckRegion enum value HealthCheckRegionUsEast1 = "us-east-1" @@ -15250,6 +15675,20 @@ const ( HealthCheckRegionSaEast1 = "sa-east-1" ) +// HealthCheckRegion_Values returns all elements of the HealthCheckRegion enum +func HealthCheckRegion_Values() []string { + return []string{ + HealthCheckRegionUsEast1, + HealthCheckRegionUsWest1, + HealthCheckRegionUsWest2, + HealthCheckRegionEuWest1, + HealthCheckRegionApSoutheast1, + HealthCheckRegionApSoutheast2, + HealthCheckRegionApNortheast1, + HealthCheckRegionSaEast1, + } +} + const ( // HealthCheckTypeHttp is a HealthCheckType enum value HealthCheckTypeHttp = "HTTP" @@ -15273,6 +15712,19 @@ const ( HealthCheckTypeCloudwatchMetric = "CLOUDWATCH_METRIC" ) +// HealthCheckType_Values returns all elements of the HealthCheckType enum +func HealthCheckType_Values() []string { + return []string{ + HealthCheckTypeHttp, + HealthCheckTypeHttps, + HealthCheckTypeHttpStrMatch, + HealthCheckTypeHttpsStrMatch, + HealthCheckTypeTcp, + HealthCheckTypeCalculated, + HealthCheckTypeCloudwatchMetric, + } +} + const ( // HostedZoneLimitTypeMaxRrsetsByZone is a HostedZoneLimitType enum value HostedZoneLimitTypeMaxRrsetsByZone = "MAX_RRSETS_BY_ZONE" @@ -15281,6 +15733,14 @@ const ( HostedZoneLimitTypeMaxVpcsAssociatedByZone = "MAX_VPCS_ASSOCIATED_BY_ZONE" ) +// HostedZoneLimitType_Values returns all elements of the HostedZoneLimitType enum +func HostedZoneLimitType_Values() []string { + return []string{ + HostedZoneLimitTypeMaxRrsetsByZone, + HostedZoneLimitTypeMaxVpcsAssociatedByZone, + } +} + const ( // InsufficientDataHealthStatusHealthy is a InsufficientDataHealthStatus enum value InsufficientDataHealthStatusHealthy = "Healthy" @@ -15292,6 +15752,15 @@ const ( InsufficientDataHealthStatusLastKnownStatus = "LastKnownStatus" ) +// InsufficientDataHealthStatus_Values returns all elements of the InsufficientDataHealthStatus enum +func InsufficientDataHealthStatus_Values() []string { + return []string{ + InsufficientDataHealthStatusHealthy, + InsufficientDataHealthStatusUnhealthy, + InsufficientDataHealthStatusLastKnownStatus, + } +} + const ( // RRTypeSoa is a RRType enum value RRTypeSoa = "SOA" @@ -15330,6 +15799,24 @@ const ( RRTypeCaa = "CAA" ) +// RRType_Values returns all elements of the RRType enum +func RRType_Values() []string { + return []string{ + RRTypeSoa, + RRTypeA, + RRTypeTxt, + RRTypeNs, + RRTypeCname, + RRTypeMx, + RRTypeNaptr, + RRTypePtr, + RRTypeSrv, + RRTypeSpf, + RRTypeAaaa, + RRTypeCaa, + } +} + const ( // ResettableElementNameFullyQualifiedDomainName is a ResettableElementName enum value ResettableElementNameFullyQualifiedDomainName = "FullyQualifiedDomainName" @@ -15344,6 +15831,16 @@ const ( ResettableElementNameChildHealthChecks = "ChildHealthChecks" ) +// ResettableElementName_Values returns all elements of the ResettableElementName enum +func ResettableElementName_Values() []string { + return []string{ + ResettableElementNameFullyQualifiedDomainName, + ResettableElementNameRegions, + ResettableElementNameResourcePath, + ResettableElementNameChildHealthChecks, + } +} + const ( // ResourceRecordSetFailoverPrimary is a ResourceRecordSetFailover enum value ResourceRecordSetFailoverPrimary = "PRIMARY" @@ -15352,6 +15849,14 @@ const ( ResourceRecordSetFailoverSecondary = "SECONDARY" ) +// ResourceRecordSetFailover_Values returns all elements of the ResourceRecordSetFailover enum +func ResourceRecordSetFailover_Values() []string { + return []string{ + ResourceRecordSetFailoverPrimary, + ResourceRecordSetFailoverSecondary, + } +} + const ( // ResourceRecordSetRegionUsEast1 is a ResourceRecordSetRegion enum value ResourceRecordSetRegionUsEast1 = "us-east-1" @@ -15423,11 +15928,47 @@ const ( ResourceRecordSetRegionEuSouth1 = "eu-south-1" ) +// ResourceRecordSetRegion_Values returns all elements of the ResourceRecordSetRegion enum +func ResourceRecordSetRegion_Values() []string { + return []string{ + ResourceRecordSetRegionUsEast1, + ResourceRecordSetRegionUsEast2, + ResourceRecordSetRegionUsWest1, + ResourceRecordSetRegionUsWest2, + ResourceRecordSetRegionCaCentral1, + ResourceRecordSetRegionEuWest1, + ResourceRecordSetRegionEuWest2, + ResourceRecordSetRegionEuWest3, + ResourceRecordSetRegionEuCentral1, + ResourceRecordSetRegionApSoutheast1, + ResourceRecordSetRegionApSoutheast2, + ResourceRecordSetRegionApNortheast1, + ResourceRecordSetRegionApNortheast2, + ResourceRecordSetRegionApNortheast3, + ResourceRecordSetRegionEuNorth1, + ResourceRecordSetRegionSaEast1, + ResourceRecordSetRegionCnNorth1, + ResourceRecordSetRegionCnNorthwest1, + ResourceRecordSetRegionApEast1, + ResourceRecordSetRegionMeSouth1, + ResourceRecordSetRegionApSouth1, + ResourceRecordSetRegionAfSouth1, + ResourceRecordSetRegionEuSouth1, + } +} + const ( // ReusableDelegationSetLimitTypeMaxZonesByReusableDelegationSet is a ReusableDelegationSetLimitType enum value ReusableDelegationSetLimitTypeMaxZonesByReusableDelegationSet = "MAX_ZONES_BY_REUSABLE_DELEGATION_SET" ) +// ReusableDelegationSetLimitType_Values returns all elements of the ReusableDelegationSetLimitType enum +func ReusableDelegationSetLimitType_Values() []string { + return []string{ + ReusableDelegationSetLimitTypeMaxZonesByReusableDelegationSet, + } +} + const ( // StatisticAverage is a Statistic enum value StatisticAverage = "Average" @@ -15445,6 +15986,17 @@ const ( StatisticMinimum = "Minimum" ) +// Statistic_Values returns all elements of the Statistic enum +func Statistic_Values() []string { + return []string{ + StatisticAverage, + StatisticSum, + StatisticSampleCount, + StatisticMaximum, + StatisticMinimum, + } +} + const ( // TagResourceTypeHealthcheck is a TagResourceType enum value TagResourceTypeHealthcheck = "healthcheck" @@ -15453,6 +16005,14 @@ const ( TagResourceTypeHostedzone = "hostedzone" ) +// TagResourceType_Values returns all elements of the TagResourceType enum +func TagResourceType_Values() []string { + return []string{ + TagResourceTypeHealthcheck, + TagResourceTypeHostedzone, + } +} + const ( // VPCRegionUsEast1 is a VPCRegion enum value VPCRegionUsEast1 = "us-east-1" @@ -15532,3 +16092,35 @@ const ( // VPCRegionEuSouth1 is a VPCRegion enum value VPCRegionEuSouth1 = "eu-south-1" ) + +// VPCRegion_Values returns all elements of the VPCRegion enum +func VPCRegion_Values() []string { + return []string{ + VPCRegionUsEast1, + VPCRegionUsEast2, + VPCRegionUsWest1, + VPCRegionUsWest2, + VPCRegionEuWest1, + VPCRegionEuWest2, + VPCRegionEuWest3, + VPCRegionEuCentral1, + VPCRegionApEast1, + VPCRegionMeSouth1, + VPCRegionUsGovWest1, + VPCRegionUsGovEast1, + VPCRegionUsIsoEast1, + VPCRegionUsIsobEast1, + VPCRegionApSoutheast1, + VPCRegionApSoutheast2, + VPCRegionApSouth1, + VPCRegionApNortheast1, + VPCRegionApNortheast2, + VPCRegionApNortheast3, + VPCRegionEuNorth1, + VPCRegionSaEast1, + VPCRegionCaCentral1, + VPCRegionCnNorth1, + VPCRegionAfSouth1, + VPCRegionEuSouth1, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go index 8515e88fcaf..d1be6cc0bcb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/route53iface/interface.go @@ -226,6 +226,10 @@ type Route53API interface { ListHostedZonesByNameWithContext(aws.Context, *route53.ListHostedZonesByNameInput, ...request.Option) (*route53.ListHostedZonesByNameOutput, error) ListHostedZonesByNameRequest(*route53.ListHostedZonesByNameInput) (*request.Request, *route53.ListHostedZonesByNameOutput) + ListHostedZonesByVPC(*route53.ListHostedZonesByVPCInput) (*route53.ListHostedZonesByVPCOutput, error) + ListHostedZonesByVPCWithContext(aws.Context, *route53.ListHostedZonesByVPCInput, ...request.Option) (*route53.ListHostedZonesByVPCOutput, error) + ListHostedZonesByVPCRequest(*route53.ListHostedZonesByVPCInput) (*request.Request, *route53.ListHostedZonesByVPCOutput) + ListQueryLoggingConfigs(*route53.ListQueryLoggingConfigsInput) (*route53.ListQueryLoggingConfigsOutput, error) ListQueryLoggingConfigsWithContext(aws.Context, *route53.ListQueryLoggingConfigsInput, ...request.Option) (*route53.ListQueryLoggingConfigsOutput, error) ListQueryLoggingConfigsRequest(*route53.ListQueryLoggingConfigsInput) (*request.Request, *route53.ListQueryLoggingConfigsOutput) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 228cd3cfe59..2ccad45a71c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -75,23 +75,23 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req // times in order to completely free all storage consumed by all parts. // // To verify that all parts have been removed, so you don't get charged for -// the part storage, you should call the ListParts operation and ensure that -// the parts list is empty. +// the part storage, you should call the ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) +// operation and ensure that the parts list is empty. // // For information about permissions required to use the multipart upload API, // see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // // The following operations are related to AbortMultipartUpload: // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * ListMultipartUploads +// * ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -173,14 +173,15 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // Completes a multipart upload by assembling previously uploaded parts. // // You first initiate the multipart upload and then upload all parts using the -// UploadPart operation. After successfully uploading all relevant parts of -// an upload, you call this operation to complete the upload. Upon receiving -// this request, Amazon S3 concatenates all the parts in ascending order by -// part number to create a new object. In the Complete Multipart Upload request, -// you must provide the parts list. You must ensure that the parts list is complete. -// This operation concatenates the parts that you provide in the list. For each -// part in the list, you must provide the part number and the ETag value, returned -// after that part was uploaded. +// UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) +// operation. After successfully uploading all relevant parts of an upload, +// you call this operation to complete the upload. Upon receiving this request, +// Amazon S3 concatenates all the parts in ascending order by part number to +// create a new object. In the Complete Multipart Upload request, you must provide +// the parts list. You must ensure that the parts list is complete. This operation +// concatenates the parts that you provide in the list. For each part in the +// list, you must provide the part number and the ETag value, returned after +// that part was uploaded. // // Processing of a Complete Multipart Upload request could take several minutes // to complete. After Amazon S3 begins processing the request, it sends an HTTP @@ -200,7 +201,7 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // For information about permissions required to use the multipart upload API, // see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // -// GetBucketLifecycle has the following special errors: +// CompleteMultipartUpload has the following special errors: // // * Error code: EntityTooSmall Description: Your proposed upload is smaller // than the minimum allowed object size. Each part must be at least 5 MB @@ -220,15 +221,15 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // // The following operations are related to CompleteMultipartUpload: // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * ListMultipartUploads +// * ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -441,13 +442,13 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // If the source object's storage class is GLACIER, you must restore a copy // of this object before you can use it as a source object for the copy operation. -// For more information, see . +// For more information, see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html). // // The following operations are related to CopyObject: // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // // For more information, see Copying Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html). // @@ -587,9 +588,9 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request // // The following operations are related to CreateBucket: // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * DeleteBucket +// * DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -679,8 +680,9 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // This operation initiates a multipart upload and returns an upload ID. This // upload ID is used to associate all of the parts in the specific multipart // upload. You specify this upload ID in each of your subsequent upload part -// requests (see UploadPart). You also include this upload ID in the final request -// to either complete or abort the multipart upload request. +// requests (see UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)). +// You also include this upload ID in the final request to either complete or +// abort the multipart upload request. // // For more information about multipart uploads, see Multipart Upload Overview // (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html). @@ -713,9 +715,10 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // and decrypts it when you access it. You can provide your own encryption key, // or use AWS Key Management Service (AWS KMS) customer master keys (CMKs) or // Amazon S3-managed encryption keys. If you choose to provide your own encryption -// key, the request headers you provide in UploadPart) and UploadPartCopy) requests -// must match the headers you used in the request to initiate the upload by -// using CreateMultipartUpload. +// key, the request headers you provide in UploadPart (AmazonS3/latest/API/API_UploadPart.html) +// and UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) +// requests must match the headers you used in the request to initiate the upload +// by using CreateMultipartUpload. // // To perform a multipart upload with encryption using an AWS KMS CMK, the requester // must have permission to the kms:Encrypt, kms:Decrypt, kms:ReEncrypt*, kms:GenerateDataKey*, @@ -759,7 +762,7 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // * Use encryption keys managed by Amazon S3 or customer master keys (CMKs) // stored in AWS Key Management Service (AWS KMS) – If you want AWS to // manage the keys used to encrypt data, specify the following headers in -// the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id +// the request. x-amz-server-side-encryption x-amz-server-side-encryption-aws-kms-key-id // x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, // but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon // S3 uses the AWS managed CMK in AWS KMS to protect the data. All GET and @@ -770,11 +773,10 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // // * Use customer-provided encryption keys – If you want to manage your // own encryption keys, provide all the following headers in the request. -// x-amz-server-side​-encryption​-customer-algorithm x-amz-server-side​-encryption​-customer-key -// x-amz-server-side​-encryption​-customer-key-MD5 For more information -// about server-side encryption with CMKs stored in AWS KMS (SSE-KMS), see -// Protecting Data Using Server-Side Encryption with CMKs stored in AWS KMS -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// x-amz-server-side-encryption-customer-algorithm x-amz-server-side-encryption-customer-key +// x-amz-server-side-encryption-customer-key-MD5 For more information about +// server-side encryption with CMKs stored in AWS KMS (SSE-KMS), see Protecting +// Data Using Server-Side Encryption with CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). // // Access-Control-List (ACL)-Specific Request Headers // @@ -815,15 +817,15 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // // The following operations are related to CreateMultipartUpload: // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * ListMultipartUploads +// * ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -903,9 +905,9 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request // // Related Resources // -// * +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * +// * DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -994,11 +996,11 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt // // The following operations are related to DeleteBucketAnalyticsConfiguration: // -// * +// * GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) // -// * +// * ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) // -// * +// * PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1084,9 +1086,9 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request // // Related Resources: // -// * +// * PutBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) // -// * RESTOPTIONSobject +// * RESTOPTIONSobject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1175,9 +1177,9 @@ func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) ( // // Related Resources // -// * PutBucketEncryption +// * PutBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) // -// * GetBucketEncryption +// * GetBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1266,11 +1268,11 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent // // Operations related to DeleteBucketInventoryConfiguration include: // -// * GetBucketInventoryConfiguration +// * GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) // -// * PutBucketInventoryConfiguration +// * PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) // -// * ListBucketInventoryConfigurations +// * ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1363,9 +1365,9 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (re // // Related actions include: // -// * PutBucketLifecycleConfiguration +// * PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) // -// * GetBucketLifecycleConfiguration +// * GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1455,11 +1457,11 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC // // The following operations are related to DeleteBucketMetricsConfiguration: // -// * GetBucketMetricsConfiguration +// * GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) // -// * PutBucketMetricsConfiguration +// * PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) // -// * ListBucketMetricsConfigurations +// * ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) // // * Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) // @@ -1556,9 +1558,9 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req // // The following operations are related to DeleteBucketPolicy // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * DeleteObject +// * DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1649,9 +1651,9 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) // // The following operations are related to DeleteBucketReplication: // -// * PutBucketReplication +// * PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) // -// * GetBucketReplication +// * GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1734,9 +1736,9 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *r // // The following operations are related to DeleteBucketTagging: // -// * GetBucketTagging +// * GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) // -// * PutBucketTagging +// * PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1828,9 +1830,9 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r // // The following operations are related to DeleteBucketWebsite: // -// * GetBucketWebsite +// * GetBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) // -// * PutBucketWebsite +// * PutBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1922,14 +1924,15 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request // To see sample requests that use versioning, see Sample Request (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete). // // You can delete objects by explicitly calling the DELETE Object API or configure -// its lifecycle (PutBucketLifecycle) to enable Amazon S3 to remove them for -// you. If you want to block users or accounts from removing or deleting objects -// from your bucket, you must deny them the s3:DeleteObject, s3:DeleteObjectVersion, -// and s3:PutLifeCycleConfiguration actions. +// its lifecycle (PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html)) +// to enable Amazon S3 to remove them for you. If you want to block users or +// accounts from removing or deleting objects from your bucket, you must deny +// them the s3:DeleteObject, s3:DeleteObjectVersion, and s3:PutLifeCycleConfiguration +// actions. // // The following operation is related to DeleteObject: // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2015,9 +2018,9 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *r // // The following operations are related to DeleteBucketMetricsConfiguration: // -// * PutObjectTagging +// * PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) // -// * GetObjectTagging +// * GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2128,15 +2131,15 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Reque // // The following operations are related to DeleteObjects: // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2221,11 +2224,11 @@ func (c *S3) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput) // // * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) // -// * GetPublicAccessBlock +// * GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) // -// * PutPublicAccessBlock +// * PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) // -// * GetBucketPolicyStatus +// * GetBucketPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2312,7 +2315,8 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // in the Amazon Simple Storage Service Developer Guide. // // You set the Transfer Acceleration state of an existing bucket to Enabled -// or Suspended by using the PutBucketAccelerateConfiguration operation. +// or Suspended by using the PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) +// operation. // // A GET accelerate request does not return a state value for a bucket that // has no transfer acceleration state. A bucket has no Transfer Acceleration @@ -2324,7 +2328,7 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // // Related Resources // -// * PutBucketAccelerateConfiguration +// * PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2406,7 +2410,7 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request // // Related Resources // -// * +// * ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2496,11 +2500,11 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon // // Related Resources // -// * +// * DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) // -// * +// * ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) // -// * +// * PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2585,9 +2589,9 @@ func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Reque // // The following operations are related to GetBucketCors: // -// * PutBucketCors +// * PutBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) // -// * DeleteBucketCors +// * DeleteBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2673,9 +2677,9 @@ func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) (req *r // // The following operations are related to GetBucketEncryption: // -// * PutBucketEncryption +// * PutBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) // -// * DeleteBucketEncryption +// * DeleteBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2763,11 +2767,11 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon // // The following operations are related to GetBucketInventoryConfiguration: // -// * DeleteBucketInventoryConfiguration +// * DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) // -// * ListBucketInventoryConfigurations +// * ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) // -// * PutBucketInventoryConfiguration +// * PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2847,7 +2851,7 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req // GetBucketLifecycle API operation for Amazon Simple Storage Service. // // -// For an updated version of this API, see GetBucketLifecycleConfiguration. +// For an updated version of this API, see GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html). // If you configured a bucket lifecycle using the filter element, you should // see the updated version of this topic. This topic is provided for backward // compatibility. @@ -2869,11 +2873,11 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req // // The following operations are related to GetBucketLifecycle: // -// * GetBucketLifecycleConfiguration +// * GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) // -// * PutBucketLifecycle +// * PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) // -// * DeleteBucketLifecycle +// * DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2958,7 +2962,7 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // the new filter element that you can use to specify a filter to select a subset // of objects to which the rule applies. If you are still using previous version // of the lifecycle configuration, it works. For the earlier API description, -// see GetBucketLifecycle. +// see GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html). // // Returns the lifecycle configuration information set on the bucket. For information // about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html). @@ -2977,11 +2981,11 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // // The following operations are related to GetBucketLifecycleConfiguration: // -// * GetBucketLifecycle +// * GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html) // -// * PutBucketLifecycle +// * PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) // -// * DeleteBucketLifecycle +// * DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3057,15 +3061,15 @@ func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *reque // // Returns the Region the bucket resides in. You set the bucket's Region using // the LocationConstraint request parameter in a CreateBucket request. For more -// information, see CreateBucket. +// information, see CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html). // // To use this implementation of the operation, you must be the bucket owner. // // The following operations are related to GetBucketLocation: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3144,9 +3148,9 @@ func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request // // The following operations are related to GetBucketLogging: // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * PutBucketLogging +// * PutBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3234,11 +3238,11 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu // // The following operations are related to GetBucketMetricsConfiguration: // -// * PutBucketMetricsConfiguration +// * PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) // -// * DeleteBucketMetricsConfiguration +// * DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) // -// * ListBucketMetricsConfigurations +// * ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) // // * Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) // @@ -3319,7 +3323,7 @@ func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurat // GetBucketNotification API operation for Amazon Simple Storage Service. // -// No longer used, see GetBucketNotificationConfiguration. +// No longer used, see GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3413,7 +3417,7 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat // // The following operation is related to GetBucketNotification: // -// * PutBucketNotification +// * PutBucketNotification (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3506,7 +3510,7 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.R // // The following operation is related to GetBucketPolicy: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3592,11 +3596,11 @@ func (c *S3) GetBucketPolicyStatusRequest(input *GetBucketPolicyStatusInput) (re // // * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) // -// * GetPublicAccessBlock +// * GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) // -// * PutPublicAccessBlock +// * PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) // -// * DeletePublicAccessBlock +// * DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3687,13 +3691,14 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req // also include the DeleteMarkerReplication and Priority elements. The response // also returns those elements. // -// For information about GetBucketReplication errors, see ReplicationErrorCodeList +// For information about GetBucketReplication errors, see List of replication-related +// error codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList) // // The following operations are related to GetBucketReplication: // -// * PutBucketReplication +// * PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) // -// * DeleteBucketReplication +// * DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3773,7 +3778,7 @@ func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) // // The following operations are related to GetBucketRequestPayment: // -// * ListObjects +// * ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3860,9 +3865,9 @@ func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request // // The following operations are related to GetBucketTagging: // -// * PutBucketTagging +// * PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) // -// * DeleteBucketTagging +// * DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3946,11 +3951,11 @@ func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *r // // The following operations are related to GetBucketVersioning: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * DeleteObject +// * DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4036,9 +4041,9 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request // // The following operations are related to DeleteBucketWebsite: // -// * DeleteBucketWebsite +// * DeleteBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html) // -// * PutBucketWebsite +// * PutBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4132,13 +4137,14 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // // To distribute large files to many people, you can save bandwidth costs by // using BitTorrent. For more information, see Amazon S3 Torrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html). -// For more information about returning the ACL of an object, see GetObjectAcl. +// For more information about returning the ACL of an object, see GetObjectAcl +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html). // // If the object you are retrieving is stored in the GLACIER or DEEP_ARCHIVE // storage classes, before you can retrieve the object you must first restore -// a copy using . Otherwise, this operation returns an InvalidObjectStateError -// error. For information about restoring archived objects, see Restoring Archived -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html). +// a copy using RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html). +// Otherwise, this operation returns an InvalidObjectStateError error. For information +// about restoring archived objects, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html). // // Encryption request headers, like x-amz-server-side-encryption, should not // be sent for GET requests if your object uses server-side encryption with @@ -4150,11 +4156,11 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // encryption keys (SSE-C) when you store the object in Amazon S3, then when // you GET the object, you must use the following headers: // -// * x-amz-server-side​-encryption​-customer-algorithm +// * x-amz-server-side-encryption-customer-algorithm // -// * x-amz-server-side​-encryption​-customer-key +// * x-amz-server-side-encryption-customer-key // -// * x-amz-server-side​-encryption​-customer-key-MD5 +// * x-amz-server-side-encryption-customer-key-MD5 // // For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided // Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). @@ -4162,6 +4168,7 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // Assuming you have permission to read object tags (permission for the s3:GetObjectVersionTagging // action), the response also returns the x-amz-tagging-count header that provides // the count of number of tags associated with the object. You can use GetObjectTagging +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) // to retrieve the tag set associated with an object. // // Permissions @@ -4186,7 +4193,7 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // as if the object was deleted and includes x-amz-delete-marker: true in the // response. // -// For more information about versioning, see PutBucketVersioning. +// For more information about versioning, see PutBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html). // // Overriding Response Header Values // @@ -4233,9 +4240,9 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // // The following operations are related to GetObject: // -// * ListBuckets +// * ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) // -// * GetObjectAcl +// * GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4324,11 +4331,11 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request // // The following operations are related to GetObjectAcl: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * DeleteObject +// * DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4652,7 +4659,7 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request // // The following operation is related to GetObjectTagging: // -// * PutObjectTagging +// * PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4738,7 +4745,7 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request // // The following operation is related to GetObjectTorrent: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4831,11 +4838,11 @@ func (c *S3) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) (req // // * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) // -// * PutPublicAccessBlock +// * PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) // -// * GetPublicAccessBlock +// * GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) // -// * DeletePublicAccessBlock +// * DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5010,11 +5017,11 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // encryption keys (SSE-C) when you store the object in Amazon S3, then when // you retrieve the metadata from the object, you must use the following headers: // -// * x-amz-server-side​-encryption​-customer-algorithm +// * x-amz-server-side-encryption-customer-algorithm // -// * x-amz-server-side​-encryption​-customer-key +// * x-amz-server-side-encryption-customer-key // -// * x-amz-server-side​-encryption​-customer-key-MD5 +// * x-amz-server-side-encryption-customer-key-MD5 // // For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided // Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). @@ -5057,7 +5064,7 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // // The following operation is related to HeadObject: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // // See http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses // for more information on returned errors. @@ -5156,11 +5163,11 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics // // The following operations are related to ListBucketAnalyticsConfigurations: // -// * GetBucketAnalyticsConfiguration +// * GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) // -// * DeleteBucketAnalyticsConfiguration +// * DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) // -// * PutBucketAnalyticsConfiguration +// * PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5256,11 +5263,11 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory // // The following operations are related to ListBucketInventoryConfigurations: // -// * GetBucketInventoryConfiguration +// * GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) // -// * DeleteBucketInventoryConfiguration +// * DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) // -// * PutBucketInventoryConfiguration +// * PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5357,11 +5364,11 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf // // The following operations are related to ListBucketMetricsConfigurations: // -// * PutBucketMetricsConfiguration +// * PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) // -// * GetBucketMetricsConfiguration +// * GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) // -// * DeleteBucketMetricsConfiguration +// * DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5540,15 +5547,15 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req // // The following operations are related to ListMultipartUploads: // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5691,13 +5698,13 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *req // // The following operations are related to ListObjectVersions: // -// * ListObjectsV2 +// * ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * DeleteObject +// * DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5835,21 +5842,22 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, // to design your application to parse the contents of the response and handle // it appropriately. // -// This API has been revised. We recommend that you use the newer version, ListObjectsV2, +// This API has been revised. We recommend that you use the newer version, ListObjectsV2 +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html), // when developing applications. For backward compatibility, Amazon S3 continues // to support ListObjects. // // The following operations are related to ListObjects: // -// * ListObjectsV2 +// * ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * ListBuckets +// * ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6003,17 +6011,18 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque // // This section describes the latest revision of the API. We recommend that // you use this revised API for application development. For backward compatibility, -// Amazon S3 continues to support the prior version of this API, ListObjects. +// Amazon S3 continues to support the prior version of this API, ListObjects +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html). // -// To get a list of your buckets, see ListBuckets. +// To get a list of your buckets, see ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html). // // The following operations are related to ListObjectsV2: // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6152,14 +6161,14 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp // // Lists the parts that have been uploaded for a specific multipart upload. // This operation must include the upload ID, which you obtain by sending the -// initiate multipart upload request (see CreateMultipartUpload). This request -// returns a maximum of 1,000 uploaded parts. The default number of parts returned -// is 1,000 parts. You can restrict the number of parts returned by specifying -// the max-parts request parameter. If your multipart upload consists of more -// than 1,000 parts, the response returns an IsTruncated field with the value -// of true, and a NextPartNumberMarker element. In subsequent ListParts requests -// you can include the part-number-marker query string parameter and set its -// value to the NextPartNumberMarker field value from the previous response. +// initiate multipart upload request (see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html)). +// This request returns a maximum of 1,000 uploaded parts. The default number +// of parts returned is 1,000 parts. You can restrict the number of parts returned +// by specifying the max-parts request parameter. If your multipart upload consists +// of more than 1,000 parts, the response returns an IsTruncated field with +// the value of true, and a NextPartNumberMarker element. In subsequent ListParts +// requests you can include the part-number-marker query string parameter and +// set its value to the NextPartNumberMarker field value from the previous response. // // For more information on multipart uploads, see Uploading Objects Using Multipart // Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). @@ -6169,15 +6178,15 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp // // The following operations are related to ListParts: // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // -// * ListMultipartUploads +// * ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6321,8 +6330,8 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // // * Suspended – Disables accelerated data transfers to the bucket. // -// The GetBucketAccelerateConfiguration operation returns the transfer acceleration -// state of a bucket. +// The GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) +// operation returns the transfer acceleration state of a bucket. // // After setting the Transfer Acceleration state of a bucket to Enabled, it // might take up to thirty minutes before the data transfer rates to the bucket @@ -6336,9 +6345,9 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // // The following operations are related to PutBucketAccelerateConfiguration: // -// * GetBucketAccelerateConfiguration +// * GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6498,11 +6507,11 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request // // Related Resources // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * DeleteBucket +// * DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) // -// * GetObjectAcl +// * GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6617,11 +6626,11 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon // // Related Resources // -// * +// * GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) // -// * +// * DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) // -// * +// * ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6738,11 +6747,11 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque // // Related Resources // -// * GetBucketCors +// * GetBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html) // -// * DeleteBucketCors +// * DeleteBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) // -// * RESTOPTIONSobject +// * RESTOPTIONSobject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6841,9 +6850,9 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *r // // Related Resources // -// * GetBucketEncryption +// * GetBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) // -// * DeleteBucketEncryption +// * DeleteBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6961,11 +6970,11 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // // Related Resources // -// * GetBucketInventoryConfiguration +// * GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) // -// * DeleteBucketInventoryConfiguration +// * DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) // -// * ListBucketInventoryConfigurations +// * ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7050,7 +7059,7 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // PutBucketLifecycle API operation for Amazon Simple Storage Service. // // -// For an updated version of this API, see PutBucketLifecycleConfiguration. +// For an updated version of this API, see PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html). // This version has been deprecated. Existing lifecycle configurations will // work. For new lifecycle configurations, use the updated API. // @@ -7086,11 +7095,11 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // // Related Resources // -// * GetBucketLifecycle(Deprecated) +// * GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html)(Deprecated) // -// * GetBucketLifecycleConfiguration +// * GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) // -// * +// * RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) // // * By default, a resource owner—in this case, a bucket owner, which is // the AWS account that created the bucket—can perform any of the operations. @@ -7189,7 +7198,7 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // Accordingly, this section describes the latest API. The previous version // of the API supported filtering based only on an object key name prefix, which // is supported for backward compatibility. For the related API description, -// see PutBucketLifecycle. +// see PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html). // // Rules // @@ -7240,9 +7249,9 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // // * Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html) // -// * GetBucketLifecycleConfiguration +// * GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) // -// * DeleteBucketLifecycle +// * DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7355,18 +7364,19 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request // For more information about server access logging, see Server Access Logging // (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html). // -// For more information about creating a bucket, see CreateBucket. For more -// information about returning the logging status of a bucket, see GetBucketLogging. +// For more information about creating a bucket, see CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html). +// For more information about returning the logging status of a bucket, see +// GetBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html). // // The following operations are related to PutBucketLogging: // -// * PutObject +// * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // -// * DeleteBucket +// * DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * GetBucketLogging +// * GetBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7458,11 +7468,11 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu // // The following operations are related to PutBucketMetricsConfiguration: // -// * DeleteBucketMetricsConfiguration +// * DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) // -// * PutBucketMetricsConfiguration +// * PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) // -// * ListBucketMetricsConfigurations +// * ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) // // GetBucketLifecycle has the following special error: // @@ -7552,7 +7562,8 @@ func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (re // PutBucketNotification API operation for Amazon Simple Storage Service. // -// No longer used, see the PutBucketNotificationConfiguration operation. +// No longer used, see the PutBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotificationConfiguration.html) +// operation. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7679,7 +7690,7 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // // The following operation is related to PutBucketNotificationConfiguration: // -// * GetBucketNotificationConfiguration +// * GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7777,9 +7788,9 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R // // The following operations are related to PutBucketPolicy: // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * DeleteBucket +// * DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7883,6 +7894,13 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // When you add the Filter element in the configuration, you must also add the // following elements: DeleteMarkerReplication, Status, and Priority. // +// The latest version of the replication configuration XML is V2. XML V2 replication +// configurations are those that contain the Filter element for rules, and rules +// that specify S3 Replication Time Control (S3 RTC). In XML V2 replication +// configurations, Amazon S3 doesn't replicate delete markers. Therefore, you +// must set the DeleteMarkerReplication element to Disabled. For backward compatibility, +// Amazon S3 continues to support the XML V1 replication configuration. +// // For information about enabling versioning on a bucket, see Using Versioning // (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html). // @@ -7901,13 +7919,14 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // replication configuration, see Replicating Objects Created with SSE Using // CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html). // -// For information on PutBucketReplication errors, see ReplicationErrorCodeList +// For information on PutBucketReplication errors, see List of replication-related +// error codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList) // // The following operations are related to PutBucketReplication: // -// * GetBucketReplication +// * GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) // -// * DeleteBucketReplication +// * DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7994,9 +8013,9 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) // // The following operations are related to PutBucketRequestPayment: // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * GetBucketRequestPayment +// * GetBucketRequestPayment (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -8114,9 +8133,9 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request // // The following operations are related to PutBucketTagging: // -// * GetBucketTagging +// * GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) // -// * DeleteBucketTagging +// * DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -8207,7 +8226,8 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r // added to the bucket receive the version ID null. // // If the versioning state has never been set on a bucket, it has no versioning -// state; a GetBucketVersioning request does not return a versioning state value. +// state; a GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) +// request does not return a versioning state value. // // If the bucket owner enables MFA Delete in the bucket versioning configuration, // the bucket owner must include the x-amz-mfa request header and the Status @@ -8224,11 +8244,11 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r // // Related Resources // -// * CreateBucket +// * CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) // -// * DeleteBucket +// * DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) // -// * GetBucketVersioning +// * GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -8503,13 +8523,14 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // // For more information about versioning, see Adding Objects to Versioning Enabled // Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html). -// For information about returning the versioning state of a bucket, see GetBucketVersioning. +// For information about returning the versioning state of a bucket, see GetBucketVersioning +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html). // // Related Resources // -// * CopyObject +// * CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) // -// * DeleteObject +// * DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -8588,8 +8609,10 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request // PutObjectAcl API operation for Amazon Simple Storage Service. // // Uses the acl subresource to set the access control list (ACL) permissions -// for an object that already exists in a bucket. You must have WRITE_ACP permission -// to set the ACL of an object. +// for an object that already exists in an S3 bucket. You must have WRITE_ACP +// permission to set the ACL of an object. For more information, see What permissions +// can I grant? (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions) +// in the Amazon Simple Storage Service Developer Guide. // // Depending on your application needs, you can choose to set the ACL on an // object using either the request body or the headers. For example, if you @@ -8666,9 +8689,9 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request // // Related Resources // -// * CopyObject +// * CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9007,7 +9030,7 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // A tag is a key-value pair. You can associate tags with an object by sending // a PUT request against the tagging subresource that is associated with the // object. You can retrieve tags by sending a GET request. For more information, -// see GetObjectTagging. +// see GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html). // // For tagging-related restrictions related to characters and encodings, see // Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html). @@ -9039,7 +9062,7 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // // Related Resources // -// * GetObjectTagging +// * GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9135,11 +9158,11 @@ func (c *S3) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req // // Related Resources // -// * GetPublicAccessBlock +// * GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) // -// * DeletePublicAccessBlock +// * DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) // -// * GetBucketPolicyStatus +// * GetBucketPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) // // * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) // @@ -9251,7 +9274,8 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) // in the Amazon Simple Storage Service Developer Guide. For more information // about the S3 structure in the request body, see the following: PutObject -// Managing Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) Managing +// Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) // in the Amazon Simple Storage Service Developer Guide Protecting Data Using // Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) // in the Amazon Simple Storage Service Developer Guide @@ -9367,7 +9391,8 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // specify in a restore request. For example, if you restore an object copy // for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes // the object in 3 days. For more information about lifecycle configuration, -// see PutBucketLifecycleConfiguration and Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) +// see PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) +// and Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) // in Amazon Simple Storage Service Developer Guide. // // Responses @@ -9394,9 +9419,9 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // // Related Resources // -// * PutBucketLifecycleConfiguration +// * PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) // -// * GetBucketNotificationConfiguration +// * GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) // // * SQL Reference for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) // in the Amazon Simple Storage Service Developer Guide @@ -9474,7 +9499,7 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r output = &SelectObjectContentOutput{} req = c.newRequest(op, input, output) - es := newSelectObjectContentEventStream() + es := NewSelectObjectContentEventStream() req.Handlers.Unmarshal.PushBack(es.setStreamCloser) output.EventStream = es @@ -9528,8 +9553,8 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // * Server-side encryption - Amazon S3 Select supports querying objects // that are protected with server-side encryption. For objects that are encrypted // with customer-provided encryption keys (SSE-C), you must use HTTPS, and -// you must use the headers that are documented in the GetObject. For more -// information about SSE-C, see Server-Side Encryption (Using Customer-Provided +// you must use the headers that are documented in the GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). +// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided // Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) // in the Amazon Simple Storage Service Developer Guide. For objects that // are encrypted with Amazon S3 managed encryption keys (SSE-S3) and customer @@ -9543,16 +9568,18 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // // Given the response size is unknown, Amazon S3 Select streams the response // as a series of messages and includes a Transfer-Encoding header with chunked -// as its value in the response. For more information, see RESTSelectObjectAppendix . +// as its value in the response. For more information, see Appendix: SelectObjectContent +// Response (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html) . // // GetObject Support // // The SelectObjectContent operation does not support the following GetObject -// functionality. For more information, see GetObject. +// functionality. For more information, see GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). // // * Range: Although you can specify a scan range for an Amazon S3 Select -// request (see SelectObjectContentRequest$ScanRange in the request parameters), -// you cannot specify the range of bytes of an object to return. +// request (see SelectObjectContentRequest - ScanRange (https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange) +// in the request parameters), you cannot specify the range of bytes of an +// object to return. // // * GLACIER, DEEP_ARCHIVE and REDUCED_REDUNDANCY storage classes: You cannot // specify the GLACIER, DEEP_ARCHIVE, or REDUCED_REDUNDANCY storage classes. @@ -9561,15 +9588,16 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // // Special Errors // -// For a list of special errors for this operation, see SelectObjectContentErrorCodeList +// For a list of special errors for this operation, see List of SELECT Object +// Content Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList) // // Related Resources // -// * GetObject +// * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // -// * GetBucketLifecycleConfiguration +// * GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) // -// * PutBucketLifecycleConfiguration +// * PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9599,7 +9627,13 @@ func (c *S3) SelectObjectContentWithContext(ctx aws.Context, input *SelectObject return out, req.Send() } +var _ awserr.Error + // SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent. +// +// For testing and mocking the event stream this type should be initialized via +// the NewSelectObjectContentEventStream constructor function. Using the functional options +// to pass in nested mock behavior. type SelectObjectContentEventStream struct { // Reader is the EventStream reader for the SelectObjectContentEventStream @@ -9622,11 +9656,31 @@ type SelectObjectContentEventStream struct { err *eventstreamapi.OnceError } -func newSelectObjectContentEventStream() *SelectObjectContentEventStream { - return &SelectObjectContentEventStream{ +// NewSelectObjectContentEventStream initializes an SelectObjectContentEventStream. +// This function should only be used for testing and mocking the SelectObjectContentEventStream +// stream within your application. +// +// The Reader member must be set before reading events from the stream. +// +// The StreamCloser member should be set to the underlying io.Closer, +// (e.g. http.Response.Body), that will be closed when the stream Close method +// is called. +// +// es := NewSelectObjectContentEventStream(func(o *SelectObjectContentEventStream{ +// es.Reader = myMockStreamReader +// es.StreamCloser = myMockStreamCloser +// }) +func NewSelectObjectContentEventStream(opts ...func(*SelectObjectContentEventStream)) *SelectObjectContentEventStream { + es := &SelectObjectContentEventStream{ done: make(chan struct{}), err: eventstreamapi.NewOnceError(), } + + for _, fn := range opts { + fn(es) + } + + return es } func (es *SelectObjectContentEventStream) setStreamCloser(r *request.Request) { @@ -9673,6 +9727,7 @@ func (es *SelectObjectContentEventStream) waitStreamPartClose() { // * ProgressEvent // * RecordsEvent // * StatsEvent +// * SelectObjectContentEventStreamUnknownEvent func (es *SelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { return es.Reader.Events() } @@ -9789,12 +9844,13 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // In this operation, you provide part data in your request. However, you have // an option to specify your existing Amazon S3 object as a data source for // the part you are uploading. To upload a part from an existing object, you -// use the UploadPartCopy operation. +// use the UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) +// operation. // -// You must initiate a multipart upload (see CreateMultipartUpload) before you -// can upload any part. In response to your initiate request, Amazon S3 returns -// an upload ID, a unique identifier, that you must include in your upload part -// request. +// You must initiate a multipart upload (see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html)) +// before you can upload any part. In response to your initiate request, Amazon +// S3 returns an upload ID, a unique identifier, that you must include in your +// upload part request. // // Part numbers can be any number from 1 to 10,000, inclusive. A part number // uniquely identifies a part and also defines its position within the object @@ -9828,25 +9884,25 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // key, or you can use the AWS managed encryption keys. If you choose to provide // your own encryption key, the request headers you provide in the request must // match the headers you used in the request to initiate the upload by using -// CreateMultipartUpload. For more information, go to Using Server-Side Encryption -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) +// CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html). +// For more information, go to Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) // in the Amazon Simple Storage Service Developer Guide. // // Server-side encryption is supported by the S3 Multipart Upload actions. Unless // you are using a customer-provided encryption key, you don't need to specify // the encryption parameters in each UploadPart request. Instead, you only need // to specify the server-side encryption parameters in the initial Initiate -// Multipart request. For more information, see CreateMultipartUpload. +// Multipart request. For more information, see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html). // // If you requested server-side encryption using a customer-provided encryption // key in your initiate multipart upload request, you must provide identical // encryption information in each part upload using the following headers. // -// * x-amz-server-side​-encryption​-customer-algorithm +// * x-amz-server-side-encryption-customer-algorithm // -// * x-amz-server-side​-encryption​-customer-key +// * x-amz-server-side-encryption-customer-key // -// * x-amz-server-side​-encryption​-customer-key-MD5 +// * x-amz-server-side-encryption-customer-key-MD5 // // Special Errors // @@ -9857,15 +9913,15 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // // Related Resources // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * ListMultipartUploads +// * ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9949,7 +10005,8 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // in the Amazon Simple Storage Service Developer Guide. // // Instead of using an existing object as part data, you might use the UploadPart -// operation and provide data in your request. +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) operation +// and provide data in your request. // // You must initiate a multipart upload before you can upload any part. In response // to your initiate request. Amazon S3 returns a unique identifier, the upload @@ -9970,8 +10027,8 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // in the Amazon Simple Storage Service Developer Guide. // // * For information about using server-side encryption with customer-provided -// encryption keys with the UploadPartCopy operation, see CopyObject and -// UploadPart. +// encryption keys with the UploadPartCopy operation, see CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) +// and UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html). // // Note the following additional considerations about the request headers x-amz-copy-source-if-match, // x-amz-copy-source-if-none-match, x-amz-copy-source-if-unmodified-since, and @@ -10016,17 +10073,17 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // // Related Resources // -// * CreateMultipartUpload +// * CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) // -// * UploadPart +// * UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // -// * CompleteMultipartUpload +// * CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) // -// * AbortMultipartUpload +// * AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) // -// * ListParts +// * ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) // -// * ListMultipartUploads +// * ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -10100,6 +10157,11 @@ type AbortMultipartUploadInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Key of the object for which the multipart upload was initiated. // // Key is a required field @@ -10166,6 +10228,12 @@ func (s *AbortMultipartUploadInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *AbortMultipartUploadInput) SetExpectedBucketOwner(v string) *AbortMultipartUploadInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *AbortMultipartUploadInput) SetKey(v string) *AbortMultipartUploadInput { s.Key = &v @@ -11206,6 +11274,11 @@ type CompleteMultipartUploadInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Object key for which the multipart upload was initiated. // // Key is a required field @@ -11275,6 +11348,12 @@ func (s *CompleteMultipartUploadInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *CompleteMultipartUploadInput) SetExpectedBucketOwner(v string) *CompleteMultipartUploadInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput { s.Key = &v @@ -11558,6 +11637,8 @@ func (s *ContinuationEvent) UnmarshalEvent( return nil } +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. func (s *ContinuationEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) return msg, err @@ -11591,8 +11672,30 @@ type CopyObjectInput struct { // A standard MIME type describing the format of the object data. ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - // The name of the source bucket and key name of the source object, separated - // by a slash (/). Must be URL-encoded. + // Specifies the source object for the copy operation. You specify the value + // in one of two formats, depending on whether you want to access the source + // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html): + // + // * For objects not accessed through an access point, specify the name of + // the source bucket and the key of the source object, separated by a slash + // (/). For example, to copy the object reports/january.pdf from the bucket + // awsexamplebucket, use awsexamplebucket/reports/january.pdf. The value + // must be URL encoded. + // + // * For objects accessed through access points, specify the Amazon Resource + // Name (ARN) of the object as accessed through the access point, in the + // format arn:aws:s3:::accesspoint//object/. + // For example, to copy the object reports/january.pdf through access point + // my-access-point owned by account 123456789012 in Region us-west-2, use + // the URL encoding of arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf. + // The value must be URL encoded. Amazon S3 supports copy operations using + // access points only when the source and destination buckets are in the + // same AWS Region. + // + // To copy a specific version of an object, append ?versionId= to + // the value (for example, awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893). + // If you don't specify a version ID, Amazon S3 copies the latest version of + // the source object. // // CopySource is a required field CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` @@ -11624,6 +11727,16 @@ type CopyObjectInput struct { // encryption key was transmitted without error. CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` + // The account id of the expected destination bucket owner. If the destination + // bucket is owned by a different account, the request will fail with an HTTP + // 403 (Access Denied) error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + + // The account id of the expected source bucket owner. If the source bucket + // is owned by a different account, the request will fail with an HTTP 403 (Access + // Denied) error. + ExpectedSourceBucketOwner *string `location:"header" locationName:"x-amz-source-expected-bucket-owner" type:"string"` + // The date and time at which the object is no longer cacheable. Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` @@ -11674,7 +11787,7 @@ type CopyObjectInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -11857,6 +11970,18 @@ func (s *CopyObjectInput) SetCopySourceSSECustomerKeyMD5(v string) *CopyObjectIn return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *CopyObjectInput) SetExpectedBucketOwner(v string) *CopyObjectInput { + s.ExpectedBucketOwner = &v + return s +} + +// SetExpectedSourceBucketOwner sets the ExpectedSourceBucketOwner field's value. +func (s *CopyObjectInput) SetExpectedSourceBucketOwner(v string) *CopyObjectInput { + s.ExpectedSourceBucketOwner = &v + return s +} + // SetExpires sets the Expires field's value. func (s *CopyObjectInput) SetExpires(v time.Time) *CopyObjectInput { s.Expires = &v @@ -12391,6 +12516,11 @@ type CreateMultipartUploadInput struct { // A standard MIME type describing the format of the object data. ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The date and time at which the object is no longer cacheable. Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` @@ -12437,7 +12567,7 @@ type CreateMultipartUploadInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -12556,6 +12686,12 @@ func (s *CreateMultipartUploadInput) SetContentType(v string) *CreateMultipartUp return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *CreateMultipartUploadInput) SetExpectedBucketOwner(v string) *CreateMultipartUploadInput { + s.ExpectedBucketOwner = &v + return s +} + // SetExpires sets the Expires field's value. func (s *CreateMultipartUploadInput) SetExpires(v time.Time) *CreateMultipartUploadInput { s.Expires = &v @@ -12955,6 +13091,11 @@ type DeleteBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID that identifies the analytics configuration. // // Id is a required field @@ -13003,6 +13144,12 @@ func (s *DeleteBucketAnalyticsConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketAnalyticsConfigurationInput) SetExpectedBucketOwner(v string) *DeleteBucketAnalyticsConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketAnalyticsConfigurationInput { s.Id = &v @@ -13044,6 +13191,11 @@ type DeleteBucketCorsInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13085,6 +13237,12 @@ func (s *DeleteBucketCorsInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketCorsInput) SetExpectedBucketOwner(v string) *DeleteBucketCorsInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketCorsInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13121,6 +13279,11 @@ type DeleteBucketEncryptionInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13162,6 +13325,12 @@ func (s *DeleteBucketEncryptionInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketEncryptionInput) SetExpectedBucketOwner(v string) *DeleteBucketEncryptionInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13197,6 +13366,11 @@ type DeleteBucketInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13238,6 +13412,12 @@ func (s *DeleteBucketInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketInput) SetExpectedBucketOwner(v string) *DeleteBucketInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13260,6 +13440,11 @@ type DeleteBucketInventoryConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID used to identify the inventory configuration. // // Id is a required field @@ -13308,6 +13493,12 @@ func (s *DeleteBucketInventoryConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketInventoryConfigurationInput) SetExpectedBucketOwner(v string) *DeleteBucketInventoryConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketInventoryConfigurationInput { s.Id = &v @@ -13349,6 +13540,11 @@ type DeleteBucketLifecycleInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13390,6 +13586,12 @@ func (s *DeleteBucketLifecycleInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketLifecycleInput) SetExpectedBucketOwner(v string) *DeleteBucketLifecycleInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13426,6 +13628,11 @@ type DeleteBucketMetricsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID used to identify the metrics configuration. // // Id is a required field @@ -13474,6 +13681,12 @@ func (s *DeleteBucketMetricsConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketMetricsConfigurationInput) SetExpectedBucketOwner(v string) *DeleteBucketMetricsConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMetricsConfigurationInput { s.Id = &v @@ -13529,6 +13742,11 @@ type DeleteBucketPolicyInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13570,6 +13788,12 @@ func (s *DeleteBucketPolicyInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketPolicyInput) SetExpectedBucketOwner(v string) *DeleteBucketPolicyInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketPolicyInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13605,6 +13829,11 @@ type DeleteBucketReplicationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13646,6 +13875,12 @@ func (s *DeleteBucketReplicationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketReplicationInput) SetExpectedBucketOwner(v string) *DeleteBucketReplicationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketReplicationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13681,6 +13916,11 @@ type DeleteBucketTaggingInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13722,6 +13962,12 @@ func (s *DeleteBucketTaggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketTaggingInput) SetExpectedBucketOwner(v string) *DeleteBucketTaggingInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketTaggingInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13757,6 +14003,11 @@ type DeleteBucketWebsiteInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -13798,6 +14049,12 @@ func (s *DeleteBucketWebsiteInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteBucketWebsiteInput) SetExpectedBucketOwner(v string) *DeleteBucketWebsiteInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeleteBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -13943,6 +14200,11 @@ type DeleteObjectInput struct { // to process this operation. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Key name of the object to delete. // // Key is a required field @@ -14016,6 +14278,12 @@ func (s *DeleteObjectInput) SetBypassGovernanceRetention(v bool) *DeleteObjectIn return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteObjectInput) SetExpectedBucketOwner(v string) *DeleteObjectInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *DeleteObjectInput) SetKey(v string) *DeleteObjectInput { s.Key = &v @@ -14113,7 +14381,12 @@ type DeleteObjectTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Name of the tag. + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + + // Name of the object key. // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -14167,6 +14440,12 @@ func (s *DeleteObjectTaggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteObjectTaggingInput) SetExpectedBucketOwner(v string) *DeleteObjectTaggingInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *DeleteObjectTaggingInput) SetKey(v string) *DeleteObjectTaggingInput { s.Key = &v @@ -14241,6 +14520,11 @@ type DeleteObjectsInput struct { // Delete is a required field Delete *Delete `locationName:"Delete" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The concatenation of the authentication device's serial number, a space, // and the value that is displayed on your authentication device. Required to // permanently delete a versioned object if versioning is configured with MFA @@ -14314,6 +14598,12 @@ func (s *DeleteObjectsInput) SetDelete(v *Delete) *DeleteObjectsInput { return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeleteObjectsInput) SetExpectedBucketOwner(v string) *DeleteObjectsInput { + s.ExpectedBucketOwner = &v + return s +} + // SetMFA sets the MFA field's value. func (s *DeleteObjectsInput) SetMFA(v string) *DeleteObjectsInput { s.MFA = &v @@ -14391,6 +14681,11 @@ type DeletePublicAccessBlockInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -14432,6 +14727,12 @@ func (s *DeletePublicAccessBlockInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *DeletePublicAccessBlockInput) SetExpectedBucketOwner(v string) *DeletePublicAccessBlockInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *DeletePublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -14774,6 +15075,8 @@ func (s *EndEvent) UnmarshalEvent( return nil } +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. func (s *EndEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) return msg, err @@ -15311,6 +15614,11 @@ type GetBucketAccelerateConfigurationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -15352,6 +15660,12 @@ func (s *GetBucketAccelerateConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketAccelerateConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketAccelerateConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketAccelerateConfigurationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -15396,6 +15710,11 @@ type GetBucketAclInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -15437,6 +15756,12 @@ func (s *GetBucketAclInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketAclInput) SetExpectedBucketOwner(v string) *GetBucketAclInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketAclInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -15491,6 +15816,11 @@ type GetBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID that identifies the analytics configuration. // // Id is a required field @@ -15539,6 +15869,12 @@ func (s *GetBucketAnalyticsConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketAnalyticsConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketAnalyticsConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput { s.Id = &v @@ -15589,6 +15925,11 @@ type GetBucketCorsInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -15630,6 +15971,12 @@ func (s *GetBucketCorsInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketCorsInput) SetExpectedBucketOwner(v string) *GetBucketCorsInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketCorsInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -15676,6 +16023,11 @@ type GetBucketEncryptionInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -15717,6 +16069,12 @@ func (s *GetBucketEncryptionInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketEncryptionInput) SetExpectedBucketOwner(v string) *GetBucketEncryptionInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -15762,6 +16120,11 @@ type GetBucketInventoryConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID used to identify the inventory configuration. // // Id is a required field @@ -15810,6 +16173,12 @@ func (s *GetBucketInventoryConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketInventoryConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketInventoryConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInventoryConfigurationInput { s.Id = &v @@ -15860,6 +16229,11 @@ type GetBucketLifecycleConfigurationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -15901,6 +16275,12 @@ func (s *GetBucketLifecycleConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketLifecycleConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketLifecycleConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketLifecycleConfigurationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -15945,6 +16325,11 @@ type GetBucketLifecycleInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -15986,6 +16371,12 @@ func (s *GetBucketLifecycleInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketLifecycleInput) SetExpectedBucketOwner(v string) *GetBucketLifecycleInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16030,6 +16421,11 @@ type GetBucketLocationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16071,6 +16467,12 @@ func (s *GetBucketLocationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketLocationInput) SetExpectedBucketOwner(v string) *GetBucketLocationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketLocationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16117,6 +16519,11 @@ type GetBucketLoggingInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16158,6 +16565,12 @@ func (s *GetBucketLoggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketLoggingInput) SetExpectedBucketOwner(v string) *GetBucketLoggingInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketLoggingInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16206,6 +16619,11 @@ type GetBucketMetricsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID used to identify the metrics configuration. // // Id is a required field @@ -16254,6 +16672,12 @@ func (s *GetBucketMetricsConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketMetricsConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketMetricsConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsConfigurationInput { s.Id = &v @@ -16304,6 +16728,11 @@ type GetBucketNotificationConfigurationRequest struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16345,6 +16774,12 @@ func (s *GetBucketNotificationConfigurationRequest) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketNotificationConfigurationRequest) SetExpectedBucketOwner(v string) *GetBucketNotificationConfigurationRequest { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketNotificationConfigurationRequest) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16366,6 +16801,11 @@ type GetBucketPolicyInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16407,6 +16847,12 @@ func (s *GetBucketPolicyInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketPolicyInput) SetExpectedBucketOwner(v string) *GetBucketPolicyInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketPolicyInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16451,6 +16897,11 @@ type GetBucketPolicyStatusInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16492,6 +16943,12 @@ func (s *GetBucketPolicyStatusInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketPolicyStatusInput) SetExpectedBucketOwner(v string) *GetBucketPolicyStatusInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketPolicyStatusInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16536,6 +16993,11 @@ type GetBucketReplicationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16577,6 +17039,12 @@ func (s *GetBucketReplicationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketReplicationInput) SetExpectedBucketOwner(v string) *GetBucketReplicationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketReplicationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16622,6 +17090,11 @@ type GetBucketRequestPaymentInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16663,6 +17136,12 @@ func (s *GetBucketRequestPaymentInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketRequestPaymentInput) SetExpectedBucketOwner(v string) *GetBucketRequestPaymentInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketRequestPaymentInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16707,6 +17186,11 @@ type GetBucketTaggingInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16748,6 +17232,12 @@ func (s *GetBucketTaggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketTaggingInput) SetExpectedBucketOwner(v string) *GetBucketTaggingInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketTaggingInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16794,6 +17284,11 @@ type GetBucketVersioningInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16835,6 +17330,12 @@ func (s *GetBucketVersioningInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketVersioningInput) SetExpectedBucketOwner(v string) *GetBucketVersioningInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketVersioningInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -16890,6 +17391,11 @@ type GetBucketWebsiteInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -16931,6 +17437,12 @@ func (s *GetBucketWebsiteInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetBucketWebsiteInput) SetExpectedBucketOwner(v string) *GetBucketWebsiteInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -17011,6 +17523,11 @@ type GetObjectAclInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The key of the object for which to get the ACL information. // // Key is a required field @@ -17072,6 +17589,12 @@ func (s *GetObjectAclInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectAclInput) SetExpectedBucketOwner(v string) *GetObjectAclInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *GetObjectAclInput) SetKey(v string) *GetObjectAclInput { s.Key = &v @@ -17161,6 +17684,11 @@ type GetObjectInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Return the object only if its entity tag (ETag) is the same as the one specified, // otherwise return a 412 (precondition failed). IfMatch *string `location:"header" locationName:"If-Match" type:"string"` @@ -17226,7 +17754,7 @@ type GetObjectInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -17284,6 +17812,12 @@ func (s *GetObjectInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectInput) SetExpectedBucketOwner(v string) *GetObjectInput { + s.ExpectedBucketOwner = &v + return s +} + // SetIfMatch sets the IfMatch field's value. func (s *GetObjectInput) SetIfMatch(v string) *GetObjectInput { s.IfMatch = &v @@ -17429,6 +17963,11 @@ type GetObjectLegalHoldInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The key name for the object whose Legal Hold status you want to retrieve. // // Key is a required field @@ -17490,6 +18029,12 @@ func (s *GetObjectLegalHoldInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectLegalHoldInput) SetExpectedBucketOwner(v string) *GetObjectLegalHoldInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *GetObjectLegalHoldInput) SetKey(v string) *GetObjectLegalHoldInput { s.Key = &v @@ -17552,6 +18097,11 @@ type GetObjectLockConfigurationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -17593,6 +18143,12 @@ func (s *GetObjectLockConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectLockConfigurationInput) SetExpectedBucketOwner(v string) *GetObjectLockConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetObjectLockConfigurationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -17967,6 +18523,11 @@ type GetObjectRetentionInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The key name for the object whose retention settings you want to retrieve. // // Key is a required field @@ -18028,6 +18589,12 @@ func (s *GetObjectRetentionInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectRetentionInput) SetExpectedBucketOwner(v string) *GetObjectRetentionInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *GetObjectRetentionInput) SetKey(v string) *GetObjectRetentionInput { s.Key = &v @@ -18098,6 +18665,11 @@ type GetObjectTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Object key for which to get the tagging information. // // Key is a required field @@ -18152,6 +18724,12 @@ func (s *GetObjectTaggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectTaggingInput) SetExpectedBucketOwner(v string) *GetObjectTaggingInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { s.Key = &v @@ -18221,6 +18799,11 @@ type GetObjectTorrentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The object key for which to get the information. // // Key is a required field @@ -18279,6 +18862,12 @@ func (s *GetObjectTorrentInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetObjectTorrentInput) SetExpectedBucketOwner(v string) *GetObjectTorrentInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *GetObjectTorrentInput) SetKey(v string) *GetObjectTorrentInput { s.Key = &v @@ -18346,6 +18935,11 @@ type GetPublicAccessBlockInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -18387,6 +18981,12 @@ func (s *GetPublicAccessBlockInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *GetPublicAccessBlockInput) SetExpectedBucketOwner(v string) *GetPublicAccessBlockInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *GetPublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -18617,6 +19217,11 @@ type HeadBucketInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -18658,6 +19263,12 @@ func (s *HeadBucketInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *HeadBucketInput) SetExpectedBucketOwner(v string) *HeadBucketInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *HeadBucketInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -18694,6 +19305,11 @@ type HeadObjectInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Return the object only if its entity tag (ETag) is the same as the one specified, // otherwise return a 412 (precondition failed). IfMatch *string `location:"header" locationName:"If-Match" type:"string"` @@ -18741,7 +19357,7 @@ type HeadObjectInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -18799,6 +19415,12 @@ func (s *HeadObjectInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *HeadObjectInput) SetExpectedBucketOwner(v string) *HeadObjectInput { + s.ExpectedBucketOwner = &v + return s +} + // SetIfMatch sets the IfMatch field's value. func (s *HeadObjectInput) SetIfMatch(v string) *HeadObjectInput { s.IfMatch = &v @@ -19002,7 +19624,8 @@ type HeadObjectOutput struct { // If the object is an archived object (an object whose storage class is GLACIER), // the response includes this header if either the archive restoration is in - // progress (see RestoreObject or an archive copy is already restored. + // progress (see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) + // or an archive copy is already restored. // // If an archive copy is already restored, the header value indicates when Amazon // S3 is scheduled to delete the object copy. For example: @@ -20279,6 +20902,11 @@ type ListBucketAnalyticsConfigurationsInput struct { // The ContinuationToken that represents a placeholder from where this request // should begin. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -20326,6 +20954,12 @@ func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListBucketAnalyticsConfigurationsInput) SetExpectedBucketOwner(v string) *ListBucketAnalyticsConfigurationsInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *ListBucketAnalyticsConfigurationsInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -20408,6 +21042,11 @@ type ListBucketInventoryConfigurationsInput struct { // response to continue the listing. The continuation token is an opaque value // that Amazon S3 understands. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -20455,6 +21094,12 @@ func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListBucketInventoryConfigurationsInput) SetExpectedBucketOwner(v string) *ListBucketInventoryConfigurationsInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *ListBucketInventoryConfigurationsInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -20537,6 +21182,11 @@ type ListBucketMetricsConfigurationsInput struct { // list response to continue the listing. The continuation token is an opaque // value that Amazon S3 understands. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -20584,6 +21234,12 @@ func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *L return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListBucketMetricsConfigurationsInput) SetExpectedBucketOwner(v string) *ListBucketMetricsConfigurationsInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *ListBucketMetricsConfigurationsInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -20733,6 +21389,11 @@ type ListMultipartUploadsInput struct { // keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Together with upload-id-marker, this parameter specifies the multipart upload // after which listing should begin. // @@ -20814,6 +21475,12 @@ func (s *ListMultipartUploadsInput) SetEncodingType(v string) *ListMultipartUplo return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListMultipartUploadsInput) SetExpectedBucketOwner(v string) *ListMultipartUploadsInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKeyMarker sets the KeyMarker field's value. func (s *ListMultipartUploadsInput) SetKeyMarker(v string) *ListMultipartUploadsInput { s.KeyMarker = &v @@ -21028,6 +21695,11 @@ type ListObjectVersionsInput struct { // keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Specifies the key to start with when listing objects in a bucket. KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` @@ -21101,6 +21773,12 @@ func (s *ListObjectVersionsInput) SetEncodingType(v string) *ListObjectVersionsI return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListObjectVersionsInput) SetExpectedBucketOwner(v string) *ListObjectVersionsInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKeyMarker sets the KeyMarker field's value. func (s *ListObjectVersionsInput) SetKeyMarker(v string) *ListObjectVersionsInput { s.KeyMarker = &v @@ -21310,6 +21988,11 @@ type ListObjectsInput struct { // keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Specifies the key to start with when listing objects in a bucket. Marker *string `location:"querystring" locationName:"marker" type:"string"` @@ -21378,6 +22061,12 @@ func (s *ListObjectsInput) SetEncodingType(v string) *ListObjectsInput { return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListObjectsInput) SetExpectedBucketOwner(v string) *ListObjectsInput { + s.ExpectedBucketOwner = &v + return s +} + // SetMarker sets the Marker field's value. func (s *ListObjectsInput) SetMarker(v string) *ListObjectsInput { s.Marker = &v @@ -21467,7 +22156,7 @@ type ListObjectsOutput struct { // is true), you can use the key name in this field as marker in the subsequent // request to get next set of objects. Amazon S3 lists objects in alphabetical // order Note: This element is returned only if you have delimiter request parameter - // specified. If response does not include the NextMaker and it is truncated, + // specified. If response does not include the NextMarker and it is truncated, // you can use the value of the last Key in the response as the marker in the // subsequent request to get the next set of object keys. NextMarker *string `type:"string"` @@ -21572,6 +22261,11 @@ type ListObjectsV2Input struct { // Encoding type used by Amazon S3 to encode object keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The owner field is not present in listV2 by default, if you want to return // owner field with each key in the result then set the fetch owner field to // true. @@ -21652,6 +22346,12 @@ func (s *ListObjectsV2Input) SetEncodingType(v string) *ListObjectsV2Input { return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListObjectsV2Input) SetExpectedBucketOwner(v string) *ListObjectsV2Input { + s.ExpectedBucketOwner = &v + return s +} + // SetFetchOwner sets the FetchOwner field's value. func (s *ListObjectsV2Input) SetFetchOwner(v bool) *ListObjectsV2Input { s.FetchOwner = &v @@ -21873,6 +22573,11 @@ type ListPartsInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Object key for which the multipart upload was initiated. // // Key is a required field @@ -21946,6 +22651,12 @@ func (s *ListPartsInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *ListPartsInput) SetExpectedBucketOwner(v string) *ListPartsInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *ListPartsInput) SetKey(v string) *ListPartsInput { s.Key = &v @@ -22947,8 +23658,22 @@ func (s *NotificationConfigurationFilter) SetKey(v *KeyFilter) *NotificationConf type Object struct { _ struct{} `type:"structure"` - // The entity tag is an MD5 hash of the object. ETag reflects only changes to - // the contents of an object, not its metadata. + // The entity tag is a hash of the object. The ETag reflects changes only to + // the contents of an object, not its metadata. The ETag may or may not be an + // MD5 digest of the object data. Whether or not it is depends on how the object + // was created and how it is encrypted as described below: + // + // * Objects created by the PUT Object, POST Object, or Copy operation, or + // through the AWS Management Console, and are encrypted by SSE-S3 or plaintext, + // have ETags that are an MD5 digest of their object data. + // + // * Objects created by the PUT Object, POST Object, or Copy operation, or + // through the AWS Management Console, and are encrypted by SSE-C or SSE-KMS, + // have ETags that are not an MD5 digest of their object data. + // + // * If an object is created by either the Multipart Upload or Part Copy + // operation, the ETag is not an MD5 digest, regardless of the method of + // encryption. ETag *string `type:"string"` // The name that you assign to an object. You use the object key to retrieve @@ -23548,6 +24273,8 @@ func (s *ProgressEvent) UnmarshalEvent( return nil } +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. func (s *ProgressEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) var buf bytes.Buffer @@ -23652,6 +24379,11 @@ type PutBucketAccelerateConfigurationInput struct { // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -23702,6 +24434,12 @@ func (s *PutBucketAccelerateConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketAccelerateConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketAccelerateConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *PutBucketAccelerateConfigurationInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -23744,6 +24482,11 @@ type PutBucketAclInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Allows grantee the read, write, read ACP, and write ACP permissions on the // bucket. GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` @@ -23817,6 +24560,12 @@ func (s *PutBucketAclInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketAclInput) SetExpectedBucketOwner(v string) *PutBucketAclInput { + s.ExpectedBucketOwner = &v + return s +} + // SetGrantFullControl sets the GrantFullControl field's value. func (s *PutBucketAclInput) SetGrantFullControl(v string) *PutBucketAclInput { s.GrantFullControl = &v @@ -23888,6 +24637,11 @@ type PutBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID that identifies the analytics configuration. // // Id is a required field @@ -23950,6 +24704,12 @@ func (s *PutBucketAnalyticsConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketAnalyticsConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketAnalyticsConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput { s.Id = &v @@ -23999,6 +24759,11 @@ type PutBucketCorsInput struct { // // CORSConfiguration is a required field CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -24054,7 +24819,13 @@ func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBuck return s } -func (s *PutBucketCorsInput) getEndpointARN() (arn.Resource, error) { +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketCorsInput) SetExpectedBucketOwner(v string) *PutBucketCorsInput { + s.ExpectedBucketOwner = &v + return s +} + +func (s *PutBucketCorsInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") } @@ -24094,6 +24865,11 @@ type PutBucketEncryptionInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Specifies the default server-side-encryption configuration. // // ServerSideEncryptionConfiguration is a required field @@ -24147,6 +24923,12 @@ func (s *PutBucketEncryptionInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketEncryptionInput) SetExpectedBucketOwner(v string) *PutBucketEncryptionInput { + s.ExpectedBucketOwner = &v + return s +} + // SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. func (s *PutBucketEncryptionInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *PutBucketEncryptionInput { s.ServerSideEncryptionConfiguration = v @@ -24189,6 +24971,11 @@ type PutBucketInventoryConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID used to identify the inventory configuration. // // Id is a required field @@ -24250,6 +25037,12 @@ func (s *PutBucketInventoryConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketInventoryConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketInventoryConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *PutBucketInventoryConfigurationInput) SetId(v string) *PutBucketInventoryConfigurationInput { s.Id = &v @@ -24298,6 +25091,11 @@ type PutBucketLifecycleConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Container for lifecycle rules. You can add as many as 1,000 rules. LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -24346,6 +25144,12 @@ func (s *PutBucketLifecycleConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketLifecycleConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketLifecycleConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetLifecycleConfiguration sets the LifecycleConfiguration field's value. func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *BucketLifecycleConfiguration) *PutBucketLifecycleConfigurationInput { s.LifecycleConfiguration = v @@ -24386,6 +25190,11 @@ type PutBucketLifecycleInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Container for lifecycle rules. You can add as many as 1000 rules. LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -24434,6 +25243,12 @@ func (s *PutBucketLifecycleInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketLifecycleInput) SetExpectedBucketOwner(v string) *PutBucketLifecycleInput { + s.ExpectedBucketOwner = &v + return s +} + // SetLifecycleConfiguration sets the LifecycleConfiguration field's value. func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfiguration) *PutBucketLifecycleInput { s.LifecycleConfiguration = v @@ -24480,6 +25295,11 @@ type PutBucketLoggingInput struct { // // BucketLoggingStatus is a required field BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` } // String returns the string representation @@ -24535,6 +25355,12 @@ func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) * return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketLoggingInput) SetExpectedBucketOwner(v string) *PutBucketLoggingInput { + s.ExpectedBucketOwner = &v + return s +} + func (s *PutBucketLoggingInput) getEndpointARN() (arn.Resource, error) { if s.Bucket == nil { return nil, fmt.Errorf("member Bucket is nil") @@ -24571,6 +25397,11 @@ type PutBucketMetricsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The ID used to identify the metrics configuration. // // Id is a required field @@ -24632,6 +25463,12 @@ func (s *PutBucketMetricsConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketMetricsConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketMetricsConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetId sets the Id field's value. func (s *PutBucketMetricsConfigurationInput) SetId(v string) *PutBucketMetricsConfigurationInput { s.Id = &v @@ -24680,6 +25517,11 @@ type PutBucketNotificationConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // A container for specifying the notification configuration of the bucket. // If this element is empty, notifications are turned off for the bucket. // @@ -24734,6 +25576,12 @@ func (s *PutBucketNotificationConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketNotificationConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketNotificationConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetNotificationConfiguration sets the NotificationConfiguration field's value. func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v *NotificationConfiguration) *PutBucketNotificationConfigurationInput { s.NotificationConfiguration = v @@ -24776,6 +25624,11 @@ type PutBucketNotificationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The container for the configuration. // // NotificationConfiguration is a required field @@ -24824,6 +25677,12 @@ func (s *PutBucketNotificationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketNotificationInput) SetExpectedBucketOwner(v string) *PutBucketNotificationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetNotificationConfiguration sets the NotificationConfiguration field's value. func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput { s.NotificationConfiguration = v @@ -24870,6 +25729,11 @@ type PutBucketPolicyInput struct { // to change this bucket policy in the future. ConfirmRemoveSelfBucketAccess *bool `location:"header" locationName:"x-amz-confirm-remove-self-bucket-access" type:"boolean"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The bucket policy as a JSON document. // // Policy is a required field @@ -24924,6 +25788,12 @@ func (s *PutBucketPolicyInput) SetConfirmRemoveSelfBucketAccess(v bool) *PutBuck return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketPolicyInput) SetExpectedBucketOwner(v string) *PutBucketPolicyInput { + s.ExpectedBucketOwner = &v + return s +} + // SetPolicy sets the Policy field's value. func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { s.Policy = &v @@ -24966,6 +25836,11 @@ type PutBucketReplicationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // A container for replication rules. You can add up to 1,000 rules. The maximum // size of a replication configuration is 2 MB. // @@ -25022,6 +25897,12 @@ func (s *PutBucketReplicationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketReplicationInput) SetExpectedBucketOwner(v string) *PutBucketReplicationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetReplicationConfiguration sets the ReplicationConfiguration field's value. func (s *PutBucketReplicationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutBucketReplicationInput { s.ReplicationConfiguration = v @@ -25070,6 +25951,11 @@ type PutBucketRequestPaymentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Container for Payer. // // RequestPaymentConfiguration is a required field @@ -25123,6 +26009,12 @@ func (s *PutBucketRequestPaymentInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketRequestPaymentInput) SetExpectedBucketOwner(v string) *PutBucketRequestPaymentInput { + s.ExpectedBucketOwner = &v + return s +} + // SetRequestPaymentConfiguration sets the RequestPaymentConfiguration field's value. func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *RequestPaymentConfiguration) *PutBucketRequestPaymentInput { s.RequestPaymentConfiguration = v @@ -25165,6 +26057,11 @@ type PutBucketTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Container for the TagSet and Tag elements. // // Tagging is a required field @@ -25218,6 +26115,12 @@ func (s *PutBucketTaggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketTaggingInput) SetExpectedBucketOwner(v string) *PutBucketTaggingInput { + s.ExpectedBucketOwner = &v + return s +} + // SetTagging sets the Tagging field's value. func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { s.Tagging = v @@ -25260,6 +26163,11 @@ type PutBucketVersioningInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The concatenation of the authentication device's serial number, a space, // and the value that is displayed on your authentication device. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` @@ -25312,6 +26220,12 @@ func (s *PutBucketVersioningInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketVersioningInput) SetExpectedBucketOwner(v string) *PutBucketVersioningInput { + s.ExpectedBucketOwner = &v + return s +} + // SetMFA sets the MFA field's value. func (s *PutBucketVersioningInput) SetMFA(v string) *PutBucketVersioningInput { s.MFA = &v @@ -25360,6 +26274,11 @@ type PutBucketWebsiteInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Container for the request. // // WebsiteConfiguration is a required field @@ -25413,6 +26332,12 @@ func (s *PutBucketWebsiteInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutBucketWebsiteInput) SetExpectedBucketOwner(v string) *PutBucketWebsiteInput { + s.ExpectedBucketOwner = &v + return s +} + // SetWebsiteConfiguration sets the WebsiteConfiguration field's value. func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) *PutBucketWebsiteInput { s.WebsiteConfiguration = v @@ -25470,6 +26395,11 @@ type PutObjectAclInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Allows grantee the read, write, read ACP, and write ACP permissions on the // bucket. GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` @@ -25564,6 +26494,12 @@ func (s *PutObjectAclInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutObjectAclInput) SetExpectedBucketOwner(v string) *PutObjectAclInput { + s.ExpectedBucketOwner = &v + return s +} + // SetGrantFullControl sets the GrantFullControl field's value. func (s *PutObjectAclInput) SetGrantFullControl(v string) *PutObjectAclInput { s.GrantFullControl = &v @@ -25707,6 +26643,11 @@ type PutObjectInput struct { // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17). ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The date and time at which the object is no longer cacheable. For more information, // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21). Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` @@ -25755,7 +26696,7 @@ type PutObjectInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -25913,6 +26854,12 @@ func (s *PutObjectInput) SetContentType(v string) *PutObjectInput { return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutObjectInput) SetExpectedBucketOwner(v string) *PutObjectInput { + s.ExpectedBucketOwner = &v + return s +} + // SetExpires sets the Expires field's value. func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput { s.Expires = &v @@ -26070,6 +27017,11 @@ type PutObjectLegalHoldInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The key name for the object that you want to place a Legal Hold on. // // Key is a required field @@ -26135,6 +27087,12 @@ func (s *PutObjectLegalHoldInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutObjectLegalHoldInput) SetExpectedBucketOwner(v string) *PutObjectLegalHoldInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *PutObjectLegalHoldInput) SetKey(v string) *PutObjectLegalHoldInput { s.Key = &v @@ -26205,6 +27163,11 @@ type PutObjectLockConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The Object Lock configuration that you want to apply to the specified bucket. ObjectLockConfiguration *ObjectLockConfiguration `locationName:"ObjectLockConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` @@ -26258,6 +27221,12 @@ func (s *PutObjectLockConfigurationInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutObjectLockConfigurationInput) SetExpectedBucketOwner(v string) *PutObjectLockConfigurationInput { + s.ExpectedBucketOwner = &v + return s +} + // SetObjectLockConfiguration sets the ObjectLockConfiguration field's value. func (s *PutObjectLockConfigurationInput) SetObjectLockConfiguration(v *ObjectLockConfiguration) *PutObjectLockConfigurationInput { s.ObjectLockConfiguration = v @@ -26320,7 +27289,8 @@ type PutObjectOutput struct { // Entity tag for the uploaded object. ETag *string `location:"header" locationName:"ETag" type:"string"` - // If the expiration is configured for the object (see PutBucketLifecycleConfiguration), + // If the expiration is configured for the object (see PutBucketLifecycleConfiguration + // (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html)), // the response includes this header. It includes the expiry-date and rule-id // key-value pairs that provide information about object expiration. The value // of the rule-id is URL encoded. @@ -26444,6 +27414,11 @@ type PutObjectRetentionInput struct { // Indicates whether this operation should bypass Governance-mode restrictions. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The key name for the object that you want to apply this Object Retention // configuration to. // @@ -26516,6 +27491,12 @@ func (s *PutObjectRetentionInput) SetBypassGovernanceRetention(v bool) *PutObjec return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutObjectRetentionInput) SetExpectedBucketOwner(v string) *PutObjectRetentionInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *PutObjectRetentionInput) SetKey(v string) *PutObjectRetentionInput { s.Key = &v @@ -26593,7 +27574,12 @@ type PutObjectTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Name of the tag. + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + + // Name of the object key. // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -26660,6 +27646,12 @@ func (s *PutObjectTaggingInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutObjectTaggingInput) SetExpectedBucketOwner(v string) *PutObjectTaggingInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { s.Key = &v @@ -26724,6 +27716,11 @@ type PutPublicAccessBlockInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The PublicAccessBlock configuration that you want to apply to this Amazon // S3 bucket. You can enable the configuration options in any combination. For // more information about when Amazon S3 considers a bucket or object public, @@ -26776,6 +27773,12 @@ func (s *PutPublicAccessBlockInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *PutPublicAccessBlockInput) SetExpectedBucketOwner(v string) *PutPublicAccessBlockInput { + s.ExpectedBucketOwner = &v + return s +} + // SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value. func (s *PutPublicAccessBlockInput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *PutPublicAccessBlockInput { s.PublicAccessBlockConfiguration = v @@ -26886,10 +27889,10 @@ func (s *QueueConfiguration) SetQueueArn(v string) *QueueConfiguration { return s } -// This data type is deprecated. Use QueueConfiguration for the same purposes. -// This data type specifies the configuration for publishing messages to an -// Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified -// events. +// This data type is deprecated. Use QueueConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_QueueConfiguration.html) +// for the same purposes. This data type specifies the configuration for publishing +// messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon +// S3 detects specified events. type QueueConfigurationDeprecated struct { _ struct{} `type:"structure"` @@ -26984,6 +27987,8 @@ func (s *RecordsEvent) UnmarshalEvent( return nil } +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. func (s *RecordsEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) msg.Headers.Set(":content-type", eventstream.StringValue("application/octet-stream")) @@ -27650,6 +28655,11 @@ type RestoreObjectInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Object key for which the operation was initiated. // // Key is a required field @@ -27719,6 +28729,12 @@ func (s *RestoreObjectInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *RestoreObjectInput) SetExpectedBucketOwner(v string) *RestoreObjectInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *RestoreObjectInput) SetKey(v string) *RestoreObjectInput { s.Key = &v @@ -27896,7 +28912,10 @@ func (s *RestoreRequest) SetType(v string) *RestoreRequest { return s } -// Specifies the redirect behavior and when a redirect is applied. +// Specifies the redirect behavior and when a redirect is applied. For more +// information about routing rules, see Configuring advanced conditional redirects +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects) +// in the Amazon Simple Storage Service Developer Guide. type RoutingRule struct { _ struct{} `type:"structure"` @@ -28204,6 +29223,7 @@ type SelectObjectContentEventStreamEvent interface { // * ProgressEvent // * RecordsEvent // * StatsEvent +// * SelectObjectContentEventStreamUnknownEvent type SelectObjectContentEventStreamReader interface { // Returns a channel of events as they are read from the event stream. Events() <-chan SelectObjectContentEventStreamEvent @@ -28278,6 +29298,9 @@ func (r *readSelectObjectContentEventStream) readEventStream() { return default: } + if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { + continue + } r.err.SetError(err) return } @@ -28307,14 +29330,39 @@ func (u unmarshalerForSelectObjectContentEventStreamEvent) UnmarshalerForEventNa case "Stats": return &StatsEvent{}, nil default: - return nil, awserr.New( - request.ErrCodeSerialization, - fmt.Sprintf("unknown event type name, %s, for SelectObjectContentEventStream", eventType), - nil, - ) + return &SelectObjectContentEventStreamUnknownEvent{Type: eventType}, nil } } +// SelectObjectContentEventStreamUnknownEvent provides a failsafe event for the +// SelectObjectContentEventStream group of events when an unknown event is received. +type SelectObjectContentEventStreamUnknownEvent struct { + Type string + Message eventstream.Message +} + +// The SelectObjectContentEventStreamUnknownEvent is and event in the SelectObjectContentEventStream +// group of events. +func (s *SelectObjectContentEventStreamUnknownEvent) eventSelectObjectContentEventStream() {} + +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. +func (e *SelectObjectContentEventStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( + msg eventstream.Message, err error, +) { + return e.Message.Clone(), nil +} + +// UnmarshalEvent unmarshals the EventStream Message into the SelectObjectContentEventStreamData value. +// This method is only used internally within the SDK's EventStream handling. +func (e *SelectObjectContentEventStreamUnknownEvent) UnmarshalEvent( + payloadUnmarshaler protocol.PayloadUnmarshaler, + msg eventstream.Message, +) error { + e.Message = msg.Clone() + return nil +} + // Request to filter the contents of an Amazon S3 object based on a simple Structured // Query Language (SQL) statement. In the request, along with the SQL expression, // you must specify a data serialization format (JSON or CSV) of the object. @@ -28330,6 +29378,11 @@ type SelectObjectContentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The expression that is used to query the object. // // Expression is a required field @@ -28446,6 +29499,12 @@ func (s *SelectObjectContentInput) getBucket() (v string) { return *s.Bucket } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *SelectObjectContentInput) SetExpectedBucketOwner(v string) *SelectObjectContentInput { + s.ExpectedBucketOwner = &v + return s +} + // SetExpression sets the Expression field's value. func (s *SelectObjectContentInput) SetExpression(v string) *SelectObjectContentInput { s.Expression = &v @@ -28966,6 +30025,8 @@ func (s *StatsEvent) UnmarshalEvent( return nil } +// MarshalEvent marshals the type into an stream event value. This method +// should only used internally within the SDK's EventStream handling. func (s *StatsEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) var buf bytes.Buffer @@ -29081,7 +30142,7 @@ func (s *StorageClassAnalysisDataExport) SetOutputSchemaVersion(v string) *Stora type Tag struct { _ struct{} `type:"structure"` - // Name of the tag. + // Name of the object key. // // Key is a required field Key *string `min:"1" type:"string" required:"true"` @@ -29312,6 +30373,7 @@ func (s *TopicConfiguration) SetTopicArn(v string) *TopicConfiguration { // A container for specifying the configuration for publication of messages // to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 // detects specified events. This data type is deprecated. Use TopicConfiguration +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_TopicConfiguration.html) // instead. type TopicConfigurationDeprecated struct { _ struct{} `type:"structure"` @@ -29422,8 +30484,29 @@ type UploadPartCopyInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The name of the source bucket and key name of the source object, separated - // by a slash (/). Must be URL-encoded. + // Specifies the source object for the copy operation. You specify the value + // in one of two formats, depending on whether you want to access the source + // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html): + // + // * For objects not accessed through an access point, specify the name of + // the source bucket and key of the source object, separated by a slash (/). + // For example, to copy the object reports/january.pdf from the bucket awsexamplebucket, + // use awsexamplebucket/reports/january.pdf. The value must be URL encoded. + // + // * For objects accessed through access points, specify the Amazon Resource + // Name (ARN) of the object as accessed through the access point, in the + // format arn:aws:s3:::accesspoint//object/. + // For example, to copy the object reports/january.pdf through the access + // point my-access-point owned by account 123456789012 in Region us-west-2, + // use the URL encoding of arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf. + // The value must be URL encoded. Amazon S3 supports copy operations using + // access points only when the source and destination buckets are in the + // same AWS Region. + // + // To copy a specific version of an object, append ?versionId= to + // the value (for example, awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893). + // If you don't specify a version ID, Amazon S3 copies the latest version of + // the source object. // // CopySource is a required field CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` @@ -29462,6 +30545,16 @@ type UploadPartCopyInput struct { // encryption key was transmitted without error. CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` + // The account id of the expected destination bucket owner. If the destination + // bucket is owned by a different account, the request will fail with an HTTP + // 403 (Access Denied) error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + + // The account id of the expected source bucket owner. If the source bucket + // is owned by a different account, the request will fail with an HTTP 403 (Access + // Denied) error. + ExpectedSourceBucketOwner *string `location:"header" locationName:"x-amz-source-expected-bucket-owner" type:"string"` + // Object key for which the multipart upload was initiated. // // Key is a required field @@ -29487,7 +30580,7 @@ type UploadPartCopyInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. This must be the same encryption key specified in the initiate multipart // upload request. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -29618,6 +30711,18 @@ func (s *UploadPartCopyInput) SetCopySourceSSECustomerKeyMD5(v string) *UploadPa return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *UploadPartCopyInput) SetExpectedBucketOwner(v string) *UploadPartCopyInput { + s.ExpectedBucketOwner = &v + return s +} + +// SetExpectedSourceBucketOwner sets the ExpectedSourceBucketOwner field's value. +func (s *UploadPartCopyInput) SetExpectedSourceBucketOwner(v string) *UploadPartCopyInput { + s.ExpectedSourceBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *UploadPartCopyInput) SetKey(v string) *UploadPartCopyInput { s.Key = &v @@ -29787,6 +30892,11 @@ type UploadPartInput struct { // if object lock parameters are specified. ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // Object key for which the multipart upload was initiated. // // Key is a required field @@ -29812,7 +30922,7 @@ type UploadPartInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. This must be the same encryption key specified in the initiate multipart // upload request. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -29897,6 +31007,12 @@ func (s *UploadPartInput) SetContentMD5(v string) *UploadPartInput { return s } +// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. +func (s *UploadPartInput) SetExpectedBucketOwner(v string) *UploadPartInput { + s.ExpectedBucketOwner = &v + return s +} + // SetKey sets the Key field's value. func (s *UploadPartInput) SetKey(v string) *UploadPartInput { s.Key = &v @@ -30165,6 +31281,13 @@ const ( AnalyticsS3ExportFileFormatCsv = "CSV" ) +// AnalyticsS3ExportFileFormat_Values returns all elements of the AnalyticsS3ExportFileFormat enum +func AnalyticsS3ExportFileFormat_Values() []string { + return []string{ + AnalyticsS3ExportFileFormatCsv, + } +} + const ( // BucketAccelerateStatusEnabled is a BucketAccelerateStatus enum value BucketAccelerateStatusEnabled = "Enabled" @@ -30173,6 +31296,14 @@ const ( BucketAccelerateStatusSuspended = "Suspended" ) +// BucketAccelerateStatus_Values returns all elements of the BucketAccelerateStatus enum +func BucketAccelerateStatus_Values() []string { + return []string{ + BucketAccelerateStatusEnabled, + BucketAccelerateStatusSuspended, + } +} + const ( // BucketCannedACLPrivate is a BucketCannedACL enum value BucketCannedACLPrivate = "private" @@ -30187,18 +31318,31 @@ const ( BucketCannedACLAuthenticatedRead = "authenticated-read" ) +// BucketCannedACL_Values returns all elements of the BucketCannedACL enum +func BucketCannedACL_Values() []string { + return []string{ + BucketCannedACLPrivate, + BucketCannedACLPublicRead, + BucketCannedACLPublicReadWrite, + BucketCannedACLAuthenticatedRead, + } +} + const ( - // BucketLocationConstraintEu is a BucketLocationConstraint enum value - BucketLocationConstraintEu = "EU" + // BucketLocationConstraintAfSouth1 is a BucketLocationConstraint enum value + BucketLocationConstraintAfSouth1 = "af-south-1" - // BucketLocationConstraintEuWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuWest1 = "eu-west-1" + // BucketLocationConstraintApEast1 is a BucketLocationConstraint enum value + BucketLocationConstraintApEast1 = "ap-east-1" - // BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintUsWest1 = "us-west-1" + // BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value + BucketLocationConstraintApNortheast1 = "ap-northeast-1" - // BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value - BucketLocationConstraintUsWest2 = "us-west-2" + // BucketLocationConstraintApNortheast2 is a BucketLocationConstraint enum value + BucketLocationConstraintApNortheast2 = "ap-northeast-2" + + // BucketLocationConstraintApNortheast3 is a BucketLocationConstraint enum value + BucketLocationConstraintApNortheast3 = "ap-northeast-3" // BucketLocationConstraintApSouth1 is a BucketLocationConstraint enum value BucketLocationConstraintApSouth1 = "ap-south-1" @@ -30209,19 +31353,89 @@ const ( // BucketLocationConstraintApSoutheast2 is a BucketLocationConstraint enum value BucketLocationConstraintApSoutheast2 = "ap-southeast-2" - // BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value - BucketLocationConstraintApNortheast1 = "ap-northeast-1" - - // BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value - BucketLocationConstraintSaEast1 = "sa-east-1" + // BucketLocationConstraintCaCentral1 is a BucketLocationConstraint enum value + BucketLocationConstraintCaCentral1 = "ca-central-1" // BucketLocationConstraintCnNorth1 is a BucketLocationConstraint enum value BucketLocationConstraintCnNorth1 = "cn-north-1" + // BucketLocationConstraintCnNorthwest1 is a BucketLocationConstraint enum value + BucketLocationConstraintCnNorthwest1 = "cn-northwest-1" + + // BucketLocationConstraintEu is a BucketLocationConstraint enum value + BucketLocationConstraintEu = "EU" + // BucketLocationConstraintEuCentral1 is a BucketLocationConstraint enum value BucketLocationConstraintEuCentral1 = "eu-central-1" + + // BucketLocationConstraintEuNorth1 is a BucketLocationConstraint enum value + BucketLocationConstraintEuNorth1 = "eu-north-1" + + // BucketLocationConstraintEuSouth1 is a BucketLocationConstraint enum value + BucketLocationConstraintEuSouth1 = "eu-south-1" + + // BucketLocationConstraintEuWest1 is a BucketLocationConstraint enum value + BucketLocationConstraintEuWest1 = "eu-west-1" + + // BucketLocationConstraintEuWest2 is a BucketLocationConstraint enum value + BucketLocationConstraintEuWest2 = "eu-west-2" + + // BucketLocationConstraintEuWest3 is a BucketLocationConstraint enum value + BucketLocationConstraintEuWest3 = "eu-west-3" + + // BucketLocationConstraintMeSouth1 is a BucketLocationConstraint enum value + BucketLocationConstraintMeSouth1 = "me-south-1" + + // BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value + BucketLocationConstraintSaEast1 = "sa-east-1" + + // BucketLocationConstraintUsEast2 is a BucketLocationConstraint enum value + BucketLocationConstraintUsEast2 = "us-east-2" + + // BucketLocationConstraintUsGovEast1 is a BucketLocationConstraint enum value + BucketLocationConstraintUsGovEast1 = "us-gov-east-1" + + // BucketLocationConstraintUsGovWest1 is a BucketLocationConstraint enum value + BucketLocationConstraintUsGovWest1 = "us-gov-west-1" + + // BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value + BucketLocationConstraintUsWest1 = "us-west-1" + + // BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value + BucketLocationConstraintUsWest2 = "us-west-2" ) +// BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum +func BucketLocationConstraint_Values() []string { + return []string{ + BucketLocationConstraintAfSouth1, + BucketLocationConstraintApEast1, + BucketLocationConstraintApNortheast1, + BucketLocationConstraintApNortheast2, + BucketLocationConstraintApNortheast3, + BucketLocationConstraintApSouth1, + BucketLocationConstraintApSoutheast1, + BucketLocationConstraintApSoutheast2, + BucketLocationConstraintCaCentral1, + BucketLocationConstraintCnNorth1, + BucketLocationConstraintCnNorthwest1, + BucketLocationConstraintEu, + BucketLocationConstraintEuCentral1, + BucketLocationConstraintEuNorth1, + BucketLocationConstraintEuSouth1, + BucketLocationConstraintEuWest1, + BucketLocationConstraintEuWest2, + BucketLocationConstraintEuWest3, + BucketLocationConstraintMeSouth1, + BucketLocationConstraintSaEast1, + BucketLocationConstraintUsEast2, + BucketLocationConstraintUsGovEast1, + BucketLocationConstraintUsGovWest1, + BucketLocationConstraintUsWest1, + BucketLocationConstraintUsWest2, + } +} + const ( // BucketLogsPermissionFullControl is a BucketLogsPermission enum value BucketLogsPermissionFullControl = "FULL_CONTROL" @@ -30233,6 +31447,15 @@ const ( BucketLogsPermissionWrite = "WRITE" ) +// BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum +func BucketLogsPermission_Values() []string { + return []string{ + BucketLogsPermissionFullControl, + BucketLogsPermissionRead, + BucketLogsPermissionWrite, + } +} + const ( // BucketVersioningStatusEnabled is a BucketVersioningStatus enum value BucketVersioningStatusEnabled = "Enabled" @@ -30241,6 +31464,14 @@ const ( BucketVersioningStatusSuspended = "Suspended" ) +// BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum +func BucketVersioningStatus_Values() []string { + return []string{ + BucketVersioningStatusEnabled, + BucketVersioningStatusSuspended, + } +} + const ( // CompressionTypeNone is a CompressionType enum value CompressionTypeNone = "NONE" @@ -30252,6 +31483,15 @@ const ( CompressionTypeBzip2 = "BZIP2" ) +// CompressionType_Values returns all elements of the CompressionType enum +func CompressionType_Values() []string { + return []string{ + CompressionTypeNone, + CompressionTypeGzip, + CompressionTypeBzip2, + } +} + const ( // DeleteMarkerReplicationStatusEnabled is a DeleteMarkerReplicationStatus enum value DeleteMarkerReplicationStatusEnabled = "Enabled" @@ -30260,6 +31500,14 @@ const ( DeleteMarkerReplicationStatusDisabled = "Disabled" ) +// DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum +func DeleteMarkerReplicationStatus_Values() []string { + return []string{ + DeleteMarkerReplicationStatusEnabled, + DeleteMarkerReplicationStatusDisabled, + } +} + // Requests Amazon S3 to encode the object keys in the response and specifies // the encoding method to use. An object key may contain any Unicode character; // however, XML 1.0 parser cannot parse some characters, such as characters @@ -30271,6 +31519,13 @@ const ( EncodingTypeUrl = "url" ) +// EncodingType_Values returns all elements of the EncodingType enum +func EncodingType_Values() []string { + return []string{ + EncodingTypeUrl, + } +} + // The bucket event for which to send notifications. const ( // EventS3ReducedRedundancyLostObject is a Event enum value @@ -30325,6 +31580,29 @@ const ( EventS3ReplicationOperationReplicatedAfterThreshold = "s3:Replication:OperationReplicatedAfterThreshold" ) +// Event_Values returns all elements of the Event enum +func Event_Values() []string { + return []string{ + EventS3ReducedRedundancyLostObject, + EventS3ObjectCreated, + EventS3ObjectCreatedPut, + EventS3ObjectCreatedPost, + EventS3ObjectCreatedCopy, + EventS3ObjectCreatedCompleteMultipartUpload, + EventS3ObjectRemoved, + EventS3ObjectRemovedDelete, + EventS3ObjectRemovedDeleteMarkerCreated, + EventS3ObjectRestore, + EventS3ObjectRestorePost, + EventS3ObjectRestoreCompleted, + EventS3Replication, + EventS3ReplicationOperationFailedReplication, + EventS3ReplicationOperationNotTracked, + EventS3ReplicationOperationMissedThreshold, + EventS3ReplicationOperationReplicatedAfterThreshold, + } +} + const ( // ExistingObjectReplicationStatusEnabled is a ExistingObjectReplicationStatus enum value ExistingObjectReplicationStatusEnabled = "Enabled" @@ -30333,6 +31611,14 @@ const ( ExistingObjectReplicationStatusDisabled = "Disabled" ) +// ExistingObjectReplicationStatus_Values returns all elements of the ExistingObjectReplicationStatus enum +func ExistingObjectReplicationStatus_Values() []string { + return []string{ + ExistingObjectReplicationStatusEnabled, + ExistingObjectReplicationStatusDisabled, + } +} + const ( // ExpirationStatusEnabled is a ExpirationStatus enum value ExpirationStatusEnabled = "Enabled" @@ -30341,11 +31627,26 @@ const ( ExpirationStatusDisabled = "Disabled" ) +// ExpirationStatus_Values returns all elements of the ExpirationStatus enum +func ExpirationStatus_Values() []string { + return []string{ + ExpirationStatusEnabled, + ExpirationStatusDisabled, + } +} + const ( // ExpressionTypeSql is a ExpressionType enum value ExpressionTypeSql = "SQL" ) +// ExpressionType_Values returns all elements of the ExpressionType enum +func ExpressionType_Values() []string { + return []string{ + ExpressionTypeSql, + } +} + const ( // FileHeaderInfoUse is a FileHeaderInfo enum value FileHeaderInfoUse = "USE" @@ -30357,6 +31658,15 @@ const ( FileHeaderInfoNone = "NONE" ) +// FileHeaderInfo_Values returns all elements of the FileHeaderInfo enum +func FileHeaderInfo_Values() []string { + return []string{ + FileHeaderInfoUse, + FileHeaderInfoIgnore, + FileHeaderInfoNone, + } +} + const ( // FilterRuleNamePrefix is a FilterRuleName enum value FilterRuleNamePrefix = "prefix" @@ -30365,6 +31675,14 @@ const ( FilterRuleNameSuffix = "suffix" ) +// FilterRuleName_Values returns all elements of the FilterRuleName enum +func FilterRuleName_Values() []string { + return []string{ + FilterRuleNamePrefix, + FilterRuleNameSuffix, + } +} + const ( // InventoryFormatCsv is a InventoryFormat enum value InventoryFormatCsv = "CSV" @@ -30376,6 +31694,15 @@ const ( InventoryFormatParquet = "Parquet" ) +// InventoryFormat_Values returns all elements of the InventoryFormat enum +func InventoryFormat_Values() []string { + return []string{ + InventoryFormatCsv, + InventoryFormatOrc, + InventoryFormatParquet, + } +} + const ( // InventoryFrequencyDaily is a InventoryFrequency enum value InventoryFrequencyDaily = "Daily" @@ -30384,6 +31711,14 @@ const ( InventoryFrequencyWeekly = "Weekly" ) +// InventoryFrequency_Values returns all elements of the InventoryFrequency enum +func InventoryFrequency_Values() []string { + return []string{ + InventoryFrequencyDaily, + InventoryFrequencyWeekly, + } +} + const ( // InventoryIncludedObjectVersionsAll is a InventoryIncludedObjectVersions enum value InventoryIncludedObjectVersionsAll = "All" @@ -30392,6 +31727,14 @@ const ( InventoryIncludedObjectVersionsCurrent = "Current" ) +// InventoryIncludedObjectVersions_Values returns all elements of the InventoryIncludedObjectVersions enum +func InventoryIncludedObjectVersions_Values() []string { + return []string{ + InventoryIncludedObjectVersionsAll, + InventoryIncludedObjectVersionsCurrent, + } +} + const ( // InventoryOptionalFieldSize is a InventoryOptionalField enum value InventoryOptionalFieldSize = "Size" @@ -30427,6 +31770,23 @@ const ( InventoryOptionalFieldIntelligentTieringAccessTier = "IntelligentTieringAccessTier" ) +// InventoryOptionalField_Values returns all elements of the InventoryOptionalField enum +func InventoryOptionalField_Values() []string { + return []string{ + InventoryOptionalFieldSize, + InventoryOptionalFieldLastModifiedDate, + InventoryOptionalFieldStorageClass, + InventoryOptionalFieldEtag, + InventoryOptionalFieldIsMultipartUploaded, + InventoryOptionalFieldReplicationStatus, + InventoryOptionalFieldEncryptionStatus, + InventoryOptionalFieldObjectLockRetainUntilDate, + InventoryOptionalFieldObjectLockMode, + InventoryOptionalFieldObjectLockLegalHoldStatus, + InventoryOptionalFieldIntelligentTieringAccessTier, + } +} + const ( // JSONTypeDocument is a JSONType enum value JSONTypeDocument = "DOCUMENT" @@ -30435,6 +31795,14 @@ const ( JSONTypeLines = "LINES" ) +// JSONType_Values returns all elements of the JSONType enum +func JSONType_Values() []string { + return []string{ + JSONTypeDocument, + JSONTypeLines, + } +} + const ( // MFADeleteEnabled is a MFADelete enum value MFADeleteEnabled = "Enabled" @@ -30443,6 +31811,14 @@ const ( MFADeleteDisabled = "Disabled" ) +// MFADelete_Values returns all elements of the MFADelete enum +func MFADelete_Values() []string { + return []string{ + MFADeleteEnabled, + MFADeleteDisabled, + } +} + const ( // MFADeleteStatusEnabled is a MFADeleteStatus enum value MFADeleteStatusEnabled = "Enabled" @@ -30451,6 +31827,14 @@ const ( MFADeleteStatusDisabled = "Disabled" ) +// MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum +func MFADeleteStatus_Values() []string { + return []string{ + MFADeleteStatusEnabled, + MFADeleteStatusDisabled, + } +} + const ( // MetadataDirectiveCopy is a MetadataDirective enum value MetadataDirectiveCopy = "COPY" @@ -30459,6 +31843,14 @@ const ( MetadataDirectiveReplace = "REPLACE" ) +// MetadataDirective_Values returns all elements of the MetadataDirective enum +func MetadataDirective_Values() []string { + return []string{ + MetadataDirectiveCopy, + MetadataDirectiveReplace, + } +} + const ( // MetricsStatusEnabled is a MetricsStatus enum value MetricsStatusEnabled = "Enabled" @@ -30467,6 +31859,14 @@ const ( MetricsStatusDisabled = "Disabled" ) +// MetricsStatus_Values returns all elements of the MetricsStatus enum +func MetricsStatus_Values() []string { + return []string{ + MetricsStatusEnabled, + MetricsStatusDisabled, + } +} + const ( // ObjectCannedACLPrivate is a ObjectCannedACL enum value ObjectCannedACLPrivate = "private" @@ -30490,11 +31890,31 @@ const ( ObjectCannedACLBucketOwnerFullControl = "bucket-owner-full-control" ) +// ObjectCannedACL_Values returns all elements of the ObjectCannedACL enum +func ObjectCannedACL_Values() []string { + return []string{ + ObjectCannedACLPrivate, + ObjectCannedACLPublicRead, + ObjectCannedACLPublicReadWrite, + ObjectCannedACLAuthenticatedRead, + ObjectCannedACLAwsExecRead, + ObjectCannedACLBucketOwnerRead, + ObjectCannedACLBucketOwnerFullControl, + } +} + const ( // ObjectLockEnabledEnabled is a ObjectLockEnabled enum value ObjectLockEnabledEnabled = "Enabled" ) +// ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum +func ObjectLockEnabled_Values() []string { + return []string{ + ObjectLockEnabledEnabled, + } +} + const ( // ObjectLockLegalHoldStatusOn is a ObjectLockLegalHoldStatus enum value ObjectLockLegalHoldStatusOn = "ON" @@ -30503,6 +31923,14 @@ const ( ObjectLockLegalHoldStatusOff = "OFF" ) +// ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum +func ObjectLockLegalHoldStatus_Values() []string { + return []string{ + ObjectLockLegalHoldStatusOn, + ObjectLockLegalHoldStatusOff, + } +} + const ( // ObjectLockModeGovernance is a ObjectLockMode enum value ObjectLockModeGovernance = "GOVERNANCE" @@ -30511,6 +31939,14 @@ const ( ObjectLockModeCompliance = "COMPLIANCE" ) +// ObjectLockMode_Values returns all elements of the ObjectLockMode enum +func ObjectLockMode_Values() []string { + return []string{ + ObjectLockModeGovernance, + ObjectLockModeCompliance, + } +} + const ( // ObjectLockRetentionModeGovernance is a ObjectLockRetentionMode enum value ObjectLockRetentionModeGovernance = "GOVERNANCE" @@ -30519,6 +31955,14 @@ const ( ObjectLockRetentionModeCompliance = "COMPLIANCE" ) +// ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum +func ObjectLockRetentionMode_Values() []string { + return []string{ + ObjectLockRetentionModeGovernance, + ObjectLockRetentionModeCompliance, + } +} + const ( // ObjectStorageClassStandard is a ObjectStorageClass enum value ObjectStorageClassStandard = "STANDARD" @@ -30542,16 +31986,43 @@ const ( ObjectStorageClassDeepArchive = "DEEP_ARCHIVE" ) +// ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum +func ObjectStorageClass_Values() []string { + return []string{ + ObjectStorageClassStandard, + ObjectStorageClassReducedRedundancy, + ObjectStorageClassGlacier, + ObjectStorageClassStandardIa, + ObjectStorageClassOnezoneIa, + ObjectStorageClassIntelligentTiering, + ObjectStorageClassDeepArchive, + } +} + const ( // ObjectVersionStorageClassStandard is a ObjectVersionStorageClass enum value ObjectVersionStorageClassStandard = "STANDARD" ) +// ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum +func ObjectVersionStorageClass_Values() []string { + return []string{ + ObjectVersionStorageClassStandard, + } +} + const ( // OwnerOverrideDestination is a OwnerOverride enum value OwnerOverrideDestination = "Destination" ) +// OwnerOverride_Values returns all elements of the OwnerOverride enum +func OwnerOverride_Values() []string { + return []string{ + OwnerOverrideDestination, + } +} + const ( // PayerRequester is a Payer enum value PayerRequester = "Requester" @@ -30560,6 +32031,14 @@ const ( PayerBucketOwner = "BucketOwner" ) +// Payer_Values returns all elements of the Payer enum +func Payer_Values() []string { + return []string{ + PayerRequester, + PayerBucketOwner, + } +} + const ( // PermissionFullControl is a Permission enum value PermissionFullControl = "FULL_CONTROL" @@ -30577,6 +32056,17 @@ const ( PermissionReadAcp = "READ_ACP" ) +// Permission_Values returns all elements of the Permission enum +func Permission_Values() []string { + return []string{ + PermissionFullControl, + PermissionWrite, + PermissionWriteAcp, + PermissionRead, + PermissionReadAcp, + } +} + const ( // ProtocolHttp is a Protocol enum value ProtocolHttp = "http" @@ -30585,6 +32075,14 @@ const ( ProtocolHttps = "https" ) +// Protocol_Values returns all elements of the Protocol enum +func Protocol_Values() []string { + return []string{ + ProtocolHttp, + ProtocolHttps, + } +} + const ( // QuoteFieldsAlways is a QuoteFields enum value QuoteFieldsAlways = "ALWAYS" @@ -30593,6 +32091,14 @@ const ( QuoteFieldsAsneeded = "ASNEEDED" ) +// QuoteFields_Values returns all elements of the QuoteFields enum +func QuoteFields_Values() []string { + return []string{ + QuoteFieldsAlways, + QuoteFieldsAsneeded, + } +} + const ( // ReplicationRuleStatusEnabled is a ReplicationRuleStatus enum value ReplicationRuleStatusEnabled = "Enabled" @@ -30601,6 +32107,14 @@ const ( ReplicationRuleStatusDisabled = "Disabled" ) +// ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum +func ReplicationRuleStatus_Values() []string { + return []string{ + ReplicationRuleStatusEnabled, + ReplicationRuleStatusDisabled, + } +} + const ( // ReplicationStatusComplete is a ReplicationStatus enum value ReplicationStatusComplete = "COMPLETE" @@ -30615,6 +32129,16 @@ const ( ReplicationStatusReplica = "REPLICA" ) +// ReplicationStatus_Values returns all elements of the ReplicationStatus enum +func ReplicationStatus_Values() []string { + return []string{ + ReplicationStatusComplete, + ReplicationStatusPending, + ReplicationStatusFailed, + ReplicationStatusReplica, + } +} + const ( // ReplicationTimeStatusEnabled is a ReplicationTimeStatus enum value ReplicationTimeStatusEnabled = "Enabled" @@ -30623,6 +32147,14 @@ const ( ReplicationTimeStatusDisabled = "Disabled" ) +// ReplicationTimeStatus_Values returns all elements of the ReplicationTimeStatus enum +func ReplicationTimeStatus_Values() []string { + return []string{ + ReplicationTimeStatusEnabled, + ReplicationTimeStatusDisabled, + } +} + // If present, indicates that the requester was successfully charged for the // request. const ( @@ -30630,6 +32162,13 @@ const ( RequestChargedRequester = "requester" ) +// RequestCharged_Values returns all elements of the RequestCharged enum +func RequestCharged_Values() []string { + return []string{ + RequestChargedRequester, + } +} + // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. For information // about downloading objects from requester pays buckets, see Downloading Objects @@ -30640,11 +32179,25 @@ const ( RequestPayerRequester = "requester" ) +// RequestPayer_Values returns all elements of the RequestPayer enum +func RequestPayer_Values() []string { + return []string{ + RequestPayerRequester, + } +} + const ( // RestoreRequestTypeSelect is a RestoreRequestType enum value RestoreRequestTypeSelect = "SELECT" ) +// RestoreRequestType_Values returns all elements of the RestoreRequestType enum +func RestoreRequestType_Values() []string { + return []string{ + RestoreRequestTypeSelect, + } +} + const ( // ServerSideEncryptionAes256 is a ServerSideEncryption enum value ServerSideEncryptionAes256 = "AES256" @@ -30653,6 +32206,14 @@ const ( ServerSideEncryptionAwsKms = "aws:kms" ) +// ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum +func ServerSideEncryption_Values() []string { + return []string{ + ServerSideEncryptionAes256, + ServerSideEncryptionAwsKms, + } +} + const ( // SseKmsEncryptedObjectsStatusEnabled is a SseKmsEncryptedObjectsStatus enum value SseKmsEncryptedObjectsStatusEnabled = "Enabled" @@ -30661,6 +32222,14 @@ const ( SseKmsEncryptedObjectsStatusDisabled = "Disabled" ) +// SseKmsEncryptedObjectsStatus_Values returns all elements of the SseKmsEncryptedObjectsStatus enum +func SseKmsEncryptedObjectsStatus_Values() []string { + return []string{ + SseKmsEncryptedObjectsStatusEnabled, + SseKmsEncryptedObjectsStatusDisabled, + } +} + const ( // StorageClassStandard is a StorageClass enum value StorageClassStandard = "STANDARD" @@ -30684,11 +32253,31 @@ const ( StorageClassDeepArchive = "DEEP_ARCHIVE" ) +// StorageClass_Values returns all elements of the StorageClass enum +func StorageClass_Values() []string { + return []string{ + StorageClassStandard, + StorageClassReducedRedundancy, + StorageClassStandardIa, + StorageClassOnezoneIa, + StorageClassIntelligentTiering, + StorageClassGlacier, + StorageClassDeepArchive, + } +} + const ( // StorageClassAnalysisSchemaVersionV1 is a StorageClassAnalysisSchemaVersion enum value StorageClassAnalysisSchemaVersionV1 = "V_1" ) +// StorageClassAnalysisSchemaVersion_Values returns all elements of the StorageClassAnalysisSchemaVersion enum +func StorageClassAnalysisSchemaVersion_Values() []string { + return []string{ + StorageClassAnalysisSchemaVersionV1, + } +} + const ( // TaggingDirectiveCopy is a TaggingDirective enum value TaggingDirectiveCopy = "COPY" @@ -30697,6 +32286,14 @@ const ( TaggingDirectiveReplace = "REPLACE" ) +// TaggingDirective_Values returns all elements of the TaggingDirective enum +func TaggingDirective_Values() []string { + return []string{ + TaggingDirectiveCopy, + TaggingDirectiveReplace, + } +} + const ( // TierStandard is a Tier enum value TierStandard = "Standard" @@ -30708,6 +32305,15 @@ const ( TierExpedited = "Expedited" ) +// Tier_Values returns all elements of the Tier enum +func Tier_Values() []string { + return []string{ + TierStandard, + TierBulk, + TierExpedited, + } +} + const ( // TransitionStorageClassGlacier is a TransitionStorageClass enum value TransitionStorageClassGlacier = "GLACIER" @@ -30725,6 +32331,17 @@ const ( TransitionStorageClassDeepArchive = "DEEP_ARCHIVE" ) +// TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum +func TransitionStorageClass_Values() []string { + return []string{ + TransitionStorageClassGlacier, + TransitionStorageClassStandardIa, + TransitionStorageClassOnezoneIa, + TransitionStorageClassIntelligentTiering, + TransitionStorageClassDeepArchive, + } +} + const ( // TypeCanonicalUser is a Type enum value TypeCanonicalUser = "CanonicalUser" @@ -30735,3 +32352,12 @@ const ( // TypeGroup is a Type enum value TypeGroup = "Group" ) + +// Type_Values returns all elements of the Type enum +func Type_Values() []string { + return []string{ + TypeCanonicalUser, + TypeAmazonCustomerByEmail, + TypeGroup, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go index 4b65f71531a..7f7aca20859 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go @@ -104,19 +104,6 @@ // content from S3. The Encryption and Decryption clients can be used concurrently // once the client is created. // -// sess := session.Must(session.NewSession()) -// -// // Create the decryption client. -// svc := s3crypto.NewDecryptionClient(sess) -// -// // The object will be downloaded from S3 and decrypted locally. By metadata -// // about the object's encryption will instruct the decryption client how -// // decrypt the content of the object. By default KMS is used for keys. -// result, err := svc.GetObject(&s3.GetObjectInput { -// Bucket: aws.String(myBucket), -// Key: aws.String(myKey), -// }) -// // See the s3crypto package documentation for more information. // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3crypto/ // diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go index f61665a58a4..9cc1e5970c1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region.go @@ -3,6 +3,7 @@ package s3manager import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/s3" @@ -35,6 +36,30 @@ import ( // } // fmt.Printf("Bucket %s is in %s region\n", bucket, region) // +// By default the request will be made to the Amazon S3 endpoint using the Path +// style addressing. +// +// s3.us-west-2.amazonaws.com/bucketname +// +// This is not compatible with Amazon S3's FIPS endpoints. To override this +// behavior to use Virtual Host style addressing, provide a functional option +// that will set the Request's Config.S3ForcePathStyle to aws.Bool(false). +// +// region, err := s3manager.GetBucketRegion(ctx, sess, "bucketname", "us-west-2", func(r *request.Request) { +// r.S3ForcePathStyle = aws.Bool(false) +// }) +// +// To configure the GetBucketRegion to make a request via the Amazon +// S3 FIPS endpoints directly when a FIPS region name is not available, (e.g. +// fips-us-gov-west-1) set the Config.Endpoint on the Session, or client the +// utility is called with. The hint region will be ignored if an endpoint URL +// is configured on the session or client. +// +// sess, err := session.NewSession(&aws.Config{ +// Endpoint: aws.String("https://s3-fips.us-west-2.amazonaws.com"), +// }) +// +// region, err := s3manager.GetBucketRegion(context.Background(), sess, "bucketname", "") func GetBucketRegion(ctx aws.Context, c client.ConfigProvider, bucket, regionHint string, opts ...request.Option) (string, error) { var cfg aws.Config if len(regionHint) != 0 { @@ -50,12 +75,38 @@ const bucketRegionHeader = "X-Amz-Bucket-Region" // that it takes a S3 service client instead of a Session. The regionHint is // derived from the region the S3 service client was created in. // +// By default the request will be made to the Amazon S3 endpoint using the Path +// style addressing. +// +// s3.us-west-2.amazonaws.com/bucketname +// +// This is not compatible with Amazon S3's FIPS endpoints. To override this +// behavior to use Virtual Host style addressing, provide a functional option +// that will set the Request's Config.S3ForcePathStyle to aws.Bool(false). +// +// region, err := s3manager.GetBucketRegionWithClient(ctx, client, "bucketname", func(r *request.Request) { +// r.S3ForcePathStyle = aws.Bool(false) +// }) +// +// To configure the GetBucketRegion to make a request via the Amazon +// S3 FIPS endpoints directly when a FIPS region name is not available, (e.g. +// fips-us-gov-west-1) set the Config.Endpoint on the Session, or client the +// utility is called with. The hint region will be ignored if an endpoint URL +// is configured on the session or client. +// +// region, err := s3manager.GetBucketRegionWithClient(context.Background(), +// s3.New(sess, &aws.Config{ +// Endpoint: aws.String("https://s3-fips.us-west-2.amazonaws.com"), +// }), +// "bucketname") +// // See GetBucketRegion for more information. func GetBucketRegionWithClient(ctx aws.Context, svc s3iface.S3API, bucket string, opts ...request.Option) (string, error) { req, _ := svc.HeadBucketRequest(&s3.HeadBucketInput{ Bucket: aws.String(bucket), }) req.Config.S3ForcePathStyle = aws.Bool(true) + req.Config.Credentials = credentials.AnonymousCredentials req.SetContext(ctx) @@ -75,6 +126,16 @@ func GetBucketRegionWithClient(ctx aws.Context, svc s3iface.S3API, bucket string r.HTTPResponse.Status = "OK" r.Error = nil }) + // Replace the endpoint validation handler to not require a region if an + // endpoint URL was specified. Since these requests are not authenticated, + // requiring a region is not needed when an endpoint URL is provided. + req.Handlers.Validate.Swap( + corehandlers.ValidateEndpointHandler.Name, + request.NamedHandler{ + Name: "validateEndpointWithoutRegion", + Fn: validateEndpointWithoutRegion, + }, + ) req.ApplyOptions(opts...) @@ -86,3 +147,13 @@ func GetBucketRegionWithClient(ctx aws.Context, svc s3iface.S3API, bucket string return bucketRegion, nil } + +func validateEndpointWithoutRegion(r *request.Request) { + // Check if the caller provided an explicit URL instead of one derived by + // the SDK's endpoint resolver. For GetBucketRegion, with an explicit + // endpoint URL, a region is not needed. If no endpoint URL is provided, + // fallback the SDK's standard endpoint validation handler. + if len(aws.StringValue(r.Config.Endpoint)) == 0 { + corehandlers.ValidateEndpointHandler.Fn(r) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go index c8810c11bbf..5aebddf9142 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go @@ -63,6 +63,11 @@ type UploadInput struct { // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17). ContentType *string `location:"header" locationName:"Content-Type" type:"string"` + // The account id of the expected bucket owner. If the bucket is owned by a + // different account, the request will fail with an HTTP 403 (Access Denied) + // error. + ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` + // The date and time at which the object is no longer cacheable. For more information, // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21). Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` @@ -111,7 +116,7 @@ type UploadInput struct { // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go index b71c835deef..57a0bd92ca3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go @@ -69,7 +69,7 @@ func computeKeyMD5(keyHeader, keyMD5Header, key string, r *http.Request) { return } - // In backwards compatiable, the header's value is not base64 encoded, + // In backwards compatible, the header's value is not base64 encoded, // and needs to be encoded and updated by the SDK's customizations. b64Key := base64.StdEncoding.EncodeToString([]byte(key)) r.Header.Set(keyHeader, b64Key) diff --git a/vendor/github.com/bombsimon/wsl/v3/wsl.go b/vendor/github.com/bombsimon/wsl/v3/wsl.go index 3b4a4e9a1a4..31520fb43f5 100644 --- a/vendor/github.com/bombsimon/wsl/v3/wsl.go +++ b/vendor/github.com/bombsimon/wsl/v3/wsl.go @@ -398,6 +398,18 @@ func (p *Processor) parseBlockStatements(statements []ast.Stmt) { if !cuddledWithLastStmt { checkingErr := atLeastOneInListsMatch(rightAndLeftHandSide, p.config.ErrorVariableNames) if checkingErr { + // We only want to enforce cuddling error checks if the + // error was assigned on the line above. See + // https://github.com/bombsimon/wsl/issues/78. + // This is needed since `assignedOnLineAbove` is not + // actually just assignments but everything from LHS in the + // previous statement. This means that if previous line was + // `if err ...`, `err` will now be in the list + // `assignedOnLineAbove`. + if _, ok := previousStatement.(*ast.AssignStmt); !ok { + continue + } + if checkingErrInitializedInline() { continue } diff --git a/vendor/github.com/daixiang0/gci/LICENSE b/vendor/github.com/daixiang0/gci/LICENSE new file mode 100644 index 00000000000..e1292f73895 --- /dev/null +++ b/vendor/github.com/daixiang0/gci/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2020, Xiang Dai +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/daixiang0/gci/pkg/gci/gci.go b/vendor/github.com/daixiang0/gci/pkg/gci/gci.go new file mode 100644 index 00000000000..f91d9b3730a --- /dev/null +++ b/vendor/github.com/daixiang0/gci/pkg/gci/gci.go @@ -0,0 +1,366 @@ +package gci + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "sort" + "strings" +) + +const ( + // pkg type: standard, remote, local + standard int = iota + // 3rd-party packages + remote + local + + commentFlag = "//" +) + +var ( + importStartFlag = []byte(` +import ( +`) + + importEndFlag = []byte(` +) +`) +) + +type FlagSet struct { + LocalFlag string + DoWrite, DoDiff *bool +} + +type pkg struct { + list map[int][]string + comment map[string]string + alias map[string]string +} + +func newPkg(data [][]byte, localFlag string) *pkg { + listMap := make(map[int][]string) + commentMap := make(map[string]string) + aliasMap := make(map[string]string) + p := &pkg{ + list: listMap, + comment: commentMap, + alias: aliasMap, + } + + formatData := make([]string, 0) + // remove all empty lines + for _, v := range data { + if len(v) > 0 { + formatData = append(formatData, strings.TrimSpace(string(v))) + } + } + + n := len(formatData) + for i := n - 1; i >= 0; i-- { + line := formatData[i] + + // check commentFlag: + // 1. one line commentFlag + // 2. commentFlag after import path + commentIndex := strings.Index(line, commentFlag) + if commentIndex == 0 { + // comment in the last line is useless, ignore it + if i+1 >= n { + continue + } + pkg, _, _ := getPkgInfo(formatData[i+1], strings.Index(formatData[i+1], commentFlag) >= 0) + p.comment[pkg] = line + continue + } else if commentIndex > 0 { + pkg, alias, comment := getPkgInfo(line, true) + if alias != "" { + p.alias[pkg] = alias + } + + p.comment[pkg] = comment + pkgType := getPkgType(pkg, localFlag) + p.list[pkgType] = append(p.list[pkgType], pkg) + continue + } + + pkg, alias, _ := getPkgInfo(line, false) + + if alias != "" { + p.alias[pkg] = alias + } + + pkgType := getPkgType(pkg, localFlag) + p.list[pkgType] = append(p.list[pkgType], pkg) + } + + return p +} + +// fmt format import pkgs as expected +func (p *pkg) fmt() []byte { + ret := make([]string, 0, 100) + + for pkgType := range []int{standard, remote, local} { + sort.Strings(p.list[pkgType]) + for _, s := range p.list[pkgType] { + if p.comment[s] != "" { + l := fmt.Sprintf("%s%s%s%s", linebreak, indent, p.comment[s], linebreak) + ret = append(ret, l) + } + + if p.alias[s] != "" { + s = fmt.Sprintf("%s%s%s%s%s", indent, p.alias[s], blank, s, linebreak) + } else { + s = fmt.Sprintf("%s%s%s", indent, s, linebreak) + } + + ret = append(ret, s) + } + + if len(p.list[pkgType]) > 0 { + ret = append(ret, linebreak) + } + } + if ret[len(ret)-1] == linebreak { + ret = ret[:len(ret)-1] + } + + // remove duplicate empty lines + s1 := fmt.Sprintf("%s%s%s%s", linebreak, linebreak, linebreak, indent) + s2 := fmt.Sprintf("%s%s%s", linebreak, linebreak, indent) + return []byte(strings.ReplaceAll(strings.Join(ret, ""), s1, s2)) +} + +// getPkgInfo assume line is a import path, and return (path, alias, comment) +func getPkgInfo(line string, comment bool) (string, string, string) { + if comment { + s := strings.Split(line, commentFlag) + pkgArray := strings.Split(s[0], blank) + if len(pkgArray) > 1 { + return pkgArray[1], pkgArray[0], fmt.Sprintf("%s%s%s", commentFlag, blank, strings.TrimSpace(s[1])) + } else { + return strings.TrimSpace(pkgArray[0]), "", fmt.Sprintf("%s%s%s", commentFlag, blank, strings.TrimSpace(s[1])) + } + } else { + pkgArray := strings.Split(line, blank) + if len(pkgArray) > 1 { + return pkgArray[1], pkgArray[0], "" + } else { + return pkgArray[0], "", "" + } + } +} + +func getPkgType(line, localFlag string) int { + if !strings.Contains(line, dot) { + return standard + } else if strings.Contains(line, localFlag) { + return local + } else { + return remote + } +} + +const ( + dot = "." + blank = " " + indent = "\t" + linebreak = "\n" +) + +func diff(b1, b2 []byte, filename string) (data []byte, err error) { + f1, err := writeTempFile("", "gci", b1) + if err != nil { + return + } + defer os.Remove(f1) + + f2, err := writeTempFile("", "gci", b2) + if err != nil { + return + } + defer os.Remove(f2) + + cmd := "diff" + + data, err = exec.Command(cmd, "-u", f1, f2).CombinedOutput() + if len(data) > 0 { + // diff exits with a non-zero status when the files don't match. + // Ignore that failure as long as we get output. + return replaceTempFilename(data, filename) + } + return +} + +func writeTempFile(dir, prefix string, data []byte) (string, error) { + file, err := ioutil.TempFile(dir, prefix) + if err != nil { + return "", err + } + _, err = file.Write(data) + if err1 := file.Close(); err == nil { + err = err1 + } + if err != nil { + os.Remove(file.Name()) + return "", err + } + return file.Name(), nil +} + +// replaceTempFilename replaces temporary filenames in diff with actual one. +// +// --- /tmp/gofmt316145376 2017-02-03 19:13:00.280468375 -0500 +// +++ /tmp/gofmt617882815 2017-02-03 19:13:00.280468375 -0500 +// ... +// -> +// --- path/to/file.go.orig 2017-02-03 19:13:00.280468375 -0500 +// +++ path/to/file.go 2017-02-03 19:13:00.280468375 -0500 +// ... +func replaceTempFilename(diff []byte, filename string) ([]byte, error) { + bs := bytes.SplitN(diff, []byte{'\n'}, 3) + if len(bs) < 3 { + return nil, fmt.Errorf("got unexpected diff for %s", filename) + } + // Preserve timestamps. + var t0, t1 []byte + if i := bytes.LastIndexByte(bs[0], '\t'); i != -1 { + t0 = bs[0][i:] + } + if i := bytes.LastIndexByte(bs[1], '\t'); i != -1 { + t1 = bs[1][i:] + } + // Always print filepath with slash separator. + f := filepath.ToSlash(filename) + bs[0] = []byte(fmt.Sprintf("--- %s%s", f+".orig", t0)) + bs[1] = []byte(fmt.Sprintf("+++ %s%s", f, t1)) + return bytes.Join(bs, []byte{'\n'}), nil +} + +func visitFile(set *FlagSet) filepath.WalkFunc { + return func(path string, f os.FileInfo, err error) error { + if err == nil && isGoFile(f) { + err = processFile(path, os.Stdout, set) + } + return err + } +} + +func WalkDir(path string, set *FlagSet) error { + return filepath.Walk(path, visitFile(set)) +} + +func isGoFile(f os.FileInfo) bool { + // ignore non-Go files + name := f.Name() + return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") +} + +func ProcessFile(filename string, out io.Writer, set *FlagSet) error { + return processFile(filename, out, set) +} + +func processFile(filename string, out io.Writer, set *FlagSet) error { + var err error + + f, err := os.Open(filename) + if err != nil { + return err + } + defer f.Close() + + src, err := ioutil.ReadAll(f) + if err != nil { + return err + } + + ori := make([]byte, len(src)) + copy(ori, src) + start := bytes.Index(src, importStartFlag) + // in case no importStartFlag or importStartFlag exist in the commentFlag + if start < 0 { + fmt.Printf("skip file %s since no import\n", filename) + return nil + } + end := bytes.Index(src[start:], importEndFlag) + start + + ret := bytes.Split(src[start+len(importStartFlag):end], []byte(linebreak)) + + p := newPkg(ret, set.LocalFlag) + + res := append(src[:start+len(importStartFlag)], append(p.fmt(), src[end+1:]...)...) + + if !bytes.Equal(ori, res) { + if *set.DoWrite { + // On Windows, we need to re-set the permissions from the file. See golang/go#38225. + var perms os.FileMode + if fi, err := os.Stat(filename); err == nil { + perms = fi.Mode() & os.ModePerm + } + err = ioutil.WriteFile(filename, res, perms) + if err != nil { + return err + } + } + if *set.DoDiff { + data, err := diff(ori, res, filename) + if err != nil { + return fmt.Errorf("failed to diff: %v", err) + } + fmt.Printf("diff -u %s %s\n", filepath.ToSlash(filename+".orig"), filepath.ToSlash(filename)) + if _, err := out.Write(data); err != nil { + return fmt.Errorf("failed to write: %v", err) + } + } + } + if !*set.DoWrite && !*set.DoDiff { + if _, err = out.Write(res); err != nil { + return fmt.Errorf("failed to write: %v", err) + } + } + + return err +} + +// Run return source and result in []byte if succeed +func Run(filename string, set *FlagSet) ([]byte, []byte, error) { + var err error + + f, err := os.Open(filename) + if err != nil { + return nil, nil, err + } + defer f.Close() + + src, err := ioutil.ReadAll(f) + if err != nil { + return nil, nil, err + } + + ori := make([]byte, len(src)) + copy(ori, src) + start := bytes.Index(src, importStartFlag) + // in case no importStartFlag or importStartFlag exist in the commentFlag + if start < 0 { + return nil, nil, nil + } + end := bytes.Index(src[start:], importEndFlag) + start + + ret := bytes.Split(src[start+len(importStartFlag):end], []byte(linebreak)) + + p := newPkg(ret, set.LocalFlag) + + res := append(src[:start+len(importStartFlag)], append(p.fmt(), src[end+1:]...)...) + + if bytes.Equal(ori, res) { + return ori, nil, nil + } + + return ori, res, nil +} diff --git a/vendor/github.com/denis-tingajkin/go-header/.gitignore b/vendor/github.com/denis-tingajkin/go-header/.gitignore new file mode 100644 index 00000000000..62c893550ad --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/vendor/github.com/denis-tingajkin/go-header/LICENSE b/vendor/github.com/denis-tingajkin/go-header/LICENSE new file mode 100644 index 00000000000..a2c9fda21f7 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/vendor/github.com/denis-tingajkin/go-header/README.md b/vendor/github.com/denis-tingajkin/go-header/README.md new file mode 100644 index 00000000000..43348b8bec7 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/README.md @@ -0,0 +1,69 @@ +# go-header +[![Actions Status](https://github.com/denis-tingajkin/go-header/workflows/ci/badge.svg)](https://github.com/denis-tingajkin/go-header/actions) + +Go source code linter providing checks for license headers. + +# Installation + +For installation you can simply use `go get`. + +``` +go get github.com/denis-tingajkin/go-header/cmd/go-header +``` + +# Configuration + +To configuring `go-header.yml` linter you simply need to fill the next structures in YAML format. +```go +// Configuration represents go-header linter setup parameters +type Configuration struct { + // Values is map of values. Supports two types 'const` and `regexp`. Values can be used recursively. + Values map[string]map[string]string `yaml:"values"'` + // Template is template for checking. Uses values. + Template string `yaml:"template"` + // TemplatePath path to the template file. Useful if need to load the template from a specific file. + TemplatePath string `yaml:"template-path"` +} +``` +Where supported two kinds of values: `const` and `regexp`. NOTE: values can be used recursively. +Values ​​with type `const` checks on equality. +Values ​​with type `regexp` checks on the match. + +# Execution + +`go-header` linter expects file path on input. If you want to run `go-header` only on diff files, then you can use this command +```bash +go-header $(git diff --name-only) +``` + +# Setup example + +## Step 1 +Create configuration file `.go-header.yaml` in the root of project. +```yaml +--- +values: + const: + MY COMPANY: mycompany.com +template-path: ./mypath/mytemplate.txt +``` +## Step 2 +Write the template file. For example for config above `mytemplate.txt` could be +```text +{{ MY COMPANY }} +SPDX-License-Identifier: Apache-2.0 + +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. +``` +## Step 3 +You are ready! Execute `go-header {FILES}` from the root of the project. diff --git a/vendor/github.com/denis-tingajkin/go-header/analyzer.go b/vendor/github.com/denis-tingajkin/go-header/analyzer.go new file mode 100644 index 00000000000..f4efe75a734 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/analyzer.go @@ -0,0 +1,98 @@ +package goheader + +import ( + "fmt" + "go/ast" + "strings" +) + +type Analyzer interface { + Analyze(file *ast.File) Issue +} + +type analyzer struct { + values map[string]Value + template string +} + +func (a *analyzer) Analyze(file *ast.File) Issue { + if a.template == "" { + return NewIssue("Missed template for check") + } + var header string + if len(file.Comments) > 0 && file.Comments[0].Pos() < file.Package { + if strings.HasPrefix(file.Comments[0].List[0].Text, "/*") { + header = (&ast.CommentGroup{List: []*ast.Comment{file.Comments[0].List[0]}}).Text() + } else { + header = file.Comments[0].Text() + } + } + header = strings.TrimSpace(header) + if header == "" { + return NewIssue("Missed header for check") + } + s := NewReader(header) + t := NewReader(a.template) + for !s.Done() && !t.Done() { + templateCh := t.Peek() + if templateCh == '{' { + name := a.readField(t) + if a.values[name] == nil { + return NewIssue(fmt.Sprintf("Template has unknown value: %v", name)) + } + if i := a.values[name].Read(s); i != nil { + return i + } + continue + } + sourceCh := s.Peek() + if sourceCh != templateCh { + l := s.Location() + notNextLine := func(r rune) bool { + return r != '\n' + } + actual := s.ReadWhile(notNextLine) + expected := t.ReadWhile(notNextLine) + return NewIssueWithLocation(fmt.Sprintf("Actual: %v\nExpected:%v", actual, expected), l) + } + s.Next() + t.Next() + } + if !s.Done() { + l := s.Location() + return NewIssueWithLocation(fmt.Sprintf("Unexpected string: %v", s.Finish()), l) + } + if !t.Done() { + l := s.Location() + return NewIssueWithLocation(fmt.Sprintf("Missed string: %v", t.Finish()), l) + } + return nil +} + +func (a *analyzer) readField(reader Reader) string { + _ = reader.Next() + _ = reader.Next() + + r := reader.ReadWhile(func(r rune) bool { + return r != '}' + }) + + _ = reader.Next() + _ = reader.Next() + + return strings.ToLower(strings.TrimSpace(r)) +} + +func New(options ...AnalyzerOption) Analyzer { + a := &analyzer{} + for _, o := range options { + o.apply(a) + } + for _, v := range a.values { + err := v.Calculate(a.values) + if err != nil { + panic(err.Error()) + } + } + return a +} diff --git a/vendor/github.com/denis-tingajkin/go-header/config.go b/vendor/github.com/denis-tingajkin/go-header/config.go new file mode 100644 index 00000000000..67e273b9bb4 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/config.go @@ -0,0 +1,69 @@ +package goheader + +import ( + "errors" + "fmt" + "gopkg.in/yaml.v2" + "io/ioutil" + "strings" +) + +// Configuration represents go-header linter setup parameters +type Configuration struct { + // Values is map of values. Supports two types 'const` and `regexp`. Values can be used recursively. + Values map[string]map[string]string `yaml:"values"'` + // Template is template for checking. Uses values. + Template string `yaml:"template"` + // TemplatePath path to the template file. Useful if need to load the template from a specific file. + TemplatePath string `yaml:"template-path"` +} + +func (c *Configuration) GetValues() (map[string]Value, error) { + var result = make(map[string]Value) + createConst := func(raw string) Value { + return &ConstValue{RawValue: raw} + } + createRegexp := func(raw string) Value { + return &RegexpValue{RawValue: raw} + } + appendValues := func(m map[string]string, create func(string) Value) { + for k, v := range m { + key := strings.ToLower(k) + result[key] = create(v) + } + } + for k, v := range c.Values { + switch k { + case "const": + appendValues(v, createConst) + case "regexp": + appendValues(v, createRegexp) + default: + return nil, fmt.Errorf("unknown value type %v", k) + } + } + return result, nil +} + +func (c *Configuration) GetTemplate() (string, error) { + if c.Template != "" { + return c.Template, nil + } + if c.TemplatePath == "" { + return "", errors.New("template has not passed") + } + if b, err := ioutil.ReadFile(c.TemplatePath); err != nil { + return "", err + } else { + c.Template = string(b) + return c.Template, nil + } +} + +func (c *Configuration) Parse(p string) error { + b, err := ioutil.ReadFile(p) + if err != nil { + return err + } + return yaml.Unmarshal(b, c) +} diff --git a/vendor/github.com/denis-tingajkin/go-header/go.mod b/vendor/github.com/denis-tingajkin/go-header/go.mod new file mode 100644 index 00000000000..c557afeb4f3 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/go.mod @@ -0,0 +1,10 @@ +module github.com/denis-tingajkin/go-header + +go 1.13 + +require ( + github.com/fatih/color v1.9.0 + github.com/sirupsen/logrus v1.6.0 + github.com/stretchr/testify v1.5.1 + gopkg.in/yaml.v2 v2.2.2 +) diff --git a/vendor/github.com/denis-tingajkin/go-header/go.sum b/vendor/github.com/denis-tingajkin/go-header/go.sum new file mode 100644 index 00000000000..4033b08f05c --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/go.sum @@ -0,0 +1,31 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/denis-tingajkin/go-header/issue.go b/vendor/github.com/denis-tingajkin/go-header/issue.go new file mode 100644 index 00000000000..d4921966a4d --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/issue.go @@ -0,0 +1,32 @@ +package goheader + +type Issue interface { + Location() Location + Message() string +} + +type issue struct { + msg string + location Location +} + +func (i *issue) Location() Location { + return i.location +} + +func (i *issue) Message() string { + return i.msg +} + +func NewIssueWithLocation(msg string, location Location) Issue { + return &issue{ + msg: msg, + location: location, + } +} + +func NewIssue(msg string) Issue { + return &issue{ + msg: msg, + } +} diff --git a/vendor/github.com/denis-tingajkin/go-header/location.go b/vendor/github.com/denis-tingajkin/go-header/location.go new file mode 100644 index 00000000000..fc33e48d8c1 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/location.go @@ -0,0 +1,12 @@ +package goheader + +import "fmt" + +type Location struct { + Line int + Position int +} + +func (l Location) String() string { + return fmt.Sprintf("%v:%v", l.Line+1, l.Position) +} diff --git a/vendor/github.com/denis-tingajkin/go-header/option.go b/vendor/github.com/denis-tingajkin/go-header/option.go new file mode 100644 index 00000000000..2adaa9a9181 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/option.go @@ -0,0 +1,28 @@ +package goheader + +import "strings" + +type AnalyzerOption interface { + apply(*analyzer) +} + +type applyAnalyzerOptionFunc func(*analyzer) + +func (f applyAnalyzerOptionFunc) apply(a *analyzer) { + f(a) +} + +func WithValues(values map[string]Value) AnalyzerOption { + return applyAnalyzerOptionFunc(func(a *analyzer) { + a.values = make(map[string]Value) + for k, v := range values { + a.values[strings.ToLower(k)] = v + } + }) +} + +func WithTemplate(template string) AnalyzerOption { + return applyAnalyzerOptionFunc(func(a *analyzer) { + a.template = template + }) +} diff --git a/vendor/github.com/denis-tingajkin/go-header/reader.go b/vendor/github.com/denis-tingajkin/go-header/reader.go new file mode 100644 index 00000000000..4386f30da78 --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/reader.go @@ -0,0 +1,105 @@ +package goheader + +type Reader interface { + Peek() rune + Next() rune + Done() bool + Finish() string + Position() int + Location() Location + SetPosition(int) + ReadWhile(func(rune) bool) string +} + +func NewReader(text string) Reader { + return &reader{source: text} +} + +type reader struct { + source string + position int + location Location +} + +func (r *reader) Position() int { + return r.position +} + +func (r *reader) Location() Location { + return r.location +} + +func (r *reader) Peek() rune { + if r.Done() { + return rune(0) + } + return rune(r.source[r.position]) +} + +func (r *reader) Done() bool { + return r.position >= len(r.source) +} + +func (r *reader) Next() rune { + if r.Done() { + return rune(0) + } + reuslt := r.Peek() + if reuslt == '\n' { + r.location.Line++ + r.location.Position = 0 + } else { + r.location.Position++ + } + r.position++ + return reuslt +} + +func (r *reader) Finish() string { + if r.position >= len(r.source) { + return "" + } + defer r.till() + return r.source[r.position:] +} + +func (r *reader) SetPosition(pos int) { + if pos < 0 { + r.position = 0 + } + r.position = pos + r.location = r.calculateLocation() +} + +func (r *reader) ReadWhile(match func(rune) bool) string { + if match == nil { + return "" + } + start := r.position + for !r.Done() && match(r.Peek()) { + r.Next() + } + return r.source[start:r.position] +} + +func (r *reader) till() { + r.position = len(r.source) + r.location = r.calculateLocation() +} + +func (r *reader) calculateLocation() Location { + min := len(r.source) + if min > r.position { + min = r.position + } + x, y := 0, 0 + for i := 0; i < min; i++ { + if r.source[i] == '\n' { + y++ + x = 0 + } else { + x++ + } + } + return Location{Line: y, Position: x} +} diff --git a/vendor/github.com/denis-tingajkin/go-header/value.go b/vendor/github.com/denis-tingajkin/go-header/value.go new file mode 100644 index 00000000000..bebc03b6e5b --- /dev/null +++ b/vendor/github.com/denis-tingajkin/go-header/value.go @@ -0,0 +1,112 @@ +package goheader + +import ( + "errors" + "fmt" + "regexp" + "strings" +) + +type Calculable interface { + Calculate(map[string]Value) error + Get() string +} + +type Value interface { + Calculable + Read(Reader) Issue +} + +func calculateValue(calculable Calculable, values map[string]Value) (string, error) { + sb := strings.Builder{} + r := calculable.Get() + var endIndex int + var startIndex int + for startIndex = strings.Index(r, "{{"); startIndex >= 0; startIndex = strings.Index(r, "{{") { + _, _ = sb.WriteString(r[:startIndex]) + endIndex = strings.Index(r, "}}") + if endIndex < 0 { + return "", errors.New("missed value ending") + } + subVal := strings.ToLower(strings.TrimSpace(r[startIndex+2 : endIndex])) + if val := values[subVal]; val != nil { + if err := val.Calculate(values); err != nil { + return "", err + } + sb.WriteString(val.Get()) + } else { + return "", fmt.Errorf("unknown value name %v", subVal) + } + endIndex += 2 + r = r[endIndex:] + } + _, _ = sb.WriteString(r) + return sb.String(), nil +} + +type ConstValue struct { + RawValue string +} + +func (c *ConstValue) Calculate(values map[string]Value) error { + v, err := calculateValue(c, values) + if err != nil { + return err + } + c.RawValue = v + return nil +} + +func (c *ConstValue) Get() string { + return c.RawValue +} + +func (c *ConstValue) Read(s Reader) Issue { + l := s.Location() + p := s.Position() + for _, ch := range c.Get() { + if ch != s.Peek() { + s.SetPosition(p) + f := s.ReadWhile(func(r rune) bool { + return r != '\n' + }) + return NewIssueWithLocation(fmt.Sprintf("Expected:%v, Actual: %v", c.Get(), f), l) + } + s.Next() + } + return nil +} + +type RegexpValue struct { + RawValue string +} + +func (r *RegexpValue) Calculate(values map[string]Value) error { + v, err := calculateValue(r, values) + if err != nil { + return err + } + r.RawValue = v + return nil +} + +func (r *RegexpValue) Get() string { + return r.RawValue +} + +func (r *RegexpValue) Read(s Reader) Issue { + l := s.Location() + p := regexp.MustCompile(r.Get()) + pos := s.Position() + str := s.Finish() + s.SetPosition(pos) + indexes := p.FindAllIndex([]byte(str), -1) + if len(indexes) == 0 { + return NewIssueWithLocation(fmt.Sprintf("Pattern %v doesn't match.", p.String()), l) + } + s.SetPosition(pos + indexes[0][1]) + return nil +} + +var _ Value = &ConstValue{} +var _ Value = &RegexpValue{} diff --git a/vendor/github.com/docker/spdystream/connection.go b/vendor/github.com/docker/spdystream/connection.go index 6031a0db1ab..2023ecf842f 100644 --- a/vendor/github.com/docker/spdystream/connection.go +++ b/vendor/github.com/docker/spdystream/connection.go @@ -14,7 +14,7 @@ import ( var ( ErrInvalidStreamId = errors.New("Invalid stream id") - ErrTimeout = errors.New("Timeout occured") + ErrTimeout = errors.New("Timeout occurred") ErrReset = errors.New("Stream reset") ErrWriteClosedStream = errors.New("Write on closed stream") ) @@ -325,7 +325,7 @@ Loop: readFrame, err := s.framer.ReadFrame() if err != nil { if err != io.EOF { - fmt.Errorf("frame read error: %s", err) + debugMessage("frame read error: %s", err) } else { debugMessage("(%p) EOF received", s) } @@ -421,7 +421,7 @@ func (s *Connection) frameHandler(frameQueue *PriorityFrameQueue, newHandler Str } if frameErr != nil { - fmt.Errorf("frame handling error: %s", frameErr) + debugMessage("frame handling error: %s", frameErr) } } } @@ -451,6 +451,7 @@ func (s *Connection) addStreamFrame(frame *spdy.SynStreamFrame) { dataChan: make(chan []byte), headerChan: make(chan http.Header), closeChan: make(chan bool), + priority: frame.Priority, } if frame.CFHeader.Flags&spdy.ControlFlagFin != 0x00 { stream.closeRemoteChannels() @@ -473,7 +474,7 @@ func (s *Connection) checkStreamFrame(frame *spdy.SynStreamFrame) bool { go func() { resetErr := s.sendResetFrame(spdy.ProtocolError, frame.StreamId) if resetErr != nil { - fmt.Errorf("reset error: %s", resetErr) + debugMessage("reset error: %s", resetErr) } }() return false @@ -718,7 +719,7 @@ func (s *Connection) shutdown(closeTimeout time.Duration) { select { case err, ok := <-s.shutdownChan: if ok { - fmt.Errorf("Unhandled close error after %s: %s", duration, err) + debugMessage("Unhandled close error after %s: %s", duration, err) } default: } diff --git a/vendor/github.com/docker/spdystream/handlers.go b/vendor/github.com/docker/spdystream/handlers.go index b59fa5fdcd0..d4ee7be8158 100644 --- a/vendor/github.com/docker/spdystream/handlers.go +++ b/vendor/github.com/docker/spdystream/handlers.go @@ -30,9 +30,7 @@ func MirrorStreamHandler(stream *Stream) { }() } -// NoopStreamHandler does nothing when stream connects, most -// likely used with RejectAuthHandler which will not allow any -// streams to make it to the stream handler. +// NoopStreamHandler does nothing when stream connects. func NoOpStreamHandler(stream *Stream) { stream.SendReply(http.Header{}, false) } diff --git a/vendor/github.com/emicklei/go-restful/.gitignore b/vendor/github.com/emicklei/go-restful/.gitignore index cece7be6649..446be09b4d0 100644 --- a/vendor/github.com/emicklei/go-restful/.gitignore +++ b/vendor/github.com/emicklei/go-restful/.gitignore @@ -68,3 +68,4 @@ examples/restful-html-template s.html restful-path-tail +.idea diff --git a/vendor/github.com/emicklei/go-restful/.travis.yml b/vendor/github.com/emicklei/go-restful/.travis.yml index b22f8f547ee..3a0bf5ff1b8 100644 --- a/vendor/github.com/emicklei/go-restful/.travis.yml +++ b/vendor/github.com/emicklei/go-restful/.travis.yml @@ -3,4 +3,11 @@ language: go go: - 1.x -script: go test -v \ No newline at end of file +before_install: + - go test -v + +script: + - go test -race -coverprofile=coverage.txt -covermode=atomic + +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/CHANGES.md b/vendor/github.com/emicklei/go-restful/CHANGES.md index e525296313e..a69393d1ab7 100644 --- a/vendor/github.com/emicklei/go-restful/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful/CHANGES.md @@ -1,59 +1,92 @@ -## Change history of go-restful +# Change history of go-restful +## [v2.14.1] - 2020-08-31 + +- Added check on writer to prevent compression of response twice. #447 + +## [v2.14.0] - 2020-08-19 + +- Enable content encoding on Handle and ServeHTTP (#446) +- List available representations in 406 body (#437) +- Convert to string using rune() (#443) + +## [v2.13.0] - 2020-06-21 + +- 405 Method Not Allowed must have Allow header (#436) +- add field allowedMethodsWithoutContentType (#424) + +## v2.12.0 + +- support describing response headers (#426) +- fix openapi examples (#425) +- merge v3 fix (#422) + +## v2.11.1 + +- fix WriteError return value (#415) + +## v2.11.0 + +- allow prefix and suffix in path variable expression (#414) + +## v2.9.6 + +- support google custome verb (#413) + +## v2.9.5 -v2.9.5 - fix panic in Response.WriteError if err == nil -v2.9.4 +## v2.9.4 - fix issue #400 , parsing mime type quality - Route Builder added option for contentEncodingEnabled (#398) -v2.9.3 +## v2.9.3 - Avoid return of 415 Unsupported Media Type when request body is empty (#396) -v2.9.2 +## v2.9.2 - Reduce allocations in per-request methods to improve performance (#395) -v2.9.1 +## v2.9.1 - Fix issue with default responses and invalid status code 0. (#393) -v2.9.0 +## v2.9.0 - add per Route content encoding setting (overrides container setting) -v2.8.0 +## v2.8.0 - add Request.QueryParameters() - add json-iterator (via build tag) - disable vgo module (until log is moved) -v2.7.1 +## v2.7.1 - add vgo module -v2.6.1 +## v2.6.1 - add JSONNewDecoderFunc to allow custom JSON Decoder usage (go 1.10+) -v2.6.0 +## v2.6.0 - Make JSR 311 routing and path param processing consistent - Adding description to RouteBuilder.Reads() - Update example for Swagger12 and OpenAPI -2017-09-13 +## 2017-09-13 - added route condition functions using `.If(func)` in route building. -2017-02-16 +## 2017-02-16 - solved issue #304, make operation names unique -2017-01-30 +## 2017-01-30 [IMPORTANT] For swagger users, change your import statement to: swagger "github.com/emicklei/go-restful-swagger12" @@ -61,60 +94,60 @@ v2.6.0 - moved swagger 1.2 code to go-restful-swagger12 - created TAG 2.0.0 -2017-01-27 +## 2017-01-27 - remove defer request body close - expose Dispatch for testing filters and Routefunctions - swagger response model cannot be array - created TAG 1.0.0 -2016-12-22 +## 2016-12-22 - (API change) Remove code related to caching request content. Removes SetCacheReadEntity(doCache bool) -2016-11-26 +## 2016-11-26 - Default change! now use CurlyRouter (was RouterJSR311) - Default change! no more caching of request content - Default change! do not recover from panics -2016-09-22 +## 2016-09-22 - fix the DefaultRequestContentType feature -2016-02-14 +## 2016-02-14 - take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response - add constructors for custom entity accessors for xml and json -2015-09-27 +## 2015-09-27 - rename new WriteStatusAnd... to WriteHeaderAnd... for consistency -2015-09-25 +## 2015-09-25 - fixed problem with changing Header after WriteHeader (issue 235) -2015-09-14 +## 2015-09-14 - changed behavior of WriteHeader (immediate write) and WriteEntity (no status write) - added support for custom EntityReaderWriters. -2015-08-06 +## 2015-08-06 - add support for reading entities from compressed request content - use sync.Pool for compressors of http response and request body - add Description to Parameter for documentation in Swagger UI -2015-03-20 +## 2015-03-20 - add configurable logging -2015-03-18 +## 2015-03-18 - if not specified, the Operation is derived from the Route function -2015-03-17 +## 2015-03-17 - expose Parameter creation functions - make trace logger an interface @@ -123,26 +156,26 @@ v2.6.0 - JSR311 router now handles wildcards - add Notes to Route -2014-11-27 +## 2014-11-27 - (api add) PrettyPrint per response. (as proposed in #167) -2014-11-12 +## 2014-11-12 - (api add) ApiVersion(.) for documentation in Swagger UI -2014-11-10 +## 2014-11-10 - (api change) struct fields tagged with "description" show up in Swagger UI -2014-10-31 +## 2014-10-31 - (api change) ReturnsError -> Returns - (api add) RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder - fix swagger nested structs - sort Swagger response messages by code -2014-10-23 +## 2014-10-23 - (api add) ReturnsError allows you to document Http codes in swagger - fixed problem with greedy CurlyRouter @@ -156,73 +189,73 @@ v2.6.0 - (api add) added AllowedDomains in CORS - (api add) ParameterNamed for detailed documentation -2014-04-16 +## 2014-04-16 - (api add) expose constructor of Request for testing. -2014-06-27 +## 2014-06-27 - (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification). - (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons). -2014-07-03 +## 2014-07-03 - (api add) CORS can be configured with a list of allowed domains -2014-03-12 +## 2014-03-12 - (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter) -2014-02-26 +## 2014-02-26 - (api add) Request now provides information about the matched Route, see method SelectedRoutePath -2014-02-17 +## 2014-02-17 - (api change) renamed parameter constants (go-lint checks) -2014-01-10 +## 2014-01-10 - (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier -2014-01-07 +## 2014-01-07 - (api change) Write* methods in Response now return the error or nil. - added example of serving HTML from a Go template. - fixed comparing Allowed headers in CORS (is now case-insensitive) -2013-11-13 +## 2013-11-13 - (api add) Response knows how many bytes are written to the response body. -2013-10-29 +## 2013-10-29 - (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information. -2013-10-04 +## 2013-10-04 - (api add) Response knows what HTTP status has been written - (api add) Request can have attributes (map of string->interface, also called request-scoped variables -2013-09-12 +## 2013-09-12 - (api change) Router interface simplified - Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths -2013-08-05 +## 2013-08-05 - add OPTIONS support - add CORS support -2013-08-27 +## 2013-08-27 - fixed some reported issues (see github) - (api change) deprecated use of WriteError; use WriteErrorString instead -2014-04-15 +## 2014-04-15 - (fix) v1.0.1 tag: fix Issue 111: WriteErrorString -2013-08-08 +## 2013-08-08 - (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer. - (api add) the swagger package has be extended to have a UI per container. @@ -235,38 +268,38 @@ Important API changes: - (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead. -2013-07-06 +## 2013-07-06 - (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature. -2013-06-19 +## 2013-06-19 - (improve) DoNotRecover option, moved request body closer, improved ReadEntity -2013-06-03 +## 2013-06-03 - (api change) removed Dispatcher interface, hide PathExpression - changed receiver names of type functions to be more idiomatic Go -2013-06-02 +## 2013-06-02 - (optimize) Cache the RegExp compilation of Paths. -2013-05-22 +## 2013-05-22 - (api add) Added support for request/response filter functions -2013-05-18 +## 2013-05-18 - (api add) Added feature to change the default Http Request Dispatch function (travis cline) - (api change) Moved Swagger Webservice to swagger package (see example restful-user) -[2012-11-14 .. 2013-05-18> +## [2012-11-14 .. 2013-05-18> - See https://github.com/emicklei/go-restful/commits -2012-11-14 +## 2012-11-14 - Initial commit diff --git a/vendor/github.com/emicklei/go-restful/README.md b/vendor/github.com/emicklei/go-restful/README.md index f52c25acf6e..4b4d26e72e9 100644 --- a/vendor/github.com/emicklei/go-restful/README.md +++ b/vendor/github.com/emicklei/go-restful/README.md @@ -4,7 +4,8 @@ package for building REST-style Web Services using Google Go [![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful) [![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful) -[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://godoc.org/github.com/emicklei/go-restful) +[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://pkg.go.dev/github.com/emicklei/go-restful) +[![codecov](https://codecov.io/gh/emicklei/go-restful/branch/master/graph/badge.svg)](https://codecov.io/gh/emicklei/go-restful) - [Code examples](https://github.com/emicklei/go-restful/tree/master/examples) @@ -18,6 +19,28 @@ REST asks developers to use HTTP methods explicitly and in a way that's consiste - PATCH = Update partial content of a resource - OPTIONS = Get information about the communication options for the request URI +### Usage + +#### Without Go Modules + +All versions up to `v2.*.*` (on the master) are not supporting Go modules. + +``` +import ( + restful "github.com/emicklei/go-restful" +) +``` + +#### Using Go Modules + +As of version `v3.0.0` (on the v3 branch), this package supports Go modules. + +``` +import ( + restful "github.com/emicklei/go-restful/v3" +) +``` + ### Example ```Go @@ -43,9 +66,9 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo ### Features -- Routes for request → function mapping with path parameter (e.g. {id}) support +- Routes for request → function mapping with path parameter (e.g. {id} but also prefix_{var} and {var}_suffix) support - Configurable router: - - (default) Fast routing algorithm that allows static elements, regular expressions and dynamic parameters in the URL path (e.g. /meetings/{id} or /static/{subpath:*} + - (default) Fast routing algorithm that allows static elements, [google custom method](https://cloud.google.com/apis/design/custom_methods), regular expressions and dynamic parameters in the URL path (e.g. /resource/name:customVerb, /meetings/{id} or /static/{subpath:*}) - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions - Request API for reading structs from JSON/XML and accesing parameters (path,query,header) - Response API for writing structs to JSON/XML and setting headers @@ -85,4 +108,4 @@ TODO: write examples of these. Type ```git shortlog -s``` for a full list of contributors. -© 2012 - 2018, http://ernestmicklei.com. MIT License. Contributions are welcome. +© 2012 - 2020, http://ernestmicklei.com. MIT License. Contributions are welcome. diff --git a/vendor/github.com/emicklei/go-restful/container.go b/vendor/github.com/emicklei/go-restful/container.go index 061a8d7189b..a61e650a4a5 100644 --- a/vendor/github.com/emicklei/go-restful/container.go +++ b/vendor/github.com/emicklei/go-restful/container.go @@ -185,6 +185,11 @@ func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) // when a ServiceError is returned during route selection. Default implementation // calls resp.WriteErrorString(err.Code, err.Message) func writeServiceError(err ServiceError, req *Request, resp *Response) { + for header, values := range err.Header { + for _, value := range values { + resp.Header().Add(header, value) + } + } resp.WriteErrorString(err.Code, err.Message) } @@ -272,16 +277,13 @@ func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.R pathParams := pathProcessor.ExtractParameters(route, webService, httpRequest.URL.Path) wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest, pathParams) // pass through filters (if any) - if len(c.containerFilters)+len(webService.filters)+len(route.Filters) > 0 { + if size := len(c.containerFilters) + len(webService.filters) + len(route.Filters); size > 0 { // compose filter chain - allFilters := []FilterFunction{} + allFilters := make([]FilterFunction, 0, size) allFilters = append(allFilters, c.containerFilters...) allFilters = append(allFilters, webService.filters...) allFilters = append(allFilters, route.Filters...) - chain := FilterChain{Filters: allFilters, Target: func(req *Request, resp *Response) { - // handle request by route after passing all filters - route.Function(wrappedRequest, wrappedResponse) - }} + chain := FilterChain{Filters: allFilters, Target: route.Function} chain.ProcessFilter(wrappedRequest, wrappedResponse) } else { // no filters, handle request by route @@ -299,13 +301,70 @@ func fixedPrefixPath(pathspec string) string { } // ServeHTTP implements net/http.Handler therefore a Container can be a Handler in a http.Server -func (c *Container) ServeHTTP(httpwriter http.ResponseWriter, httpRequest *http.Request) { - c.ServeMux.ServeHTTP(httpwriter, httpRequest) +func (c *Container) ServeHTTP(httpWriter http.ResponseWriter, httpRequest *http.Request) { + // Skip, if httpWriter is already an CompressingResponseWriter + if _, ok := httpWriter.(*CompressingResponseWriter); ok { + c.ServeMux.ServeHTTP(httpWriter, httpRequest) + return + } + + writer := httpWriter + // CompressingResponseWriter should be closed after all operations are done + defer func() { + if compressWriter, ok := writer.(*CompressingResponseWriter); ok { + compressWriter.Close() + } + }() + + if c.contentEncodingEnabled { + doCompress, encoding := wantsCompressedResponse(httpRequest) + if doCompress { + var err error + writer, err = NewCompressingResponseWriter(httpWriter, encoding) + if err != nil { + log.Print("unable to install compressor: ", err) + httpWriter.WriteHeader(http.StatusInternalServerError) + return + } + } + } + + c.ServeMux.ServeHTTP(writer, httpRequest) } // Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics. func (c *Container) Handle(pattern string, handler http.Handler) { - c.ServeMux.Handle(pattern, handler) + c.ServeMux.Handle(pattern, http.HandlerFunc(func(httpWriter http.ResponseWriter, httpRequest *http.Request) { + // Skip, if httpWriter is already an CompressingResponseWriter + if _, ok := httpWriter.(*CompressingResponseWriter); ok { + handler.ServeHTTP(httpWriter, httpRequest) + return + } + + writer := httpWriter + + // CompressingResponseWriter should be closed after all operations are done + defer func() { + if compressWriter, ok := writer.(*CompressingResponseWriter); ok { + compressWriter.Close() + } + }() + + if c.contentEncodingEnabled { + doCompress, encoding := wantsCompressedResponse(httpRequest) + if doCompress { + var err error + writer, err = NewCompressingResponseWriter(httpWriter, encoding) + if err != nil { + log.Print("unable to install compressor: ", err) + httpWriter.WriteHeader(http.StatusInternalServerError) + return + } + } + } + + handler.ServeHTTP(writer, httpRequest) + })) } // HandleWithFilter registers the handler for the given pattern. @@ -319,7 +378,7 @@ func (c *Container) HandleWithFilter(pattern string, handler http.Handler) { } chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - handler.ServeHTTP(httpResponse, httpRequest) + handler.ServeHTTP(resp, req.Request) }} chain.ProcessFilter(NewRequest(httpRequest), NewResponse(httpResponse)) } diff --git a/vendor/github.com/emicklei/go-restful/curly.go b/vendor/github.com/emicklei/go-restful/curly.go index 14d5b76bf08..ba1fc5d5f15 100644 --- a/vendor/github.com/emicklei/go-restful/curly.go +++ b/vendor/github.com/emicklei/go-restful/curly.go @@ -47,7 +47,7 @@ func (c CurlyRouter) SelectRoute( func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes { candidates := make(sortableCurlyRoutes, 0, 8) for _, each := range ws.routes { - matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens) + matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens, each.hasCustomVerb) if matches { candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers? } @@ -57,7 +57,7 @@ func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortab } // matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are. -func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string) (matches bool, paramCount int, staticCount int) { +func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string, routeHasCustomVerb bool) (matches bool, paramCount int, staticCount int) { if len(routeTokens) < len(requestTokens) { // proceed in matching only if last routeToken is wildcard count := len(routeTokens) @@ -72,6 +72,15 @@ func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []strin return false, 0, 0 } requestToken := requestTokens[i] + if routeHasCustomVerb && hasCustomVerb(routeToken){ + if !isMatchCustomVerb(routeToken, requestToken) { + return false, 0, 0 + } + staticCount++ + requestToken = removeCustomVerb(requestToken) + routeToken = removeCustomVerb(routeToken) + } + if strings.HasPrefix(routeToken, "{") { paramCount++ if colon := strings.Index(routeToken, ":"); colon != -1 { diff --git a/vendor/github.com/emicklei/go-restful/custom_verb.go b/vendor/github.com/emicklei/go-restful/custom_verb.go new file mode 100644 index 00000000000..bfc17efde80 --- /dev/null +++ b/vendor/github.com/emicklei/go-restful/custom_verb.go @@ -0,0 +1,29 @@ +package restful + +import ( + "fmt" + "regexp" +) + +var ( + customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") +) + +func hasCustomVerb(routeToken string) bool { + return customVerbReg.MatchString(routeToken) +} + +func isMatchCustomVerb(routeToken string, pathToken string) bool { + rs := customVerbReg.FindStringSubmatch(routeToken) + if len(rs) < 2 { + return false + } + + customVerb := rs[1] + specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb)) + return specificVerbReg.MatchString(pathToken) +} + +func removeCustomVerb(str string) string { + return customVerbReg.ReplaceAllString(str, "") +} diff --git a/vendor/github.com/emicklei/go-restful/jsr311.go b/vendor/github.com/emicklei/go-restful/jsr311.go index 3ede1891eca..9cfd59a1ce6 100644 --- a/vendor/github.com/emicklei/go-restful/jsr311.go +++ b/vendor/github.com/emicklei/go-restful/jsr311.go @@ -9,6 +9,7 @@ import ( "fmt" "net/http" "sort" + "strings" ) // RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions) @@ -98,7 +99,18 @@ func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*R if trace { traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(previous), httpRequest.Method) } - return nil, NewError(http.StatusMethodNotAllowed, "405: Method Not Allowed") + allowed := []string{} + allowedLoop: + for _, candidate := range previous { + for _, method := range allowed { + if method == candidate.Method { + continue allowedLoop + } + } + allowed = append(allowed, candidate.Method) + } + header := http.Header{"Allow": []string{strings.Join(allowed, ", ")}} + return nil, NewErrorWithHeader(http.StatusMethodNotAllowed, "405: Method Not Allowed", header) } // content-type @@ -135,7 +147,14 @@ func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*R if trace { traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(previous), accept) } - return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable") + available := []string{} + for _, candidate := range previous { + available = append(available, candidate.Produces...) + } + return nil, NewError( + http.StatusNotAcceptable, + fmt.Sprintf("406: Not Acceptable\n\nAvailable representations: %s", strings.Join(available, ", ")), + ) } // return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil return candidates[0], nil diff --git a/vendor/github.com/emicklei/go-restful/path_processor.go b/vendor/github.com/emicklei/go-restful/path_processor.go index 357c723a7ae..14157324506 100644 --- a/vendor/github.com/emicklei/go-restful/path_processor.go +++ b/vendor/github.com/emicklei/go-restful/path_processor.go @@ -29,7 +29,12 @@ func (d defaultPathProcessor) ExtractParameters(r *Route, _ *WebService, urlPath } else { value = urlParts[i] } - if strings.HasPrefix(key, "{") { // path-parameter + if r.hasCustomVerb && hasCustomVerb(key) { + key = removeCustomVerb(key) + value = removeCustomVerb(value) + } + + if strings.Index(key, "{") > -1 { // path-parameter if colon := strings.Index(key, ":"); colon != -1 { // extract by regex regPart := key[colon+1 : len(key)-1] @@ -42,7 +47,13 @@ func (d defaultPathProcessor) ExtractParameters(r *Route, _ *WebService, urlPath } } else { // without enclosing {} - pathParameters[key[1:len(key)-1]] = value + startIndex := strings.Index(key, "{") + endKeyIndex := strings.Index(key, "}") + + suffixLength := len(key) - endKeyIndex - 1 + endValueIndex := len(value) - suffixLength + + pathParameters[key[startIndex+1:endKeyIndex]] = value[startIndex:endValueIndex] } } } diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go index fbb48f2da88..e2f78f00f75 100644 --- a/vendor/github.com/emicklei/go-restful/response.go +++ b/vendor/github.com/emicklei/go-restful/response.go @@ -174,15 +174,16 @@ func (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType return writeJSON(r, status, contentType, value) } -// WriteError write the http status and the error string on the response. err can be nil. -func (r *Response) WriteError(httpStatus int, err error) error { +// WriteError writes the http status and the error string on the response. err can be nil. +// Return an error if writing was not succesful. +func (r *Response) WriteError(httpStatus int, err error) (writeErr error) { r.err = err if err == nil { - r.WriteErrorString(httpStatus, "") + writeErr = r.WriteErrorString(httpStatus, "") } else { - r.WriteErrorString(httpStatus, err.Error()) + writeErr = r.WriteErrorString(httpStatus, err.Error()) } - return err + return writeErr } // WriteServiceError is a convenience method for a responding with a status and a ServiceError diff --git a/vendor/github.com/emicklei/go-restful/route.go b/vendor/github.com/emicklei/go-restful/route.go index 6d15dbf66fe..598aa57a76e 100644 --- a/vendor/github.com/emicklei/go-restful/route.go +++ b/vendor/github.com/emicklei/go-restful/route.go @@ -49,11 +49,20 @@ type Route struct { //Overrides the container.contentEncodingEnabled contentEncodingEnabled *bool + + // indicate route path has custom verb + hasCustomVerb bool + + // if a request does not include a content-type header then + // depending on the method, it may return a 415 Unsupported Media + // Must have uppercase HTTP Method names such as GET,HEAD,OPTIONS,... + allowedMethodsWithoutContentType []string } // Initialize for Route func (r *Route) postBuild() { r.pathParts = tokenizePath(r.Path) + r.hasCustomVerb = hasCustomVerb(r.Path) } // Create Request and Response from their http versions @@ -67,17 +76,6 @@ func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest return wrappedRequest, wrappedResponse } -// dispatchWithFilters call the function after passing through its own filters -func (r *Route) dispatchWithFilters(wrappedRequest *Request, wrappedResponse *Response) { - if len(r.Filters) > 0 { - chain := FilterChain{Filters: r.Filters, Target: r.Function} - chain.ProcessFilter(wrappedRequest, wrappedResponse) - } else { - // unfiltered - r.Function(wrappedRequest, wrappedResponse) - } -} - func stringTrimSpaceCutset(r rune) bool { return r == ' ' } @@ -121,8 +119,17 @@ func (r Route) matchesContentType(mimeTypes string) bool { if len(mimeTypes) == 0 { // idempotent methods with (most-likely or guaranteed) empty content match missing Content-Type m := r.Method - if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" { - return true + // if route specifies less or non-idempotent methods then use that + if len(r.allowedMethodsWithoutContentType) > 0 { + for _, each := range r.allowedMethodsWithoutContentType { + if m == each { + return true + } + } + } else { + if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" { + return true + } } // proceed with default mimeTypes = MIME_OCTET diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go index 0fccf61e94e..1d67a4c2358 100644 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ b/vendor/github.com/emicklei/go-restful/route_builder.go @@ -17,14 +17,15 @@ import ( // RouteBuilder is a helper to construct Routes. type RouteBuilder struct { - rootPath string - currentPath string - produces []string - consumes []string - httpMethod string // required - function RouteFunction // required - filters []FilterFunction - conditions []RouteSelectionConditionFunction + rootPath string + currentPath string + produces []string + consumes []string + httpMethod string // required + function RouteFunction // required + filters []FilterFunction + conditions []RouteSelectionConditionFunction + allowedMethodsWithoutContentType []string // see Route typeNameHandleFunc TypeNameHandleFunction // required @@ -176,6 +177,15 @@ func (b *RouteBuilder) Returns(code int, message string, model interface{}) *Rou return b } +// ReturnsWithHeaders is similar to Returns, but can specify response headers +func (b *RouteBuilder) ReturnsWithHeaders(code int, message string, model interface{}, headers map[string]Header) *RouteBuilder { + b.Returns(code, message, model) + err := b.errorMap[code] + err.Headers = headers + b.errorMap[code] = err + return b +} + // DefaultReturns is a special Returns call that sets the default of the response. func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder { b.defaultResponse = &ResponseError{ @@ -200,14 +210,41 @@ func (b *RouteBuilder) Deprecate() *RouteBuilder { return b } +// AllowedMethodsWithoutContentType overides the default list GET,HEAD,OPTIONS,DELETE,TRACE +// If a request does not include a content-type header then +// depending on the method, it may return a 415 Unsupported Media. +// Must have uppercase HTTP Method names such as GET,HEAD,OPTIONS,... +func (b *RouteBuilder) AllowedMethodsWithoutContentType(methods []string) *RouteBuilder { + b.allowedMethodsWithoutContentType = methods + return b +} + // ResponseError represents a response; not necessarily an error. type ResponseError struct { Code int Message string Model interface{} + Headers map[string]Header IsDefault bool } +// Header describes a header for a response of the API +// +// For more information: http://goo.gl/8us55a#headerObject +type Header struct { + *Items + Description string +} + +// Items describe swagger simple schemas for headers +type Items struct { + Type string + Format string + Items *Items + CollectionFormat string + Default interface{} +} + func (b *RouteBuilder) servicePath(path string) *RouteBuilder { b.rootPath = path return b @@ -276,26 +313,27 @@ func (b *RouteBuilder) Build() Route { operationName = nameOfFunction(b.function) } route := Route{ - Method: b.httpMethod, - Path: concatPath(b.rootPath, b.currentPath), - Produces: b.produces, - Consumes: b.consumes, - Function: b.function, - Filters: b.filters, - If: b.conditions, - relativePath: b.currentPath, - pathExpr: pathExpr, - Doc: b.doc, - Notes: b.notes, - Operation: operationName, - ParameterDocs: b.parameters, - ResponseErrors: b.errorMap, - DefaultResponse: b.defaultResponse, - ReadSample: b.readSample, - WriteSample: b.writeSample, - Metadata: b.metadata, - Deprecated: b.deprecated, - contentEncodingEnabled: b.contentEncodingEnabled, + Method: b.httpMethod, + Path: concatPath(b.rootPath, b.currentPath), + Produces: b.produces, + Consumes: b.consumes, + Function: b.function, + Filters: b.filters, + If: b.conditions, + relativePath: b.currentPath, + pathExpr: pathExpr, + Doc: b.doc, + Notes: b.notes, + Operation: operationName, + ParameterDocs: b.parameters, + ResponseErrors: b.errorMap, + DefaultResponse: b.defaultResponse, + ReadSample: b.readSample, + WriteSample: b.writeSample, + Metadata: b.metadata, + Deprecated: b.deprecated, + contentEncodingEnabled: b.contentEncodingEnabled, + allowedMethodsWithoutContentType: b.allowedMethodsWithoutContentType, } route.postBuild() return route diff --git a/vendor/github.com/emicklei/go-restful/service_error.go b/vendor/github.com/emicklei/go-restful/service_error.go index 62d1108bbda..a4157546944 100644 --- a/vendor/github.com/emicklei/go-restful/service_error.go +++ b/vendor/github.com/emicklei/go-restful/service_error.go @@ -4,12 +4,16 @@ package restful // Use of this source code is governed by a license // that can be found in the LICENSE file. -import "fmt" +import ( + "fmt" + "net/http" +) // ServiceError is a transport object to pass information about a non-Http error occurred in a WebService while processing a request. type ServiceError struct { Code int Message string + Header http.Header } // NewError returns a ServiceError using the code and reason @@ -17,6 +21,11 @@ func NewError(code int, message string) ServiceError { return ServiceError{Code: code, Message: message} } +// NewErrorWithHeader returns a ServiceError using the code, reason and header +func NewErrorWithHeader(code int, message string, header http.Header) ServiceError { + return ServiceError{Code: code, Message: message, Header: header} +} + // Error returns a text representation of the service error func (s ServiceError) Error() string { return fmt.Sprintf("[ServiceError:%v] %v", s.Code, s.Message) diff --git a/vendor/github.com/emicklei/go-restful/web_service.go b/vendor/github.com/emicklei/go-restful/web_service.go index 77ba9a8cfc5..4f907967446 100644 --- a/vendor/github.com/emicklei/go-restful/web_service.go +++ b/vendor/github.com/emicklei/go-restful/web_service.go @@ -188,7 +188,7 @@ func (w *WebService) RemoveRoute(path, method string) error { continue } newRoutes[current] = w.routes[ix] - current = current + 1 + current++ } w.routes = newRoutes return nil diff --git a/vendor/github.com/fatih/color/README.md b/vendor/github.com/fatih/color/README.md index 42d9abc07ed..d62e4024aa5 100644 --- a/vendor/github.com/fatih/color/README.md +++ b/vendor/github.com/fatih/color/README.md @@ -1,20 +1,11 @@ -# Archived project. No maintenance. - -This project is not maintained anymore and is archived. Feel free to fork and -make your own changes if needed. For more detail read my blog post: [Taking an indefinite sabbatical from my projects](https://arslan.io/2018/10/09/taking-an-indefinite-sabbatical-from-my-projects/) - -Thanks to everyone for their valuable feedback and contributions. - - -# Color [![GoDoc](https://godoc.org/github.com/fatih/color?status.svg)](https://godoc.org/github.com/fatih/color) +# color [![](https://github.com/fatih/color/workflows/build/badge.svg)](https://github.com/fatih/color/actions) [![PkgGoDev](https://pkg.go.dev/badge/github.com/fatih/color)](https://pkg.go.dev/github.com/fatih/color) Color lets you use colorized outputs in terms of [ANSI Escape Codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It has support for Windows too! The API can be used in several ways, pick one that suits you. - -![Color](https://i.imgur.com/c1JI0lA.png) +![Color](https://user-images.githubusercontent.com/438920/96832689-03b3e000-13f4-11eb-9803-46f4c4de3406.jpg) ## Install diff --git a/vendor/github.com/fatih/color/go.mod b/vendor/github.com/fatih/color/go.mod index bc0df754586..78872815ea6 100644 --- a/vendor/github.com/fatih/color/go.mod +++ b/vendor/github.com/fatih/color/go.mod @@ -3,6 +3,6 @@ module github.com/fatih/color go 1.13 require ( - github.com/mattn/go-colorable v0.1.4 - github.com/mattn/go-isatty v0.0.11 + github.com/mattn/go-colorable v0.1.8 + github.com/mattn/go-isatty v0.0.12 ) diff --git a/vendor/github.com/fatih/color/go.sum b/vendor/github.com/fatih/color/go.sum index 44328a8db54..54f7c46e810 100644 --- a/vendor/github.com/fatih/color/go.sum +++ b/vendor/github.com/fatih/color/go.sum @@ -1,8 +1,7 @@ -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go b/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go index 47d12f01426..d269217706e 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go @@ -5,15 +5,15 @@ import ( "go/token" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/astp" "golang.org/x/tools/go/ast/astutil" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "appendAssign" info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious append result assignments" @@ -24,14 +24,14 @@ p.negatives = append(p.negatives, y)` p.positives = append(p.positives, x) p.negatives = append(p.negatives, y)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&appendAssignChecker{ctx: ctx}) }) } type appendAssignChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *appendAssignChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go b/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go index 63f5d9fea4e..a761f2a8f55 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go @@ -4,14 +4,14 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "appendCombine" info.Tags = []string{"performance"} info.Summary = "Detects `append` chains to the same slice that can be done in a single `append` call" @@ -20,14 +20,14 @@ xs = append(xs, 1) xs = append(xs, 2)` info.After = `xs = append(xs, 1, 2)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmtList(&appendCombineChecker{ctx: ctx}) }) } type appendCombineChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *appendCombineChecker) VisitStmtList(list []ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/argOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/argOrder_checker.go index 85a6f7c664e..2eb7cf7d8f9 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/argOrder_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/argOrder_checker.go @@ -4,8 +4,8 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astp" @@ -13,21 +13,21 @@ import ( ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "argOrder" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious arguments order" info.Before = `strings.HasPrefix("#", userpass)` info.After = `strings.HasPrefix(userpass, "#")` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&argOrderChecker{ctx: ctx}) }) } type argOrderChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *argOrderChecker) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/assignOp_checker.go b/vendor/github.com/go-critic/go-critic/checkers/assignOp_checker.go index eb34286636c..e3acd09ef61 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/assignOp_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/assignOp_checker.go @@ -4,29 +4,29 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "assignOp" info.Tags = []string{"style"} info.Summary = "Detects assignments that can be simplified by using assignment operators" info.Before = `x = x * 2` info.After = `x *= 2` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&assignOpChecker{ctx: ctx}) }) } type assignOpChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *assignOpChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/badCall_checker.go b/vendor/github.com/go-critic/go-critic/checkers/badCall_checker.go index 150cc690426..3e96a39cbe5 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/badCall_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/badCall_checker.go @@ -3,28 +3,28 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "badCall" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious function calls" info.Before = `strings.Replace(s, from, to, 0)` info.After = `strings.Replace(s, from, to, -1)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&badCallChecker{ctx: ctx}) }) } type badCallChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *badCallChecker) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go b/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go index 466a89cc374..6ce81f35846 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go @@ -5,9 +5,9 @@ import ( "go/constant" "go/token" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astequal" @@ -16,9 +16,9 @@ import ( ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "badCond" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious condition expressions" info.Before = ` for i := 0; i > n; i++ { @@ -29,14 +29,14 @@ for i := 0; i < n; i++ { xs[i] = 0 }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForFuncDecl(&badCondChecker{ctx: ctx}) }) } type badCondChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *badCondChecker) VisitFuncDecl(decl *ast.FuncDecl) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go b/vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go new file mode 100644 index 00000000000..1025454df1a --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go @@ -0,0 +1,445 @@ +package checkers + +import ( + "go/ast" + "go/constant" + "sort" + "strconv" + "unicode" + "unicode/utf8" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/quasilyte/regex/syntax" +) + +func init() { + var info linter.CheckerInfo + info.Name = "badRegexp" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects suspicious regexp patterns" + info.Before = "regexp.MustCompile(`(?:^aa|bb|cc)foo[aba]`)" + info.After = "regexp.MustCompile(`^(?:aa|bb|cc)foo[ab]`)" + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + opts := &syntax.ParserOptions{} + c := &badRegexpChecker{ + ctx: ctx, + parser: syntax.NewParser(opts), + } + return astwalk.WalkerForExpr(c) + }) +} + +type badRegexpChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext + + parser *syntax.Parser + cause ast.Expr + + flagStates []regexpFlagState + goodAnchors []syntax.Position +} + +type regexpFlagState [utf8.RuneSelf]bool + +func (c *badRegexpChecker) VisitExpr(x ast.Expr) { + call, ok := x.(*ast.CallExpr) + if !ok { + return + } + + switch qualifiedName(call.Fun) { + case "regexp.Compile", "regexp.MustCompile": + cv := c.ctx.TypesInfo.Types[call.Args[0]].Value + if cv == nil || cv.Kind() != constant.String { + return + } + pat := constant.StringVal(cv) + c.cause = call.Args[0] + c.checkPattern(pat) + } +} + +func (c *badRegexpChecker) checkPattern(pat string) { + re, err := c.parser.Parse(pat) + if err != nil { + return + } + + c.flagStates = c.flagStates[:0] + c.goodAnchors = c.goodAnchors[:0] + + // In Go all flags (modifiers) are set to false by default, + // so we start from the empty flag set. + c.flagStates = append(c.flagStates, regexpFlagState{}) + + c.markGoodCarets(re.Expr) + c.walk(re.Expr) +} + +func (c *badRegexpChecker) markGoodCarets(e syntax.Expr) { + canSkip := func(e syntax.Expr) bool { + switch e.Op { + case syntax.OpFlagOnlyGroup: + return true + case syntax.OpGroup: + x := e.Args[0] + return x.Op == syntax.OpConcat && len(x.Args) == 0 + } + return false + } + + if e.Op == syntax.OpConcat && len(e.Args) > 1 { + i := 0 + for i < len(e.Args) && canSkip(e.Args[i]) { + i++ + } + if i < len(e.Args) { + c.markGoodCarets(e.Args[i]) + } + return + } + if e.Op == syntax.OpCaret { + c.addGoodAnchor(e.Pos) + } + for _, a := range e.Args { + c.markGoodCarets(a) + } +} + +func (c *badRegexpChecker) walk(e syntax.Expr) { + switch e.Op { + case syntax.OpAlt: + c.checkAltAnchor(e) + c.checkAltDups(e) + for _, a := range e.Args { + c.walk(a) + } + + case syntax.OpCharClass, syntax.OpNegCharClass: + if c.checkCharClassRanges(e) { + c.checkCharClassDups(e) + } + + case syntax.OpStar, syntax.OpPlus: + c.checkNestedQuantifier(e) + c.walk(e.Args[0]) + + case syntax.OpFlagOnlyGroup: + c.updateFlagState(c.currentFlagState(), e, e.Args[0].Value) + case syntax.OpGroupWithFlags: + // Creates a new context using the current context copy. + // New flags are evaluated inside a new context. + // After nested expressions are processed, previous context is restored. + nflags := len(c.flagStates) + c.flagStates = append(c.flagStates, *c.currentFlagState()) + c.updateFlagState(c.currentFlagState(), e, e.Args[1].Value) + c.walk(e.Args[0]) + c.flagStates = c.flagStates[:nflags] + case syntax.OpGroup, syntax.OpCapture, syntax.OpNamedCapture: + // Like with OpGroupWithFlags, but doesn't evaluate any new flags. + nflags := len(c.flagStates) + c.flagStates = append(c.flagStates, *c.currentFlagState()) + c.walk(e.Args[0]) + c.flagStates = c.flagStates[:nflags] + + case syntax.OpCaret: + if !c.isGoodAnchor(e) { + c.warn("dangling or redundant ^, maybe \\^ is intended?") + } + + default: + for _, a := range e.Args { + c.walk(a) + } + } +} + +func (c *badRegexpChecker) currentFlagState() *regexpFlagState { + return &c.flagStates[len(c.flagStates)-1] +} + +func (c *badRegexpChecker) updateFlagState(state *regexpFlagState, e syntax.Expr, flagString string) { + clearing := false + for i := 0; i < len(flagString); i++ { + ch := flagString[i] + if ch == '-' { + clearing = true + continue + } + if int(ch) >= len(state) { + continue // Should never happen in practice, but we don't want a panic + } + + if clearing { + if !state[ch] { + c.warn("clearing unset flag %c in %s", ch, e.Value) + } + } else { + if state[ch] { + c.warn("redundant flag %c in %s", ch, e.Value) + } + } + state[ch] = !clearing + } +} + +func (c *badRegexpChecker) checkNestedQuantifier(e syntax.Expr) { + x := e.Args[0] + switch x.Op { + case syntax.OpGroup, syntax.OpCapture, syntax.OpGroupWithFlags: + if len(e.Args) == 1 { + x = x.Args[0] + } + } + + switch x.Op { + case syntax.OpPlus, syntax.OpStar: + c.warn("repeated greedy quantifier in %s", e.Value) + } +} + +func (c *badRegexpChecker) checkAltDups(alt syntax.Expr) { + // Seek duplicated alternation expressions. + + set := make(map[string]struct{}, len(alt.Args)) + for _, a := range alt.Args { + if _, ok := set[a.Value]; ok { + c.warn("`%s` is duplicated in %s", a.Value, alt.Value) + } + set[a.Value] = struct{}{} + } +} + +func (c *badRegexpChecker) isCharOrLit(e syntax.Expr) bool { + return e.Op == syntax.OpChar || e.Op == syntax.OpLiteral +} + +func (c *badRegexpChecker) checkAltAnchor(alt syntax.Expr) { + // Seek suspicious anchors. + + // Case 1: an alternation of literals where 1st expr begins with ^ anchor. + first := alt.Args[0] + if first.Op == syntax.OpConcat && len(first.Args) == 2 && first.Args[0].Op == syntax.OpCaret && c.isCharOrLit(first.Args[1]) { + matched := true + for _, a := range alt.Args[1:] { + if !c.isCharOrLit(a) { + matched = false + break + } + } + if matched { + c.warn("^ applied only to `%s` in %s", first.Value[len(`^`):], alt.Value) + } + } + + // Case 2: an alternation of literals where last expr ends with $ anchor. + last := alt.Args[len(alt.Args)-1] + if last.Op == syntax.OpConcat && len(last.Args) == 2 && last.Args[1].Op == syntax.OpDollar && c.isCharOrLit(last.Args[0]) { + matched := true + for _, a := range alt.Args[:len(alt.Args)-1] { + if !c.isCharOrLit(a) { + matched = false + break + } + } + if matched { + c.warn("$ applied only to `%s` in %s", last.Value[:len(last.Value)-len(`$`)], alt.Value) + } + } +} + +func (c *badRegexpChecker) checkCharClassRanges(cc syntax.Expr) bool { + // Seek for suspicious ranges like `!-_`. + // + // We permit numerical ranges (0-9, hex and octal literals) + // and simple ascii letter ranges. + + for _, e := range cc.Args { + if e.Op != syntax.OpCharRange { + continue + } + switch e.Args[0].Op { + case syntax.OpEscapeOctal, syntax.OpEscapeHex: + continue + } + ch := c.charClassBoundRune(e.Args[0]) + if ch == 0 { + return false + } + good := unicode.IsLetter(ch) || (ch >= '0' && ch <= '9') + if !good { + c.warnSloppyCharRange(e.Value, cc.Value) + } + } + + return true +} + +func (c *badRegexpChecker) checkCharClassDups(cc syntax.Expr) { + // Seek for excessive elements inside a character class. + // Report them as intersections. + + if len(cc.Args) == 1 { + return // Can't had duplicates. + } + + type charRange struct { + low rune + high rune + source string + } + ranges := make([]charRange, 0, 8) + addRange := func(source string, low, high rune) { + ranges = append(ranges, charRange{source: source, low: low, high: high}) + } + addRange1 := func(source string, ch rune) { + addRange(source, ch, ch) + } + + // 1. Collect ranges, O(n). + for _, e := range cc.Args { + switch e.Op { + case syntax.OpEscapeOctal: + addRange1(e.Value, c.octalToRune(e)) + case syntax.OpEscapeHex: + addRange1(e.Value, c.hexToRune(e)) + case syntax.OpChar: + addRange1(e.Value, c.stringToRune(e.Value)) + case syntax.OpCharRange: + addRange(e.Value, c.charClassBoundRune(e.Args[0]), c.charClassBoundRune(e.Args[1])) + case syntax.OpEscapeMeta: + addRange1(e.Value, rune(e.Value[1])) + case syntax.OpEscapeChar: + ch := c.stringToRune(e.Value[len(`\`):]) + if unicode.IsPunct(ch) { + addRange1(e.Value, ch) + break + } + switch e.Value { + case `\|`, `\<`, `\>`, `\+`, `\=`: // How to cover all symbols? + addRange1(e.Value, c.stringToRune(e.Value[len(`\`):])) + case `\t`: + addRange1(e.Value, '\t') + case `\n`: + addRange1(e.Value, '\n') + case `\r`: + addRange1(e.Value, '\r') + case `\v`: + addRange1(e.Value, '\v') + case `\d`: + addRange(e.Value, '0', '9') + case `\D`: + addRange(e.Value, 0, '0'-1) + addRange(e.Value, '9'+1, utf8.MaxRune) + case `\s`: + addRange(e.Value, '\t', '\n') // 9-10 + addRange(e.Value, '\f', '\r') // 12-13 + addRange1(e.Value, ' ') // 32 + case `\S`: + addRange(e.Value, 0, '\t'-1) + addRange(e.Value, '\n'+1, '\f'-1) + addRange(e.Value, '\r'+1, ' '-1) + addRange(e.Value, ' '+1, utf8.MaxRune) + case `\w`: + addRange(e.Value, '0', '9') // 48-57 + addRange(e.Value, 'A', 'Z') // 65-90 + addRange1(e.Value, '_') // 95 + addRange(e.Value, 'a', 'z') // 97-122 + case `\W`: + addRange(e.Value, 0, '0'-1) + addRange(e.Value, '9'+1, 'A'-1) + addRange(e.Value, 'Z'+1, '_'-1) + addRange(e.Value, '_'+1, 'a'-1) + addRange(e.Value, 'z'+1, utf8.MaxRune) + default: + // Give up: unknown escape sequence. + return + } + default: + // Give up: unexpected operation inside char class. + return + } + } + + // 2. Sort ranges, O(nlogn). + sort.Slice(ranges, func(i, j int) bool { + return ranges[i].low < ranges[j].low + }) + + // 3. Search for duplicates, O(n). + for i := 0; i < len(ranges)-1; i++ { + x := ranges[i+0] + y := ranges[i+1] + if x.high >= y.low { + c.warnCharClassDup(x.source, y.source, cc.Value) + break + } + } +} + +func (c *badRegexpChecker) charClassBoundRune(e syntax.Expr) rune { + switch e.Op { + case syntax.OpChar: + return c.stringToRune(e.Value) + case syntax.OpEscapeHex: + return c.hexToRune(e) + case syntax.OpEscapeOctal: + return c.octalToRune(e) + default: + return 0 + } +} + +func (c *badRegexpChecker) octalToRune(e syntax.Expr) rune { + v, _ := strconv.ParseInt(e.Value[len(`\`):], 8, 32) + return rune(v) +} + +func (c *badRegexpChecker) hexToRune(e syntax.Expr) rune { + var s string + switch e.Form { + case syntax.FormEscapeHexFull: + s = e.Value[len(`\x{`) : len(e.Value)-len(`}`)] + default: + s = e.Value[len(`\x`):] + } + v, _ := strconv.ParseInt(s, 16, 32) + return rune(v) +} + +func (c *badRegexpChecker) stringToRune(s string) rune { + ch, _ := utf8.DecodeRuneInString(s) + return ch +} + +func (c *badRegexpChecker) addGoodAnchor(pos syntax.Position) { + c.goodAnchors = append(c.goodAnchors, pos) +} + +func (c *badRegexpChecker) isGoodAnchor(e syntax.Expr) bool { + for _, pos := range c.goodAnchors { + if e.Pos == pos { + return true + } + } + return false +} + +func (c *badRegexpChecker) warn(format string, args ...interface{}) { + c.ctx.Warn(c.cause, format, args...) +} + +func (c *badRegexpChecker) warnSloppyCharRange(rng, charClass string) { + c.ctx.Warn(c.cause, "suspicious char range `%s` in %s", rng, charClass) +} + +func (c *badRegexpChecker) warnCharClassDup(x, y, charClass string) { + if x == y { + c.ctx.Warn(c.cause, "`%s` is duplicated in %s", x, charClass) + } else { + c.ctx.Warn(c.cause, "`%s` intersects with `%s` in %s", x, y, charClass) + } +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go b/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go index f4eb9ed7394..8c599031dba 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go @@ -6,9 +6,9 @@ import ( "go/token" "strconv" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astequal" @@ -18,7 +18,7 @@ import ( ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "boolExprSimplify" info.Tags = []string{"style", "experimental"} info.Summary = "Detects bool expressions that can be simplified" @@ -29,14 +29,14 @@ b := !(x) == !(y)` a := elapsed < expectElapsedMin b := (x) == (y)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&boolExprSimplifyChecker{ctx: ctx}) }) } type boolExprSimplifyChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext hasFloats bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go b/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go index 24d8b7fff4f..ff5e517464a 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go @@ -3,26 +3,26 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "builtinShadow" info.Tags = []string{"style", "opinionated"} info.Summary = "Detects when predeclared identifiers shadowed in assignments" info.Before = `len := 10` info.After = `length := 10` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForLocalDef(&builtinShadowChecker{ctx: ctx}, ctx.TypesInfo) }) } type builtinShadowChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *builtinShadowChecker) VisitLocalDef(name astwalk.Name, _ ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go b/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go index bc9a2115f2f..76b6fb4fc3c 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go @@ -3,15 +3,15 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "captLocal" info.Tags = []string{"style"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "paramsOnly": { Value: true, Usage: "whether to restrict checker to params only", @@ -21,7 +21,7 @@ func init() { info.Before = `func f(IN int, OUT *int) (ERR error) {}` info.After = `func f(in int, out *int) (err error) {}` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &captLocalChecker{ctx: ctx} c.paramsOnly = info.Params.Bool("paramsOnly") return astwalk.WalkerForLocalDef(c, ctx.TypesInfo) @@ -30,7 +30,7 @@ func init() { type captLocalChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext paramsOnly bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go index 1ef4b53b7ff..95036752038 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go @@ -4,12 +4,12 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "caseOrder" info.Tags = []string{"diagnostic"} info.Summary = "Detects erroneous case order inside switch statements" @@ -28,14 +28,14 @@ case ast.Expr: fmt.Println("expr") }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&caseOrderChecker{ctx: ctx}) }) } type caseOrderChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *caseOrderChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/checkers.go b/vendor/github.com/go-critic/go-critic/checkers/checkers.go index 96202221e2b..0c2ebc00cac 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/checkers.go +++ b/vendor/github.com/go-critic/go-critic/checkers/checkers.go @@ -2,9 +2,18 @@ package checkers import ( - "github.com/go-lintpack/lintpack" + "os" + + "github.com/go-critic/go-critic/framework/linter" ) -var collection = &lintpack.CheckerCollection{ +var collection = &linter.CheckerCollection{ URL: "https://github.com/go-critic/go-critic/checkers", } + +var debug = func() func() bool { + v := os.Getenv("DEBUG") != "" + return func() bool { + return v + } +}() diff --git a/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go b/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go index 14d89da374b..ecadba10ee4 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go @@ -5,19 +5,19 @@ import ( "regexp" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "codegenComment" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects malformed 'code generated' file comments" info.Before = `// This file was automatically generated by foogen` info.After = `// Code generated by foogen. DO NOT EDIT.` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { patterns := []string{ "this (?:file|code) (?:was|is) auto(?:matically)? generated", "this (?:file|code) (?:was|is) generated automatically", @@ -38,7 +38,7 @@ func init() { type codegenCommentChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext badCommentRE *regexp.Regexp } diff --git a/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go b/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go index ed75015e095..de7bfc19806 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go @@ -7,23 +7,25 @@ import ( "unicode" "unicode/utf8" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "commentFormatting" - info.Tags = []string{"style", "experimental"} + info.Tags = []string{"style"} info.Summary = "Detects comments with non-idiomatic formatting" info.Before = `//This is a comment` info.After = `// This is a comment` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { parts := []string{ - `^//\w+:.*$`, //key: value - `^//nolint$`, //nolint - `^//line /.*:\d+`, //line /path/to/file:123 + `^//go:generate .*$`, // e.g.: go:generate value + `^//\w+:.*$`, // e.g.: key: value + `^//nolint$`, // e.g.: nolint + `^//line /.*:\d+`, // e.g.: line /path/to/file:123 + `^//export \w+$`, // e.g.: export Foo } pat := "(?m)" + strings.Join(parts, "|") pragmaRE := regexp.MustCompile(pat) @@ -36,7 +38,7 @@ func init() { type commentFormattingChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext pragmaRE *regexp.Regexp } diff --git a/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go b/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go index 0554e365ed3..8d93870459b 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go @@ -7,13 +7,13 @@ import ( "regexp" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/strparse" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "commentedOutCode" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects commented-out code inside function bodies" @@ -22,7 +22,7 @@ func init() { foo(1, 2)` info.After = `foo(1, 2)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForLocalComment(&commentedOutCodeChecker{ ctx: ctx, notQuiteFuncCall: regexp.MustCompile(`\w+\s+\([^)]*\)\s*$`), @@ -32,7 +32,7 @@ foo(1, 2)` type commentedOutCodeChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext fn *ast.FuncDecl notQuiteFuncCall *regexp.Regexp diff --git a/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go b/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go index 5aeb86c0765..096a9024153 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go @@ -5,12 +5,12 @@ import ( "go/token" "regexp" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "commentedOutImport" info.Tags = []string{"style", "experimental"} info.Summary = "Detects commented-out imports" @@ -24,7 +24,7 @@ import ( "fmt" )` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { const pattern = `(?m)^(?://|/\*)?\s*"([a-zA-Z0-9_/]+)"\s*(?:\*/)?$` return &commentedOutImportChecker{ ctx: ctx, @@ -35,7 +35,7 @@ import ( type commentedOutImportChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext importStringRE *regexp.Regexp } diff --git a/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go index caa0de65720..755449e07ef 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go @@ -3,12 +3,12 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "defaultCaseOrder" info.Tags = []string{"style"} info.Summary = "Detects when default case in switch isn't on 1st or last position" @@ -31,14 +31,14 @@ default: // <- last case (could also be the first one) // ... }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&defaultCaseOrderChecker{ctx: ctx}) }) } type defaultCaseOrderChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *defaultCaseOrderChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/deferUnlambda_checker.go b/vendor/github.com/go-critic/go-critic/checkers/deferUnlambda_checker.go new file mode 100644 index 00000000000..3cab7827c98 --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/deferUnlambda_checker.go @@ -0,0 +1,94 @@ +package checkers + +import ( + "go/ast" + "go/types" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/go-toolsmith/astcast" +) + +func init() { + var info linter.CheckerInfo + info.Name = "deferUnlambda" + info.Tags = []string{"style", "experimental"} + info.Summary = "Detects deferred function literals that can be simplified" + info.Before = `defer func() { f() }()` + info.After = `f()` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return astwalk.WalkerForStmt(&deferUnlambdaChecker{ctx: ctx}) + }) +} + +type deferUnlambdaChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext +} + +func (c *deferUnlambdaChecker) VisitStmt(x ast.Stmt) { + def, ok := x.(*ast.DeferStmt) + if !ok { + return + } + + // We don't analyze deferred function args. + // Most deferred calls don't have them, so it's not a big deal to skip them. + if len(def.Call.Args) != 0 { + return + } + + fn, ok := def.Call.Fun.(*ast.FuncLit) + if !ok { + return + } + + if len(fn.Body.List) != 1 { + return + } + + call, ok := astcast.ToExprStmt(fn.Body.List[0]).X.(*ast.CallExpr) + if !ok || !c.isFunctionCall(call) { + return + } + + // Skip recover() as it can't be moved outside of the lambda. + // Skip panic() to avoid affecting the stack trace. + switch qualifiedName(call.Fun) { + case "recover", "panic": + return + } + + for _, arg := range call.Args { + if !c.isConstExpr(arg) { + return + } + } + + c.warn(def, call) +} + +func (c *deferUnlambdaChecker) isFunctionCall(e *ast.CallExpr) bool { + switch fnExpr := e.Fun.(type) { + case *ast.Ident: + return true + case *ast.SelectorExpr: + x, ok := fnExpr.X.(*ast.Ident) + if !ok { + return false + } + _, ok = c.ctx.TypesInfo.ObjectOf(x).(*types.PkgName) + return ok + default: + return false + } +} + +func (c *deferUnlambdaChecker) isConstExpr(e ast.Expr) bool { + return c.ctx.TypesInfo.Types[e].Value != nil +} + +func (c *deferUnlambdaChecker) warn(cause, suggestion ast.Node) { + c.ctx.Warn(cause, "can rewrite as `defer %s`", suggestion) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go b/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go index 37675735b86..82f300b37ea 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go @@ -5,14 +5,14 @@ import ( "regexp" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "deprecatedComment" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects malformed 'deprecated' doc-comments" info.Before = ` // deprecated, use FuncNew instead @@ -21,7 +21,7 @@ func FuncOld() int` // Deprecated: use FuncNew instead func FuncOld() int` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &deprecatedCommentChecker{ctx: ctx} c.commonPatterns = []*regexp.Regexp{ @@ -61,7 +61,7 @@ func FuncOld() int` type deprecatedCommentChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext commonPatterns []*regexp.Regexp commonTypos []string diff --git a/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go b/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go index 5c771b31cfb..2a3b393a0db 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go @@ -6,12 +6,12 @@ import ( "regexp" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "docStub" info.Tags = []string{"style", "experimental"} info.Summary = "Detects comments that silence go lint complaints about doc-comment" @@ -26,7 +26,7 @@ func Foo() {} // Foo is a demonstration-only function. func Foo() {}` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { re := `(?i)^\.\.\.$|^\.$|^xxx\.?$|^whatever\.?$` c := &docStubChecker{ ctx: ctx, @@ -38,7 +38,7 @@ func Foo() {}` type docStubChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext stubCommentRE *regexp.Regexp } diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupArg_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupArg_checker.go index 819759403e2..24e921b093a 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/dupArg_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/dupArg_checker.go @@ -4,21 +4,21 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "dupArg" info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious duplicated arguments" info.Before = `copy(dst, dst)` info.After = `copy(dst, src)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &dupArgChecker{ctx: ctx} // newMatcherFunc returns a function that matches a call if // args[xIndex] and args[yIndex] are equal. @@ -101,7 +101,7 @@ func init() { type dupArgChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext matchers map[string]func(*ast.CallExpr) bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go index a13884873c1..3399f05317c 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go @@ -3,13 +3,13 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "dupBranchBody" info.Tags = []string{"diagnostic"} info.Summary = "Detects duplicated branch bodies inside conditional statements" @@ -26,14 +26,14 @@ if cond { println("cond=false") }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&dupBranchBodyChecker{ctx: ctx}) }) } type dupBranchBodyChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *dupBranchBodyChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go index 26ef17398f8..89ec66bbf02 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go @@ -3,13 +3,13 @@ package checkers import ( "go/ast" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "dupCase" info.Tags = []string{"diagnostic"} info.Summary = "Detects duplicated case clauses inside switch statements" @@ -22,14 +22,14 @@ switch x { case ys[0], ys[1], ys[2], ys[3], ys[4]: }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&dupCaseChecker{ctx: ctx}) }) } type dupCaseChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext astSet lintutil.AstSet } diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go index d531413a11c..27b796cdc1e 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go @@ -4,11 +4,11 @@ import ( "fmt" "go/ast" - "github.com/go-lintpack/lintpack" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "dupImport" info.Tags = []string{"style", "experimental"} info.Summary = "Detects multiple imports of the same package under different aliases" @@ -22,13 +22,13 @@ import( "fmt" )` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return &dupImportChecker{ctx: ctx} }) } type dupImportChecker struct { - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *dupImportChecker) WalkFile(f *ast.File) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go index 24bb52434f3..4966cd2a5ac 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go @@ -5,14 +5,14 @@ import ( "go/token" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "dupSubExpr" info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious duplicated sub-expressions" @@ -25,7 +25,7 @@ sort.Slice(xs, func(i, j int) bool { return xs[i].v < xs[j].v })` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &dupSubExprChecker{ctx: ctx} ops := []struct { @@ -65,7 +65,7 @@ sort.Slice(xs, func(i, j int) bool { type dupSubExprChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext // opSet is a set of binary operations that do not make // sense with duplicated (same) RHS and LHS. diff --git a/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go b/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go index c3a9546bf07..9e56d1c408a 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go @@ -3,16 +3,16 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "elseif" info.Tags = []string{"style"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "skipBalanced": { Value: true, Usage: "whether to skip balanced if-else pairs", @@ -30,7 +30,7 @@ if cond1 { } else if x := cond2; x { }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &elseifChecker{ctx: ctx} c.skipBalanced = info.Params.Bool("skipBalanced") return astwalk.WalkerForStmt(c) @@ -39,7 +39,7 @@ if cond1 { type elseifChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext skipBalanced bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go b/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go index 5908dfa3167..16bfa7e4579 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go @@ -4,12 +4,12 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "emptyFallthrough" info.Tags = []string{"style", "experimental"} info.Summary = "Detects fallthrough that can be avoided by using multi case values" @@ -24,14 +24,14 @@ case reflect.Int, reflect.Int32: return Int }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&emptyFallthroughChecker{ctx: ctx}) }) } type emptyFallthroughChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *emptyFallthroughChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/emptyStringTest_checker.go b/vendor/github.com/go-critic/go-critic/checkers/emptyStringTest_checker.go index a7be906ed08..20d647ffab2 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/emptyStringTest_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/emptyStringTest_checker.go @@ -4,15 +4,15 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "emptyStringTest" info.Tags = []string{"style", "experimental"} info.Summary = "Detects empty string checks that can be written more idiomatically" @@ -20,14 +20,14 @@ func init() { info.After = `s == ""` info.Note = "See https://dmitri.shuralyov.com/idiomatic-go#empty-string-check." - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&emptyStringTestChecker{ctx: ctx}) }) } type emptyStringTestChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *emptyStringTestChecker) VisitExpr(e ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/equalFold_checker.go b/vendor/github.com/go-critic/go-critic/checkers/equalFold_checker.go index 265b2f79bee..b8dfdc02fd8 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/equalFold_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/equalFold_checker.go @@ -4,28 +4,28 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "equalFold" info.Tags = []string{"performance", "experimental"} info.Summary = "Detects unoptimal strings/bytes case-insensitive comparison" info.Before = `strings.ToLower(x) == strings.ToLower(y)` info.After = `strings.EqualFold(x, y)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&equalFoldChecker{ctx: ctx}) }) } type equalFoldChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *equalFoldChecker) VisitExpr(e ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go index f76519cd7c8..0bec0e83a71 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go @@ -5,16 +5,16 @@ import ( "go/token" "go/types" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "evalOrder" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects unwanted dependencies on the evaluation order" @@ -24,14 +24,14 @@ err := f(&x) return x, err ` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&evalOrderChecker{ctx: ctx}) }) } type evalOrderChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *evalOrderChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go b/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go index 05ed6ae9e1a..65800fc5463 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go @@ -3,17 +3,17 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astfmt" "github.com/go-toolsmith/astp" "golang.org/x/tools/go/ast/astutil" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "exitAfterDefer" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects calls to exit/fatal inside functions that use defer" info.Before = ` defer os.Remove(filename) @@ -27,14 +27,14 @@ if bad { return }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForFuncDecl(&exitAfterDeferChecker{ctx: ctx}) }) } type exitAfterDeferChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *exitAfterDeferChecker) VisitFuncDecl(fn *ast.FuncDecl) { @@ -66,13 +66,11 @@ func (c *exitAfterDeferChecker) VisitFuncDecl(fn *ast.FuncDecl) { } func (c *exitAfterDeferChecker) warn(cause *ast.CallExpr, deferStmt *ast.DeferStmt) { - var s string + s := astfmt.Sprint(deferStmt) if fnlit, ok := deferStmt.Call.Fun.(*ast.FuncLit); ok { // To avoid long and multi-line warning messages, // collapse the function literals. s = "defer " + astfmt.Sprint(fnlit.Type) + "{...}(...)" - } else { - s = astfmt.Sprint(deferStmt) } c.ctx.Warn(cause, "%s clutters `%s`", cause.Fun, s) } diff --git a/vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go b/vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go new file mode 100644 index 00000000000..b11dc247023 --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go @@ -0,0 +1,50 @@ +package checkers + +import ( + "go/ast" + "strings" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/go-toolsmith/astcast" +) + +func init() { + var info linter.CheckerInfo + info.Name = "filepathJoin" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects problems in filepath.Join() function calls" + info.Before = `filepath.Join("dir/", filename)` + info.After = `filepath.Join("dir", filename)` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return astwalk.WalkerForExpr(&filepathJoinChecker{ctx: ctx}) + }) +} + +type filepathJoinChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext +} + +func (c *filepathJoinChecker) VisitExpr(expr ast.Expr) { + call := astcast.ToCallExpr(expr) + if qualifiedName(call.Fun) != "filepath.Join" { + return + } + + for _, arg := range call.Args { + arg, ok := arg.(*ast.BasicLit) + if ok && c.hasSeparator(arg) { + c.warnSeparator(arg) + } + } +} + +func (c *filepathJoinChecker) hasSeparator(v *ast.BasicLit) bool { + return strings.ContainsAny(v.Value, `/\`) +} + +func (c *filepathJoinChecker) warnSeparator(sep ast.Expr) { + c.ctx.Warn(sep, "%s contains a path separator", sep) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/flagDeref_checker.go b/vendor/github.com/go-critic/go-critic/checkers/flagDeref_checker.go index cb9faee716d..393274c4350 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/flagDeref_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/flagDeref_checker.go @@ -3,12 +3,12 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "flagDeref" info.Tags = []string{"diagnostic"} info.Summary = "Detects immediate dereferencing of `flag` package pointers" @@ -21,7 +21,7 @@ flag.BoolVar(&b, "b", false, "b docs")` Dereferencing returned pointers will lead to hard to find errors where flag values are not updated after flag.Parse().` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &flagDerefChecker{ ctx: ctx, flagPtrFuncs: map[string]bool{ @@ -41,7 +41,7 @@ where flag values are not updated after flag.Parse().` type flagDerefChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext flagPtrFuncs map[string]bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go b/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go index 1d43ba52113..36d2e4506f7 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go @@ -6,27 +6,27 @@ import ( "go/types" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "flagName" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects flag names with whitespace" info.Before = `b := flag.Bool(" foo ", false, "description")` info.After = `b := flag.Bool("foo", false, "description")` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&flagNameChecker{ctx: ctx}) }) } type flagNameChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *flagNameChecker) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go b/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go index a700314cf3d..f3f9c535c69 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go @@ -5,13 +5,13 @@ import ( "go/token" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "hexLiteral" info.Tags = []string{"style", "experimental"} info.Summary = "Detects hex literals that have mixed case letter digits" @@ -25,14 +25,14 @@ y := 0xff // (B) y := 0xFF` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&hexLiteralChecker{ctx: ctx}) }) } type hexLiteralChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *hexLiteralChecker) warn0X(lit *ast.BasicLit) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go b/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go index 656b4cc2d79..54be776387a 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go @@ -3,15 +3,15 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "hugeParam" info.Tags = []string{"performance"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "sizeThreshold": { Value: 80, Usage: "size in bytes that makes the warning trigger", @@ -21,7 +21,7 @@ func init() { info.Before = `func f(x [1024]int) {}` info.After = `func f(x *[1024]int) {}` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForFuncDecl(&hugeParamChecker{ ctx: ctx, sizeThreshold: int64(info.Params.Int("sizeThreshold")), @@ -31,7 +31,7 @@ func init() { type hugeParamChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext sizeThreshold int64 } diff --git a/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go b/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go index c0a456afd21..91e1cfb39e0 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go @@ -3,12 +3,12 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "ifElseChain" info.Tags = []string{"style"} info.Summary = "Detects repeated if-else statements and suggests to replace them with switch statement" @@ -34,14 +34,14 @@ Permits single else or else-if; repeated else-if or else + else-if will trigger suggestion to use switch statement. See [EffectiveGo#switch](https://golang.org/doc/effective_go.html#switch).` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&ifElseChainChecker{ctx: ctx}) }) } type ifElseChainChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext cause *ast.IfStmt visited map[*ast.IfStmt]bool diff --git a/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go b/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go index 9a2ccc55ecd..60c0ab21e9c 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go @@ -4,12 +4,12 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "importShadow" info.Tags = []string{"style", "opinionated"} info.Summary = "Detects when imported package names shadowed in the assignments" @@ -19,7 +19,7 @@ filepath := "foo.txt"` info.After = ` filename := "foo.txt"` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { ctx.Require.PkgObjects = true return astwalk.WalkerForLocalDef(&importShadowChecker{ctx: ctx}, ctx.TypesInfo) }) @@ -27,7 +27,7 @@ filename := "foo.txt"` type importShadowChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *importShadowChecker) VisitLocalDef(def astwalk.Name, _ ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/indexAlloc_checker.go b/vendor/github.com/go-critic/go-critic/checkers/indexAlloc_checker.go index 8fbe98c9d2b..73399887391 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/indexAlloc_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/indexAlloc_checker.go @@ -3,14 +3,14 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "indexAlloc" info.Tags = []string{"performance"} info.Summary = "Detects strings.Index calls that may cause unwanted allocs" @@ -18,14 +18,14 @@ func init() { info.After = `bytes.Index(x, []byte(y))` info.Note = `See Go issue for details: https://github.com/golang/go/issues/25864` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&indexAllocChecker{ctx: ctx}) }) } type indexAllocChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *indexAllocChecker) VisitExpr(e ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go b/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go index bfbd661b245..91e8816d238 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go @@ -3,13 +3,13 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "initClause" info.Tags = []string{"style", "opinionated", "experimental"} info.Summary = "Detects non-assignment statements inside if/switch init clause" @@ -19,14 +19,14 @@ func init() { if cond { }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&initClauseChecker{ctx: ctx}) }) } type initClauseChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *initClauseChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/comment_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/comment_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/comment_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/comment_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/doc_comment_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/doc_comment_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/doc_comment_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/doc_comment_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/expr_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/expr_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/expr_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/expr_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/func_decl_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/func_decl_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/func_decl_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/func_decl_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/local_comment_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_comment_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/local_comment_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_comment_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/local_def_visitor.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_visitor.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/local_def_visitor.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_visitor.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/local_def_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/local_def_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/local_expr_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_expr_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/local_expr_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_expr_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/stmt_list_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_list_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/stmt_list_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_list_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/stmt_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/stmt_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/type_expr_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/type_expr_walker.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/type_expr_walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/type_expr_walker.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/visitor.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/visitor.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/visitor.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/visitor.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/walk_handler.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walk_handler.go similarity index 100% rename from vendor/github.com/go-lintpack/lintpack/astwalk/walk_handler.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walk_handler.go diff --git a/vendor/github.com/go-lintpack/lintpack/astwalk/walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go similarity index 70% rename from vendor/github.com/go-lintpack/lintpack/astwalk/walker.go rename to vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go index fddae710ad9..cd5e1c9793c 100644 --- a/vendor/github.com/go-lintpack/lintpack/astwalk/walker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go @@ -3,55 +3,55 @@ package astwalk import ( "go/types" - "github.com/go-lintpack/lintpack" + "github.com/go-critic/go-critic/framework/linter" ) // WalkerForFuncDecl returns file walker implementation for FuncDeclVisitor. -func WalkerForFuncDecl(v FuncDeclVisitor) lintpack.FileWalker { +func WalkerForFuncDecl(v FuncDeclVisitor) linter.FileWalker { return &funcDeclWalker{visitor: v} } // WalkerForExpr returns file walker implementation for ExprVisitor. -func WalkerForExpr(v ExprVisitor) lintpack.FileWalker { +func WalkerForExpr(v ExprVisitor) linter.FileWalker { return &exprWalker{visitor: v} } // WalkerForLocalExpr returns file walker implementation for LocalExprVisitor. -func WalkerForLocalExpr(v LocalExprVisitor) lintpack.FileWalker { +func WalkerForLocalExpr(v LocalExprVisitor) linter.FileWalker { return &localExprWalker{visitor: v} } // WalkerForStmtList returns file walker implementation for StmtListVisitor. -func WalkerForStmtList(v StmtListVisitor) lintpack.FileWalker { +func WalkerForStmtList(v StmtListVisitor) linter.FileWalker { return &stmtListWalker{visitor: v} } // WalkerForStmt returns file walker implementation for StmtVisitor. -func WalkerForStmt(v StmtVisitor) lintpack.FileWalker { +func WalkerForStmt(v StmtVisitor) linter.FileWalker { return &stmtWalker{visitor: v} } // WalkerForTypeExpr returns file walker implementation for TypeExprVisitor. -func WalkerForTypeExpr(v TypeExprVisitor, info *types.Info) lintpack.FileWalker { +func WalkerForTypeExpr(v TypeExprVisitor, info *types.Info) linter.FileWalker { return &typeExprWalker{visitor: v, info: info} } // WalkerForLocalComment returns file walker implementation for LocalCommentVisitor. -func WalkerForLocalComment(v LocalCommentVisitor) lintpack.FileWalker { +func WalkerForLocalComment(v LocalCommentVisitor) linter.FileWalker { return &localCommentWalker{visitor: v} } // WalkerForComment returns file walker implementation for CommentVisitor. -func WalkerForComment(v CommentVisitor) lintpack.FileWalker { +func WalkerForComment(v CommentVisitor) linter.FileWalker { return &commentWalker{visitor: v} } // WalkerForDocComment returns file walker implementation for DocCommentVisitor. -func WalkerForDocComment(v DocCommentVisitor) lintpack.FileWalker { +func WalkerForDocComment(v DocCommentVisitor) linter.FileWalker { return &docCommentWalker{visitor: v} } // WalkerForLocalDef returns file walker implementation for LocalDefVisitor. -func WalkerForLocalDef(v LocalDefVisitor, info *types.Info) lintpack.FileWalker { +func WalkerForLocalDef(v LocalDefVisitor, info *types.Info) linter.FileWalker { return &localDefWalker{visitor: v, info: info} } diff --git a/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go b/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go index de3e781e52a..fdbbb45a281 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go @@ -5,18 +5,18 @@ import ( "go/types" "strings" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astp" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "mapKey" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects suspicious map literal keys" info.Before = ` _ = map[string]int{ @@ -29,14 +29,14 @@ _ = map[string]int{ "bar": 2, }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&mapKeyChecker{ctx: ctx}) }) } type mapKeyChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext astSet lintutil.AstSet } diff --git a/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go b/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go index 60da116559c..efd631143f5 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go @@ -4,15 +4,15 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "methodExprCall" info.Tags = []string{"style", "experimental"} info.Summary = "Detects method expression call that can be replaced with a method call" @@ -21,14 +21,14 @@ foo.bar(f)` info.After = `f := foo{} f.bar()` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&methodExprCallChecker{ctx: ctx}) }) } type methodExprCallChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *methodExprCallChecker) VisitExpr(x ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go b/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go index 4a0331d5c72..de02c7eec78 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go @@ -3,15 +3,15 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "nestingReduce" info.Tags = []string{"style", "opinionated", "experimental"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "bodyWidth": { Value: 5, Usage: "min number of statements inside a branch to trigger a warning", @@ -32,7 +32,7 @@ for _, v := range a { body() }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &nestingReduceChecker{ctx: ctx} c.bodyWidth = info.Params.Int("bodyWidth") return astwalk.WalkerForStmt(c) @@ -41,7 +41,7 @@ for _, v := range a { type nestingReduceChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext bodyWidth int } diff --git a/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go b/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go index 75e7f642824..7b9f02bd333 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go @@ -3,29 +3,29 @@ package checkers import ( "go/ast" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "golang.org/x/tools/go/ast/astutil" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "newDeref" - info.Tags = []string{"style", "experimental"} + info.Tags = []string{"style"} info.Summary = "Detects immediate dereferencing of `new` expressions" info.Before = `x := *new(bool)` info.After = `x := false` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&newDerefChecker{ctx: ctx}) }) } type newDerefChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *newDerefChecker) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go b/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go index 231e25800fa..37f964f7087 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go @@ -4,14 +4,14 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "nilValReturn" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects return statements those results evaluate to nil" @@ -29,14 +29,14 @@ if err != nil { return err }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&nilValReturnChecker{ctx: ctx}) }) } type nilValReturnChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *nilValReturnChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go b/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go index e40ec6db5e3..a1d96804301 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go @@ -5,20 +5,20 @@ import ( "go/token" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "octalLiteral" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects octal literals passed to functions" info.Before = `foo(02)` info.After = `foo(2)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &octalLiteralChecker{ ctx: ctx, octFriendlyPkg: map[string]bool{ @@ -32,7 +32,7 @@ func init() { type octalLiteralChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext octFriendlyPkg map[string]bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/offBy1_checker.go b/vendor/github.com/go-critic/go-critic/checkers/offBy1_checker.go index d5c8de0b796..df20b429af6 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/offBy1_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/offBy1_checker.go @@ -4,8 +4,8 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astequal" @@ -13,21 +13,21 @@ import ( ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "offBy1" - info.Tags = []string{"diagnostic", "experimental"} + info.Tags = []string{"diagnostic"} info.Summary = "Detects various off-by-one kind of errors" info.Before = `xs[len(xs)]` info.After = `xs[len(xs)-1]` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&offBy1Checker{ctx: ctx}) }) } type offBy1Checker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *offBy1Checker) VisitExpr(e ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go b/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go index ffa74061e67..f9f9d6c5a9f 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go @@ -3,27 +3,27 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "paramTypeCombine" info.Tags = []string{"style", "opinionated"} info.Summary = "Detects if function parameters could be combined by type and suggest the way to do it" info.Before = `func foo(a, b int, c, d int, e, f int, g int) {}` info.After = `func foo(a, b, c, d, e, f, g int) {}` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForFuncDecl(¶mTypeCombineChecker{ctx: ctx}) }) } type paramTypeCombineChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *paramTypeCombineChecker) EnterFunc(*ast.FuncDecl) bool { @@ -51,7 +51,8 @@ func (c *paramTypeCombineChecker) optimizeParams(params *ast.FieldList) *ast.Fie // ast.Field have empty name list. skip := params == nil || len(params.List) < 2 || - len(params.List[0].Names) == 0 + len(params.List[0].Names) == 0 || + c.paramsAreMultiLine(params) if skip { return params } @@ -84,3 +85,9 @@ func (c *paramTypeCombineChecker) optimizeParams(params *ast.FieldList) *ast.Fie func (c *paramTypeCombineChecker) warn(f1, f2 *ast.FuncType) { c.ctx.Warn(f1, "%s could be replaced with %s", f1, f2) } + +func (c *paramTypeCombineChecker) paramsAreMultiLine(params *ast.FieldList) bool { + startPos := c.ctx.FileSet.Position(params.Opening) + endPos := c.ctx.FileSet.Position(params.Closing) + return startPos.Line != endPos.Line +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go b/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go index dacffc85ab4..2716fe04b80 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go @@ -4,26 +4,26 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "ptrToRefParam" info.Tags = []string{"style", "opinionated", "experimental"} info.Summary = "Detects input and output parameters that have a type of pointer to referential type" info.Before = `func f(m *map[string]int) (*chan *int)` info.After = `func f(m map[string]int) (chan *int)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForFuncDecl(&ptrToRefParamChecker{ctx: ctx}) }) } type ptrToRefParamChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *ptrToRefParamChecker) VisitFuncDecl(fn *ast.FuncDecl) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go b/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go index 387d1bbbcc0..90b5987abb7 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go @@ -4,15 +4,15 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "rangeExprCopy" info.Tags = []string{"performance"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "sizeThreshold": { Value: 512, Usage: "size in bytes that makes the warning trigger", @@ -36,7 +36,7 @@ for _, x := range &xs { // No copy }` info.Note = "See Go issue for details: https://github.com/golang/go/issues/15812." - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &rangeExprCopyChecker{ctx: ctx} c.sizeThreshold = int64(info.Params.Int("sizeThreshold")) c.skipTestFuncs = info.Params.Bool("skipTestFuncs") @@ -46,7 +46,7 @@ for _, x := range &xs { // No copy type rangeExprCopyChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext sizeThreshold int64 skipTestFuncs bool diff --git a/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go b/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go index 182538a9f0a..57dcc315128 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go @@ -3,15 +3,15 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "rangeValCopy" info.Tags = []string{"performance"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "sizeThreshold": { Value: 128, Usage: "size in bytes that makes the warning trigger", @@ -35,7 +35,7 @@ for i := range xs { // Loop body. }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &rangeValCopyChecker{ctx: ctx} c.sizeThreshold = int64(info.Params.Int("sizeThreshold")) c.skipTestFuncs = info.Params.Bool("skipTestFuncs") @@ -45,7 +45,7 @@ for i := range xs { type rangeValCopyChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext sizeThreshold int64 skipTestFuncs bool diff --git a/vendor/github.com/go-critic/go-critic/checkers/regexpMust_checker.go b/vendor/github.com/go-critic/go-critic/checkers/regexpMust_checker.go index ef7a397877c..411932ee5df 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/regexpMust_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/regexpMust_checker.go @@ -4,28 +4,28 @@ import ( "go/ast" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astp" "golang.org/x/tools/go/ast/astutil" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "regexpMust" info.Tags = []string{"style"} info.Summary = "Detects `regexp.Compile*` that can be replaced with `regexp.MustCompile*`" info.Before = `re, _ := regexp.Compile("const pattern")` info.After = `re := regexp.MustCompile("const pattern")` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(®expMustChecker{ctx: ctx}) }) } type regexpMustChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *regexpMustChecker) VisitExpr(x ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go b/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go index 383deb5d446..018ab42d196 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go @@ -6,19 +6,19 @@ import ( "regexp" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "regexpPattern" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects suspicious regexp patterns" info.Before = "regexp.MustCompile(`google.com|yandex.ru`)" info.After = "regexp.MustCompile(`google\\.com|yandex\\.ru`)" - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { domains := []string{ "com", "org", @@ -39,7 +39,7 @@ func init() { type regexpPatternChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext domainRE *regexp.Regexp } diff --git a/vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go b/vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go new file mode 100644 index 00000000000..10dcb327f1b --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go @@ -0,0 +1,511 @@ +package checkers + +import ( + "fmt" + "go/ast" + "go/constant" + "log" + "strings" + "unicode/utf8" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/quasilyte/regex/syntax" +) + +func init() { + var info linter.CheckerInfo + info.Name = "regexpSimplify" + info.Tags = []string{"style", "experimental", "opinionated"} + info.Summary = "Detects regexp patterns that can be simplified" + info.Before = "regexp.MustCompile(`(?:a|b|c) [a-z][a-z]*`)" + info.After = "regexp.MustCompile(`[abc] {3}[a-z]+`)" + + // TODO(quasilyte): add params to control most opinionated replacements + // like `[0-9] -> \d` + // `[[:digit:]] -> \d` + // `[A-Za-z0-9_]` -> `\w` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + opts := &syntax.ParserOptions{ + NoLiterals: true, + } + c := ®expSimplifyChecker{ + ctx: ctx, + parser: syntax.NewParser(opts), + out: &strings.Builder{}, + } + return astwalk.WalkerForExpr(c) + }) +} + +type regexpSimplifyChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext + parser *syntax.Parser + + // out is a tmp buffer where we build a simplified regexp pattern. + out *strings.Builder + // score is a number of applied simplifications + score int +} + +func (c *regexpSimplifyChecker) VisitExpr(x ast.Expr) { + call, ok := x.(*ast.CallExpr) + if !ok { + return + } + + switch qualifiedName(call.Fun) { + case "regexp.Compile", "regexp.MustCompile": + cv := c.ctx.TypesInfo.Types[call.Args[0]].Value + if cv == nil || cv.Kind() != constant.String { + return + } + pat := constant.StringVal(cv) + if len(pat) > 60 { + // Skip scary regexp patterns for now. + break + } + + // Only do 2 passes. + simplified := pat + for pass := 0; pass < 2; pass++ { + candidate := c.simplify(pass, simplified) + if candidate == "" { + break + } + simplified = candidate + } + if simplified != "" && simplified != pat { + c.warn(call.Args[0], pat, simplified) + } + } +} + +func (c *regexpSimplifyChecker) simplify(pass int, pat string) string { + re, err := c.parser.Parse(pat) + if err != nil { + return "" + } + + c.score = 0 + c.out.Reset() + + // TODO(quasilyte): suggest char ranges for things like [012345689]? + // TODO(quasilyte): evaluate char range to suggest better replacements. + // TODO(quasilyte): (?:ab|ac) -> a[bc] + // TODO(quasilyte): suggest "s" and "." flag if things like [\w\W] are used. + // TODO(quasilyte): x{n}x? -> x{n,n+1} + + c.walk(re.Expr) + + if debug() { + // This happens only in one of two cases: + // 1. Parser has a bug and we got invalid AST for the given pattern. + // 2. Simplifier incorrectly built a replacement string from the AST. + if c.score == 0 && c.out.String() != pat { + log.Printf("pass %d: unexpected pattern diff:\n\thave: %q\n\twant: %q", + pass, c.out.String(), pat) + } + } + + if c.score > 0 { + return c.out.String() + } + return "" +} + +func (c *regexpSimplifyChecker) walk(e syntax.Expr) { + out := c.out + + switch e.Op { + case syntax.OpConcat: + c.walkConcat(e) + + case syntax.OpAlt: + c.walkAlt(e) + + case syntax.OpCharRange: + s := c.simplifyCharRange(e) + if s != "" { + out.WriteString(s) + c.score++ + } else { + out.WriteString(e.Value) + } + + case syntax.OpGroupWithFlags: + out.WriteString("(") + out.WriteString(e.Args[1].Value) + out.WriteString(":") + c.walk(e.Args[0]) + out.WriteString(")") + case syntax.OpGroup: + c.walkGroup(e) + case syntax.OpCapture: + out.WriteString("(") + c.walk(e.Args[0]) + out.WriteString(")") + case syntax.OpNamedCapture: + out.WriteString("(?P<") + out.WriteString(e.Args[1].Value) + out.WriteString(">") + c.walk(e.Args[0]) + out.WriteString(")") + + case syntax.OpRepeat: + // TODO(quasilyte): is it worth it to analyze repeat argument + // more closely and handle `{n,n} -> {n}` cases? + rep := e.Args[1].Value + switch rep { + case "{0,1}": + c.walk(e.Args[0]) + out.WriteString("?") + c.score++ + case "{1,}": + c.walk(e.Args[0]) + out.WriteString("+") + c.score++ + case "{0,}": + c.walk(e.Args[0]) + out.WriteString("*") + c.score++ + case "{0}": + // Maybe {0} should be reported by another check, regexpLint? + c.score++ + case "{1}": + c.walk(e.Args[0]) + c.score++ + default: + c.walk(e.Args[0]) + out.WriteString(rep) + } + + case syntax.OpPosixClass: + out.WriteString(e.Value) + + case syntax.OpNegCharClass: + s := c.simplifyNegCharClass(e) + if s != "" { + c.out.WriteString(s) + c.score++ + } else { + out.WriteString("[^") + for _, e := range e.Args { + c.walk(e) + } + out.WriteString("]") + } + + case syntax.OpCharClass: + s := c.simplifyCharClass(e) + if s != "" { + c.out.WriteString(s) + c.score++ + } else { + out.WriteString("[") + for _, e := range e.Args { + c.walk(e) + } + out.WriteString("]") + } + + case syntax.OpEscapeChar: + switch e.Value { + case `\&`, `\#`, `\!`, `\@`, `\%`, `\<`, `\>`, `\:`, `\;`, `\/`, `\,`, `\=`, `\.`: + c.score++ + out.WriteString(e.Value[len(`\`):]) + default: + out.WriteString(e.Value) + } + + case syntax.OpQuestion, syntax.OpNonGreedy: + c.walk(e.Args[0]) + out.WriteString("?") + case syntax.OpStar: + c.walk(e.Args[0]) + out.WriteString("*") + case syntax.OpPlus: + c.walk(e.Args[0]) + out.WriteString("+") + + default: + out.WriteString(e.Value) + } +} + +func (c *regexpSimplifyChecker) walkGroup(g syntax.Expr) { + switch g.Args[0].Op { + case syntax.OpChar, syntax.OpEscapeChar, syntax.OpEscapeMeta, syntax.OpCharClass: + c.walk(g.Args[0]) + c.score++ + return + } + + c.out.WriteString("(?:") + c.walk(g.Args[0]) + c.out.WriteString(")") +} + +func (c *regexpSimplifyChecker) simplifyNegCharClass(e syntax.Expr) string { + switch e.Value { + case `[^0-9]`: + return `\D` + case `[^\s]`: + return `\S` + case `[^\S]`: + return `\s` + case `[^\w]`: + return `\W` + case `[^\W]`: + return `\w` + case `[^\d]`: + return `\D` + case `[^\D]`: + return `\d` + case `[^[:^space:]]`: + return `\s` + case `[^[:space:]]`: + return `\S` + case `[^[:^word:]]`: + return `\w` + case `[^[:word:]]`: + return `\W` + case `[^[:^digit:]]`: + return `\d` + case `[^[:digit:]]`: + return `\D` + } + + return "" +} + +func (c *regexpSimplifyChecker) simplifyCharClass(e syntax.Expr) string { + switch e.Value { + case `[0-9]`: + return `\d` + case `[[:word:]]`: + return `\w` + case `[[:^word:]]`: + return `\W` + case `[[:digit:]]`: + return `\d` + case `[[:^digit:]]`: + return `\D` + case `[[:space:]]`: + return `\s` + case `[[:^space:]]`: + return `\S` + case `[][]`: + return `\]\[` + case `[]]`: + return `\]` + } + + if len(e.Args) == 1 { + switch e.Args[0].Op { + case syntax.OpChar: + switch v := e.Args[0].Value; v { + case "|", "*", "+", "?", ".", "[", "^", "$", "(", ")": + // Can't take outside of the char group without escaping. + default: + return v + } + case syntax.OpEscapeChar: + return e.Args[0].Value + } + } + + return "" +} + +func (c *regexpSimplifyChecker) canMerge(x, y syntax.Expr) bool { + if x.Op != y.Op { + return false + } + switch x.Op { + case syntax.OpChar, syntax.OpCharClass, syntax.OpEscapeMeta, syntax.OpEscapeChar, syntax.OpNegCharClass, syntax.OpGroup: + return x.Value == y.Value + default: + return false + } +} + +func (c *regexpSimplifyChecker) canCombine(x, y syntax.Expr) (threshold int, ok bool) { + if x.Op != y.Op { + return 0, false + } + + switch x.Op { + case syntax.OpDot: + return 3, true + + case syntax.OpChar: + if x.Value != y.Value { + return 0, false + } + if x.Value == " " { + return 1, true + } + return 4, true + + case syntax.OpEscapeMeta, syntax.OpEscapeChar: + if x.Value == y.Value { + return 2, true + } + + case syntax.OpCharClass, syntax.OpNegCharClass, syntax.OpGroup: + if x.Value == y.Value { + return 1, true + } + } + + return 0, false +} + +func (c *regexpSimplifyChecker) concatLiteral(e syntax.Expr) string { + if e.Op == syntax.OpConcat && c.allChars(e) { + return e.Value + } + return "" +} + +func (c *regexpSimplifyChecker) allChars(e syntax.Expr) bool { + for _, a := range e.Args { + if a.Op != syntax.OpChar { + return false + } + } + return true +} + +func (c *regexpSimplifyChecker) factorPrefixSuffix(alt syntax.Expr) bool { + // TODO: more forms of prefixes/suffixes? + // + // A more generalized algorithm could handle `fo|fo1|fo2` -> `fo[12]?`. + // but it's an open question whether the latter form universally better. + // + // Right now it handles only the simplest cases: + // `http|https` -> `https?` + // `xfoo|foo` -> `x?foo` + if len(alt.Args) != 2 { + return false + } + x := c.concatLiteral(alt.Args[0]) + y := c.concatLiteral(alt.Args[1]) + if x == y { + return false // Reject non-literals and identical strings early + } + + // Let x be a shorter string. + if len(x) > len(y) { + x, y = y, x + } + // Do we have a common prefix? + tail := strings.TrimPrefix(y, x) + if len(tail) <= utf8.UTFMax && utf8.RuneCountInString(tail) == 1 { + c.out.WriteString(x + tail + "?") + c.score++ + return true + } + // Do we have a common suffix? + head := strings.TrimSuffix(y, x) + if len(head) <= utf8.UTFMax && utf8.RuneCountInString(head) == 1 { + c.out.WriteString(head + "?" + x) + c.score++ + return true + } + return false +} + +func (c *regexpSimplifyChecker) walkAlt(alt syntax.Expr) { + // `x|y|z` -> `[xyz]`. + if c.allChars(alt) { + c.score++ + c.out.WriteString("[") + for _, e := range alt.Args { + c.out.WriteString(e.Value) + } + c.out.WriteString("]") + return + } + + if c.factorPrefixSuffix(alt) { + return + } + + for i, e := range alt.Args { + c.walk(e) + if i != len(alt.Args)-1 { + c.out.WriteString("|") + } + } +} + +func (c *regexpSimplifyChecker) walkConcat(concat syntax.Expr) { + i := 0 + for i < len(concat.Args) { + x := concat.Args[i] + c.walk(x) + i++ + + if i >= len(concat.Args) { + break + } + + // Try merging `xy*` into `x+` where x=y. + if concat.Args[i].Op == syntax.OpStar { + if c.canMerge(x, concat.Args[i].Args[0]) { + c.out.WriteString("+") + c.score++ + i++ + continue + } + } + + // Try combining `xy` into `x{2}` where x=y. + threshold, ok := c.canCombine(x, concat.Args[i]) + if !ok { + continue + } + n := 1 // Can combine at least 1 pair. + for j := i + 1; j < len(concat.Args); j++ { + _, ok := c.canCombine(x, concat.Args[j]) + if !ok { + break + } + n++ + } + if n >= threshold { + fmt.Fprintf(c.out, "{%d}", n+1) + c.score++ + i += n + } + } +} + +func (c *regexpSimplifyChecker) simplifyCharRange(rng syntax.Expr) string { + if rng.Args[0].Op != syntax.OpChar || rng.Args[1].Op != syntax.OpChar { + return "" + } + + lo := rng.Args[0].Value + hi := rng.Args[1].Value + if len(lo) == 1 && len(hi) == 1 { + switch hi[0] - lo[0] { + case 0: + return lo + case 1: + return fmt.Sprintf("%s%s", lo, hi) + case 2: + return fmt.Sprintf("%s%s%s", lo, string(lo[0]+1), hi) + } + } + + return "" +} + +func (c *regexpSimplifyChecker) warn(cause ast.Expr, orig, suggest string) { + c.ctx.Warn(cause, "can re-write `%s` as `%s`", orig, suggest) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go b/vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go new file mode 100644 index 00000000000..d9799102d33 --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go @@ -0,0 +1,95 @@ +package checkers + +import ( + "bytes" + "go/ast" + "go/token" + "io/ioutil" + "log" + + "github.com/go-critic/go-critic/framework/linter" + "github.com/quasilyte/go-ruleguard/ruleguard" +) + +func init() { + var info linter.CheckerInfo + info.Name = "ruleguard" + info.Tags = []string{"style", "experimental"} + info.Params = linter.CheckerParams{ + "rules": { + Value: "", + Usage: "path to a gorules file", + }, + } + info.Summary = "Runs user-defined rules using ruleguard linter" + info.Details = "Reads a rules file and turns them into go-critic checkers." + info.Before = `N/A` + info.After = `N/A` + info.Note = "See https://github.com/quasilyte/go-ruleguard." + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return newRuleguardChecker(&info, ctx) + }) +} + +func newRuleguardChecker(info *linter.CheckerInfo, ctx *linter.CheckerContext) *ruleguardChecker { + c := &ruleguardChecker{ctx: ctx} + rulesFilename := info.Params.String("rules") + if rulesFilename == "" { + return c + } + + // TODO(quasilyte): handle initialization errors better when we make + // a transition to the go/analysis framework. + // + // For now, we log error messages and return a ruleguard checker + // with an empty rules set. + + data, err := ioutil.ReadFile(rulesFilename) + if err != nil { + log.Printf("ruleguard init error: %+v", err) + return c + } + + fset := token.NewFileSet() + rset, err := ruleguard.ParseRules(rulesFilename, fset, bytes.NewReader(data)) + if err != nil { + log.Printf("ruleguard init error: %+v", err) + return c + } + + c.rset = rset + return c +} + +type ruleguardChecker struct { + ctx *linter.CheckerContext + + rset *ruleguard.GoRuleSet +} + +func (c *ruleguardChecker) WalkFile(f *ast.File) { + if c.rset == nil { + return + } + + ctx := &ruleguard.Context{ + Pkg: c.ctx.Pkg, + Types: c.ctx.TypesInfo, + Sizes: c.ctx.SizesInfo, + Fset: c.ctx.FileSet, + Report: func(_ ruleguard.GoRuleInfo, n ast.Node, msg string, _ *ruleguard.Suggestion) { + // TODO(quasilyte): investigate whether we should add a rule name as + // a message prefix here. + c.ctx.Warn(n, msg) + }, + } + + err := ruleguard.RunRules(ctx, f, c.rset) + if err != nil { + // Normally this should never happen, but since + // we don't have a better mechanism to report errors, + // emit a warning. + c.ctx.Warn(f, "execution error: %v", err) + } +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go b/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go index 6cdb06aefc4..abead3fa283 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go @@ -2,13 +2,15 @@ package checkers import ( "go/ast" + "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "golang.org/x/tools/go/ast/astutil" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "singleCaseSwitch" info.Tags = []string{"style"} info.Summary = "Detects switch statements that could be better written as if statement" @@ -22,14 +24,14 @@ if x, ok := x.(int); ok { body() }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&singleCaseSwitchChecker{ctx: ctx}) }) } type singleCaseSwitchChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *singleCaseSwitchChecker) VisitStmt(stmt ast.Stmt) { @@ -42,16 +44,37 @@ func (c *singleCaseSwitchChecker) VisitStmt(stmt ast.Stmt) { } func (c *singleCaseSwitchChecker) checkSwitchStmt(stmt ast.Stmt, body *ast.BlockStmt) { - if len(body.List) == 1 { - if body.List[0].(*ast.CaseClause).List == nil { - // default case. - c.warnDefault(stmt) - } else if len(body.List[0].(*ast.CaseClause).List) == 1 { - c.warn(stmt) - } + if len(body.List) != 1 { + return + } + cc := body.List[0].(*ast.CaseClause) + if c.hasBreak(cc) { + return + } + switch { + case cc.List == nil: + c.warnDefault(stmt) + case len(cc.List) == 1: + c.warn(stmt) } } +func (c *singleCaseSwitchChecker) hasBreak(stmt ast.Stmt) bool { + found := false + astutil.Apply(stmt, func(cur *astutil.Cursor) bool { + switch n := cur.Node().(type) { + case *ast.BranchStmt: + if n.Tok == token.BREAK { + found = true + } + case *ast.ForStmt, *ast.RangeStmt, *ast.SelectStmt, *ast.SwitchStmt: + return false + } + return true + }, nil) + return found +} + func (c *singleCaseSwitchChecker) warn(stmt ast.Stmt) { c.ctx.Warn(stmt, "should rewrite switch statement to if statement") } diff --git a/vendor/github.com/go-critic/go-critic/checkers/sloppyLen_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sloppyLen_checker.go index 45123ec6bdc..e12545ffe62 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/sloppyLen_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/sloppyLen_checker.go @@ -4,14 +4,14 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astfmt" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "sloppyLen" info.Tags = []string{"style"} info.Summary = "Detects usage of `len` when result is obvious or doesn't make sense" @@ -23,14 +23,14 @@ len(arr) < 0 // Doesn't make sense at all` len(arr) > 0 len(arr) == 0` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&sloppyLenChecker{ctx: ctx}) }) } type sloppyLenChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *sloppyLenChecker) VisitExpr(x ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go index 1a7c198774e..d099450d1fc 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go @@ -4,29 +4,29 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "sloppyReassign" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects suspicious/confusing re-assignments" info.Before = `if err = f(); err != nil { return err }` info.After = `if err := f(); err != nil { return err }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&sloppyReassignChecker{ctx: ctx}) }) } type sloppyReassignChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *sloppyReassignChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go new file mode 100644 index 00000000000..4abfcbab496 --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go @@ -0,0 +1,75 @@ +package checkers + +import ( + "go/ast" + "go/types" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/go-toolsmith/astcast" +) + +func init() { + var info linter.CheckerInfo + info.Name = "sloppyTypeAssert" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects redundant type assertions" + info.Before = ` +function f(r io.Reader) interface{} { + return r.(interface{}) +} +` + info.After = ` +function f(r io.Reader) interface{} { + return r +} +` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return astwalk.WalkerForExpr(&sloppyTypeAssertChecker{ctx: ctx}) + }) +} + +type sloppyTypeAssertChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext +} + +func (c *sloppyTypeAssertChecker) VisitExpr(expr ast.Expr) { + assert := astcast.ToTypeAssertExpr(expr) + if assert.Type == nil { + return + } + + toType := c.ctx.TypesInfo.TypeOf(expr) + fromType := c.ctx.TypesInfo.TypeOf(assert.X) + + if types.Identical(toType, fromType) { + c.warnIdentical(expr) + return + } + + toIface, ok := toType.Underlying().(*types.Interface) + if !ok { + return + } + + switch { + case toIface.Empty(): + c.warnEmpty(expr) + case types.Implements(fromType, toIface): + c.warnImplements(expr, assert.X) + } +} + +func (c *sloppyTypeAssertChecker) warnIdentical(cause ast.Expr) { + c.ctx.Warn(cause, "type assertion from/to types are identical") +} + +func (c *sloppyTypeAssertChecker) warnEmpty(cause ast.Expr) { + c.ctx.Warn(cause, "type assertion to interface{} may be redundant") +} + +func (c *sloppyTypeAssertChecker) warnImplements(cause, val ast.Expr) { + c.ctx.Warn(cause, "type assertion may be redundant as %s always implements selected interface", val) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go new file mode 100644 index 00000000000..b80c1787384 --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go @@ -0,0 +1,135 @@ +package checkers + +import ( + "go/ast" + "go/token" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/checkers/internal/lintutil" + "github.com/go-critic/go-critic/framework/linter" + "github.com/go-toolsmith/astcast" + "github.com/go-toolsmith/astequal" + "github.com/go-toolsmith/typep" + "golang.org/x/tools/go/ast/astutil" +) + +func init() { + var info linter.CheckerInfo + info.Name = "sortSlice" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects suspicious sort.Slice calls" + info.Before = `sort.Slice(xs, func(i, j) bool { return keys[i] < keys[j] })` + info.After = `sort.Slice(kv, func(i, j) bool { return kv[i].key < kv[j].key })` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return astwalk.WalkerForExpr(&sortSliceChecker{ctx: ctx}) + }) +} + +type sortSliceChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext +} + +func (c *sortSliceChecker) VisitExpr(expr ast.Expr) { + call := astcast.ToCallExpr(expr) + if len(call.Args) != 2 { + return + } + switch qualifiedName(call.Fun) { + case "sort.Slice", "sort.SliceStable": + // OK. + default: + return + } + + slice := c.unwrapSlice(call.Args[0]) + lessFunc, ok := call.Args[1].(*ast.FuncLit) + if !ok { + return + } + if !typep.SideEffectFree(c.ctx.TypesInfo, slice) { + return // Don't check unpredictable slice values + } + + ivar, jvar := c.paramIdents(lessFunc.Type) + if ivar == nil || jvar == nil { + return + } + + if len(lessFunc.Body.List) != 1 { + return + } + ret, ok := lessFunc.Body.List[0].(*ast.ReturnStmt) + if !ok { + return + } + cmp := astcast.ToBinaryExpr(astutil.Unparen(ret.Results[0])) + if !typep.SideEffectFree(c.ctx.TypesInfo, cmp) { + return + } + switch cmp.Op { + case token.LSS, token.LEQ, token.GTR, token.GEQ: + // Both cmp.X and cmp.Y are expected to be some expressions + // over the `slice` expression. In the simplest case, + // it's a `slice[i] slice[j]`. + if !c.containsSlice(cmp.X, slice) && !c.containsSlice(cmp.Y, slice) { + c.warnSlice(cmp, slice) + } + + // This one is more about the style, but can reveal potential issue + // or misprint in sorting condition. + // We give a warn if X contains indexing with `i` index and Y + // contains indexing with `j`. + if c.containsIndex(cmp.X, jvar) && c.containsIndex(cmp.Y, ivar) { + c.warnIndex(cmp, ivar, jvar) + } + } +} + +func (c *sortSliceChecker) paramIdents(e *ast.FuncType) (*ast.Ident, *ast.Ident) { + // Covers both `i, j int` and `i int, j int`. + idents := make([]*ast.Ident, 0, 2) + for _, field := range e.Params.List { + idents = append(idents, field.Names...) + } + if len(idents) == 2 { + return idents[0], idents[1] + } + return nil, nil +} + +func (c *sortSliceChecker) unwrapSlice(e ast.Expr) ast.Expr { + switch e := e.(type) { + case *ast.ParenExpr: + return c.unwrapSlice(e.X) + case *ast.SliceExpr: + return e.X + default: + return e + } +} + +func (c *sortSliceChecker) containsIndex(e, index ast.Expr) bool { + return lintutil.ContainsNode(e, func(n ast.Node) bool { + indexing, ok := n.(*ast.IndexExpr) + if !ok { + return false + } + return astequal.Expr(indexing.Index, index) + }) +} + +func (c *sortSliceChecker) containsSlice(e, slice ast.Expr) bool { + return lintutil.ContainsNode(e, func(n ast.Node) bool { + return astequal.Node(n, slice) + }) +} + +func (c *sortSliceChecker) warnSlice(cause ast.Node, slice ast.Expr) { + c.ctx.Warn(cause, "cmp func must use %s slice in comparison", slice) +} + +func (c *sortSliceChecker) warnIndex(cause ast.Node, ivar, jvar *ast.Ident) { + c.ctx.Warn(cause, "unusual order of {%s,%s} params in comparison", ivar, jvar) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go new file mode 100644 index 00000000000..697a82ccf5f --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go @@ -0,0 +1,167 @@ +package checkers + +import ( + "go/ast" + "go/types" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/go-toolsmith/astcast" +) + +func init() { + var info linter.CheckerInfo + info.Name = "sqlQuery" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects issue in Query() and Exec() calls" + info.Before = `_, err := db.Query("UPDATE ...")` + info.After = `_, err := db.Exec("UPDATE ...")` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return astwalk.WalkerForStmt(&sqlQueryChecker{ctx: ctx}) + }) +} + +type sqlQueryChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext +} + +func (c *sqlQueryChecker) VisitStmt(stmt ast.Stmt) { + assign := astcast.ToAssignStmt(stmt) + if len(assign.Lhs) != 2 { // Query() has 2 return values. + return + } + if len(assign.Rhs) != 1 { + return + } + + // If Query() is called, but first return value is ignored, + // there is no way to close/read the returned rows. + // This can cause a connection leak. + if id, ok := assign.Lhs[0].(*ast.Ident); ok && id.Name != "_" { + return + } + + call := astcast.ToCallExpr(assign.Rhs[0]) + funcExpr := astcast.ToSelectorExpr(call.Fun) + if !c.funcIsQuery(funcExpr) { + return + } + + if c.typeHasExecMethod(c.ctx.TypesInfo.TypeOf(funcExpr.X)) { + c.warnAndSuggestExec(funcExpr) + } else { + c.warnRowsIgnored(funcExpr) + } +} + +func (c *sqlQueryChecker) funcIsQuery(funcExpr *ast.SelectorExpr) bool { + if funcExpr.Sel == nil { + return false + } + switch funcExpr.Sel.Name { + case "Query", "QueryContext": + // Stdlib and friends. + case "Queryx", "QueryxContext": + // sqlx. + default: + return false + } + + // To avoid false positives (unrelated types can have Query method) + // check that the 1st returned type has Row-like name. + typ, ok := c.ctx.TypesInfo.TypeOf(funcExpr).Underlying().(*types.Signature) + if !ok || typ.Results() == nil || typ.Results().Len() != 2 { + return false + } + if !c.typeIsRowsLike(typ.Results().At(0).Type()) { + return false + } + + return true +} + +func (c *sqlQueryChecker) typeIsRowsLike(typ types.Type) bool { + switch typ := typ.(type) { + case *types.Pointer: + return c.typeIsRowsLike(typ.Elem()) + case *types.Named: + return typ.Obj().Name() == "Rows" + default: + return false + } +} + +func (c *sqlQueryChecker) funcIsExec(fn *types.Func) bool { + if fn.Name() != "Exec" { + return false + } + + // Expect exactly 2 results. + sig := fn.Type().(*types.Signature) + if sig.Results() == nil || sig.Results().Len() != 2 { + return false + } + + // Expect at least 1 param and it should be a string (query). + params := sig.Params() + if params == nil || params.Len() == 0 { + return false + } + if typ, ok := params.At(0).Type().(*types.Basic); !ok || typ.Kind() != types.String { + return false + } + + return true +} + +func (c *sqlQueryChecker) typeHasExecMethod(typ types.Type) bool { + switch typ := typ.(type) { + case *types.Struct: + for i := 0; i < typ.NumFields(); i++ { + if c.typeHasExecMethod(typ.Field(i).Type()) { + return true + } + } + case *types.Interface: + for i := 0; i < typ.NumMethods(); i++ { + if c.funcIsExec(typ.Method(i)) { + return true + } + } + case *types.Pointer: + return c.typeHasExecMethod(typ.Elem()) + case *types.Named: + for i := 0; i < typ.NumMethods(); i++ { + if c.funcIsExec(typ.Method(i)) { + return true + } + } + switch ut := typ.Underlying().(type) { + case *types.Interface: + return c.typeHasExecMethod(ut) + case *types.Struct: + // Check embedded types. + for i := 0; i < ut.NumFields(); i++ { + field := ut.Field(i) + if !field.Embedded() { + continue + } + if c.typeHasExecMethod(field.Type()) { + return true + } + } + } + } + + return false +} + +func (c *sqlQueryChecker) warnAndSuggestExec(funcExpr *ast.SelectorExpr) { + c.ctx.Warn(funcExpr, "use %s.Exec() if returned result is not needed", funcExpr.X) +} + +func (c *sqlQueryChecker) warnRowsIgnored(funcExpr *ast.SelectorExpr) { + c.ctx.Warn(funcExpr, "ignoring Query() rows result may lead to a connection leak") +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/stringXbytes_checker.go b/vendor/github.com/go-critic/go-critic/checkers/stringXbytes_checker.go index 74570108e69..57e4084f62c 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/stringXbytes_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/stringXbytes_checker.go @@ -3,27 +3,27 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/typep" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "stringXbytes" - info.Tags = []string{"style", "experimental"} + info.Tags = []string{"style"} info.Summary = "Detects redundant conversions between string and []byte" info.Before = `copy(b, []byte(s))` info.After = `copy(b, s)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&stringXbytes{ctx: ctx}) }) } type stringXbytes struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *stringXbytes) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/switchTrue_checker.go b/vendor/github.com/go-critic/go-critic/checkers/switchTrue_checker.go index 3b276627697..5390360c53c 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/switchTrue_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/switchTrue_checker.go @@ -3,12 +3,12 @@ package checkers import ( "go/ast" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "switchTrue" info.Tags = []string{"style"} info.Summary = "Detects switch-over-bool statements that use explicit `true` tag value" @@ -21,14 +21,14 @@ switch { case x > y: }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&switchTrueChecker{ctx: ctx}) }) } type switchTrueChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *switchTrueChecker) VisitStmt(stmt ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go b/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go index f4cb9e8662d..a5b7bdd3275 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go @@ -5,17 +5,17 @@ import ( "go/token" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "truncateCmp" info.Tags = []string{"diagnostic", "experimental"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "skipArchDependent": { Value: true, Usage: "whether to skip int/uint/uintptr types", @@ -31,7 +31,7 @@ func f(x int32, int16) bool { return x < int32(y) }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &truncateCmpChecker{ctx: ctx} c.skipArchDependent = info.Params.Bool("skipArchDependent") return astwalk.WalkerForExpr(c) @@ -40,7 +40,7 @@ func f(x int32, int16) bool { type truncateCmpChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext skipArchDependent bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go index c0c42e3511c..2940e57f9a7 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go @@ -4,16 +4,16 @@ import ( "go/ast" "go/token" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "typeAssertChain" info.Tags = []string{"style", "experimental"} info.Summary = "Detects repeated type assertions and suggests to replace them with type switch statement" @@ -35,14 +35,14 @@ default: // Code C, uses x. }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&typeAssertChainChecker{ctx: ctx}) }) } type typeAssertChainChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext cause *ast.IfStmt visited map[*ast.IfStmt]bool diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go index a113597b6a7..2ade4a954d6 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go @@ -3,15 +3,15 @@ package checkers import ( "go/ast" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "typeSwitchVar" info.Tags = []string{"style"} info.Summary = "Detects type switches that can benefit from type guard clause with variable" @@ -34,18 +34,20 @@ default: return 0 }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&typeSwitchVarChecker{ctx: ctx}) }) } type typeSwitchVarChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext + count int } func (c *typeSwitchVarChecker) VisitStmt(stmt ast.Stmt) { if stmt, ok := stmt.(*ast.TypeSwitchStmt); ok { + c.count = 0 c.checkTypeSwitch(stmt) } } @@ -61,7 +63,7 @@ func (c *typeSwitchVarChecker) checkTypeSwitch(root *ast.TypeSwitchStmt) { return // Give up: can't handle shadowing without object } - for i, clause := range root.Body.List { + for _, clause := range root.Body.List { clause := clause.(*ast.CaseClause) // Multiple types in a list mean that assert.X will have // a type of interface{} inside clause body. @@ -76,13 +78,20 @@ func (c *typeSwitchVarChecker) checkTypeSwitch(root *ast.TypeSwitchStmt) { return astequal.Node(&assert1, x) }) if object == c.ctx.TypesInfo.ObjectOf(identOf(assert2)) { - c.warn(root, i) + c.count++ break } } } + if c.count > 0 { + c.warn(root) + } } -func (c *typeSwitchVarChecker) warn(n ast.Node, caseIndex int) { - c.ctx.Warn(n, "case %d can benefit from type switch with assignment", caseIndex) +func (c *typeSwitchVarChecker) warn(n ast.Node) { + msg := "case" + if c.count > 1 { + msg = "cases" + } + c.ctx.Warn(n, "%d "+msg+" can benefit from type switch with assignment", c.count) } diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go index a17c77b4969..620d2d79748 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go @@ -3,30 +3,30 @@ package checkers import ( "go/ast" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astp" "golang.org/x/tools/go/ast/astutil" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "typeUnparen" info.Tags = []string{"style", "opinionated"} info.Summary = "Detects unneded parenthesis inside type expressions and suggests to remove them" info.Before = `type foo [](func([](func())))` info.After = `type foo []func([]func())` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForTypeExpr(&typeUnparenChecker{ctx: ctx}, ctx.TypesInfo) }) } type typeUnparenChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *typeUnparenChecker) VisitTypeExpr(x ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go b/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go index dfc6077bbf1..561270c7c1c 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go @@ -4,17 +4,17 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "underef" info.Tags = []string{"style"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "skipRecvDeref": { Value: true, Usage: "whether to skip (*x).method() calls where x is a pointer receiver", @@ -28,7 +28,7 @@ v := (*a)[5] // only if a is array` k.field = 5 v := a[5]` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &underefChecker{ctx: ctx} c.skipRecvDeref = info.Params.Bool("skipRecvDeref") return astwalk.WalkerForExpr(c) @@ -37,7 +37,7 @@ v := a[5]` type underefChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext skipRecvDeref bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go index d90c65c2ce1..83c5b14841b 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go @@ -4,13 +4,13 @@ import ( "go/ast" "go/token" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "unlabelStmt" info.Tags = []string{"style", "experimental"} info.Summary = "Detects redundant statement labels" @@ -28,14 +28,14 @@ for x := range xs { } }` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmt(&unlabelStmtChecker{ctx: ctx}) }) } type unlabelStmtChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *unlabelStmtChecker) EnterFunc(fn *ast.FuncDecl) bool { diff --git a/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go index 9e01299bff9..946227c2f1a 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go @@ -4,28 +4,28 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "unlambda" info.Tags = []string{"style"} info.Summary = "Detects function literals that can be simplified" info.Before = `func(x int) int { return fn(x) }` info.After = `fn` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&unlambdaChecker{ctx: ctx}) }) } type unlambdaChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *unlambdaChecker) VisitExpr(x ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go index 09423250ad4..f053842ec94 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go @@ -4,15 +4,15 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "unnamedResult" info.Tags = []string{"style", "opinionated", "experimental"} - info.Params = lintpack.CheckerParams{ + info.Params = linter.CheckerParams{ "checkExported": { Value: false, Usage: "whether to check exported functions", @@ -22,7 +22,7 @@ func init() { info.Before = `func f() (float64, float64)` info.After = `func f() (x, y float64)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { c := &unnamedResultChecker{ctx: ctx} c.checkExported = info.Params.Bool("checkExported") return astwalk.WalkerForFuncDecl(c) @@ -31,7 +31,7 @@ func init() { type unnamedResultChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext checkExported bool } diff --git a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go index e5dc45f7ef0..acc9fadbf91 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go @@ -4,12 +4,12 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "unnecessaryBlock" info.Tags = []string{"style", "opinionated", "experimental"} info.Summary = "Detects unnecessary braced statement blocks" @@ -22,14 +22,14 @@ x := 1 x := 1 print(x)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmtList(&unnecessaryBlockChecker{ctx: ctx}) }) } type unnecessaryBlockChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *unnecessaryBlockChecker) VisitStmtList(statements []ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go new file mode 100644 index 00000000000..ee706e0996d --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go @@ -0,0 +1,111 @@ +package checkers + +import ( + "go/ast" + + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" + "github.com/go-toolsmith/astfmt" +) + +func init() { + var info linter.CheckerInfo + info.Name = "unnecessaryDefer" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects redundantly deferred calls" + info.Before = ` +func() { + defer os.Remove(filename) +}` + info.After = ` +func() { + os.Remove(filename) +}` + + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { + return astwalk.WalkerForFuncDecl(&unnecessaryDeferChecker{ctx: ctx}) + }) +} + +type unnecessaryDeferChecker struct { + astwalk.WalkHandler + ctx *linter.CheckerContext + isFunc bool +} + +// Visit implements the ast.Visitor. This visitor keeps track of the block +// statement belongs to a function or any other block. If the block is not a +// function and ends with a defer statement that should be OK since it's +// defering the outer function. +func (c *unnecessaryDeferChecker) Visit(node ast.Node) ast.Visitor { + switch n := node.(type) { + case *ast.FuncDecl, *ast.FuncLit: + c.isFunc = true + case *ast.BlockStmt: + c.checkDeferBeforeReturn(n) + default: + c.isFunc = false + } + + return c +} + +func (c *unnecessaryDeferChecker) VisitFuncDecl(funcDecl *ast.FuncDecl) { + // We always start as a function (*ast.FuncDecl.Body passed) + c.isFunc = true + + ast.Walk(c, funcDecl.Body) +} + +func (c *unnecessaryDeferChecker) checkDeferBeforeReturn(funcDecl *ast.BlockStmt) { + // Check if we have an explicit return or if it's just the end of the scope. + explicitReturn := false + retIndex := len(funcDecl.List) + for i, stmt := range funcDecl.List { + retStmt, ok := stmt.(*ast.ReturnStmt) + if !ok { + continue + } + explicitReturn = true + if !c.isTrivialReturn(retStmt) { + continue + } + retIndex = i + break + } + if retIndex == 0 { + return + } + + if deferStmt, ok := funcDecl.List[retIndex-1].(*ast.DeferStmt); ok { + // If the block is a function and ending with return or if we have an + // explicit return in any other block we should warn about + // unnecessary defer. + if c.isFunc || explicitReturn { + c.warn(deferStmt) + } + } +} + +func (c *unnecessaryDeferChecker) isTrivialReturn(ret *ast.ReturnStmt) bool { + for _, e := range ret.Results { + if !c.isConstExpr(e) { + return false + } + } + return true +} + +func (c *unnecessaryDeferChecker) isConstExpr(e ast.Expr) bool { + return c.ctx.TypesInfo.Types[e].Value != nil +} + +func (c *unnecessaryDeferChecker) warn(deferStmt *ast.DeferStmt) { + s := astfmt.Sprint(deferStmt) + if fnlit, ok := deferStmt.Call.Fun.(*ast.FuncLit); ok { + // To avoid long and multi-line warning messages, + // collapse the function literals. + s = "defer " + astfmt.Sprint(fnlit.Type) + "{...}(...)" + } + c.ctx.Warn(deferStmt, "%s is placed just before return", s) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unslice_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unslice_checker.go index 06d90819c9a..73f67bc8ee1 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/unslice_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/unslice_checker.go @@ -4,13 +4,13 @@ import ( "go/ast" "go/types" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "unslice" info.Tags = []string{"style"} info.Summary = "Detects slice expressions that can be simplified to sliced expression itself" @@ -21,14 +21,14 @@ copy(b[:], values...) // b is []byte` f(s) copy(b, values...)` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&unsliceChecker{ctx: ctx}) }) } type unsliceChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *unsliceChecker) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/utils.go b/vendor/github.com/go-critic/go-critic/checkers/utils.go index ba4777dbdda..b71f24d7490 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/utils.go +++ b/vendor/github.com/go-critic/go-critic/checkers/utils.go @@ -5,7 +5,7 @@ import ( "go/types" "strings" - "github.com/go-lintpack/lintpack" + "github.com/go-critic/go-critic/framework/linter" ) // goStdlib contains `go list std` command output list. @@ -247,7 +247,7 @@ func isExampleTestFunc(fn *ast.FuncDecl) bool { } // isUnitTestFunc reports whether FuncDecl declares testing function. -func isUnitTestFunc(ctx *lintpack.CheckerContext, fn *ast.FuncDecl) bool { +func isUnitTestFunc(ctx *linter.CheckerContext, fn *ast.FuncDecl) bool { if !strings.HasPrefix(fn.Name.Name, "Test") { return false } diff --git a/vendor/github.com/go-critic/go-critic/checkers/valSwap_checker.go b/vendor/github.com/go-critic/go-critic/checkers/valSwap_checker.go index ab27f920079..4dd494ecfad 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/valSwap_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/valSwap_checker.go @@ -4,16 +4,16 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "valSwap" - info.Tags = []string{"style", "experimental"} + info.Tags = []string{"style"} info.Summary = "Detects value swapping code that are not using parallel assignment" info.Before = ` tmp := *x @@ -21,14 +21,14 @@ tmp := *x *y = tmp` info.After = `*x, *y = *y, *x` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForStmtList(&valSwapChecker{ctx: ctx}) }) } type valSwapChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *valSwapChecker) VisitStmtList(list []ast.Stmt) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go b/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go index fcd9aee527e..1d6ee58efed 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go @@ -4,9 +4,9 @@ import ( "go/ast" "go/token" + "github.com/go-critic/go-critic/checkers/internal/astwalk" "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" "github.com/go-toolsmith/astequal" "github.com/go-toolsmith/typep" @@ -14,21 +14,21 @@ import ( ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "weakCond" info.Tags = []string{"diagnostic", "experimental"} info.Summary = "Detects conditions that are unsafe due to not being exhaustive" info.Before = `xs != nil && xs[0] != nil` info.After = `len(xs) != 0 && xs[0] != nil` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForExpr(&weakCondChecker{ctx: ctx}) }) } type weakCondChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *weakCondChecker) VisitExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go b/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go index 52fefb82c45..cc5c5172e17 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go @@ -5,12 +5,12 @@ import ( "regexp" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" ) func init() { - info := lintpack.CheckerInfo{ + info := linter.CheckerInfo{ Name: "whyNoLint", Tags: []string{"style", "experimental"}, Summary: "Ensures that `//nolint` comments include an explanation", @@ -19,7 +19,7 @@ func init() { } re := regexp.MustCompile(`^// *nolint(?::[^ ]+)? *(.*)$`) - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForComment(&whyNoLintChecker{ ctx: ctx, re: re, @@ -30,7 +30,7 @@ func init() { type whyNoLintChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext re *regexp.Regexp } diff --git a/vendor/github.com/go-critic/go-critic/checkers/wrapperFunc_checker.go b/vendor/github.com/go-critic/go-critic/checkers/wrapperFunc_checker.go index bba82e5ee85..bc543e6483f 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/wrapperFunc_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/wrapperFunc_checker.go @@ -6,20 +6,20 @@ import ( "go/types" "strings" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcast" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "wrapperFunc" - info.Tags = []string{"style", "experimental"} + info.Tags = []string{"style"} info.Summary = "Detects function calls that can be replaced with convenience wrappers" info.Before = `wg.Add(-1)` info.After = `wg.Done()` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { type arg struct { index int value string @@ -81,6 +81,11 @@ func init() { "bytes.Map => bytes.ToTitle": { {0, "unicode.ToTitle"}, }, + + "draw.DrawMask => draw.Draw": { + {4, "nil"}, + {5, "image.Point{}"}, + }, } matchers := make(map[string]*matcher) @@ -203,7 +208,7 @@ func init() { type wrapperFuncChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext findSuggestion func(*ast.CallExpr) string } diff --git a/vendor/github.com/go-critic/go-critic/checkers/yodaStyleExpr_checker.go b/vendor/github.com/go-critic/go-critic/checkers/yodaStyleExpr_checker.go index ddd3099fd0b..b4672fcca17 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/yodaStyleExpr_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/yodaStyleExpr_checker.go @@ -4,28 +4,28 @@ import ( "go/ast" "go/token" - "github.com/go-lintpack/lintpack" - "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-critic/go-critic/checkers/internal/astwalk" + "github.com/go-critic/go-critic/framework/linter" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astp" ) func init() { - var info lintpack.CheckerInfo + var info linter.CheckerInfo info.Name = "yodaStyleExpr" info.Tags = []string{"style", "experimental"} info.Summary = "Detects Yoda style expressions and suggests to replace them" info.Before = `return nil != ptr` info.After = `return ptr != nil` - collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + collection.AddChecker(&info, func(ctx *linter.CheckerContext) linter.FileWalker { return astwalk.WalkerForLocalExpr(&yodaStyleExprChecker{ctx: ctx}) }) } type yodaStyleExprChecker struct { astwalk.WalkHandler - ctx *lintpack.CheckerContext + ctx *linter.CheckerContext } func (c *yodaStyleExprChecker) VisitLocalExpr(expr ast.Expr) { diff --git a/vendor/github.com/go-lintpack/lintpack/checkers_db.go b/vendor/github.com/go-critic/go-critic/framework/linter/checkers_db.go similarity index 99% rename from vendor/github.com/go-lintpack/lintpack/checkers_db.go rename to vendor/github.com/go-critic/go-critic/framework/linter/checkers_db.go index 83d41b4e4c0..b4bebe44355 100644 --- a/vendor/github.com/go-lintpack/lintpack/checkers_db.go +++ b/vendor/github.com/go-critic/go-critic/framework/linter/checkers_db.go @@ -1,4 +1,4 @@ -package lintpack +package linter import ( "fmt" diff --git a/vendor/github.com/go-lintpack/lintpack/context.go b/vendor/github.com/go-critic/go-critic/framework/linter/context.go similarity index 97% rename from vendor/github.com/go-lintpack/lintpack/context.go rename to vendor/github.com/go-critic/go-critic/framework/linter/context.go index 8671e175ca3..6e108ab6a5d 100644 --- a/vendor/github.com/go-lintpack/lintpack/context.go +++ b/vendor/github.com/go-critic/go-critic/framework/linter/context.go @@ -1,4 +1,4 @@ -package lintpack +package linter import ( "go/ast" diff --git a/vendor/github.com/go-lintpack/lintpack/lintpack.go b/vendor/github.com/go-critic/go-critic/framework/linter/lintpack.go similarity index 98% rename from vendor/github.com/go-lintpack/lintpack/lintpack.go rename to vendor/github.com/go-critic/go-critic/framework/linter/lintpack.go index 28c3a6354eb..1f984d146ee 100644 --- a/vendor/github.com/go-lintpack/lintpack/lintpack.go +++ b/vendor/github.com/go-critic/go-critic/framework/linter/lintpack.go @@ -1,7 +1,6 @@ -package lintpack +package linter import ( - "fmt" "go/ast" "go/token" "go/types" @@ -25,7 +24,7 @@ type CheckerCollection struct { // constructor will not be called. func (coll *CheckerCollection) AddChecker(info *CheckerInfo, constructor func(*CheckerContext) FileWalker) { if coll == nil { - panic(fmt.Sprintf("adding checker to a nil collection")) + panic("adding checker to a nil collection") } info.Collection = coll addChecker(info, constructor) diff --git a/vendor/github.com/go-lintpack/lintpack/.travis.yml b/vendor/github.com/go-lintpack/lintpack/.travis.yml deleted file mode 100644 index 41a0cbac510..00000000000 --- a/vendor/github.com/go-lintpack/lintpack/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go -go: - - 1.x -install: - - # Prevent default install action "go get -t -v ./...". -script: - - make ci diff --git a/vendor/github.com/go-lintpack/lintpack/Makefile b/vendor/github.com/go-lintpack/lintpack/Makefile deleted file mode 100644 index 63f21d2f93d..00000000000 --- a/vendor/github.com/go-lintpack/lintpack/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -.PHONY: test ci - -%: # stubs to get makefile param for `test-checker` command - @: # see: https://stackoverflow.com/a/6273809/433041 - -build: - go build cmd/lintpack/build.go cmd/lintpack/main.go - -test: - go test -v -count=1 ./... - -ci: - go get -t -v ./... - go test -v -count=1 ./... diff --git a/vendor/github.com/go-lintpack/lintpack/README.md b/vendor/github.com/go-lintpack/lintpack/README.md deleted file mode 100644 index 5702228ebce..00000000000 --- a/vendor/github.com/go-lintpack/lintpack/README.md +++ /dev/null @@ -1,32 +0,0 @@ -[![Build Status][travis-image]][travis-url] -[![Go Report Card][go-report-image]][go-report-url] - -[travis-image]: https://travis-ci.org/go-critic/go-critic.svg?branch=master -[travis-url]: https://travis-ci.org/go-critic/go-critic -[go-report-image]: https://goreportcard.com/badge/github.com/go-critic/go-critic -[go-report-url]: https://goreportcard.com/report/github.com/go-critic/go-critic - -## Quick start / Installation / Usage - -Install `lintpack`: - -```bash -go get -v -u github.com/go-lintpack/lintpack/... -``` - -Install checkers from [go-critic/checkers](https://github.com/go-critic/checkers): - -```bash -# You'll need to have sources under your Go workspace first: -go get -v -u github.com/go-critic/checkers -# Now build a linter that includes all checks from that package: -lintpack build -o gocritic github.com/go-critic/checkers -# Executable gocritic is created and can be used as a standalone linter. -``` - -Produced binary includes basic help as well as supported checks documentation. - -So, the process is simple: - -* Get the `lintpack` linter builder -* Build linter from checks implemented in different repos, by various vendors diff --git a/vendor/github.com/go-lintpack/lintpack/doc.go b/vendor/github.com/go-lintpack/lintpack/doc.go deleted file mode 100644 index 4aba342f536..00000000000 --- a/vendor/github.com/go-lintpack/lintpack/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package lintpack provides shared API between the linter and its checkers. -// -// Linter is usually implemented by creating instances of registered checkers. -// Checkers are registered by the AddChecker call. -package lintpack diff --git a/vendor/github.com/go-lintpack/lintpack/go.mod b/vendor/github.com/go-lintpack/lintpack/go.mod deleted file mode 100644 index b2e4cd984d7..00000000000 --- a/vendor/github.com/go-lintpack/lintpack/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module github.com/go-lintpack/lintpack - -require ( - github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6 - github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086 - github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30 - github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8 - github.com/google/go-cmp v0.2.0 - github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e - golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09 -) diff --git a/vendor/github.com/go-lintpack/lintpack/go.sum b/vendor/github.com/go-lintpack/lintpack/go.sum deleted file mode 100644 index bd9f5dcb95e..00000000000 --- a/vendor/github.com/go-lintpack/lintpack/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6 h1:aTBUNRTatDDU24gbOEKEoLiDwxtc98ga6K/iMTm6fvs= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086 h1:EIMuvbE9fbtQtimdLe5yeXjuC5CeKbQt8zH6GwtIrhM= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30 h1:zRJPftZJNLPDiOtvYbFRwjSbaJAcVOf80TeEmWGe2kQ= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8 h1:vVouagbdmqTVlCIAxpyYsNNTbkKZ3V66VpKOLU/s6W4= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e h1:9MlwzLdW7QSDrhDjFlsEYmxpFyIoXmYRon3dt0io31k= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09 h1:QJFxMApN9XdBRwtqXfOidB2azUCA4ziuiMTrQ1uBGxw= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/go-logr/logr/README.md b/vendor/github.com/go-logr/logr/README.md index 97b1f904a6b..e9b5520a1c5 100644 --- a/vendor/github.com/go-logr/logr/README.md +++ b/vendor/github.com/go-logr/logr/README.md @@ -42,6 +42,7 @@ There are implementations for the following logging libraries: [stdr](https://github.com/go-logr/stdr) - **github.com/sirupsen/logrus**: [logrusr](https://github.com/bombsimon/logrusr) - **github.com/wojas/genericr**: [genericr](https://github.com/wojas/genericr) (makes it easy to implement your own backend) +- **logfmt** (Heroku style [logging](https://www.brandur.org/logfmt)): [logfmtr](https://github.com/iand/logfmtr) # FAQ diff --git a/vendor/github.com/go-logr/logr/discard.go b/vendor/github.com/go-logr/logr/discard.go new file mode 100644 index 00000000000..267c796c669 --- /dev/null +++ b/vendor/github.com/go-logr/logr/discard.go @@ -0,0 +1,35 @@ +package logr + +// Discard returns a valid Logger that discards all messages logged to it. +// It can be used whenever the caller is not interested in the logs. +func Discard() Logger { + return discardLogger{} +} + +// discardLogger is a Logger that discards all messages. +type discardLogger struct{} + +func (l discardLogger) Enabled() bool { + return false +} + +func (l discardLogger) Info(msg string, keysAndValues ...interface{}) { +} + +func (l discardLogger) Error(err error, msg string, keysAndValues ...interface{}) { +} + +func (l discardLogger) V(level int) Logger { + return l +} + +func (l discardLogger) WithValues(keysAndValues ...interface{}) Logger { + return l +} + +func (l discardLogger) WithName(name string) Logger { + return l +} + +// Verify that it actually implements the interface +var _ Logger = discardLogger{} diff --git a/vendor/github.com/go-logr/logr/logr.go b/vendor/github.com/go-logr/logr/logr.go index 50c34329729..e86896c6c04 100644 --- a/vendor/github.com/go-logr/logr/logr.go +++ b/vendor/github.com/go-logr/logr/logr.go @@ -40,17 +40,16 @@ limitations under the License. // we want to log that we've made some decision. // // With the traditional log package, we might write: -// log.Printf( -// "decided to set field foo to value %q for object %s/%s", +// log.Printf("decided to set field foo to value %q for object %s/%s", // targetValue, object.Namespace, object.Name) // // With logr's structured logging, we'd write: -// // elsewhere in the file, set up the logger to log with the prefix of "reconcilers", -// // and the named value target-type=Foo, for extra context. -// log := mainLogger.WithName("reconcilers").WithValues("target-type", "Foo") +// // elsewhere in the file, set up the logger to log with the prefix of +// // "reconcilers", and the named value target-type=Foo, for extra context. +// log := mainLogger.WithName("reconcilers").WithValues("target-type", "Foo") // -// // later on... -// log.Info("setting field foo on object", "value", targetValue, "object", object) +// // later on... +// log.Info("setting foo on object", "value", targetValue, "object", object) // // Depending on our logging implementation, we could then make logging decisions // based on field values (like only logging such events for objects in a certain @@ -128,8 +127,22 @@ limitations under the License. // above concepts, when necessary (for example, in a pure-JSON output form, it // would be necessary to represent at least message and timestamp as ordinary // named values). +// +// Implementations may choose to give callers access to the underlying +// logging implementation. The recommended pattern for this is: +// // Underlier exposes access to the underlying logging implementation. +// // Since callers only have a logr.Logger, they have to know which +// // implementation is in use, so this interface is less of an abstraction +// // and more of way to test type conversion. +// type Underlier interface { +// GetUnderlying() +// } package logr +import ( + "context" +) + // TODO: consider adding back in format strings if they're really needed // TODO: consider other bits of zap/zapcore functionality like ObjectMarshaller (for arbitrary objects) // TODO: consider other bits of glog functionality like Flush, InfoDepth, OutputStats @@ -180,3 +193,30 @@ type Logger interface { // InfoLogger provides compatibility with code that relies on the v0.1.0 interface // Deprecated: use Logger instead. This will be removed in a future release. type InfoLogger = Logger + +type contextKey struct{} + +// FromContext returns a Logger constructed from ctx or nil if no +// logger details are found. +func FromContext(ctx context.Context) Logger { + if v, ok := ctx.Value(contextKey{}).(Logger); ok { + return v + } + + return nil +} + +// FromContextOrDiscard returns a Logger constructed from ctx or a Logger +// that discards all messages if no logger details are found. +func FromContextOrDiscard(ctx context.Context) Logger { + if v, ok := ctx.Value(contextKey{}).(Logger); ok { + return v + } + + return discardLogger{} +} + +// NewContext returns a new context derived from ctx that embeds the Logger. +func NewContext(ctx context.Context, l Logger) context.Context { + return context.WithValue(ctx, contextKey{}, l) +} diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md index 66345f4c61f..b94753aa527 100644 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ b/vendor/github.com/go-openapi/jsonreference/README.md @@ -4,7 +4,7 @@ An implementation of JSON Reference - Go language ## Status -Work in progress ( 90% done ) +Feature complete. Stable API ## Dependencies https://github.com/go-openapi/jsonpointer diff --git a/vendor/github.com/go-openapi/jsonreference/go.mod b/vendor/github.com/go-openapi/jsonreference/go.mod index aff1d0163ec..e6c2ec4d929 100644 --- a/vendor/github.com/go-openapi/jsonreference/go.mod +++ b/vendor/github.com/go-openapi/jsonreference/go.mod @@ -6,7 +6,7 @@ require ( github.com/go-openapi/jsonpointer v0.19.3 github.com/stretchr/testify v1.3.0 golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - golang.org/x/text v0.3.2 // indirect + golang.org/x/text v0.3.3 // indirect ) go 1.13 diff --git a/vendor/github.com/go-openapi/jsonreference/go.sum b/vendor/github.com/go-openapi/jsonreference/go.sum index c7ceab5802d..b37f873e553 100644 --- a/vendor/github.com/go-openapi/jsonreference/go.sum +++ b/vendor/github.com/go-openapi/jsonreference/go.sum @@ -5,12 +5,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -28,14 +24,12 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/vendor/github.com/go-openapi/spec/.golangci.yml b/vendor/github.com/go-openapi/spec/.golangci.yml index 3e33f9f2e3e..00277082fbe 100644 --- a/vendor/github.com/go-openapi/spec/.golangci.yml +++ b/vendor/github.com/go-openapi/spec/.golangci.yml @@ -8,7 +8,7 @@ linters-settings: maligned: suggest-new: true dupl: - threshold: 200 + threshold: 100 goconst: min-len: 2 min-occurrences: 2 diff --git a/vendor/github.com/go-openapi/spec/.travis.yml b/vendor/github.com/go-openapi/spec/.travis.yml index aa26d8763aa..a4f03484b76 100644 --- a/vendor/github.com/go-openapi/spec/.travis.yml +++ b/vendor/github.com/go-openapi/spec/.travis.yml @@ -1,15 +1,18 @@ after_success: - bash <(curl -s https://codecov.io/bash) go: +- '1.9' +- 1.10.x - 1.11.x -- 1.12.x install: -- GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on +- go get -u github.com/stretchr/testify +- go get -u github.com/go-openapi/swag +- go get -u gopkg.in/yaml.v2 +- go get -u github.com/go-openapi/jsonpointer +- go get -u github.com/go-openapi/jsonreference language: go notifications: slack: secure: QUWvCkBBK09GF7YtEvHHVt70JOkdlNBG0nIKu/5qc4/nW5HP8I2w0SEf/XR2je0eED1Qe3L/AfMCWwrEj+IUZc3l4v+ju8X8R3Lomhme0Eb0jd1MTMCuPcBT47YCj0M7RON7vXtbFfm1hFJ/jLe5+9FXz0hpXsR24PJc5ZIi/ogNwkaPqG4BmndzecpSh0vc2FJPZUD9LT0I09REY/vXR0oQAalLkW0asGD5taHZTUZq/kBpsNxaAFrLM23i4mUcf33M5fjLpvx5LRICrX/57XpBrDh2TooBU6Qj3CgoY0uPRYUmSNxbVx1czNzl2JtEpb5yjoxfVPQeg0BvQM00G8LJINISR+ohrjhkZmAqchDupAX+yFrxTtORa78CtnIL6z/aTNlgwwVD8kvL/1pFA/JWYmKDmz93mV/+6wubGzNSQCstzjkFA4/iZEKewKUoRIAi/fxyscP6L/rCpmY/4llZZvrnyTqVbt6URWpopUpH4rwYqreXAtJxJsfBJIeSmUIiDIOMGkCTvyTEW3fWGmGoqWtSHLoaWDyAIGb7azb+KvfpWtEcoPFWfSWU+LGee0A/YsUhBl7ADB9A0CJEuR8q4BPpKpfLwPKSiKSAXL7zDkyjExyhtgqbSl2jS+rKIHOZNL8JkCcTP2MKMVd563C5rC5FMKqu3S9m2b6380E= script: -- gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./... +- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/spec/bindata.go b/vendor/github.com/go-openapi/spec/bindata.go index 66b1f32635d..d5ec7b900a7 100644 --- a/vendor/github.com/go-openapi/spec/bindata.go +++ b/vendor/github.com/go-openapi/spec/bindata.go @@ -1,7 +1,7 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: // schemas/jsonschema-draft-04.json (4.357kB) -// schemas/v2/schema.json (40.248kB) +// schemas/v2/schema.json (40.249kB) package spec @@ -21,7 +21,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer @@ -29,7 +29,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } if clErr != nil { return nil, err @@ -70,43 +70,43 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _jsonschemaDraft04Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") +var _jsonschemaDraft04JSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") -func jsonschemaDraft04JsonBytes() ([]byte, error) { +func jsonschemaDraft04JSONBytes() ([]byte, error) { return bindataRead( - _jsonschemaDraft04Json, + _jsonschemaDraft04JSON, "jsonschema-draft-04.json", ) } -func jsonschemaDraft04Json() (*asset, error) { - bytes, err := jsonschemaDraft04JsonBytes() +func jsonschemaDraft04JSON() (*asset, error) { + bytes, err := jsonschemaDraft04JSONBytes() if err != nil { return nil, err } - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(0640), modTime: time.Unix(1568963823, 0)} + info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(436), modTime: time.Unix(1540282154, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}} return a, nil } -var _v2SchemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\xe3\x08\xb5\x8b\x99\xbd\x82\xbc\x9e\xc2\xe8\x53\x46\x83\x3f\x33\x54\x2b\x5b\xad\x92\x79\xd9\x8f\x5d\x93\x98\xf2\xe6\xc6\x1c\xe6\x9a\x9e\xfc\x43\x82\x31\x66\x8e\x53\x77\xfe\x90\xe7\xf3\xf6\xe9\x62\x23\x3f\x10\x93\x18\xae\x72\x1a\x9d\xf9\x48\xcb\xcc\x5a\x65\xc7\x4a\x04\xf0\xf3\xd5\xd5\x05\x8a\x41\x08\xbc\x86\x86\x43\x51\x6c\xe0\x46\x57\xf6\x44\x40\x0d\xfb\xff\xa2\xc3\x7c\x3d\x39\x84\xdc\x09\x22\x64\x4f\x12\xd9\xba\xaa\xf6\xe3\xbd\x56\xdd\x91\x25\x6a\x14\x9c\x89\x34\x8e\x31\xdf\xee\x15\x7e\x2f\x39\x81\x15\x2a\x28\x95\x66\x51\xf5\xfd\x83\xc5\xfe\x15\x07\xcf\xf7\x08\xee\x1d\x8e\xb6\xc5\x52\xcc\x8c\x5a\x93\x66\xc5\xd8\x79\x38\x46\xd6\xa7\x88\x37\xc9\x2e\xe3\xd2\xa5\x7b\x4b\x3a\xdc\xa1\xdc\x9e\x29\xf1\x8c\x8a\x99\x16\x47\x8d\xd4\x78\x8b\xf6\x1c\xe9\x71\x54\x1b\x69\xa8\x4a\x93\x37\xe5\xb2\x2c\x4f\x0c\x92\xab\xa0\x73\x32\x72\x59\xd3\xf0\x2d\x8d\xed\xca\x37\x16\x19\x9e\xdb\x1c\xab\x17\x49\xc3\x0f\x37\xdc\x88\xb1\xb4\xd4\x42\xcb\x58\x5e\x6a\x52\x0b\x15\x10\x0a\xb0\x04\xe7\xf8\x58\x32\x16\x01\xa6\xcd\x01\xb2\xc2\x69\x24\x35\x38\x6f\x30\x6a\xae\x1b\xb4\x71\xaa\xad\x1d\xa0\xd6\x20\x2d\x8b\x3c\xc6\x82\x62\x27\x34\x6d\x15\x84\x7b\x43\xb1\x35\x78\xa6\x24\x77\x28\xc1\x6e\xfc\xe9\x48\x74\xf4\x15\xe3\xe1\x84\x42\x88\x40\x7a\x26\x49\x3b\x48\xb1\xa4\x19\x8e\x0c\xa7\xb5\x01\x6c\x0c\x97\x61\x8a\xc2\x32\xd8\x8c\x44\x69\x24\xbf\x65\x1d\x74\xd6\xe5\x44\xef\xec\x48\x5e\xb7\x8a\xa3\x29\x8e\x41\x64\xce\x1f\x88\xdc\x00\x47\x4b\x40\x98\x6e\xd1\x0d\x8e\x48\x98\x63\x5c\x21\xb1\x4c\x05\x0a\x58\x98\xc5\x6d\x4f\x0a\x77\x53\x4f\x8b\xc4\x44\x1f\xb2\xdf\x8d\x3b\xea\x9f\xfe\xf6\xf2\xc5\xff\x5d\x7f\xfe\x9f\xfb\x67\x8f\xff\xf3\xe9\x69\xd1\xfe\xb3\xc7\xfd\x3c\xf8\x3f\x71\x94\x82\x23\xd1\x72\x00\xb7\x42\x99\x6c\xc0\x60\x7b\x0f\x79\xea\xa8\x53\x4b\x56\x31\xfa\x0b\x52\x9f\x96\xdb\xcd\x2f\xd7\x67\xcd\x04\x19\x85\xfe\xdb\x02\x9a\x59\x03\xad\x63\x3c\xea\xff\x2e\x18\xfd\x00\xd9\xe2\x56\x60\x59\x93\xb9\xb6\xb2\x3e\x3c\x2c\xab\x0f\xa7\xb2\x89\x43\xc7\xf6\xd5\xce\x2e\xad\xa6\xa9\xed\xa6\xc6\x5a\xb4\xa6\x67\xdf\x8c\x26\x7b\x50\x5a\x91\x08\x2e\x6d\xd4\x3a\xc1\x9d\xf2\xdb\xde\x1e\xb2\x2c\x6c\xa5\x64\xc9\x16\xb4\x90\xaa\x4a\xb7\x0c\xde\x13\xc3\x2a\x9a\x11\x9b\x7a\x1b\x3d\x95\x97\x37\x31\x6b\x69\x7e\x34\xc0\x67\x1f\x66\x19\x49\xef\xf1\x25\xf5\xac\x0e\xea\x0a\x28\x8d\x4d\x7e\xd9\x57\x4b\x49\xe5\xc6\xb3\x25\xfd\xe6\x57\x42\x25\xac\xcd\xcf\x36\x74\x8e\xca\x24\x47\xe7\x80\xa8\x92\x72\xbd\x3d\x84\x2d\x65\xe2\x82\x1a\x9c\xc4\x44\x92\x1b\x10\x79\x8a\xc4\x4a\x2f\x60\x51\x04\x81\xaa\xf0\xa3\x95\x27\xd7\x12\x7b\xa3\x96\x03\x45\x96\xc1\x8a\x07\xc9\xb2\xb0\x95\x52\x8c\xef\x48\x9c\xc6\x7e\x94\xca\xc2\x0e\x07\x12\x44\xa9\x20\x37\xf0\xae\x0f\x49\xa3\x96\x9d\x4b\x42\x7b\x70\x59\x14\xee\xe0\xb2\x0f\x49\xa3\x96\x4b\x97\xbf\x00\x5d\x4b\x4f\xfc\xbb\x2b\xee\x92\xb9\x17\xb5\xaa\xb8\x0b\x97\x17\x9b\x43\xfd\xd6\xc2\xb2\xc2\x2e\x29\xcf\xfd\x87\x4a\x55\xda\x25\x63\x1f\x5a\x65\x69\x2b\x2d\x3d\x67\xe9\x41\xae\x5e\xc1\x6e\x2b\xd4\xdb\x3e\xa8\xd3\x26\xd2\x48\x92\x24\xca\x61\x86\x8f\x8c\xbb\xf2\x8e\x91\xdf\x1f\x06\x19\x33\xf3\x03\x4d\xba\xcd\xe2\x2d\xfb\x69\xe9\x16\x15\x13\xd5\x56\x85\x4e\x3c\x5b\x8a\xbf\x25\x72\x83\xee\x5e\x20\x22\xf2\xc8\xaa\x7b\xdb\x8e\xe4\x29\x58\xca\x38\xb7\x3f\x2e\x59\xb8\xbd\xa8\x16\x16\xf7\xdb\x79\x51\x9f\x5a\xb4\x8d\x87\x3a\x6e\xbc\x3e\xc5\xb4\xcd\x58\xf9\xf5\x3c\xb9\x6f\x49\xaf\x57\xc1\xfa\x1c\x5d\x6d\x88\x8a\x8b\xd3\x28\xcc\xb7\xef\x10\x8a\x4a\x74\xa9\x4a\xa7\x62\xbf\x0d\x76\x23\x6f\x59\xd9\x31\xee\x40\x11\xfb\x28\xec\x8d\x22\x1c\x13\x5a\x64\x94\x23\x16\x60\xbb\xd2\x7c\xa0\x98\xb2\xe5\x6e\xbc\x54\x33\xe0\x3e\xb9\x52\x17\xdb\xb7\x1b\xc8\x12\x20\x8c\x23\xca\x64\x7e\x78\xa3\x62\x5b\x75\x56\xd9\x9e\x2a\x91\x27\xb0\x70\x34\x1f\x90\x89\xb5\x86\x73\x7e\x71\xda\x1e\xfb\x3a\x72\xdc\x5e\x79\x88\xcb\x74\x79\xd9\x64\xe4\xd4\xc2\x9e\xce\xb1\xfe\x85\x5a\xc0\xe9\x0c\x34\x3d\xd0\x43\xce\xa1\x36\x39\xd5\xa1\x4e\xf5\xf8\xb1\xa9\x23\x08\x75\x84\xac\x53\x6c\x3a\xc5\xa6\x53\x6c\x3a\xc5\xa6\x7f\xc5\xd8\xf4\x51\xfd\xff\x25\x4e\xfa\x33\x05\xbe\x9d\x60\xd2\x04\x93\x6a\x5f\x33\x9b\x98\x50\xd2\xe1\x50\x52\xc6\xcc\xdb\x38\x91\xdb\xe6\xaa\xa2\x8f\xa1\x6a\xa6\xd4\xc6\x56\xd6\x8c\x40\x02\x68\x48\xe8\x1a\xe1\x9a\xd9\x2e\xb7\x05\xc3\x34\xda\x2a\xbb\xcd\x12\x36\x98\x22\x50\x4c\xa1\x1b\xc5\xd5\x84\xf0\xbe\x24\x84\xf7\x2f\x22\x37\xef\x94\xd7\x9f\xa0\xde\x04\xf5\x26\xa8\x37\x41\x3d\x64\x40\x3d\xe5\xf2\xde\x60\x89\x27\xb4\x37\xa1\xbd\xda\xd7\xd2\x2c\x26\xc0\x37\x01\x3e\x1b\xef\x5f\x06\xe0\x6b\x7c\x5c\x91\x08\x26\x10\x38\x81\xc0\x09\x04\x76\x4a\x3d\x81\xc0\xbf\x12\x08\x4c\xb0\xdc\x7c\x99\x00\xd0\x75\x70\xb4\xf8\x5a\x7c\xea\xde\x3e\x39\x08\x30\x5a\x27\x35\xed\xb4\x65\xad\x69\x74\x10\x88\x79\xe2\x30\x52\x19\xd6\x04\x21\xa7\x95\xd5\x0e\x03\xf8\xda\x20\xd7\x84\xb4\x26\xa4\x35\x21\xad\x09\x69\x21\x03\x69\x51\x46\xff\xff\x18\x9b\x54\xed\x87\x47\x06\x9d\x4e\x73\x6e\x9a\xb3\xa9\xce\x83\x5e\x4b\xc6\x71\x20\x45\xd7\x72\xf5\x40\x72\x0e\x34\x6c\xf4\x6c\xf3\xba\x5e\x4b\x97\x0e\x52\xb8\xbe\x8b\x79\xa0\x10\x86\xa1\x75\xb0\x6f\xec\xc8\xf4\x3d\x4d\x7b\x86\xc2\x02\x31\x12\x51\xbf\x07\x94\xad\x10\xd6\x2e\x79\xcf\xe9\x1c\xf5\x1e\x31\x23\x5c\x18\xfb\x9c\xfb\x70\xe0\x62\xbd\xf7\xb5\x94\xcf\xf3\xf6\xfa\xc5\x4e\x9c\x85\x76\x1d\xae\x37\xbc\xde\xa3\x41\xcb\x29\xd0\x5e\x70\x67\x50\x93\x6d\x98\xa8\xd3\x67\x0f\x68\xb1\xeb\x38\x47\x07\x10\x1b\xd2\xe2\x18\x68\x6d\x40\xbb\xa3\x40\xba\x21\xf2\x8e\x81\xfb\xf6\x92\x77\x2f\x70\xe8\xdb\xb2\x36\xbf\x30\x91\xc5\x21\xe7\x45\xcc\x34\x0c\x48\x8e\xd0\xf2\x9b\x7c\x3c\xbd\x1c\x04\x3e\x07\xe8\x7c\x2f\x84\x7a\x48\x4d\x1f\xba\xe1\x76\x45\x7b\x60\xe0\x01\xca\xee\x04\xca\x31\xbe\x73\x5f\xa3\x70\x0c\xad\x1f\xa5\xf5\x76\xd5\xbb\xd2\x7e\xfb\x30\x90\xcf\xfa\x67\x7a\xe6\xc3\x37\x42\x19\xe2\xc9\x9c\x61\x4c\xe7\xd1\x77\x55\x86\x6e\x8f\x7b\x85\x42\x33\xa3\xaa\x57\xae\xfd\xd5\xcc\x9c\x56\x68\xe2\xde\x0e\xa8\x2c\xa9\xb0\x7d\xf0\x54\x2d\x80\xf2\x48\x39\x3d\x98\x1a\x6d\x0b\x9d\xba\x53\xfb\xce\xf8\xd1\x7e\xbb\x60\x4f\x06\xf5\xce\xda\xab\xeb\xca\xcb\xd5\xac\x20\xda\x72\x3b\xa2\x4b\x38\xd7\xb5\x89\xbe\x42\xd9\xb9\x73\xc4\x0c\x6d\xb7\xd9\xf8\x8d\xbd\x3e\x9c\xf5\x53\x68\x48\x14\x36\x8f\x09\xc5\x92\xf1\x21\xd1\x09\x07\x1c\xbe\xa7\x91\xf3\x6a\xc8\xc1\x57\xb0\xdd\xc5\xc6\x1d\xad\x76\x1d\xa8\x82\x0e\x4c\x38\xfe\xa5\x8c\xc5\x0a\x40\x5d\xa1\xbb\x98\xd1\xfb\x74\x61\xed\x1a\x98\xaf\x3c\x8c\x1e\xe3\xc2\x92\x29\x74\x3e\x99\xd0\xf9\x41\x50\xd0\x38\x4b\x57\x7e\x5b\x7a\x0e\xe6\xce\x4e\xd7\x19\x35\x57\xbb\x3c\x3c\xd2\x5e\x4f\x4b\x4c\xf7\x0f\x4d\x2b\x91\x5d\x94\xa6\x95\xc8\x69\x25\x72\x5a\x89\x7c\xb8\x95\xc8\x07\x80\x8c\xda\x9c\x64\x7b\xb7\x71\xdf\x57\x12\x4b\x9a\x1f\x72\x0c\x13\x03\xad\x3c\xd5\x4e\xde\x8e\x57\x13\x6d\x34\x86\xcf\x97\xe6\xa4\x68\xc4\xb0\xf6\xc9\xc2\xeb\x8d\x0b\xd7\xcd\xfe\xba\xa6\xf5\x30\xeb\x30\x33\xbe\xc7\x56\x27\xab\x08\xd9\x6d\xbb\x09\xee\x7c\x2d\xcf\xee\x87\x38\xac\xc8\xdd\x90\x9a\x58\x4a\x4e\x96\xa9\x79\x79\xf3\xde\x20\xf0\x96\xe3\x24\x19\xeb\xba\xf2\x53\x19\xab\x12\xaf\x47\xb3\xa0\x3e\xef\x9b\x8d\x6d\x6d\x7b\xde\x3b\x3b\x1a\xc0\x3f\x95\x7e\xed\x78\xfb\x76\xb8\xaf\xb3\xdd\xc5\xeb\x95\xed\x5a\x62\x41\x82\xb3\x54\x6e\x80\x4a\x92\x6f\x36\xbd\x34\xae\xde\x6f\xa4\xc0\xbc\x08\xe3\x84\xfc\x1d\xb6\xe3\xd0\x62\x38\x95\x9b\x57\xe7\x71\x12\x91\x80\xc8\x31\x69\x5e\x60\x21\x6e\x19\x0f\xc7\xa4\x79\x96\x28\x3e\x47\x54\x65\x41\x36\x08\x40\x88\x1f\x58\x08\x56\xaa\xd5\xbf\xaf\xad\x96\xd7\xd6\xcf\x87\xf5\x34\x0f\x71\x93\x6e\x26\xed\x98\x5b\x9f\x4f\xcf\x95\x34\xc6\xd7\x11\xfa\xb0\x81\x22\x1a\xdb\xdf\x8e\xdc\xc3\xb9\xf8\xdd\x5d\x3c\x74\xe6\xea\xb7\x8b\xbf\xf5\x6e\xb3\x46\x2e\x64\xf4\xab\x3c\x4e\xcf\x36\x1d\xfe\xfa\xb8\x36\xba\x8a\xd8\xad\xf6\xc6\x41\x2a\x37\x8c\x17\x0f\xda\xfe\xda\xe7\x65\xbc\x71\x2c\x36\x57\x8a\x47\x12\x4c\xf1\xbd\x77\x6b\xa4\x50\x7e\x77\x7b\x22\x60\x89\xef\xcd\xf5\xb9\x0c\x97\x79\x0d\x2b\x35\x43\xcb\x3d\x24\xf1\x78\xfc\xf8\xcb\x1f\x15\x06\xe2\x78\xd8\x51\x21\xd9\x1f\xf0\xf5\x8f\x86\xa4\x50\xfa\xb1\x47\x43\xa5\xdd\x69\x14\xe8\xa3\xc0\x86\x91\xa7\x81\x50\xb4\x7c\xc0\x81\x80\x77\x7a\x9f\xc6\xc2\xa9\x8c\x05\x33\xb0\x3b\x31\xa4\xf4\xd7\x1b\x26\x55\x97\x7c\x65\xf8\x69\x1a\x84\x8e\x41\x78\xd9\xec\xc5\x11\x16\x1e\x74\x91\xf5\x56\xf5\x57\x49\x47\x5c\x92\xa9\x1e\x99\x36\xf4\xdb\xb1\x0e\xd3\x78\x02\xb0\x9b\x25\xcb\xe9\xe9\x1d\x0d\x44\x01\x42\x08\x91\x64\xd9\xdd\x37\x08\x17\xef\xf9\xe5\x0f\xbd\x46\x91\xf5\xf9\x89\x92\x37\xdd\x89\x59\x44\x1f\x9c\xee\x34\x1e\xbe\x47\x83\x32\x72\x8e\x37\xdf\xac\x69\x38\xef\x75\xb0\xda\xdb\xac\x83\x94\x2f\x39\xa6\x62\x05\x1c\x25\x9c\x49\x16\xb0\xa8\x3c\xc7\x7e\x76\x71\x3e\x6f\xb5\x24\xe7\xe8\xb7\xb9\xc7\x6c\x43\x92\xee\x21\xd4\x17\xa1\x7f\xba\x35\xfe\xae\x39\xbc\xde\xba\x69\xd9\x8e\xe1\x62\xde\x64\x7d\x16\x88\x1b\xed\x29\x11\xfd\x4f\xa9\xff\x99\x90\xc4\xf6\xf4\xf9\x6e\xe9\x28\x23\xd7\xca\xe5\xee\xee\x9f\x63\xb1\x5b\xfb\x10\xd7\x2f\x1d\xf2\xe3\xbf\xb9\xb5\x6f\xa4\x6d\x7d\x25\x79\xfb\x24\x31\xea\x56\xbe\x5d\x53\xcd\x2d\x36\xa3\x6d\xdf\xab\x1c\xb8\x6d\x6f\xc0\x98\xa7\xdd\xaa\x86\x8c\x1d\x39\xa3\x9d\x70\x2b\x9b\x68\xd9\xfd\x33\xfe\xa9\xb6\x4a\x2e\x63\x0f\xcf\x68\x27\xd9\x4c\xb9\x46\x6d\xcb\xbe\xa1\xa8\xd6\x5f\xc6\xd6\x9f\xf1\x4f\xf4\xd4\xb4\x78\xd0\xd6\xf4\x13\x3c\x3b\xac\xd0\xdc\x90\x34\xda\xc9\xb4\x9a\x1a\x8d\xbd\x93\x87\xd4\xe2\x21\x1b\xb3\x2b\xd1\xbe\xe7\x69\xd4\x53\x67\xd5\x40\xa0\xe3\x19\x3f\x6d\x1a\xbc\x0e\x86\x3c\x10\xb4\x3d\x2a\xcd\x78\x32\xe6\xab\xbd\x36\xc9\xf4\x3a\x58\xae\xc3\xf4\x47\xea\xbf\xfb\x47\xff\x0d\x00\x00\xff\xff\xd2\x32\x5a\x28\x38\x9d\x00\x00") +var _v2SchemaJSON = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\x87\x15\xca\x15\xe5\xf5\x94\x46\x9f\x33\x1a\x0c\x9a\xb1\x5a\xd9\x6a\x95\xcd\xcb\x7e\xec\x9a\xc5\x94\x3b\x37\x26\x31\xd7\xfc\xe4\x1f\x13\x8c\x31\x75\x9c\xba\xf7\x87\x3c\xa1\xb7\x4f\x17\x1b\x09\x82\x98\xc4\x70\x95\xd3\xe8\x4c\x48\x5a\xa6\xd6\x2a\x3d\x56\x42\x80\x9f\xaf\xae\x2e\x50\x0c\x42\xe0\x35\x34\x3c\x8a\x62\x03\x37\xba\xb2\x27\x04\xda\x25\x8d\x06\xe2\xa0\x13\x8a\xf3\xf5\xec\x10\x72\x67\x88\x90\x3d\x4b\x64\xeb\xaa\xda\x8f\xf7\x5a\x75\x47\x9a\xa8\x51\x70\x26\xd2\x38\xc6\x7c\xbb\x57\xfc\xbd\xe4\x04\x56\xa8\xa0\x54\x9a\x45\xd5\xf7\x0f\x16\xfc\x57\x1c\x3c\xdf\x23\xba\x77\x38\xda\x16\x4b\x31\x53\x6a\x4d\x9a\x15\x63\xe7\xe1\x18\x69\x9f\x22\xe0\x24\xbb\x94\x4b\x97\xee\x2d\xf9\x70\x87\x72\x7b\xe6\xc4\x33\x2a\x66\x5e\x1c\x35\x72\xe3\x2d\xda\x73\xe4\xc7\x51\x6d\xa4\xa1\x2a\x4f\xde\x94\xcb\xb2\x3e\x31\x48\xae\x82\xce\xc9\xc8\x65\xcd\xc3\xb7\x34\xb6\x2b\xdf\x58\x65\x78\x6e\x73\xac\x5e\x24\x0d\x3f\xdc\x70\x23\xc6\xda\x52\x0b\x2d\x63\x7d\xa9\x49\x2d\x54\x48\x28\xc0\x12\x9c\xe3\x63\xc9\x58\x04\x98\x36\x07\xc8\x0a\xa7\x91\xd4\xf0\xbc\xc1\xa8\xb9\x70\xd0\xc6\xa9\xb6\x78\x80\x5a\xa3\xb4\x2c\xf4\x18\x0b\x8a\x9d\xd0\xb4\x55\x10\xee\x0d\xc5\xd6\xe0\x99\x93\xdc\xa1\x04\xbb\xf1\xa7\x23\xd1\xd1\x97\x8c\x87\x13\x0a\x21\x02\xe9\x99\x25\xed\x20\xc5\x92\x66\x3c\x32\x9c\xd6\x06\xb0\x31\x5c\x86\x29\x0a\xcb\x60\x33\x12\xa5\x91\xfc\x96\x75\xd0\x59\xd7\x13\xbd\xd3\x23\x79\xdd\x2a\x90\xa6\x38\x06\x91\x39\x7f\x20\x72\x03\x1c\x2d\x01\x61\xba\x45\x37\x38\x22\x61\x8e\x71\x85\xc4\x32\x15\x28\x60\x61\x16\xb8\x3d\x29\xdc\x4d\x3d\x2f\x12\x13\x7d\xc8\x7e\x37\xee\xa8\x7f\xfa\xdb\xcb\x17\xff\x77\xfd\xf9\x7f\xee\x9f\x3d\xfe\xcf\xa7\xa7\x45\xfb\xcf\x1e\xf7\xf3\xe0\xff\xc4\x51\x0a\x8e\x4c\xcb\x01\xdc\x0a\x65\xb2\x01\x83\xed\x3d\xe4\xa9\xa3\x4e\x2d\x59\xc5\xe8\x2f\x48\x7d\x5a\x6e\x37\xbf\x5c\x9f\x35\x13\x64\x14\xfa\xef\x0b\x68\xa6\x0d\xb4\x8e\xf1\xa8\xff\xbb\x60\xf4\x03\x64\xab\x5b\x81\x65\x51\xe6\xda\xca\xfa\xf0\xb0\xac\x3e\x9c\xca\x26\x0e\x1d\xdb\x57\x5b\xbb\xb4\x9a\xa6\xb6\x9b\x1a\x6b\xd1\x9a\x9e\x7e\x33\x9a\xec\x41\x69\x45\x22\xb8\xb4\x51\xeb\x04\x77\xca\x6f\x7b\x7b\xc8\xb2\xb0\x95\x92\x25\x5b\xd0\x42\xaa\x2a\xdd\x32\x78\x4f\x0c\xab\x68\x46\x6c\xea\x6d\xf4\x5c\x5e\xde\xc4\xac\xa5\xf9\xd1\x00\x9f\x7d\x98\x65\x24\xbd\xc7\x97\xd4\xb3\x3a\xa8\x2b\xa0\x34\x76\xf9\x65\x5f\x2d\x25\x95\x1b\xcf\xd6\xf4\x9b\x5f\x09\x95\xb0\x36\x3f\xdb\xd0\x39\x2a\x93\x1c\x9d\x03\xa2\x4a\xca\xf5\xf6\x10\xb6\x94\x89\x0b\x6a\x70\x12\x13\x49\x6e\x40\xe4\x29\x12\x2b\xbd\x80\x45\x11\x04\xaa\xc2\x8f\x56\x9e\x5c\x6b\xec\x8d\x5a\x0e\x14\x59\x06\x2b\x1e\x24\xcb\xc2\x56\x4a\x31\xbe\x23\x71\x1a\xfb\x51\x2a\x0b\x3b\x1c\x48\x10\xa5\x82\xdc\xc0\xbb\x3e\x24\x8d\x5a\x76\x2e\x09\xed\xc1\x65\x51\xb8\x83\xcb\x3e\x24\x8d\x5a\x2e\x5d\xfe\x02\x74\x2d\x3d\xf1\xef\xae\xb8\x4b\xe6\x5e\xd4\xaa\xe2\x2e\x5c\x5e\xec\x0e\xf5\x5b\x0c\xcb\x0a\xbb\xa4\x3c\xf7\x1f\x2a\x55\x69\x97\x8c\x7d\x68\x95\xa5\xad\xb4\xf4\x9c\xa5\x07\xb9\x7a\x05\xbb\xad\x50\x6f\xfb\xa0\x4e\x9b\x48\x23\x49\x92\x28\x87\x19\x3e\x32\xee\xca\x3b\x46\x7e\x7f\x18\x64\xcc\xcc\x0f\x34\xe9\x36\x8b\xb7\x6c\xa8\xa5\x5b\x54\x4c\x54\x5b\x15\x3a\xf1\x6c\x2d\xfe\x96\xc8\x0d\xba\x7b\x81\x88\xc8\x23\xab\xee\x7d\x3b\x92\xa7\x60\x29\xe3\xdc\xff\xb8\x64\xe1\xf6\xa2\x5a\x59\xdc\x6f\xeb\x45\x7d\x6a\xd1\x76\x1e\xea\xb8\xf1\xfa\x14\xd3\x36\x63\xe5\xd7\xf3\xe4\xbe\x25\xbd\x5e\x05\xeb\x73\x74\xb5\x21\x2a\x2e\x4e\xa3\x30\xdf\xbf\x43\x28\x2a\xd1\xa5\x2a\x9d\x8a\xfd\x76\xd8\x8d\xbc\x67\x65\xc7\xb8\x03\x45\xec\xa3\xb0\x37\x8a\x70\x4c\x68\x91\x51\x8e\x58\x80\xed\x4a\xf3\x81\x62\xca\x96\xbb\xf1\x52\xcd\x80\xfb\xe4\x4a\x5d\x6c\xdf\x6e\x20\x4b\x80\x30\x8e\x28\x93\xf9\xe9\x8d\x8a\x6d\xd5\x59\x65\x7b\xaa\x44\x9e\xc0\xc2\xd1\x7c\x40\x26\xd6\x1a\xce\xf9\xc5\x69\x7b\x6c\xec\xc8\x71\x7b\xe5\x21\x2e\xd3\xe5\x65\x93\x91\x53\x0b\x7b\x3a\xc7\xfa\x17\x6a\x01\xa7\x33\xd0\xf4\x40\x0f\x39\x87\xda\xe4\x54\x87\x3a\xd5\xe3\xc7\xa6\x8e\x20\xd4\x11\xb2\x4e\xb1\xe9\x14\x9b\x4e\xb1\xe9\x14\x9b\xfe\x15\x63\xd3\x47\xf5\xff\x97\x38\xe9\xcf\x14\xf8\x76\x82\x49\x13\x4c\xaa\x7d\xcd\x6c\x62\x42\x49\x87\x43\x49\x19\x33\x6f\xe3\x44\x6e\x9b\xab\x8a\x3e\x86\xaa\x99\x52\x1b\x5b\x59\x33\x02\x09\xa0\x21\xa1\x6b\x84\x6b\x66\xbb\xdc\x16\x0c\xd3\x68\xab\xec\x36\x4b\xd8\x60\x8a\x40\x31\x85\x6e\x14\x57\x13\xc2\xfb\x92\x10\xde\xbf\x88\xdc\xbc\x53\x5e\x7f\x82\x7a\x13\xd4\x9b\xa0\xde\x04\xf5\x90\x01\xf5\x94\xcb\x7b\x83\x25\x9e\xd0\xde\x84\xf6\x6a\x5f\x4b\xb3\x98\x00\xdf\x04\xf8\x6c\xbc\x7f\x19\x80\xaf\xf1\x71\x45\x22\x98\x40\xe0\x04\x02\x27\x10\xd8\x29\xf5\x04\x02\xff\x4a\x20\x30\xc1\x72\xf3\x65\x02\x40\xd7\xc1\xd1\xe2\x6b\xf1\xa9\x7b\xfb\xe4\x20\xc0\x68\x9d\xd4\xb4\xd3\x96\xb5\xa6\xd1\x41\x20\xe6\x89\xc3\x48\x65\x58\x13\x84\x9c\x56\x56\x3b\x0c\xe0\x6b\x83\x5c\x13\xd2\x9a\x90\xd6\x84\xb4\x26\xa4\x85\x0c\xa4\x45\x19\xfd\xff\x63\x6c\x52\xb5\x1f\x1e\x19\x74\x3a\xcd\xb9\x69\xce\xa6\x3a\x0f\x7a\x2d\x19\xc7\x81\x14\x5d\xcb\xd5\x03\xc9\x39\xd0\xb0\xd1\xb3\xcd\xfb\x7a\x2d\x5d\x3a\x48\xe1\xfa\x2e\xe6\x81\x42\x18\x86\xd6\xc1\xbe\xb1\x23\xd3\xf7\x34\xed\x19\x0a\x0b\xc4\x48\x44\xfd\x22\x50\xb6\x42\x58\xbb\xe5\x3d\xa7\x73\xd4\x8b\xc4\x8c\x70\x61\xec\x73\xee\xc3\x81\x8b\xf5\xe2\xd7\x52\x3e\xcf\xeb\xeb\x17\x3b\x71\x16\xda\x7d\xb8\xde\xf0\x7a\x8f\x06\x2d\xa7\x40\x7b\xc1\x9d\x41\x4d\xb6\x61\xa2\x4e\x9f\x3d\xa0\xc5\xae\xe3\x1c\x1d\x40\x6c\x48\x8b\x63\xa0\xb5\x01\xed\x8e\x02\xe9\x86\xc8\x3b\x06\xee\xdb\x4b\xde\xbd\xc0\xa1\x6f\xcb\xda\xfc\xc2\x44\x16\x87\x9c\x17\x31\xd3\x30\x20\x39\x42\xcb\x6f\xf2\xf1\xf4\x72\x10\xf8\x1c\xa0\xf3\xbd\x10\xea\x21\x35\x7d\xe8\x86\xdb\x15\xed\x81\x81\x07\x28\xbb\x13\x28\xc7\xf8\xce\x7d\x8d\xc2\x31\xb4\x7e\x94\xd6\xdb\x55\xef\x4a\xfb\xed\xc3\x40\x3e\xeb\x9f\xe9\x99\x0f\xdf\x08\x65\x88\x27\x73\x86\x31\x9d\x47\xdf\x55\x19\xba\x3d\xee\x15\x0a\xcd\x8c\xaa\x5e\xb9\xf6\x57\x33\x73\x5a\xa1\x89\x7b\x3b\xa0\xb2\xa4\xc2\xf6\xc1\x53\xb5\x00\xca\x23\xe5\xf4\x60\x6a\xb4\x2d\x74\xea\x4e\xed\x3b\xe3\x47\xfb\xed\x82\x3d\x19\xd4\x3b\x6b\xaf\xae\x2b\x2f\x57\xb3\x82\x68\xcb\xed\x88\x2e\xe1\x5c\xd7\x26\xfa\x0a\x65\xe7\xce\x11\x33\xb4\xdd\x66\xe3\x37\xf6\xfa\x70\xd6\x4f\xa1\x21\x51\xd8\x3c\x26\x14\x4b\xc6\x87\x44\x27\x1c\x70\xf8\x9e\x46\xce\xab\x21\x07\x5f\xc1\x76\x17\x1b\x77\xb4\xda\x75\xa0\x0a\x3a\x30\xe1\xf8\x97\x32\x16\x2b\x00\x75\x85\xee\x62\x46\xef\xd3\x85\xb5\x6b\x60\xbe\xf2\x30\x7a\x8c\x0b\x4b\xa6\xd0\xf9\x64\x42\xe7\x07\x41\x41\xe3\x2c\x5d\xf9\x6d\xe9\x39\x98\x3b\x3b\x5d\x67\xd4\x5c\xed\xf2\xf0\x48\x7b\xbd\x2d\x31\xdd\x3f\x34\xad\x44\x76\x51\x9a\x56\x22\xa7\x95\xc8\x69\x25\xf2\xe1\x56\x22\x1f\x00\x32\x6a\x73\x92\xed\xe1\xc6\x7d\x9f\x49\x2c\x69\x7e\xc8\x31\x4c\x0c\xb4\xf2\x54\x3b\x79\x3b\x9e\x4d\xb4\xd1\x18\x3e\x5f\x9a\x93\xa2\x11\xc3\xda\x27\x0b\xaf\x37\x2e\x5c\x37\xfb\xeb\x9a\xd6\xc3\xac\xc3\xcc\xf8\x1e\x5b\x9d\xac\x22\x64\xb7\xed\x26\xb8\xf3\xb9\x3c\xbb\x1f\xe2\xb0\x22\x77\x43\x6a\x62\x29\x39\x59\xa6\xe6\xe5\xcd\x7b\x83\xc0\x5b\x8e\x93\x64\xac\xeb\xca\x4f\x65\xac\x4a\xbc\x1e\xcd\x82\xfa\x3c\x70\x36\xb6\xb5\xed\x79\xef\xec\x68\x00\xff\x54\xfa\xb5\xe3\xf1\xdb\xe1\xbe\xce\x76\x17\xaf\x57\xb6\x6b\x89\x05\x09\xce\x52\xb9\x01\x2a\x49\xbe\xd9\xf4\xd2\xb8\x7a\xbf\x91\x02\xf3\x22\x8c\x13\xf2\x77\xd8\x8e\x43\x8b\xe1\x54\x6e\x5e\x9d\xc7\x49\x44\x02\x22\xc7\xa4\x79\x81\x85\xb8\x65\x3c\x1c\x93\xe6\x59\xa2\xf8\x1c\x51\x95\x05\xd9\x20\x00\x21\x7e\x60\x21\x58\xa9\x56\xff\xbe\xb6\x5a\x5e\x5b\x3f\x1f\xd6\xd3\x3c\xc4\x4d\xba\x99\xb4\x63\x6e\x7d\x3e\x3d\x57\xd2\x18\x5f\x47\xe8\xc3\x06\x8a\x68\x6c\x7f\x3b\x72\x0f\xe7\xe2\x77\x77\xf1\xd0\x99\xab\xdf\x2e\xfe\xd6\xbb\xcd\x1a\xb9\x90\xd1\xaf\xf2\x38\x3d\xdb\x74\xf8\xeb\xe3\xda\xe8\x2a\x62\xb7\xda\x1b\x07\xa9\xdc\x30\x5e\xbc\x68\xfb\x6b\x9f\x97\xf1\xc6\xb1\xd8\x5c\x29\x1e\x49\x30\xc5\xf7\xde\xad\x91\x42\xf9\xdd\xed\x89\x80\x25\xbe\x37\xd7\xe7\x32\x5c\xe6\x35\xac\xd4\x0c\x2d\xf7\x90\xc4\xe3\xf5\xe3\x2f\x7f\x54\x18\x88\xe3\x61\x47\x85\x64\x7f\xc0\xd7\x3f\x1a\x92\x42\xe9\xc7\x1e\x0d\x95\x76\xa7\x51\xa0\x8f\x02\x1b\x46\x9e\x06\x42\xd1\xf2\x01\x07\x02\xde\xe9\x7d\x1a\x0b\xa7\x32\x16\xcc\xc0\xee\xc4\x90\xd2\x5f\x6f\x98\x54\x5d\xf2\x95\xe1\xa7\x69\x10\x3a\x06\xe1\x65\xb3\x17\x47\x58\x78\xd0\x45\xd6\x5b\xd5\x5f\x25\x1d\x71\x49\xa6\x7a\x64\xda\xd0\x6f\xc7\x3a\x4c\xe3\x09\xc0\x6e\x96\x2c\xa7\xa7\x77\x34\x10\x05\x08\x21\x44\x92\x65\x77\xdf\x20\x5c\xbc\xe7\x97\x3f\xf4\x1a\x45\xd6\xe7\x27\x4a\xde\x74\x27\x66\x11\x7d\x70\xba\xd3\x78\xf9\x1e\x0d\xca\xc8\x39\xde\x7c\xb3\xa6\xe1\xbc\xd7\xc1\x6a\x6f\xb3\x0e\x52\xbe\xe4\x98\x8a\x15\x70\x94\x70\x26\x59\xc0\xa2\xf2\x1c\xfb\xd9\xc5\xf9\xbc\xd5\x92\x9c\xa3\xdf\xe6\x1e\xb3\x0d\x49\xba\x87\x50\x5f\x84\xfe\xe9\xd6\xf8\xbb\xe6\xf0\x7a\xeb\xa6\x65\x3b\x86\x8b\x79\x93\xf5\x59\x20\x6e\xb4\xa7\x44\xf4\x3f\xa5\xfe\x67\x42\x12\xdb\xd3\xe7\xbb\xa5\xa3\x8c\x5c\x2b\x97\xbb\xbb\x7f\x8e\xc5\x6e\xed\x43\x5c\xbf\x74\xc8\x8f\xff\xe6\xd6\xbe\x91\xb6\xf5\x95\xe4\xed\x93\xc4\xa8\x5b\xf9\x76\x4d\x35\xb7\xd8\x8c\xb6\x7d\xaf\x72\xe0\xb6\xbd\x01\x63\x9e\x76\xab\x1a\x32\x76\xe4\x8c\x76\xc2\xad\x6c\xa2\x65\xf7\xcf\xf8\xa7\xda\x2a\xb9\x8c\x3d\x3c\xa3\x9d\x64\x33\xe5\x1a\xb5\x2d\xfb\x86\xa2\x5a\x7f\x19\x5b\x7f\xc6\x3f\xd1\x53\xd3\xe2\x41\x5b\xd3\x4f\xf0\xec\xb0\x42\x73\x43\xd2\x68\x27\xd3\x6a\x6a\x34\xf6\x4e\x1e\x52\x8b\x87\x6c\xcc\xae\x44\xfb\x9e\xa7\x51\x4f\x9d\x55\x03\x81\x8e\x67\xfc\xb4\x69\xf0\x3a\x18\xf2\x40\xd0\xf6\xa8\x34\xe3\xc9\x98\xaf\xf6\xda\x24\xd3\xeb\x60\xb9\x0e\xd3\x1f\xa9\xff\xee\x1f\xfd\x37\x00\x00\xff\xff\x69\x5d\x0a\x6a\x39\x9d\x00\x00") -func v2SchemaJsonBytes() ([]byte, error) { +func v2SchemaJSONBytes() ([]byte, error) { return bindataRead( - _v2SchemaJson, + _v2SchemaJSON, "v2/schema.json", ) } -func v2SchemaJson() (*asset, error) { - bytes, err := v2SchemaJsonBytes() +func v2SchemaJSON() (*asset, error) { + bytes, err := v2SchemaJSONBytes() if err != nil { return nil, err } - info := bindataFileInfo{name: "v2/schema.json", size: 40248, mode: os.FileMode(0640), modTime: time.Unix(1568964748, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x88, 0x5e, 0xf, 0xbf, 0x17, 0x74, 0x0, 0xb2, 0x5a, 0x7f, 0xbc, 0x58, 0xcd, 0xc, 0x25, 0x73, 0xd5, 0x29, 0x1c, 0x7a, 0xd0, 0xce, 0x79, 0xd4, 0x89, 0x31, 0x27, 0x90, 0xf2, 0xff, 0xe6}} + info := bindataFileInfo{name: "v2/schema.json", size: 40249, mode: os.FileMode(436), modTime: time.Unix(1540282154, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xcb, 0x25, 0x27, 0xe8, 0x46, 0xae, 0x22, 0xc4, 0xf4, 0x8b, 0x1, 0x32, 0x4d, 0x1f, 0xf8, 0xdf, 0x75, 0x15, 0xc8, 0x2d, 0xc7, 0xed, 0xe, 0x7e, 0x0, 0x75, 0xc0, 0xf9, 0xd2, 0x1f, 0x75, 0x57}} return a, nil } @@ -201,9 +201,9 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04Json, + "jsonschema-draft-04.json": jsonschemaDraft04JSON, - "v2/schema.json": v2SchemaJson, + "v2/schema.json": v2SchemaJSON, } // AssetDir returns the file names below a certain @@ -247,9 +247,9 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": &bintree{jsonschemaDraft04Json, map[string]*bintree{}}, + "jsonschema-draft-04.json": &bintree{jsonschemaDraft04JSON, map[string]*bintree{}}, "v2": &bintree{nil, map[string]*bintree{ - "schema.json": &bintree{v2SchemaJson, map[string]*bintree{}}, + "schema.json": &bintree{v2SchemaJSON, map[string]*bintree{}}, }}, }} diff --git a/vendor/github.com/go-openapi/spec/go.mod b/vendor/github.com/go-openapi/spec/go.mod index 02a142c03c2..5af64c10b57 100644 --- a/vendor/github.com/go-openapi/spec/go.mod +++ b/vendor/github.com/go-openapi/spec/go.mod @@ -1,17 +1,16 @@ module github.com/go-openapi/spec require ( - github.com/go-openapi/jsonpointer v0.19.3 - github.com/go-openapi/jsonreference v0.19.2 - github.com/go-openapi/swag v0.19.5 - github.com/kr/pty v1.1.5 // indirect - github.com/stretchr/objx v0.2.0 // indirect - github.com/stretchr/testify v1.3.0 - golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 // indirect - golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect - golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f // indirect - golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59 // indirect - gopkg.in/yaml.v2 v2.2.2 + github.com/PuerkitoBio/purell v1.1.0 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-openapi/jsonpointer v0.17.0 + github.com/go-openapi/jsonreference v0.17.0 + github.com/go-openapi/swag v0.17.0 + github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.2.2 + golang.org/x/net v0.0.0-20181005035420-146acd28ed58 // indirect + golang.org/x/text v0.3.0 // indirect + gopkg.in/yaml.v2 v2.2.1 ) - -go 1.13 diff --git a/vendor/github.com/go-openapi/spec/go.sum b/vendor/github.com/go-openapi/spec/go.sum index 86db601c978..ab6bfb6086a 100644 --- a/vendor/github.com/go-openapi/spec/go.sum +++ b/vendor/github.com/go-openapi/spec/go.sum @@ -1,74 +1,22 @@ github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ0dwoRHP0= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8= -github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk= -github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/go-openapi/jsonpointer v0.17.0 h1:Bpl2DtZ6k7wKqfFs7e+4P08+M9I3FQgn09a1UsRUQbk= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonreference v0.17.0 h1:d/o7/fsLWWQZACbihvZxcyLQ59jfUVs7WOJv/ak7T7A= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/swag v0.17.0 h1:7wu+dZ5k83kvUWeAb+WUkFiUhDzwGqzTR/NhWzeo1JU= +github.com/go-openapi/swag v0.17.0/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 h1:nTT4s92Dgz2HlrB2NaMgvlfqHH39OgMhA7z3PK7PGD4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20181005035420-146acd28ed58 h1:otZG8yDCO4LVps5+9bxOeNiCvgmOyt96J3roHTYs7oE= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/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-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -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-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/spec/items.go b/vendor/github.com/go-openapi/spec/items.go index 365d1631582..78389317e4a 100644 --- a/vendor/github.com/go-openapi/spec/items.go +++ b/vendor/github.com/go-openapi/spec/items.go @@ -29,7 +29,6 @@ const ( // SimpleSchema describe swagger simple schemas for parameters and headers type SimpleSchema struct { Type string `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` Format string `json:"format,omitempty"` Items *Items `json:"items,omitempty"` CollectionFormat string `json:"collectionFormat,omitempty"` @@ -92,12 +91,6 @@ func (i *Items) Typed(tpe, format string) *Items { return i } -// AsNullable flags this schema as nullable. -func (i *Items) AsNullable() *Items { - i.Nullable = true - return i -} - // CollectionOf a fluent builder method for an array item func (i *Items) CollectionOf(items *Items, format string) *Items { i.Type = jsonArray diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go index 813dfe71b40..08ff869b2fc 100644 --- a/vendor/github.com/go-openapi/spec/ref.go +++ b/vendor/github.com/go-openapi/spec/ref.go @@ -72,7 +72,6 @@ func (r *Ref) IsValidURI(basepaths ...string) bool { if err != nil { return false } - defer rr.Body.Close() return rr.StatusCode/100 == 2 } diff --git a/vendor/github.com/go-openapi/spec/schema.go b/vendor/github.com/go-openapi/spec/schema.go index 37858ece909..ce30d26e324 100644 --- a/vendor/github.com/go-openapi/spec/schema.go +++ b/vendor/github.com/go-openapi/spec/schema.go @@ -163,7 +163,6 @@ type SchemaProps struct { Schema SchemaURL `json:"-"` Description string `json:"description,omitempty"` Type StringOrArray `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` Format string `json:"format,omitempty"` Title string `json:"title,omitempty"` Default interface{} `json:"default,omitempty"` @@ -303,12 +302,6 @@ func (s *Schema) AddType(tpe, format string) *Schema { return s } -// AsNullable flags this schema as nullable. -func (s *Schema) AsNullable() *Schema { - s.Nullable = true - return s -} - // CollectionOf a fluent builder method for an array parameter func (s *Schema) CollectionOf(items Schema) *Schema { s.Type = []string{jsonArray} diff --git a/vendor/github.com/go-openapi/spec/schema_loader.go b/vendor/github.com/go-openapi/spec/schema_loader.go index 9e20e96c2a1..c34a96fa04e 100644 --- a/vendor/github.com/go-openapi/spec/schema_loader.go +++ b/vendor/github.com/go-openapi/spec/schema_loader.go @@ -160,7 +160,6 @@ func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) if !fromCache { b, err := r.loadDoc(normalized) if err != nil { - debugLog("unable to load the document: %v", err) return nil, url.URL{}, false, err } diff --git a/vendor/github.com/go-openapi/spec/swagger.go b/vendor/github.com/go-openapi/spec/swagger.go index 44722ffd5ad..454617e5852 100644 --- a/vendor/github.com/go-openapi/spec/swagger.go +++ b/vendor/github.com/go-openapi/spec/swagger.go @@ -15,8 +15,6 @@ package spec import ( - "bytes" - "encoding/gob" "encoding/json" "fmt" "strconv" @@ -70,36 +68,6 @@ func (s *Swagger) UnmarshalJSON(data []byte) error { return nil } -// GobEncode provides a safe gob encoder for Swagger, including extensions -func (s Swagger) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw := struct { - Props SwaggerProps - Ext VendorExtensible - }{ - Props: s.SwaggerProps, - Ext: s.VendorExtensible, - } - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Swagger, including extensions -func (s *Swagger) GobDecode(b []byte) error { - var raw struct { - Props SwaggerProps - Ext VendorExtensible - } - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - s.SwaggerProps = raw.Props - s.VendorExtensible = raw.Ext - return nil -} - // SwaggerProps captures the top-level properties of an Api specification // // NOTE: validation rules @@ -125,98 +93,6 @@ type SwaggerProps struct { ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` } -type swaggerPropsAlias SwaggerProps - -type gobSwaggerPropsAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *swaggerPropsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements -func (o SwaggerProps) GobEncode() ([]byte, error) { - raw := gobSwaggerPropsAlias{ - Alias: (*swaggerPropsAlias)(&o), - } - - var b bytes.Buffer - if o.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(o.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(o.Security)) - for _, req := range o.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements -func (o *SwaggerProps) GobDecode(b []byte) error { - var raw gobSwaggerPropsAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *o = *(*SwaggerProps)(raw.Alias) - return nil -} - // Dependencies represent a dependencies property type Dependencies map[string]SchemaOrStringArray diff --git a/vendor/github.com/go-openapi/swag/.travis.yml b/vendor/github.com/go-openapi/swag/.travis.yml index aa26d8763aa..f1a3f80b350 100644 --- a/vendor/github.com/go-openapi/swag/.travis.yml +++ b/vendor/github.com/go-openapi/swag/.travis.yml @@ -1,12 +1,10 @@ after_success: - bash <(curl -s https://codecov.io/bash) go: -- 1.11.x -- 1.12.x +- 1.13.x +- 1.14.x install: - GO111MODULE=off go get -u gotest.tools/gotestsum -env: -- GO111MODULE=on language: go notifications: slack: diff --git a/vendor/github.com/go-openapi/swag/convert.go b/vendor/github.com/go-openapi/swag/convert.go index 7da35c316e5..fc085aeb8ea 100644 --- a/vendor/github.com/go-openapi/swag/convert.go +++ b/vendor/github.com/go-openapi/swag/convert.go @@ -88,7 +88,7 @@ func ConvertFloat64(str string) (float64, error) { return strconv.ParseFloat(str, 64) } -// ConvertInt8 turn a string into int8 boolean +// ConvertInt8 turn a string into an int8 func ConvertInt8(str string) (int8, error) { i, err := strconv.ParseInt(str, 10, 8) if err != nil { @@ -97,7 +97,7 @@ func ConvertInt8(str string) (int8, error) { return int8(i), nil } -// ConvertInt16 turn a string into a int16 +// ConvertInt16 turn a string into an int16 func ConvertInt16(str string) (int16, error) { i, err := strconv.ParseInt(str, 10, 16) if err != nil { @@ -106,7 +106,7 @@ func ConvertInt16(str string) (int16, error) { return int16(i), nil } -// ConvertInt32 turn a string into a int32 +// ConvertInt32 turn a string into an int32 func ConvertInt32(str string) (int32, error) { i, err := strconv.ParseInt(str, 10, 32) if err != nil { @@ -115,12 +115,12 @@ func ConvertInt32(str string) (int32, error) { return int32(i), nil } -// ConvertInt64 turn a string into a int64 +// ConvertInt64 turn a string into an int64 func ConvertInt64(str string) (int64, error) { return strconv.ParseInt(str, 10, 64) } -// ConvertUint8 turn a string into a uint8 +// ConvertUint8 turn a string into an uint8 func ConvertUint8(str string) (uint8, error) { i, err := strconv.ParseUint(str, 10, 8) if err != nil { @@ -129,7 +129,7 @@ func ConvertUint8(str string) (uint8, error) { return uint8(i), nil } -// ConvertUint16 turn a string into a uint16 +// ConvertUint16 turn a string into an uint16 func ConvertUint16(str string) (uint16, error) { i, err := strconv.ParseUint(str, 10, 16) if err != nil { @@ -138,7 +138,7 @@ func ConvertUint16(str string) (uint16, error) { return uint16(i), nil } -// ConvertUint32 turn a string into a uint32 +// ConvertUint32 turn a string into an uint32 func ConvertUint32(str string) (uint32, error) { i, err := strconv.ParseUint(str, 10, 32) if err != nil { @@ -147,7 +147,7 @@ func ConvertUint32(str string) (uint32, error) { return uint32(i), nil } -// ConvertUint64 turn a string into a uint64 +// ConvertUint64 turn a string into an uint64 func ConvertUint64(str string) (uint64, error) { return strconv.ParseUint(str, 10, 64) } diff --git a/vendor/github.com/go-openapi/swag/convert_types.go b/vendor/github.com/go-openapi/swag/convert_types.go index c95e4e78bdd..c49cc473a8c 100644 --- a/vendor/github.com/go-openapi/swag/convert_types.go +++ b/vendor/github.com/go-openapi/swag/convert_types.go @@ -181,12 +181,12 @@ func IntValueMap(src map[string]*int) map[string]int { return dst } -// Int32 returns a pointer to of the int64 value passed in. +// Int32 returns a pointer to of the int32 value passed in. func Int32(v int32) *int32 { return &v } -// Int32Value returns the value of the int64 pointer passed in or +// Int32Value returns the value of the int32 pointer passed in or // 0 if the pointer is nil. func Int32Value(v *int32) int32 { if v != nil { @@ -195,7 +195,7 @@ func Int32Value(v *int32) int32 { return 0 } -// Int32Slice converts a slice of int64 values into a slice of +// Int32Slice converts a slice of int32 values into a slice of // int32 pointers func Int32Slice(src []int32) []*int32 { dst := make([]*int32, len(src)) @@ -299,13 +299,80 @@ func Int64ValueMap(src map[string]*int64) map[string]int64 { return dst } -// Uint returns a pouinter to of the uint value passed in. +// Uint16 returns a pointer to of the uint16 value passed in. +func Uint16(v uint16) *uint16 { + return &v +} + +// Uint16Value returns the value of the uint16 pointer passed in or +// 0 if the pointer is nil. +func Uint16Value(v *uint16) uint16 { + if v != nil { + return *v + } + + return 0 +} + +// Uint16Slice converts a slice of uint16 values into a slice of +// uint16 pointers +func Uint16Slice(src []uint16) []*uint16 { + dst := make([]*uint16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + + return dst +} + +// Uint16ValueSlice converts a slice of uint16 pointers into a slice of +// uint16 values +func Uint16ValueSlice(src []*uint16) []uint16 { + dst := make([]uint16, len(src)) + + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + + return dst +} + +// Uint16Map converts a string map of uint16 values into a string +// map of uint16 pointers +func Uint16Map(src map[string]uint16) map[string]*uint16 { + dst := make(map[string]*uint16) + + for k, val := range src { + v := val + dst[k] = &v + } + + return dst +} + +// Uint16ValueMap converts a string map of uint16 pointers into a string +// map of uint16 values +func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { + dst := make(map[string]uint16) + + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + + return dst +} + +// Uint returns a pointer to of the uint value passed in. func Uint(v uint) *uint { return &v } -// UintValue returns the value of the uint pouinter passed in or -// 0 if the pouinter is nil. +// UintValue returns the value of the uint pointer passed in or +// 0 if the pointer is nil. func UintValue(v *uint) uint { if v != nil { return *v @@ -313,8 +380,8 @@ func UintValue(v *uint) uint { return 0 } -// UintSlice converts a slice of uint values uinto a slice of -// uint pouinters +// UintSlice converts a slice of uint values into a slice of +// uint pointers func UintSlice(src []uint) []*uint { dst := make([]*uint, len(src)) for i := 0; i < len(src); i++ { @@ -323,7 +390,7 @@ func UintSlice(src []uint) []*uint { return dst } -// UintValueSlice converts a slice of uint pouinters uinto a slice of +// UintValueSlice converts a slice of uint pointers into a slice of // uint values func UintValueSlice(src []*uint) []uint { dst := make([]uint, len(src)) @@ -335,8 +402,8 @@ func UintValueSlice(src []*uint) []uint { return dst } -// UintMap converts a string map of uint values uinto a string -// map of uint pouinters +// UintMap converts a string map of uint values into a string +// map of uint pointers func UintMap(src map[string]uint) map[string]*uint { dst := make(map[string]*uint) for k, val := range src { @@ -346,7 +413,7 @@ func UintMap(src map[string]uint) map[string]*uint { return dst } -// UintValueMap converts a string map of uint pouinters uinto a string +// UintValueMap converts a string map of uint pointers into a string // map of uint values func UintValueMap(src map[string]*uint) map[string]uint { dst := make(map[string]uint) @@ -358,13 +425,13 @@ func UintValueMap(src map[string]*uint) map[string]uint { return dst } -// Uint32 returns a pouinter to of the uint64 value passed in. +// Uint32 returns a pointer to of the uint32 value passed in. func Uint32(v uint32) *uint32 { return &v } -// Uint32Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. +// Uint32Value returns the value of the uint32 pointer passed in or +// 0 if the pointer is nil. func Uint32Value(v *uint32) uint32 { if v != nil { return *v @@ -372,8 +439,8 @@ func Uint32Value(v *uint32) uint32 { return 0 } -// Uint32Slice converts a slice of uint64 values uinto a slice of -// uint32 pouinters +// Uint32Slice converts a slice of uint32 values into a slice of +// uint32 pointers func Uint32Slice(src []uint32) []*uint32 { dst := make([]*uint32, len(src)) for i := 0; i < len(src); i++ { @@ -382,7 +449,7 @@ func Uint32Slice(src []uint32) []*uint32 { return dst } -// Uint32ValueSlice converts a slice of uint32 pouinters uinto a slice of +// Uint32ValueSlice converts a slice of uint32 pointers into a slice of // uint32 values func Uint32ValueSlice(src []*uint32) []uint32 { dst := make([]uint32, len(src)) @@ -394,8 +461,8 @@ func Uint32ValueSlice(src []*uint32) []uint32 { return dst } -// Uint32Map converts a string map of uint32 values uinto a string -// map of uint32 pouinters +// Uint32Map converts a string map of uint32 values into a string +// map of uint32 pointers func Uint32Map(src map[string]uint32) map[string]*uint32 { dst := make(map[string]*uint32) for k, val := range src { @@ -405,7 +472,7 @@ func Uint32Map(src map[string]uint32) map[string]*uint32 { return dst } -// Uint32ValueMap converts a string map of uint32 pouinters uinto a string +// Uint32ValueMap converts a string map of uint32 pointers into a string // map of uint32 values func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { dst := make(map[string]uint32) @@ -417,13 +484,13 @@ func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return dst } -// Uint64 returns a pouinter to of the uint64 value passed in. +// Uint64 returns a pointer to of the uint64 value passed in. func Uint64(v uint64) *uint64 { return &v } -// Uint64Value returns the value of the uint64 pouinter passed in or -// 0 if the pouinter is nil. +// Uint64Value returns the value of the uint64 pointer passed in or +// 0 if the pointer is nil. func Uint64Value(v *uint64) uint64 { if v != nil { return *v @@ -431,8 +498,8 @@ func Uint64Value(v *uint64) uint64 { return 0 } -// Uint64Slice converts a slice of uint64 values uinto a slice of -// uint64 pouinters +// Uint64Slice converts a slice of uint64 values into a slice of +// uint64 pointers func Uint64Slice(src []uint64) []*uint64 { dst := make([]*uint64, len(src)) for i := 0; i < len(src); i++ { @@ -441,7 +508,7 @@ func Uint64Slice(src []uint64) []*uint64 { return dst } -// Uint64ValueSlice converts a slice of uint64 pouinters uinto a slice of +// Uint64ValueSlice converts a slice of uint64 pointers into a slice of // uint64 values func Uint64ValueSlice(src []*uint64) []uint64 { dst := make([]uint64, len(src)) @@ -453,8 +520,8 @@ func Uint64ValueSlice(src []*uint64) []uint64 { return dst } -// Uint64Map converts a string map of uint64 values uinto a string -// map of uint64 pouinters +// Uint64Map converts a string map of uint64 values into a string +// map of uint64 pointers func Uint64Map(src map[string]uint64) map[string]*uint64 { dst := make(map[string]*uint64) for k, val := range src { @@ -464,7 +531,7 @@ func Uint64Map(src map[string]uint64) map[string]*uint64 { return dst } -// Uint64ValueMap converts a string map of uint64 pouinters uinto a string +// Uint64ValueMap converts a string map of uint64 pointers into a string // map of uint64 values func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { dst := make(map[string]uint64) @@ -476,6 +543,74 @@ func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return dst } +// Float32 returns a pointer to of the float32 value passed in. +func Float32(v float32) *float32 { + return &v +} + +// Float32Value returns the value of the float32 pointer passed in or +// 0 if the pointer is nil. +func Float32Value(v *float32) float32 { + if v != nil { + return *v + } + + return 0 +} + +// Float32Slice converts a slice of float32 values into a slice of +// float32 pointers +func Float32Slice(src []float32) []*float32 { + dst := make([]*float32, len(src)) + + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + + return dst +} + +// Float32ValueSlice converts a slice of float32 pointers into a slice of +// float32 values +func Float32ValueSlice(src []*float32) []float32 { + dst := make([]float32, len(src)) + + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + + return dst +} + +// Float32Map converts a string map of float32 values into a string +// map of float32 pointers +func Float32Map(src map[string]float32) map[string]*float32 { + dst := make(map[string]*float32) + + for k, val := range src { + v := val + dst[k] = &v + } + + return dst +} + +// Float32ValueMap converts a string map of float32 pointers into a string +// map of float32 values +func Float32ValueMap(src map[string]*float32) map[string]float32 { + dst := make(map[string]float32) + + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + + return dst +} + // Float64 returns a pointer to of the float64 value passed in. func Float64(v float64) *float64 { return &v diff --git a/vendor/github.com/go-openapi/swag/go.mod b/vendor/github.com/go-openapi/swag/go.mod index 15bbb082227..4aef463e425 100644 --- a/vendor/github.com/go-openapi/swag/go.mod +++ b/vendor/github.com/go-openapi/swag/go.mod @@ -6,9 +6,11 @@ require ( github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 github.com/stretchr/testify v1.3.0 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.2 + gopkg.in/yaml.v2 v2.2.4 ) replace github.com/golang/lint => golang.org/x/lint v0.0.0-20190409202823-959b441ac422 replace sourcegraph.com/sourcegraph/go-diff => github.com/sourcegraph/go-diff v0.5.1 + +go 1.13 diff --git a/vendor/github.com/go-openapi/swag/go.sum b/vendor/github.com/go-openapi/swag/go.sum index 33469f54acb..e8a80bacf0a 100644 --- a/vendor/github.com/go-openapi/swag/go.sum +++ b/vendor/github.com/go-openapi/swag/go.sum @@ -16,5 +16,5 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/go-openapi/swag/json.go b/vendor/github.com/go-openapi/swag/json.go index edf93d84c60..7e9902ca314 100644 --- a/vendor/github.com/go-openapi/swag/json.go +++ b/vendor/github.com/go-openapi/swag/json.go @@ -51,7 +51,7 @@ type ejUnmarshaler interface { UnmarshalEasyJSON(w *jlexer.Lexer) } -// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaller +// WriteJSON writes json data, prefers finding an appropriate interface to short-circuit the marshaler // so it takes the fastest option available. func WriteJSON(data interface{}) ([]byte, error) { if d, ok := data.(ejMarshaler); ok { @@ -65,8 +65,8 @@ func WriteJSON(data interface{}) ([]byte, error) { return json.Marshal(data) } -// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller -// so it takes the fastes option available +// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaler +// so it takes the fastest option available func ReadJSON(data []byte, value interface{}) error { trimmedData := bytes.Trim(data, "\x00") if d, ok := value.(ejUnmarshaler); ok { @@ -189,7 +189,7 @@ func FromDynamicJSON(data, target interface{}) error { return json.Unmarshal(b, target) } -// NameProvider represents an object capabale of translating from go property names +// NameProvider represents an object capable of translating from go property names // to json property names // This type is thread-safe. type NameProvider struct { diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go index 70f4fb361c1..04160b89ba9 100644 --- a/vendor/github.com/go-openapi/swag/loading.go +++ b/vendor/github.com/go-openapi/swag/loading.go @@ -27,6 +27,15 @@ import ( // LoadHTTPTimeout the default timeout for load requests var LoadHTTPTimeout = 30 * time.Second +// LoadHTTPBasicAuthUsername the username to use when load requests require basic auth +var LoadHTTPBasicAuthUsername = "" + +// LoadHTTPBasicAuthPassword the password to use when load requests require basic auth +var LoadHTTPBasicAuthPassword = "" + +// LoadHTTPCustomHeaders an optional collection of custom HTTP headers for load requests +var LoadHTTPCustomHeaders = map[string]string{} + // LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in func LoadFromFileOrHTTP(path string) ([]byte, error) { return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) @@ -59,6 +68,15 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { if err != nil { return nil, err } + + if LoadHTTPBasicAuthUsername != "" && LoadHTTPBasicAuthPassword != "" { + req.SetBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword) + } + + for key, val := range LoadHTTPCustomHeaders { + req.Header.Set(key, val) + } + resp, err := client.Do(req) defer func() { if resp != nil { diff --git a/vendor/github.com/go-toolsmith/typep/.travis.yml b/vendor/github.com/go-toolsmith/typep/.travis.yml index c32ac00627d..d3ff3cca8be 100644 --- a/vendor/github.com/go-toolsmith/typep/.travis.yml +++ b/vendor/github.com/go-toolsmith/typep/.travis.yml @@ -5,5 +5,5 @@ install: - # Prevent default install action "go get -t -v ./...". script: - go get -t -v ./... - - go tool vet . + - go vet ./... - go test -v -race ./... diff --git a/vendor/github.com/go-toolsmith/typep/README.md b/vendor/github.com/go-toolsmith/typep/README.md index 73665801280..f7979148fa3 100644 --- a/vendor/github.com/go-toolsmith/typep/README.md +++ b/vendor/github.com/go-toolsmith/typep/README.md @@ -1,6 +1,6 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/go-toolsmith/typep)](https://goreportcard.com/report/github.com/go-toolsmith/typep) [![GoDoc](https://godoc.org/github.com/go-toolsmith/typep?status.svg)](https://godoc.org/github.com/go-toolsmith/typep) - +[![Build Status](https://travis-ci.org/go-toolsmith/typep.svg?branch=master)](https://travis-ci.org/go-toolsmith/typep) # typep diff --git a/vendor/github.com/go-toolsmith/typep/predicates.go b/vendor/github.com/go-toolsmith/typep/predicates.go index 70e5b55cd17..b07325a726c 100644 --- a/vendor/github.com/go-toolsmith/typep/predicates.go +++ b/vendor/github.com/go-toolsmith/typep/predicates.go @@ -27,7 +27,7 @@ func IsTypeExpr(info *types.Info, x ast.Expr) bool { _, ok := info.ObjectOf(x).(*types.TypeName) return ok - case *ast.FuncType, *ast.StructType, *ast.InterfaceType, *ast.ArrayType, *ast.MapType: + case *ast.FuncType, *ast.StructType, *ast.InterfaceType, *ast.ArrayType, *ast.MapType, *ast.ChanType: return true default: diff --git a/vendor/github.com/go-toolsmith/typep/safeExpr.go b/vendor/github.com/go-toolsmith/typep/safeExpr.go index 7236e6e037e..d5835d97bb1 100644 --- a/vendor/github.com/go-toolsmith/typep/safeExpr.go +++ b/vendor/github.com/go-toolsmith/typep/safeExpr.go @@ -20,6 +20,10 @@ func SideEffectFree(info *types.Info, expr ast.Expr) bool { // whitelist to be on the conservative side. // Can be extended as needed. + if expr == nil { + return true + } + switch expr := expr.(type) { case *ast.StarExpr: return SideEffectFree(info, expr.X) @@ -31,6 +35,11 @@ func SideEffectFree(info *types.Info, expr ast.Expr) bool { SideEffectFree(info, expr.X) case *ast.BasicLit, *ast.Ident: return true + case *ast.SliceExpr: + return SideEffectFree(info, expr.X) && + SideEffectFree(info, expr.Low) && + SideEffectFree(info, expr.High) && + SideEffectFree(info, expr.Max) case *ast.IndexExpr: return SideEffectFree(info, expr.X) && SideEffectFree(info, expr.Index) @@ -38,6 +47,8 @@ func SideEffectFree(info *types.Info, expr ast.Expr) bool { return SideEffectFree(info, expr.X) case *ast.ParenExpr: return SideEffectFree(info, expr.X) + case *ast.TypeAssertExpr: + return SideEffectFree(info, expr.X) case *ast.CompositeLit: return SideEffectFreeList(info, expr.Elts) case *ast.CallExpr: diff --git a/vendor/github.com/go-xmlfmt/xmlfmt/LICENSE b/vendor/github.com/go-xmlfmt/xmlfmt/LICENSE new file mode 100644 index 00000000000..890776ab7c7 --- /dev/null +++ b/vendor/github.com/go-xmlfmt/xmlfmt/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 go-xmlfmt + +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. diff --git a/vendor/github.com/go-xmlfmt/xmlfmt/README.md b/vendor/github.com/go-xmlfmt/xmlfmt/README.md new file mode 100644 index 00000000000..4eb6d69a03c --- /dev/null +++ b/vendor/github.com/go-xmlfmt/xmlfmt/README.md @@ -0,0 +1,178 @@ +# Go XML Formatter + +[![MIT License](http://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) +[![Go Doc](https://img.shields.io/badge/godoc-reference-4b68a3.svg)](https://godoc.org/github.com/go-xmlfmt/xmlfmt) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-xmlfmt/xmlfmt)](https://goreportcard.com/report/github.com/go-xmlfmt/xmlfmt) +[![Codeship Status](https://codeship.com/projects/c49f02b0-a384-0134-fb20-2e0351080565/status?branch=master)](https://codeship.com/projects/190297) + +## Synopsis + +The Go XML Formatter, xmlfmt, will format the XML string in a readable way. + +```go +package main + +import "github.com/go-xmlfmt/xmlfmt" + +func main() { + xml1 := `aSome org-or-otherWouldnt you like to knowPatCalifia` + x := xmlfmt.FormatXML(xml1, "\t", " ") + print(x) +} + +``` + +Output: + +```xml + + + a + + + + + + Some org-or-other + + Wouldnt you like to know + + + + Pat + + Califia + + + + + +``` + +There is no XML decoding and encoding involved, only pure regular expression matching and replacing. So it is much faster than going through decoding and encoding procedures. Moreover, the exact XML source string is preserved, instead of being changed by the encoder. This is why this package exists in the first place. + +## Command + +To use it on command line, check out [xmlfmt](https://github.com/AntonioSun/xmlfmt): + + +``` +$ xmlfmt +XML Formatter +built on 2019-12-08 + +The xmlfmt will format the XML string without rewriting the document + +Options: + + -h, --help display help information + -f, --file *The xml file to read from (or stdin) + -p, --prefix each element begins on a new line and this prefix + -i, --indent[= ] indent string for nested elements +``` + + +## Justification + +### The format + +The Go XML Formatter is not called XML Beautifier because the result is not *exactly* as what people would expect -- some, but not all, closing tags stays on the same line, just as shown above. Having been looking at the result and thinking over it, I now think it is actually a better way to present it, as those closing tags on the same line are better stay that way in my opinion. I.e., + +When it comes to very big XML strings, which is what I’m dealing every day, saving spaces by not allowing those closing tags taking extra lines is plus instead of negative to me. + +### The alternative + +To format it “properly”, i.e., as what people would normally see, is very hard using pure regular expression. In fact, according to Sam Whited from the go-nuts mlist, + +> Regular expression is, well, regular. This means that they can parse regular grammars, but can't parse context free grammars (like XML). It is actually impossible to use a regex to do this task; it will always be fragile, unfortunately. + +So if the output format is so important to you, then unfortunately you have to go through decoding and encoding procedures. But there are some drawbacks as well, as put by James McGill, in http://stackoverflow.com/questions/21117161, besides such method being slow: + +> I like this solution, but am still in search of a Golang XML formatter/prettyprinter that doesn't rewrite the document (other than formatting whitespace). Marshalling or using the Encoder will change namespace declarations. +> +> For example an element like "< ns1:Element />" will be translated to something like '< Element xmlns="http://bla...bla/ns1" >< /Element >' which seems harmless enough except when the intent is to not alter the xml other than formatting. -- James McGill Nov 12 '15 + +Using Sam's code as an example, + +https://play.golang.org/p/JUqQY3WpW5 + +The above code formats the following XML + +```xml + + + + + + 123 + John Brown + + + + +``` + +into this: + +```xml + +
+ + + + 123 + John Brown + + + +
+``` + +I know they are syntactically the same, however the problem is that they *look* totally different. + +That's why there is this package, an XML Beautifier that doesn't rewrite the document. + +## Credit + +The credit goes to **diotalevi** from his post at http://www.perlmonks.org/?node_id=261292. + +However, it does not work for all cases. For example, + +```sh +$ echo '
123John Brown
' | perl -pe 's/(?<=>)\s+(?=<)//g; s(<(/?)([^/>]+)(/?)>\s*(?=(".($1&&($4 eq"
+123 +John Brown + + + + +``` + +I simplified the algorithm, and now it should work for all cases: + +```sh +echo '
123John Brown
' | perl -pe 's/(?<=>)\s+(?=<)//g; s(<(/?)([^>]+)(/?)>)($indent+=$3?0:$1?-1:1;"<$1$2$3>"."\n".(" "x$indent))ge' +``` +```xml + +
+
+ + + + + 123 + + John Brown + + + +
+``` + +This package is a direct translate from above Perl code into Go, +then further enhanced by @ruandao. diff --git a/vendor/github.com/go-xmlfmt/xmlfmt/xmlfmt.go b/vendor/github.com/go-xmlfmt/xmlfmt/xmlfmt.go new file mode 100644 index 00000000000..b744f5b3506 --- /dev/null +++ b/vendor/github.com/go-xmlfmt/xmlfmt/xmlfmt.go @@ -0,0 +1,56 @@ +//////////////////////////////////////////////////////////////////////////// +// Porgram: xmlfmt.go +// Purpose: Go XML Beautify from XML string using pure string manipulation +// Authors: Antonio Sun (c) 2016-2019, All rights reserved +//////////////////////////////////////////////////////////////////////////// + +package xmlfmt + +import ( + "regexp" + "strings" +) + +var ( + reg = regexp.MustCompile(`<([/!]?)([^>]+?)(/?)>`) + // NL is the newline string used in XML output, define for DOS-convenient. + NL = "\r\n" +) + +// FormatXML will (purly) reformat the XML string in a readable way, without any rewriting/altering the structure +func FormatXML(xmls, prefix, indent string) string { + src := regexp.MustCompile(`(?s)>\s+<`).ReplaceAllString(xmls, "><") + + rf := replaceTag(prefix, indent) + return (prefix + reg.ReplaceAllStringFunc(src, rf)) +} + +// replaceTag returns a closure function to do 's/(?<=>)\s+(?=<)//g; s(<(/?)([^>]+?)(/?)>)($indent+=$3?0:$1?-1:1;"<$1$2$3>"."\n".(" "x$indent))ge' as in Perl +// and deal with comments as well +func replaceTag(prefix, indent string) func(string) string { + indentLevel := 0 + return func(m string) string { + // head elem + if strings.HasPrefix(m, "") { + return NL + prefix + strings.Repeat(indent, indentLevel) + m + } + // comment elem + if strings.HasPrefix(m, " 1 { - x += i.Original[1:] - } - return New(x) + runes := []rune(i.Original) + runes[0] = unicode.ToTitle(runes[0]) + return New(string(runes)) } diff --git a/vendor/github.com/gobuffalo/flect/go.mod b/vendor/github.com/gobuffalo/flect/go.mod index cd02d074b93..7c8d049abaa 100644 --- a/vendor/github.com/gobuffalo/flect/go.mod +++ b/vendor/github.com/gobuffalo/flect/go.mod @@ -1,8 +1,5 @@ module github.com/gobuffalo/flect -go 1.12 +go 1.13 -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/stretchr/testify v1.3.0 -) +require github.com/stretchr/testify v1.4.0 diff --git a/vendor/github.com/gobuffalo/flect/go.sum b/vendor/github.com/gobuffalo/flect/go.sum index 4f76e62c1f3..8fdee5854f1 100644 --- a/vendor/github.com/gobuffalo/flect/go.sum +++ b/vendor/github.com/gobuffalo/flect/go.sum @@ -1,9 +1,11 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/gobuffalo/flect/humanize.go b/vendor/github.com/gobuffalo/flect/humanize.go index ded09397039..6a0b75af7bf 100644 --- a/vendor/github.com/gobuffalo/flect/humanize.go +++ b/vendor/github.com/gobuffalo/flect/humanize.go @@ -7,11 +7,11 @@ import ( // Humanize returns first letter of sentence capitalized. // Common acronyms are capitalized as well. // Other capital letters in string are left as provided. -// employee_salary = Employee salary -// employee_id = employee ID -// employee_mobile_number = Employee mobile number -// first_Name = First Name -// firstName = First Name +// employee_salary = Employee salary +// employee_id = employee ID +// employee_mobile_number = Employee mobile number +// first_Name = First Name +// firstName = First Name func Humanize(s string) string { return New(s).Humanize().String() } diff --git a/vendor/github.com/gobuffalo/flect/ident.go b/vendor/github.com/gobuffalo/flect/ident.go index 78b51d45767..9189e9a39b6 100644 --- a/vendor/github.com/gobuffalo/flect/ident.go +++ b/vendor/github.com/gobuffalo/flect/ident.go @@ -38,9 +38,9 @@ func toParts(s string) []string { return []string{strings.ToUpper(s)} } var prev rune - var x string + var x strings.Builder + x.Grow(len(s)) for _, c := range s { - cs := string(c) // fmt.Println("### cs ->", cs) // fmt.Println("### unicode.IsControl(c) ->", unicode.IsControl(c)) // fmt.Println("### unicode.IsDigit(c) ->", unicode.IsDigit(c)) @@ -58,35 +58,38 @@ func toParts(s string) []string { } if isSpace(c) { - parts = xappend(parts, x) - x = cs + parts = xappend(parts, x.String()) + x.Reset() + x.WriteRune(c) prev = c continue } if unicode.IsUpper(c) && !unicode.IsUpper(prev) { - parts = xappend(parts, x) - x = cs + parts = xappend(parts, x.String()) + x.Reset() + x.WriteRune(c) prev = c continue } - if unicode.IsUpper(c) && baseAcronyms[strings.ToUpper(x)] { - parts = xappend(parts, x) - x = cs + if unicode.IsUpper(c) && baseAcronyms[strings.ToUpper(x.String())] { + parts = xappend(parts, x.String()) + x.Reset() + x.WriteRune(c) prev = c continue } if unicode.IsLetter(c) || unicode.IsDigit(c) || unicode.IsPunct(c) || c == '`' { prev = c - x += cs + x.WriteRune(c) continue } - parts = xappend(parts, x) - x = "" + parts = xappend(parts, x.String()) + x.Reset() prev = c } - parts = xappend(parts, x) + parts = xappend(parts, x.String()) return parts } @@ -94,6 +97,19 @@ func toParts(s string) []string { var _ encoding.TextUnmarshaler = &Ident{} var _ encoding.TextMarshaler = &Ident{} +// LastPart returns the last part/word of the original string +func (i *Ident) LastPart() string { + if len(i.Parts) == 0 { + return "" + } + return i.Parts[len(i.Parts)-1] +} + +// ReplaceSuffix creates a new Ident with the original suffix replaced by new +func (i Ident) ReplaceSuffix(orig, new string) Ident { + return New(strings.TrimSuffix(i.Original, orig) + new) +} + //UnmarshalText unmarshalls byte array into the Ident func (i *Ident) UnmarshalText(data []byte) error { (*i) = New(string(data)) diff --git a/vendor/github.com/gobuffalo/flect/plural_rules.go b/vendor/github.com/gobuffalo/flect/plural_rules.go index 86fca8c5f5a..8cd3ba72e7a 100644 --- a/vendor/github.com/gobuffalo/flect/plural_rules.go +++ b/vendor/github.com/gobuffalo/flect/plural_rules.go @@ -40,6 +40,7 @@ var singleToPlural = map[string]string{ "bus": "buses", "campus": "campuses", "caucus": "caucuses", + "child": "children", "château": "châteaux", "circus": "circuses", "codex": "codices", @@ -48,7 +49,6 @@ var singleToPlural = map[string]string{ "crisis": "crises", "curriculum": "curriculums", "datum": "data", - "dear": "dear", "deer": "deer", "diagnosis": "diagnoses", "die": "dice", @@ -105,11 +105,13 @@ var singleToPlural = map[string]string{ "prognosis": "prognoses", "prometheus": "prometheuses", "quiz": "quizzes", + "quota": "quotas", "radius": "radiuses", "referendum": "referendums", "ress": "resses", "rice": "rice", "salmon": "salmon", + "sex": "sexes", "series": "series", "sheep": "sheep", "shoe": "shoes", @@ -120,6 +122,7 @@ var singleToPlural = map[string]string{ "swine": "swine", "syllabus": "syllabi", "symposium": "symposiums", + "synapse": "synapses", "synopsis": "synopses", "tableau": "tableaus", "testis": "testes", @@ -128,12 +131,14 @@ var singleToPlural = map[string]string{ "tooth": "teeth", "trout": "trout", "tuna": "tuna", + "vedalia": "vedalias", "vertebra": "vertebrae", "vertix": "vertices", "vita": "vitae", "vortex": "vortices", "wharf": "wharves", "wife": "wives", + "woman": "women", "wolf": "wolves", "you": "you", } @@ -160,7 +165,6 @@ var singularToPluralSuffixList = []singularToPluralSuffix{ {"randum", "randa"}, {"actus", "acti"}, {"adium", "adia"}, - {"alias", "aliases"}, {"basis", "basis"}, {"child", "children"}, {"chive", "chives"}, @@ -168,6 +172,7 @@ var singularToPluralSuffixList = []singularToPluralSuffix{ {"hello", "hellos"}, {"jeans", "jeans"}, {"louse", "lice"}, + {"media", "media"}, {"mouse", "mice"}, {"movie", "movies"}, {"oasis", "oasis"}, @@ -251,12 +256,10 @@ var singularToPluralSuffixList = []singularToPluralSuffix{ {"io", "ios"}, {"jy", "jies"}, {"ky", "kies"}, - {"ld", "ldren"}, {"lf", "lves"}, {"ly", "lies"}, {"my", "mies"}, {"ny", "nies"}, - {"ox", "oxen"}, {"py", "pies"}, {"qy", "qies"}, {"rf", "rves"}, diff --git a/vendor/github.com/gobuffalo/flect/pluralize.go b/vendor/github.com/gobuffalo/flect/pluralize.go index 1b9d43e4620..e265f84e91d 100644 --- a/vendor/github.com/gobuffalo/flect/pluralize.go +++ b/vendor/github.com/gobuffalo/flect/pluralize.go @@ -15,12 +15,22 @@ func Pluralize(s string) string { return New(s).Pluralize().String() } +// PluralizeWithSize will pluralize a string taking a number number into account. +// PluralizeWithSize("user", 1) = user +// PluralizeWithSize("user", 2) = users +func PluralizeWithSize(s string, i int) string { + if i == 1 || i == -1 { + return New(s).Singularize().String() + } + return New(s).Pluralize().String() +} + // Pluralize returns a plural version of the string // user = users // person = people // datum = data func (i Ident) Pluralize() Ident { - s := i.Original + s := i.LastPart() if len(s) == 0 { return New("") } @@ -33,11 +43,11 @@ func (i Ident) Pluralize() Ident { return i } if p, ok := singleToPlural[ls]; ok { - return New(p) + return i.ReplaceSuffix(s, p) } for _, r := range pluralRules { if strings.HasSuffix(ls, r.suffix) { - return New(r.fn(s)) + return i.ReplaceSuffix(s, r.fn(s)) } } diff --git a/vendor/github.com/gobuffalo/flect/singularize.go b/vendor/github.com/gobuffalo/flect/singularize.go index a0f8545ef2a..1ed4995053e 100644 --- a/vendor/github.com/gobuffalo/flect/singularize.go +++ b/vendor/github.com/gobuffalo/flect/singularize.go @@ -15,6 +15,16 @@ func Singularize(s string) string { return New(s).Singularize().String() } +// SingularizeWithSize will singular a string taking a number number into account. +// SingularizeWithSize("user", 1) = user +// SingularizeWithSize("user", 2) = users +func SingularizeWithSize(s string, i int) string { + if i == 1 || i == -1 { + return New(s).Singularize().String() + } + return New(s).Pluralize().String() +} + // Singularize returns a singular version of the string // users = user // data = datum diff --git a/vendor/github.com/gobuffalo/flect/underscore.go b/vendor/github.com/gobuffalo/flect/underscore.go index b92488aa00b..e1466d99b9f 100644 --- a/vendor/github.com/gobuffalo/flect/underscore.go +++ b/vendor/github.com/gobuffalo/flect/underscore.go @@ -18,16 +18,17 @@ func Underscore(s string) string { // Nice to see you! = nice_to_see_you // widgetID = widget_id func (i Ident) Underscore() Ident { - var out []string + out := make([]string, 0, len(i.Parts)) for _, part := range i.Parts { - var x string + var x strings.Builder + x.Grow(len(part)) for _, c := range part { if unicode.IsLetter(c) || unicode.IsDigit(c) { - x += string(c) + x.WriteRune(c) } } - if x != "" { - out = append(out, x) + if x.Len() > 0 { + out = append(out, x.String()) } } return New(strings.ToLower(strings.Join(out, "_"))) diff --git a/vendor/github.com/gofrs/flock/.travis.yml b/vendor/github.com/gofrs/flock/.travis.yml index b791a74213c..b16d040fa89 100644 --- a/vendor/github.com/gofrs/flock/.travis.yml +++ b/vendor/github.com/gofrs/flock/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.10.x - - 1.11.x + - 1.14.x + - 1.15.x script: go test -v -check.vv -race ./... sudo: false notifications: diff --git a/vendor/github.com/gofrs/flock/LICENSE b/vendor/github.com/gofrs/flock/LICENSE index aff7d358e24..8b8ff36fe42 100644 --- a/vendor/github.com/gofrs/flock/LICENSE +++ b/vendor/github.com/gofrs/flock/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015, Tim Heckman +Copyright (c) 2015-2020, Tim Heckman All rights reserved. Redistribution and use in source and binary forms, with or without @@ -11,9 +11,9 @@ modification, are permitted provided that the following conditions are met: this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* Neither the name of linode-netint nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. +* Neither the name of gofrs nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE diff --git a/vendor/github.com/gofrs/flock/README.md b/vendor/github.com/gofrs/flock/README.md index 7375e72eeb4..71ce63692e8 100644 --- a/vendor/github.com/gofrs/flock/README.md +++ b/vendor/github.com/gofrs/flock/README.md @@ -1,6 +1,6 @@ # flock [![TravisCI Build Status](https://img.shields.io/travis/gofrs/flock/master.svg?style=flat)](https://travis-ci.org/gofrs/flock) -[![GoDoc](https://img.shields.io/badge/godoc-go--flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock) +[![GoDoc](https://img.shields.io/badge/godoc-flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock) [![License](https://img.shields.io/badge/license-BSD_3--Clause-brightgreen.svg?style=flat)](https://github.com/gofrs/flock/blob/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/flock)](https://goreportcard.com/report/github.com/gofrs/flock) diff --git a/vendor/github.com/gofrs/flock/appveyor.yml b/vendor/github.com/gofrs/flock/appveyor.yml index 6848e94bf88..909b4bf7cb4 100644 --- a/vendor/github.com/gofrs/flock/appveyor.yml +++ b/vendor/github.com/gofrs/flock/appveyor.yml @@ -7,7 +7,7 @@ clone_folder: 'c:\gopath\src\github.com\gofrs\flock' environment: GOPATH: 'c:\gopath' - GOVERSION: '1.11' + GOVERSION: '1.15' init: - git config --global core.autocrlf input diff --git a/vendor/github.com/gofrs/flock/flock.go b/vendor/github.com/gofrs/flock/flock.go index 8f109b8a967..95c784ca504 100644 --- a/vendor/github.com/gofrs/flock/flock.go +++ b/vendor/github.com/gofrs/flock/flock.go @@ -19,6 +19,7 @@ package flock import ( "context" "os" + "runtime" "sync" "time" ) @@ -116,7 +117,15 @@ func tryCtx(ctx context.Context, fn func() (bool, error), retryDelay time.Durati func (f *Flock) setFh() error { // open a new os.File instance // create it if it doesn't exist, and open the file read-only. - fh, err := os.OpenFile(f.path, os.O_CREATE|os.O_RDONLY, os.FileMode(0600)) + flags := os.O_CREATE + if runtime.GOOS == "aix" { + // AIX cannot preform write-lock (ie exclusive) on a + // read-only file. + flags |= os.O_RDWR + } else { + flags |= os.O_RDONLY + } + fh, err := os.OpenFile(f.path, flags, os.FileMode(0600)) if err != nil { return err } @@ -125,3 +134,11 @@ func (f *Flock) setFh() error { f.fh = fh return nil } + +// ensure the file handle is closed if no lock is held +func (f *Flock) ensureFhState() { + if !f.l && !f.r && f.fh != nil { + f.fh.Close() + f.fh = nil + } +} diff --git a/vendor/github.com/gofrs/flock/flock_aix.go b/vendor/github.com/gofrs/flock/flock_aix.go new file mode 100644 index 00000000000..2a1607b2ffb --- /dev/null +++ b/vendor/github.com/gofrs/flock/flock_aix.go @@ -0,0 +1,271 @@ +// Copyright 2019 Tim Heckman. All rights reserved. Use of this source code is +// governed by the BSD 3-Clause license that can be found in the LICENSE file. + +// Copyright 2018 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. + +// This code implements the filelock API using POSIX 'fcntl' locks, which attach +// to an (inode, process) pair rather than a file descriptor. To avoid unlocking +// files prematurely when the same file is opened through different descriptors, +// we allow only one read-lock at a time. +// +// This code is adapted from the Go package: +// cmd/go/internal/lockedfile/internal/filelock + +//+build aix + +package flock + +import ( + "errors" + "io" + "os" + "sync" + "syscall" + + "golang.org/x/sys/unix" +) + +type lockType int16 + +const ( + readLock lockType = unix.F_RDLCK + writeLock lockType = unix.F_WRLCK +) + +type inode = uint64 + +type inodeLock struct { + owner *Flock + queue []<-chan *Flock +} + +var ( + mu sync.Mutex + inodes = map[*Flock]inode{} + locks = map[inode]inodeLock{} +) + +// Lock is a blocking call to try and take an exclusive file lock. It will wait +// until it is able to obtain the exclusive file lock. It's recommended that +// TryLock() be used over this function. This function may block the ability to +// query the current Locked() or RLocked() status due to a RW-mutex lock. +// +// If we are already exclusive-locked, this function short-circuits and returns +// immediately assuming it can take the mutex lock. +// +// If the *Flock has a shared lock (RLock), this may transparently replace the +// shared lock with an exclusive lock on some UNIX-like operating systems. Be +// careful when using exclusive locks in conjunction with shared locks +// (RLock()), because calling Unlock() may accidentally release the exclusive +// lock that was once a shared lock. +func (f *Flock) Lock() error { + return f.lock(&f.l, writeLock) +} + +// RLock is a blocking call to try and take a shared file lock. It will wait +// until it is able to obtain the shared file lock. It's recommended that +// TryRLock() be used over this function. This function may block the ability to +// query the current Locked() or RLocked() status due to a RW-mutex lock. +// +// If we are already shared-locked, this function short-circuits and returns +// immediately assuming it can take the mutex lock. +func (f *Flock) RLock() error { + return f.lock(&f.r, readLock) +} + +func (f *Flock) lock(locked *bool, flag lockType) error { + f.m.Lock() + defer f.m.Unlock() + + if *locked { + return nil + } + + if f.fh == nil { + if err := f.setFh(); err != nil { + return err + } + defer f.ensureFhState() + } + + if _, err := f.doLock(flag, true); err != nil { + return err + } + + *locked = true + return nil +} + +func (f *Flock) doLock(lt lockType, blocking bool) (bool, error) { + // POSIX locks apply per inode and process, and the lock for an inode is + // released when *any* descriptor for that inode is closed. So we need to + // synchronize access to each inode internally, and must serialize lock and + // unlock calls that refer to the same inode through different descriptors. + fi, err := f.fh.Stat() + if err != nil { + return false, err + } + ino := inode(fi.Sys().(*syscall.Stat_t).Ino) + + mu.Lock() + if i, dup := inodes[f]; dup && i != ino { + mu.Unlock() + return false, &os.PathError{ + Path: f.Path(), + Err: errors.New("inode for file changed since last Lock or RLock"), + } + } + + inodes[f] = ino + + var wait chan *Flock + l := locks[ino] + if l.owner == f { + // This file already owns the lock, but the call may change its lock type. + } else if l.owner == nil { + // No owner: it's ours now. + l.owner = f + } else if !blocking { + // Already owned: cannot take the lock. + mu.Unlock() + return false, nil + } else { + // Already owned: add a channel to wait on. + wait = make(chan *Flock) + l.queue = append(l.queue, wait) + } + locks[ino] = l + mu.Unlock() + + if wait != nil { + wait <- f + } + + err = setlkw(f.fh.Fd(), lt) + + if err != nil { + f.doUnlock() + return false, err + } + + return true, nil +} + +func (f *Flock) Unlock() error { + f.m.Lock() + defer f.m.Unlock() + + // if we aren't locked or if the lockfile instance is nil + // just return a nil error because we are unlocked + if (!f.l && !f.r) || f.fh == nil { + return nil + } + + if err := f.doUnlock(); err != nil { + return err + } + + f.fh.Close() + + f.l = false + f.r = false + f.fh = nil + + return nil +} + +func (f *Flock) doUnlock() (err error) { + var owner *Flock + mu.Lock() + ino, ok := inodes[f] + if ok { + owner = locks[ino].owner + } + mu.Unlock() + + if owner == f { + err = setlkw(f.fh.Fd(), unix.F_UNLCK) + } + + mu.Lock() + l := locks[ino] + if len(l.queue) == 0 { + // No waiters: remove the map entry. + delete(locks, ino) + } else { + // The first waiter is sending us their file now. + // Receive it and update the queue. + l.owner = <-l.queue[0] + l.queue = l.queue[1:] + locks[ino] = l + } + delete(inodes, f) + mu.Unlock() + + return err +} + +// TryLock is the preferred function for taking an exclusive file lock. This +// function takes an RW-mutex lock before it tries to lock the file, so there is +// the possibility that this function may block for a short time if another +// goroutine is trying to take any action. +// +// The actual file lock is non-blocking. If we are unable to get the exclusive +// file lock, the function will return false instead of waiting for the lock. If +// we get the lock, we also set the *Flock instance as being exclusive-locked. +func (f *Flock) TryLock() (bool, error) { + return f.try(&f.l, writeLock) +} + +// TryRLock is the preferred function for taking a shared file lock. This +// function takes an RW-mutex lock before it tries to lock the file, so there is +// the possibility that this function may block for a short time if another +// goroutine is trying to take any action. +// +// The actual file lock is non-blocking. If we are unable to get the shared file +// lock, the function will return false instead of waiting for the lock. If we +// get the lock, we also set the *Flock instance as being share-locked. +func (f *Flock) TryRLock() (bool, error) { + return f.try(&f.r, readLock) +} + +func (f *Flock) try(locked *bool, flag lockType) (bool, error) { + f.m.Lock() + defer f.m.Unlock() + + if *locked { + return true, nil + } + + if f.fh == nil { + if err := f.setFh(); err != nil { + return false, err + } + defer f.ensureFhState() + } + + haslock, err := f.doLock(flag, false) + if err != nil { + return false, err + } + + *locked = haslock + return haslock, nil +} + +// setlkw calls FcntlFlock with F_SETLKW for the entire file indicated by fd. +func setlkw(fd uintptr, lt lockType) error { + for { + err := unix.FcntlFlock(fd, unix.F_SETLKW, &unix.Flock_t{ + Type: int16(lt), + Whence: io.SeekStart, + Start: 0, + Len: 0, // All bytes. + }) + if err != unix.EINTR { + return err + } + } +} diff --git a/vendor/github.com/gofrs/flock/flock_unix.go b/vendor/github.com/gofrs/flock/flock_unix.go index 45f71a707c3..c315a3e2908 100644 --- a/vendor/github.com/gofrs/flock/flock_unix.go +++ b/vendor/github.com/gofrs/flock/flock_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. -// +build !windows +// +build !aix,!windows package flock @@ -51,6 +51,7 @@ func (f *Flock) lock(locked *bool, flag int) error { if err := f.setFh(); err != nil { return err } + defer f.ensureFhState() } if err := syscall.Flock(int(f.fh.Fd()), flag); err != nil { @@ -142,6 +143,7 @@ func (f *Flock) try(locked *bool, flag int) (bool, error) { if err := f.setFh(); err != nil { return false, err } + defer f.ensureFhState() } var retried bool diff --git a/vendor/github.com/gofrs/flock/flock_windows.go b/vendor/github.com/gofrs/flock/flock_windows.go index 9f4a5f10d24..ddb534ccef0 100644 --- a/vendor/github.com/gofrs/flock/flock_windows.go +++ b/vendor/github.com/gofrs/flock/flock_windows.go @@ -46,6 +46,7 @@ func (f *Flock) lock(locked *bool, flag uint32) error { if err := f.setFh(); err != nil { return err } + defer f.ensureFhState() } if _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { @@ -122,6 +123,7 @@ func (f *Flock) try(locked *bool, flag uint32) (bool, error) { if err := f.setFh(); err != nil { return false, err } + defer f.ensureFhState() } _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag|winLockfileFailImmediately, 0, 1, 0, &syscall.Overlapped{}) diff --git a/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go b/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go index 9ac140c50ea..51c75a77d2d 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go +++ b/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go @@ -14,7 +14,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strconv" @@ -24,6 +23,7 @@ import ( "github.com/pkg/errors" "github.com/golangci/golangci-lint/internal/renameio" + "github.com/golangci/golangci-lint/internal/robustio" ) // An ActionID is a cache action key, the hash of a complete description of a @@ -81,7 +81,7 @@ func (c *Cache) fileName(id [HashSize]byte, key string) string { var errMissing = errors.New("cache entry not found") func IsErrMissing(err error) bool { - return err == errMissing + return errors.Cause(err) == errMissing } const ( @@ -199,26 +199,6 @@ func (c *Cache) get(id ActionID) (Entry, error) { return Entry{buf, size, time.Unix(0, tm)}, nil } -// GetFile looks up the action ID in the cache and returns -// the name of the corresponding data file. -func (c *Cache) GetFile(id ActionID) (file string, entry Entry, err error) { - entry, err = c.Get(id) - if err != nil { - return "", Entry{}, err - } - - file, err = c.OutputFile(entry.OutputID) - if err != nil { - return "", Entry{}, err - } - - info, err := os.Stat(file) - if err != nil || info.Size() != entry.Size { - return "", Entry{}, errMissing - } - return file, entry, nil -} - // GetBytes looks up the action ID in the cache and returns // the corresponding output bytes. // GetBytes should only be used for data that can be expected to fit in memory. @@ -232,7 +212,7 @@ func (c *Cache) GetBytes(id ActionID) ([]byte, Entry, error) { return nil, entry, err } - data, err := ioutil.ReadFile(outputFile) + data, err := robustio.ReadFile(outputFile) if err != nil { return nil, entry, err } @@ -282,6 +262,9 @@ const ( func (c *Cache) used(file string) error { info, err := os.Stat(file) if err != nil { + if os.IsNotExist(err) { + return errMissing + } return errors.Wrapf(err, "failed to stat file %s", file) } diff --git a/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_darwin.go b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_darwin.go new file mode 100644 index 00000000000..1ac0d10d7f1 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_darwin.go @@ -0,0 +1,29 @@ +// Copyright 2019 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 robustio + +import ( + "os" + "syscall" +) + +const errFileNotFound = syscall.ENOENT + +// isEphemeralError returns true if err may be resolved by waiting. +func isEphemeralError(err error) bool { + switch werr := err.(type) { + case *os.PathError: + err = werr.Err + case *os.LinkError: + err = werr.Err + case *os.SyscallError: + err = werr.Err + + } + if errno, ok := err.(syscall.Errno); ok { + return errno == errFileNotFound + } + return false +} diff --git a/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_flaky.go b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_flaky.go new file mode 100644 index 00000000000..e0bf5b9b3b9 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_flaky.go @@ -0,0 +1,93 @@ +// Copyright 2019 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. + +// +build windows darwin + +package robustio + +import ( + "io/ioutil" + "math/rand" + "os" + "syscall" + "time" +) + +const arbitraryTimeout = 500 * time.Millisecond + +const ERROR_SHARING_VIOLATION = 32 + +// retry retries ephemeral errors from f up to an arbitrary timeout +// to work around filesystem flakiness on Windows and Darwin. +func retry(f func() (err error, mayRetry bool)) error { + var ( + bestErr error + lowestErrno syscall.Errno + start time.Time + nextSleep time.Duration = 1 * time.Millisecond + ) + for { + err, mayRetry := f() + if err == nil || !mayRetry { + return err + } + + if errno, ok := err.(syscall.Errno); ok && (lowestErrno == 0 || errno < lowestErrno) { + bestErr = err + lowestErrno = errno + } else if bestErr == nil { + bestErr = err + } + + if start.IsZero() { + start = time.Now() + } else if d := time.Since(start) + nextSleep; d >= arbitraryTimeout { + break + } + time.Sleep(nextSleep) + nextSleep += time.Duration(rand.Int63n(int64(nextSleep))) + } + + return bestErr +} + +// rename is like os.Rename, but retries ephemeral errors. +// +// On windows it wraps os.Rename, which (as of 2019-06-04) uses MoveFileEx with +// MOVEFILE_REPLACE_EXISTING. +// +// Windows also provides a different system call, ReplaceFile, +// that provides similar semantics, but perhaps preserves more metadata. (The +// documentation on the differences between the two is very sparse.) +// +// Empirical error rates with MoveFileEx are lower under modest concurrency, so +// for now we're sticking with what the os package already provides. +func rename(oldpath, newpath string) (err error) { + return retry(func() (err error, mayRetry bool) { + err = os.Rename(oldpath, newpath) + return err, isEphemeralError(err) + }) +} + +// readFile is like ioutil.ReadFile, but retries ephemeral errors. +func readFile(filename string) ([]byte, error) { + var b []byte + err := retry(func() (err error, mayRetry bool) { + b, err = ioutil.ReadFile(filename) + + // Unlike in rename, we do not retry errFileNotFound here: it can occur + // as a spurious error, but the file may also genuinely not exist, so the + // increase in robustness is probably not worth the extra latency. + + return err, isEphemeralError(err) && err != errFileNotFound + }) + return b, err +} + +func removeAll(path string) error { + return retry(func() (err error, mayRetry bool) { + err = os.RemoveAll(path) + return err, isEphemeralError(err) + }) +} diff --git a/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_other.go b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_other.go index 91ca56cb82c..a2428856f2e 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_other.go +++ b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_other.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build !windows +//+build !windows,!darwin package robustio diff --git a/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_windows.go b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_windows.go index 02f1e8c1ce6..a35237d44ae 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_windows.go +++ b/vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_windows.go @@ -5,93 +5,22 @@ package robustio import ( - "io/ioutil" - "math/rand" "os" "syscall" - "time" ) -const arbitraryTimeout = 500 * time.Millisecond - -const ERROR_SHARING_VIOLATION = 32 - -// retry retries ephemeral errors from f up to an arbitrary timeout -// to work around spurious filesystem errors on Windows -func retry(f func() (err error, mayRetry bool)) error { - var ( - bestErr error - lowestErrno syscall.Errno - start time.Time - nextSleep time.Duration = 1 * time.Millisecond - ) - for { - err, mayRetry := f() - if err == nil || !mayRetry { - return err - } - - if errno, ok := err.(syscall.Errno); ok && (lowestErrno == 0 || errno < lowestErrno) { - bestErr = err - lowestErrno = errno - } else if bestErr == nil { - bestErr = err - } - - if start.IsZero() { - start = time.Now() - } else if d := time.Since(start) + nextSleep; d >= arbitraryTimeout { - break - } - time.Sleep(nextSleep) - nextSleep += time.Duration(rand.Int63n(int64(nextSleep))) - } - - return bestErr -} - -// rename is like os.Rename, but retries ephemeral errors. -// -// It wraps os.Rename, which (as of 2019-06-04) uses MoveFileEx with -// MOVEFILE_REPLACE_EXISTING. -// -// Windows also provides a different system call, ReplaceFile, -// that provides similar semantics, but perhaps preserves more metadata. (The -// documentation on the differences between the two is very sparse.) -// -// Empirical error rates with MoveFileEx are lower under modest concurrency, so -// for now we're sticking with what the os package already provides. -func rename(oldpath, newpath string) (err error) { - return retry(func() (err error, mayRetry bool) { - err = os.Rename(oldpath, newpath) - return err, isEphemeralError(err) - }) -} - -// readFile is like ioutil.ReadFile, but retries ephemeral errors. -func readFile(filename string) ([]byte, error) { - var b []byte - err := retry(func() (err error, mayRetry bool) { - b, err = ioutil.ReadFile(filename) - - // Unlike in rename, we do not retry ERROR_FILE_NOT_FOUND here: it can occur - // as a spurious error, but the file may also genuinely not exist, so the - // increase in robustness is probably not worth the extra latency. - - return err, isEphemeralError(err) && err != syscall.ERROR_FILE_NOT_FOUND - }) - return b, err -} - -func removeAll(path string) error { - return retry(func() (err error, mayRetry bool) { - err = os.RemoveAll(path) - return err, isEphemeralError(err) - }) -} +const errFileNotFound = syscall.ERROR_FILE_NOT_FOUND // isEphemeralError returns true if err may be resolved by waiting. func isEphemeralError(err error) bool { + switch werr := err.(type) { + case *os.PathError: + err = werr.Err + case *os.LinkError: + err = werr.Err + case *os.SyscallError: + err = werr.Err + } if errno, ok := err.(syscall.Errno); ok { switch errno { case syscall.ERROR_ACCESS_DENIED, diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go index 807f1ca492a..4b63e2e5239 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go @@ -35,22 +35,32 @@ func (e *Executor) initConfig() { cmd.AddCommand(pathCmd) } +func (e *Executor) getUsedConfig() string { + usedConfigFile := viper.ConfigFileUsed() + if usedConfigFile == "" { + return "" + } + + prettyUsedConfigFile, err := fsutils.ShortestRelPath(usedConfigFile, "") + if err != nil { + e.log.Warnf("Can't pretty print config file path: %s", err) + return usedConfigFile + } + + return prettyUsedConfigFile +} + func (e *Executor) executePathCmd(_ *cobra.Command, args []string) { if len(args) != 0 { e.log.Fatalf("Usage: golangci-lint config path") } - usedConfigFile := viper.ConfigFileUsed() + usedConfigFile := e.getUsedConfig() if usedConfigFile == "" { e.log.Warnf("No config file detected") os.Exit(exitcodes.NoConfigFileDetected) } - usedConfigFile, err := fsutils.ShortestRelPath(usedConfigFile, "") - if err != nil { - e.log.Warnf("Can't pretty print config file path: %s", err) - } - fmt.Println(usedConfigFile) os.Exit(0) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go index ffef5b0a5bd..0becc9900db 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go @@ -5,10 +5,10 @@ import ( "context" "crypto/sha256" "encoding/json" - "fmt" "io" "os" "path/filepath" + "strings" "time" "github.com/fatih/color" @@ -31,8 +31,9 @@ import ( ) type Executor struct { - rootCmd *cobra.Command - runCmd *cobra.Command + rootCmd *cobra.Command + runCmd *cobra.Command + lintersCmd *cobra.Command exitCode int version, commit, date string @@ -55,6 +56,7 @@ type Executor struct { } func NewExecutor(version, commit, date string) *Executor { + startedAt := time.Now() e := &Executor{ cfg: config.NewDefault(), version: version, @@ -66,9 +68,6 @@ func NewExecutor(version, commit, date string) *Executor { e.debugf("Starting execution...") e.log = report.NewLogWrapper(logutils.NewStderrLog(""), &e.reportData) - if ok := e.acquireFileLock(); !ok { - e.log.Fatalf("Parallel golangci-lint is running") - } // to setup log level early we need to parse config from command line extra time to // find `-v` option @@ -121,6 +120,7 @@ func NewExecutor(version, commit, date string) *Executor { // Slice options must be explicitly set for proper merging of config and command-line options. fixSlicesFlags(e.runCmd.Flags()) + fixSlicesFlags(e.lintersCmd.Flags()) e.EnabledLintersSet = lintersdb.NewEnabledSet(e.DBManager, lintersdb.NewValidator(e.DBManager), e.log.Child("lintersdb"), e.cfg) @@ -139,7 +139,7 @@ func NewExecutor(version, commit, date string) *Executor { if err = e.initHashSalt(version); err != nil { e.log.Fatalf("Failed to init hash salt: %s", err) } - e.debugf("Initialized executor") + e.debugf("Initialized executor in %s", time.Since(startedAt)) return e } @@ -191,27 +191,43 @@ func computeBinarySalt(version string) ([]byte, error) { } func computeConfigSalt(cfg *config.Config) ([]byte, error) { - configBytes, err := json.Marshal(cfg) + // We don't hash all config fields to reduce meaningless cache + // invalidations. At least, it has a huge impact on tests speed. + + lintersSettingsBytes, err := json.Marshal(cfg.LintersSettings) if err != nil { - return nil, errors.Wrap(err, "failed to json marshal config") + return nil, errors.Wrap(err, "failed to json marshal config linter settings") } + var configData bytes.Buffer + configData.WriteString("linters-settings=") + configData.Write(lintersSettingsBytes) + configData.WriteString("\nbuild-tags=%s" + strings.Join(cfg.Run.BuildTags, ",")) + h := sha256.New() - if n, err := h.Write(configBytes); n != len(configBytes) { - return nil, fmt.Errorf("failed to hash config bytes: wrote %d/%d bytes, error: %s", n, len(configBytes), err) - } + h.Write(configData.Bytes()) //nolint:errcheck return h.Sum(nil), nil } func (e *Executor) acquireFileLock() bool { + if e.cfg.Run.AllowParallelRunners { + e.debugf("Parallel runners are allowed, no locking") + return true + } + lockFile := filepath.Join(os.TempDir(), "golangci-lint.lock") e.debugf("Locking on file %s...", lockFile) f := flock.New(lockFile) - ctx, finish := context.WithTimeout(context.Background(), time.Minute) - defer finish() + const retryDelay = time.Second - timeout := time.Second * 3 - if ok, _ := f.TryLockContext(ctx, timeout); !ok { + ctx := context.Background() + if !e.cfg.Run.AllowSerialRunners { + const totalTimeout = 5 * time.Second + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, totalTimeout) + defer cancel() + } + if ok, _ := f.TryLockContext(ctx, retryDelay); !ok { return false } @@ -220,6 +236,10 @@ func (e *Executor) acquireFileLock() bool { } func (e *Executor) releaseFileLock() { + if e.cfg.Run.AllowParallelRunners { + return + } + if err := e.flock.Unlock(); err != nil { e.debugf("Failed to unlock on file: %s", err) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/linters.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/linters.go index 84452201945..873dab81770 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/linters.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/linters.go @@ -11,23 +11,13 @@ import ( ) func (e *Executor) initLinters() { - lintersCmd := &cobra.Command{ + e.lintersCmd = &cobra.Command{ Use: "linters", Short: "List current linters configuration", Run: e.executeLinters, } - e.rootCmd.AddCommand(lintersCmd) - e.initRunConfiguration(lintersCmd) -} - -func IsLinterInConfigsList(name string, linters []*linter.Config) bool { - for _, lc := range linters { - if lc.Name() == name { - return true - } - } - - return false + e.rootCmd.AddCommand(e.lintersCmd) + e.initRunConfiguration(e.lintersCmd) } func (e *Executor) executeLinters(_ *cobra.Command, args []string) { @@ -35,17 +25,21 @@ func (e *Executor) executeLinters(_ *cobra.Command, args []string) { e.log.Fatalf("Usage: golangci-lint linters") } - enabledLCs, err := e.EnabledLintersSet.Get(false) + enabledLintersMap, err := e.EnabledLintersSet.GetEnabledLintersMap() if err != nil { log.Fatalf("Can't get enabled linters: %s", err) } color.Green("Enabled by your configuration linters:\n") - printLinterConfigs(enabledLCs) + enabledLinters := make([]*linter.Config, 0, len(enabledLintersMap)) + for _, linter := range enabledLintersMap { + enabledLinters = append(enabledLinters, linter) + } + printLinterConfigs(enabledLinters) var disabledLCs []*linter.Config for _, lc := range e.DBManager.GetAllSupportedLinterConfigs() { - if !IsLinterInConfigsList(lc.Name(), enabledLCs) { + if enabledLintersMap[lc.Name()] == nil { disabledLCs = append(disabledLCs, lc) } } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go index c8548cd7340..f90df9901ff 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go @@ -73,7 +73,6 @@ func (e *Executor) persistentPostRun(_ *cobra.Command, _ []string) { trace.Stop() } - e.releaseFileLock() os.Exit(e.exitCode) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go index 4149a00c4b0..57cb5471f5d 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go @@ -80,7 +80,9 @@ func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, is fs.BoolVar(&oc.PrintIssuedLine, "print-issued-lines", true, wh("Print lines of code with issue")) fs.BoolVar(&oc.PrintLinterName, "print-linter-name", true, wh("Print linter name in issue line")) fs.BoolVar(&oc.UniqByLine, "uniq-by-line", true, wh("Make issues output unique by line")) + fs.BoolVar(&oc.SortResults, "sort-results", false, wh("Sort linter results")) fs.BoolVar(&oc.PrintWelcomeMessage, "print-welcome", false, wh("Print welcome message")) + fs.StringVar(&oc.PathPrefix, "path-prefix", "", wh("Path prefix to add to output")) hideFlag("print-welcome") // no longer used // Run config @@ -106,6 +108,13 @@ func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, is fs.BoolVar(&rc.UseDefaultSkipDirs, "skip-dirs-use-default", true, getDefaultDirectoryExcludeHelp()) fs.StringSliceVar(&rc.SkipFiles, "skip-files", nil, wh("Regexps of files to skip")) + const allowParallelDesc = "Allow multiple parallel golangci-lint instances running. " + + "If false (default) - golangci-lint acquires file lock on start." + fs.BoolVar(&rc.AllowParallelRunners, "allow-parallel-runners", false, wh(allowParallelDesc)) + const allowSerialDesc = "Allow multiple golangci-lint instances running, but serialize them around a lock. " + + "If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start." + fs.BoolVar(&rc.AllowSerialRunners, "allow-serial-runners", false, wh(allowSerialDesc)) + // Linters settings config lsc := &cfg.LintersSettings @@ -228,6 +237,7 @@ func (e *Executor) getConfigForCommandLine() (*config.Config, error) { // Use another config variable here, not e.cfg, to not // affect main parsing by this parsing of only config option. initFlagSet(fs, &cfg, e.DBManager, false) + initVersionFlagSet(fs, &cfg) // Parse max options, even force version option: don't want // to get access to Executor here: it's error-prone to use @@ -251,6 +261,14 @@ func (e *Executor) initRun() { Use: "run", Short: welcomeMessage, Run: e.executeRun, + PreRun: func(_ *cobra.Command, _ []string) { + if ok := e.acquireFileLock(); !ok { + e.log.Fatalf("Parallel golangci-lint is running") + } + }, + PostRun: func(_ *cobra.Command, _ []string) { + e.releaseFileLock() + }, } e.rootCmd.AddCommand(e.runCmd) @@ -285,40 +303,34 @@ func fixSlicesFlags(fs *pflag.FlagSet) { func (e *Executor) runAnalysis(ctx context.Context, args []string) ([]result.Issue, error) { e.cfg.Run.Args = args - enabledLinters, err := e.EnabledLintersSet.Get(true) + lintersToRun, err := e.EnabledLintersSet.GetOptimizedLinters() if err != nil { return nil, err } - enabledOriginalLinters, err := e.EnabledLintersSet.Get(false) + enabledLintersMap, err := e.EnabledLintersSet.GetEnabledLintersMap() if err != nil { return nil, err } for _, lc := range e.DBManager.GetAllSupportedLinterConfigs() { - isEnabled := false - for _, enabledLC := range enabledOriginalLinters { - if enabledLC.Name() == lc.Name() { - isEnabled = true - break - } - } + isEnabled := enabledLintersMap[lc.Name()] != nil e.reportData.AddLinter(lc.Name(), isEnabled, lc.EnabledByDefault) } - lintCtx, err := e.contextLoader.Load(ctx, enabledLinters) + lintCtx, err := e.contextLoader.Load(ctx, lintersToRun) if err != nil { return nil, errors.Wrap(err, "context loading failed") } lintCtx.Log = e.log.Child("linters context") runner, err := lint.NewRunner(e.cfg, e.log.Child("runner"), - e.goenv, e.lineCache, e.DBManager, lintCtx.Packages) + e.goenv, e.EnabledLintersSet, e.lineCache, e.DBManager, lintCtx.Packages) if err != nil { return nil, err } - issues, err := runner.Run(ctx, enabledLinters, lintCtx) + issues, err := runner.Run(ctx, lintersToRun, lintCtx) if err != nil { return nil, err } @@ -440,8 +452,8 @@ func (e *Executor) executeRun(_ *cobra.Command, args []string) { // to be removed when deadline is finally decommissioned func (e *Executor) setTimeoutToDeadlineIfOnlyDeadlineIsSet() { - //lint:ignore SA1019 We want to promoted the deprecated config value when needed - deadlineValue := e.cfg.Run.Deadline // nolint:staticcheck + // nolint:staticcheck + deadlineValue := e.cfg.Run.Deadline if deadlineValue != 0 && e.cfg.Run.Timeout == defaultTimeout { e.cfg.Run.Timeout = deadlineValue } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go index fdb5aa884a1..3918d6b7b7a 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go @@ -1,17 +1,59 @@ package commands import ( + "encoding/json" + "strings" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + + "github.com/golangci/golangci-lint/pkg/config" ) +type jsonVersion struct { + Version string `json:"version"` + Commit string `json:"commit"` + Date string `json:"date"` +} + +func (e *Executor) initVersionConfiguration(cmd *cobra.Command) { + fs := cmd.Flags() + fs.SortFlags = false // sort them as they are defined here + initVersionFlagSet(fs, e.cfg) +} + +func initVersionFlagSet(fs *pflag.FlagSet, cfg *config.Config) { + // Version config + vc := &cfg.Version + fs.StringVar(&vc.Format, "format", "", wh("The version's format can be: 'short', 'json'")) +} + func (e *Executor) initVersion() { versionCmd := &cobra.Command{ Use: "version", Short: "Version", - Run: func(cmd *cobra.Command, _ []string) { - cmd.Printf("golangci-lint has version %s built from %s on %s\n", e.version, e.commit, e.date) + RunE: func(cmd *cobra.Command, _ []string) error { + switch strings.ToLower(e.cfg.Version.Format) { + case "short": + cmd.Println(e.version) + case "json": + ver := jsonVersion{ + Version: e.version, + Commit: e.commit, + Date: e.date, + } + data, err := json.Marshal(&ver) + if err != nil { + return err + } + cmd.Println(string(data)) + default: + cmd.Printf("golangci-lint has version %s built from %s on %s\n", e.version, e.commit, e.date) + } + return nil }, } e.rootCmd.AddCommand(versionCmd) + e.initVersionConfiguration(versionCmd) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/config/config.go b/vendor/github.com/golangci/golangci-lint/pkg/config/config.go index 2315f308c1c..9689ea0922b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/config/config.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/config/config.go @@ -40,7 +40,7 @@ var DefaultExcludePatterns = []ExcludePattern{ { ID: "EXC0001", Pattern: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close" + - "|.*Flush|os\\.Remove(All)?|.*printf?|os\\.(Un)?Setenv). is not checked", + "|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked", Linter: "errcheck", Why: "Almost all programs ignore errors on these functions and in most cases it's ok", }, @@ -150,9 +150,15 @@ type Run struct { SkipFiles []string `mapstructure:"skip-files"` SkipDirs []string `mapstructure:"skip-dirs"` UseDefaultSkipDirs bool `mapstructure:"skip-dirs-use-default"` + + AllowParallelRunners bool `mapstructure:"allow-parallel-runners"` + AllowSerialRunners bool `mapstructure:"allow-serial-runners"` } type LintersSettings struct { + Gci struct { + LocalPrefixes string `mapstructure:"local-prefixes"` + } Govet GovetSettings Golint struct { MinConfidence float64 `mapstructure:"min-confidence"` @@ -219,6 +225,10 @@ type LintersSettings struct { Recommendations []string `mapstructure:"recommendations"` Reason string `mapstructure:"reason"` } `mapstructure:"modules"` + Versions []map[string]struct { + Version string `mapstructure:"version"` + Reason string `mapstructure:"reason"` + } `mapstructure:"versions"` } `mapstructure:"blocked"` } @@ -233,13 +243,22 @@ type LintersSettings struct { Dogsled DogsledSettings Gocognit GocognitSettings Godot GodotSettings + Goheader GoHeaderSettings Testpackage TestpackageSettings Nestif NestifSettings NoLintLint NoLintLintSettings + Exhaustive ExhaustiveSettings + Gofumpt GofumptSettings Custom map[string]CustomLinterSettings } +type GoHeaderSettings struct { + Values map[string]map[string]string `mapstructure:"values"` + Template string `mapstructure:"template"` + TemplatePath string `mapstructure:"template-path"` +} + type GovetSettings struct { CheckShadowing bool `mapstructure:"check-shadowing"` Settings map[string]map[string]interface{} @@ -333,6 +352,14 @@ type NestifSettings struct { MinComplexity int `mapstructure:"min-complexity"` } +type ExhaustiveSettings struct { + DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"` +} + +type GofumptSettings struct { + ExtraRules bool `mapstructure:"extra-rules"` +} + var defaultLintersSettings = LintersSettings{ Lll: LllSettings{ LineLength: 120, @@ -383,6 +410,12 @@ var defaultLintersSettings = LintersSettings{ Nestif: NestifSettings{ MinComplexity: 5, }, + Exhaustive: ExhaustiveSettings{ + DefaultSignifiesExhaustive: false, + }, + Gofumpt: GofumptSettings{ + ExtraRules: false, + }, } type CustomLinterSettings struct { @@ -401,51 +434,71 @@ type Linters struct { Presets []string } -type ExcludeRule struct { +type BaseRule struct { Linters []string Path string Text string Source string } -func validateOptionalRegex(value string) error { - if value == "" { - return nil - } - _, err := regexp.Compile(value) - return err -} - -func (e ExcludeRule) Validate() error { - if err := validateOptionalRegex(e.Path); err != nil { +func (b BaseRule) Validate(minConditionsCount int) error { + if err := validateOptionalRegex(b.Path); err != nil { return fmt.Errorf("invalid path regex: %v", err) } - if err := validateOptionalRegex(e.Text); err != nil { + if err := validateOptionalRegex(b.Text); err != nil { return fmt.Errorf("invalid text regex: %v", err) } - if err := validateOptionalRegex(e.Source); err != nil { + if err := validateOptionalRegex(b.Source); err != nil { return fmt.Errorf("invalid source regex: %v", err) } nonBlank := 0 - if len(e.Linters) > 0 { + if len(b.Linters) > 0 { nonBlank++ } - if e.Path != "" { + if b.Path != "" { nonBlank++ } - if e.Text != "" { + if b.Text != "" { nonBlank++ } - if e.Source != "" { + if b.Source != "" { nonBlank++ } - const minConditionsCount = 2 if nonBlank < minConditionsCount { - return errors.New("at least 2 of (text, source, path, linters) should be set") + return fmt.Errorf("at least %d of (text, source, path, linters) should be set", minConditionsCount) } return nil } +const excludeRuleMinConditionsCount = 2 + +type ExcludeRule struct { + BaseRule `mapstructure:",squash"` +} + +func validateOptionalRegex(value string) error { + if value == "" { + return nil + } + _, err := regexp.Compile(value) + return err +} + +func (e ExcludeRule) Validate() error { + return e.BaseRule.Validate(excludeRuleMinConditionsCount) +} + +const severityRuleMinConditionsCount = 1 + +type SeverityRule struct { + BaseRule `mapstructure:",squash"` + Severity string +} + +func (s *SeverityRule) Validate() error { + return s.BaseRule.Validate(severityRuleMinConditionsCount) +} + type Issues struct { IncludeDefaultExcludes []string `mapstructure:"include"` ExcludeCaseSensitive bool `mapstructure:"exclude-case-sensitive"` @@ -463,21 +516,35 @@ type Issues struct { NeedFix bool `mapstructure:"fix"` } +type Severity struct { + Default string `mapstructure:"default-severity"` + CaseSensitive bool `mapstructure:"case-sensitive"` + Rules []SeverityRule `mapstructure:"rules"` +} + +type Version struct { + Format string `mapstructure:"format"` +} + type Config struct { Run Run Output struct { Format string Color string - PrintIssuedLine bool `mapstructure:"print-issued-lines"` - PrintLinterName bool `mapstructure:"print-linter-name"` - UniqByLine bool `mapstructure:"uniq-by-line"` - PrintWelcomeMessage bool `mapstructure:"print-welcome"` + PrintIssuedLine bool `mapstructure:"print-issued-lines"` + PrintLinterName bool `mapstructure:"print-linter-name"` + UniqByLine bool `mapstructure:"uniq-by-line"` + SortResults bool `mapstructure:"sort-results"` + PrintWelcomeMessage bool `mapstructure:"print-welcome"` + PathPrefix string `mapstructure:"path-prefix"` } LintersSettings LintersSettings `mapstructure:"linters-settings"` Linters Linters Issues Issues + Severity Severity + Version Version InternalTest bool // Option is used only for testing golangci-lint code, don't use it } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go b/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go index bbfd7bb1338..26317a678b5 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go @@ -5,7 +5,7 @@ import ( "sort" "strings" - "github.com/go-lintpack/lintpack" + "github.com/go-critic/go-critic/framework/linter" "github.com/pkg/errors" _ "github.com/go-critic/go-critic/checkers" // this import register checkers @@ -18,9 +18,9 @@ const gocriticDebugKey = "gocritic" var ( gocriticDebugf = logutils.Debug(gocriticDebugKey) isGocriticDebug = logutils.HaveDebugTag(gocriticDebugKey) - allGocriticCheckers = lintpack.GetCheckersInfo() - allGocriticCheckerMap = func() map[string]*lintpack.CheckerInfo { - checkInfoMap := make(map[string]*lintpack.CheckerInfo) + allGocriticCheckers = linter.GetCheckersInfo() + allGocriticCheckerMap = func() map[string]*linter.CheckerInfo { + checkInfoMap := make(map[string]*linter.CheckerInfo) for _, checkInfo := range allGocriticCheckers { checkInfoMap[checkInfo.Name] = checkInfo } @@ -281,7 +281,7 @@ func getAllCheckerNames() map[string]bool { return allCheckerNames } -func isEnabledByDefaultGocriticCheck(info *lintpack.CheckerInfo) bool { +func isEnabledByDefaultGocriticCheck(info *linter.CheckerInfo) bool { return !info.HasTag("experimental") && !info.HasTag("opinionated") && !info.HasTag("performance") @@ -290,9 +290,6 @@ func isEnabledByDefaultGocriticCheck(info *lintpack.CheckerInfo) bool { func getDefaultEnabledGocriticCheckersNames() []string { var enabled []string for _, info := range allGocriticCheckers { - // get in sync with lintpack behavior in bindDefaultEnabledList - // in https://github.com/go-lintpack/lintpack/blob/master/linter/lintmain/internal/check/check.go#L317 - enable := isEnabledByDefaultGocriticCheck(info) if enable { enabled = append(enabled, info.Name) @@ -305,9 +302,6 @@ func getDefaultEnabledGocriticCheckersNames() []string { func getDefaultDisabledGocriticCheckersNames() []string { var disabled []string for _, info := range allGocriticCheckers { - // get in sync with lintpack behavior in bindDefaultEnabledList - // in https://github.com/go-lintpack/lintpack/blob/master/linter/lintmain/internal/check/check.go#L317 - enable := isEnabledByDefaultGocriticCheck(info) if !enable { disabled = append(disabled, info.Name) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go b/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go index 1e355e72213..00722ba6366 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go @@ -12,6 +12,7 @@ import ( "github.com/golangci/golangci-lint/pkg/fsutils" "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/sliceutil" ) type FileReader struct { @@ -113,6 +114,14 @@ func (r *FileReader) validateConfig() error { return fmt.Errorf("error in exclude rule #%d: %v", i, err) } } + if len(c.Severity.Rules) > 0 && c.Severity.Default == "" { + return errors.New("can't set severity rule option: no default severity defined") + } + for i, rule := range c.Severity.Rules { + if err := rule.Validate(); err != nil { + return fmt.Errorf("error in severity rule #%d: %v", i, err) + } + } if err := c.LintersSettings.Govet.Validate(); err != nil { return fmt.Errorf("error in govet config: %v", err) } @@ -162,6 +171,7 @@ func (r *FileReader) setupConfigFileSearch() { // find all dirs from it up to the root configSearchPaths := []string{"./"} + for { configSearchPaths = append(configSearchPaths, curDir) newCurDir := filepath.Dir(curDir) @@ -171,6 +181,13 @@ func (r *FileReader) setupConfigFileSearch() { curDir = newCurDir } + // find home directory for global config + if home, err := homedir.Dir(); err != nil { + r.log.Warnf("Can't get user's home directory: %s", err.Error()) + } else if !sliceutil.Contains(configSearchPaths, home) { + configSearchPaths = append(configSearchPaths, home) + } + r.log.Infof("Config search paths: %s", configSearchPaths) viper.SetConfigName(".golangci") for _, p := range configSearchPaths { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go index eaac928e0aa..ed1c4fcbdc5 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go @@ -34,7 +34,7 @@ func NewDupl() *goanalysis.Linter { analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { var fileNames []string for _, f := range pass.Files { - pos := pass.Fset.Position(f.Pos()) + pos := pass.Fset.PositionFor(f.Pos(), false) fileNames = append(fileNames, pos.Filename) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/exhaustive.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/exhaustive.go new file mode 100644 index 00000000000..cae37ecc61d --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/exhaustive.go @@ -0,0 +1,25 @@ +package golinters + +import ( + "github.com/nishanths/exhaustive" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter { + a := exhaustive.Analyzer + + var cfg map[string]map[string]interface{} + if settings != nil { + cfg = map[string]map[string]interface{}{ + a.Name: { + exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive, + }, + } + } + + return goanalysis.NewLinter(a.Name, a.Doc, []*analysis.Analyzer{a}, cfg). + WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/exportloopref.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/exportloopref.go new file mode 100644 index 00000000000..1131c575b95 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/exportloopref.go @@ -0,0 +1,19 @@ +package golinters + +import ( + "github.com/kyoh86/exportloopref" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewExportLoopRef() *goanalysis.Linter { + a := exportloopref.Analyzer + + return goanalysis.NewLinter( + a.Name, + a.Doc, + []*analysis.Analyzer{a}, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gci.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gci.go new file mode 100644 index 00000000000..6fa43544e64 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gci.go @@ -0,0 +1,92 @@ +package golinters + +import ( + "bytes" + "fmt" + "sync" + + "github.com/daixiang0/gci/pkg/gci" + "github.com/pkg/errors" + "github.com/shazow/go-diff/difflib" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" +) + +const gciName = "gci" + +func NewGci() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + differ := difflib.New() + + analyzer := &analysis.Analyzer{ + Name: gciName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + gciName, + "Gci control golang package import order and make it always deterministic.", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + localFlag := lintCtx.Settings().Gci.LocalPrefixes + goimportsFlag := lintCtx.Settings().Goimports.LocalPrefixes + if localFlag == "" && goimportsFlag != "" { + localFlag = goimportsFlag + } + + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.PositionFor(f.Pos(), false) + fileNames = append(fileNames, pos.Filename) + } + + var issues []goanalysis.Issue + + for _, f := range fileNames { + source, result, err := gci.Run(f, &gci.FlagSet{LocalFlag: localFlag}) + if err != nil { + return nil, err + } + if result == nil { + continue + } + + diff := bytes.Buffer{} + _, err = diff.WriteString(fmt.Sprintf("--- %[1]s\n+++ %[1]s\n", f)) + if err != nil { + return nil, fmt.Errorf("can't write diff header: %v", err) + } + + err = differ.Diff(&diff, bytes.NewReader(source), bytes.NewReader(result)) + if err != nil { + return nil, fmt.Errorf("can't get gci diff output: %v", err) + } + + is, err := extractIssuesFromPatch(diff.String(), lintCtx.Log, lintCtx, gciName) + if err != nil { + return nil, errors.Wrapf(err, "can't extract issues from gci diff output %q", diff.String()) + } + + for i := range is { + issues = append(issues, goanalysis.NewIssue(&is[i], pass)) + } + } + + if len(issues) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, issues...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load/guard.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load/guard.go index 5695f717eb9..ab7775cc806 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load/guard.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load/guard.go @@ -7,9 +7,8 @@ import ( ) type Guard struct { - loadMutexes map[*packages.Package]*sync.Mutex - mutexForExportData sync.Mutex - mutex sync.Mutex + loadMutexes map[*packages.Package]*sync.Mutex + mutex sync.Mutex } func NewGuard() *Guard { @@ -26,10 +25,6 @@ func (g *Guard) MutexForPkg(pkg *packages.Package) *sync.Mutex { return g.loadMutexes[pkg] } -func (g *Guard) MutexForExportData() *sync.Mutex { - return &g.mutexForExportData -} - func (g *Guard) Mutex() *sync.Mutex { return &g.mutex } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go index 64087c2833e..db193f37bb2 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go @@ -384,26 +384,6 @@ func extractDiagnostics(roots []*action) (retDiags []Diagnostic, retErrors []err return } -// NeedFacts reports whether any analysis required by the specified set -// needs facts. If so, we must load the entire program from source. -func NeedFacts(analyzers []*analysis.Analyzer) bool { - seen := make(map[*analysis.Analyzer]bool) - var q []*analysis.Analyzer // for BFS - q = append(q, analyzers...) - for len(q) > 0 { - a := q[0] - q = q[1:] - if !seen[a] { - seen[a] = true - if len(a.FactTypes) > 0 { - return true - } - q = append(q, a.Requires...) - } - } - return false -} - // An action represents one unit of analysis work: the application of // one analysis to one package. Actions form a DAG, both within a // package (as different analyzers are applied, either in sequence or @@ -955,7 +935,8 @@ func sizeOfReflectValueTreeBytes(rv reflect.Value, visitedPtrs map[uintptr]struc return rv.Len() case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Uintptr, reflect.Bool, reflect.Float32, reflect.Float64, reflect.UnsafePointer: + reflect.Uintptr, reflect.Bool, reflect.Float32, reflect.Float64, + reflect.Complex64, reflect.Complex128, reflect.Func, reflect.UnsafePointer: return int(rv.Type().Size()) case reflect.Invalid: return 0 @@ -964,7 +945,7 @@ func sizeOfReflectValueTreeBytes(rv reflect.Value, visitedPtrs map[uintptr]struc } } -func (lp *loadingPackage) decUse() { +func (lp *loadingPackage) decUse(canClearTypes bool) { lp.decUseMutex.Lock() defer lp.decUseMutex.Unlock() @@ -1007,11 +988,17 @@ func (lp *loadingPackage) decUse() { return } - lp.pkg.Types = nil + if canClearTypes { + // canClearTypes is set to true if we can discard type + // information after the package and its dependents have been + // processed. This is the case when no whole program checkers (unused) are + // being run. + lp.pkg.Types = nil + } lp.pkg = nil for _, imp := range lp.imports { - imp.decUse() + imp.decUse(canClearTypes) } lp.imports = nil @@ -1047,12 +1034,8 @@ func (lp *loadingPackage) analyze(loadMode LoadMode, loadSem chan struct{}) { <-loadSem }() - defer func() { - if loadMode < LoadModeWholeProgram { - // Save memory on unused more fields. - lp.decUse() - } - }() + // Save memory on unused more fields. + defer lp.decUse(loadMode < LoadModeWholeProgram) if err := lp.loadWithFacts(loadMode); err != nil { werr := errors.Wrapf(err, "failed to load package %s", lp.pkg.Name) @@ -1168,22 +1151,6 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error { } func (lp *loadingPackage) loadFromExportData() error { - // Because gcexportdata.Read has the potential to create or - // modify the types.Package for each node in the transitive - // closure of dependencies of lpkg, all exportdata operations - // must be sequential. (Finer-grained locking would require - // changes to the gcexportdata API.) - // - // The exportMu lock guards the Package.Pkg field and the - // types.Package it points to, for each Package in the graph. - // - // Not all accesses to Package.Pkg need to be protected by this mutex: - // graph ordering ensures that direct dependencies of source - // packages are fully loaded before the importer reads their Pkg field. - mu := lp.loadGuard.MutexForExportData() - mu.Lock() - defer mu.Unlock() - pkg := lp.pkg // Call NewPackage directly with explicit name. diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go index 8044e3e51d0..78afff86c59 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go @@ -39,7 +39,7 @@ func NewGocognit() *goanalysis.Linter { return nil, nil } - sort.Slice(stats, func(i, j int) bool { + sort.SliceStable(stats, func(i, j int) bool { return stats[i].Complexity > stats[j].Complexity }) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go index fb29252096b..7181c48637d 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "github.com/go-lintpack/lintpack" + gocriticlinter "github.com/go-critic/go-critic/framework/linter" "golang.org/x/tools/go/analysis" "github.com/golangci/golangci-lint/pkg/config" @@ -38,15 +38,15 @@ func NewGocritic() *goanalysis.Linter { nil, ).WithContextSetter(func(lintCtx *linter.Context) { analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { - lintpackCtx := lintpack.NewContext(pass.Fset, sizes) - enabledCheckers, err := buildEnabledCheckers(lintCtx, lintpackCtx) + linterCtx := gocriticlinter.NewContext(pass.Fset, sizes) + enabledCheckers, err := buildEnabledCheckers(lintCtx, linterCtx) if err != nil { return nil, err } - lintpackCtx.SetPackageInfo(pass.TypesInfo, pass.Pkg) + linterCtx.SetPackageInfo(pass.TypesInfo, pass.Pkg) var res []goanalysis.Issue - pkgIssues := runGocriticOnPackage(lintpackCtx, enabledCheckers, pass.Files) + pkgIssues := runGocriticOnPackage(linterCtx, enabledCheckers, pass.Files) for i := range pkgIssues { res = append(res, goanalysis.NewIssue(&pkgIssues[i], pass)) } @@ -65,9 +65,9 @@ func NewGocritic() *goanalysis.Linter { }).WithLoadMode(goanalysis.LoadModeTypesInfo) } -func normalizeCheckerInfoParams(info *lintpack.CheckerInfo) lintpack.CheckerParams { +func normalizeCheckerInfoParams(info *gocriticlinter.CheckerInfo) gocriticlinter.CheckerParams { // lowercase info param keys here because golangci-lint's config parser lowercases all strings - ret := lintpack.CheckerParams{} + ret := gocriticlinter.CheckerParams{} for k, v := range info.Params { ret[strings.ToLower(k)] = v } @@ -75,7 +75,7 @@ func normalizeCheckerInfoParams(info *lintpack.CheckerInfo) lintpack.CheckerPara return ret } -func configureCheckerInfo(info *lintpack.CheckerInfo, allParams map[string]config.GocriticCheckSettings) error { +func configureCheckerInfo(info *gocriticlinter.CheckerInfo, allParams map[string]config.GocriticCheckSettings) error { params := allParams[strings.ToLower(info.Name)] if params == nil { // no config for this checker return nil @@ -108,12 +108,12 @@ func configureCheckerInfo(info *lintpack.CheckerInfo, allParams map[string]confi return nil } -func buildEnabledCheckers(lintCtx *linter.Context, lintpackCtx *lintpack.Context) ([]*lintpack.Checker, error) { +func buildEnabledCheckers(lintCtx *linter.Context, linterCtx *gocriticlinter.Context) ([]*gocriticlinter.Checker, error) { s := lintCtx.Settings().Gocritic allParams := s.GetLowercasedParams() - var enabledCheckers []*lintpack.Checker - for _, info := range lintpack.GetCheckersInfo() { + var enabledCheckers []*gocriticlinter.Checker + for _, info := range gocriticlinter.GetCheckersInfo() { if !s.IsCheckEnabled(info.Name) { continue } @@ -122,27 +122,27 @@ func buildEnabledCheckers(lintCtx *linter.Context, lintpackCtx *lintpack.Context return nil, err } - c := lintpack.NewChecker(lintpackCtx, info) + c := gocriticlinter.NewChecker(linterCtx, info) enabledCheckers = append(enabledCheckers, c) } return enabledCheckers, nil } -func runGocriticOnPackage(lintpackCtx *lintpack.Context, checkers []*lintpack.Checker, +func runGocriticOnPackage(linterCtx *gocriticlinter.Context, checkers []*gocriticlinter.Checker, files []*ast.File) []result.Issue { var res []result.Issue for _, f := range files { - filename := filepath.Base(lintpackCtx.FileSet.Position(f.Pos()).Filename) - lintpackCtx.SetFileInfo(filename, f) + filename := filepath.Base(linterCtx.FileSet.Position(f.Pos()).Filename) + linterCtx.SetFileInfo(filename, f) - issues := runGocriticOnFile(lintpackCtx, f, checkers) + issues := runGocriticOnFile(linterCtx, f, checkers) res = append(res, issues...) } return res } -func runGocriticOnFile(ctx *lintpack.Context, f *ast.File, checkers []*lintpack.Checker) []result.Issue { +func runGocriticOnFile(ctx *gocriticlinter.Context, f *ast.File, checkers []*gocriticlinter.Checker) []result.Issue { var res []result.Issue for _, c := range checkers { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go index f9c0a799348..55f13fcfed2 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go @@ -39,7 +39,7 @@ func NewGocyclo() *goanalysis.Linter { return nil, nil } - sort.Slice(stats, func(i, j int) bool { + sort.SliceStable(stats, func(i, j int) bool { return stats[i].Complexity > stats[j].Complexity }) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/godot.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/godot.go index 842ec97d26e..5139713c4af 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/godot.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/godot.go @@ -31,7 +31,7 @@ func NewGodot() *goanalysis.Linter { settings := godot.Settings{CheckAll: cfg.CheckAll} analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { - var issues []godot.Message + var issues []godot.Issue for _, file := range pass.Files { issues = append(issues, godot.Run(file, pass.Fset, settings)...) } @@ -43,10 +43,12 @@ func NewGodot() *goanalysis.Linter { res := make([]goanalysis.Issue, len(issues)) for k, i := range issues { issue := result.Issue{ - Pos: i.Pos, - Text: i.Message, - FromLinter: godotName, - Replacement: &result.Replacement{}, + Pos: i.Pos, + Text: i.Message, + FromLinter: godotName, + Replacement: &result.Replacement{ + NewLines: []string{i.Replacement}, + }, } res[k] = goanalysis.NewIssue(&issue, pass) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go index e71f27bb171..aa340dcf3c4 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go @@ -31,7 +31,7 @@ func NewGofmt() *goanalysis.Linter { analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { var fileNames []string for _, f := range pass.Files { - pos := pass.Fset.Position(f.Pos()) + pos := pass.Fset.PositionFor(f.Pos(), false) fileNames = append(fileNames, pos.Filename) } @@ -46,7 +46,7 @@ func NewGofmt() *goanalysis.Linter { continue } - is, err := extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx, false) + is, err := extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx, gofmtName) if err != nil { return nil, errors.Wrapf(err, "can't extract issues from gofmt diff output %q", string(diff)) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go index fb1e3f6623f..3235622e8bf 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go @@ -207,7 +207,40 @@ func (p *hunkChangesParser) parse(h *diffpkg.Hunk) []Change { return p.ret } -func extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Context, isGoimports bool) ([]result.Issue, error) { +func getErrorTextForLinter(lintCtx *linter.Context, linterName string) string { + text := "File is not formatted" + switch linterName { + case gofumptName: + text = "File is not `gofumpt`-ed" + if lintCtx.Settings().Gofumpt.ExtraRules { + text += " with `-extra`" + } + case gofmtName: + text = "File is not `gofmt`-ed" + if lintCtx.Settings().Gofmt.Simplify { + text += " with `-s`" + } + case goimportsName: + text = "File is not `goimports`-ed" + if lintCtx.Settings().Goimports.LocalPrefixes != "" { + text += " with -local " + lintCtx.Settings().Goimports.LocalPrefixes + } + case gciName: + text = "File is not `gci`-ed" + localPrefixes := lintCtx.Settings().Gci.LocalPrefixes + goimportsFlag := lintCtx.Settings().Goimports.LocalPrefixes + if localPrefixes == "" && goimportsFlag != "" { + localPrefixes = goimportsFlag + } + + if localPrefixes != "" { + text += " with -local " + localPrefixes + } + } + return text +} + +func extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Context, linterName string) ([]result.Issue, error) { diffs, err := diffpkg.ParseMultiFileDiff([]byte(patch)) if err != nil { return nil, errors.Wrap(err, "can't parse patch") @@ -225,35 +258,19 @@ func extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Cont } for _, hunk := range d.Hunks { - var text string - if isGoimports { - text = "File is not `goimports`-ed" - if lintCtx.Settings().Goimports.LocalPrefixes != "" { - text += " with -local " + lintCtx.Settings().Goimports.LocalPrefixes - } - } else { - text = "File is not `gofmt`-ed" - if lintCtx.Settings().Gofmt.Simplify { - text += " with `-s`" - } - } p := hunkChangesParser{ log: log, } changes := p.parse(hunk) for _, change := range changes { change := change // fix scope - linterName := gofmtName - if isGoimports { - linterName = goimportsName - } i := result.Issue{ FromLinter: linterName, Pos: token.Position{ Filename: d.NewName, Line: change.LineRange.From, }, - Text: text, + Text: getErrorTextForLinter(lintCtx, linterName), Replacement: &change.Replacement, } if change.LineRange.From != change.LineRange.To { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofumpt.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofumpt.go new file mode 100644 index 00000000000..e91e54eeafc --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofumpt.go @@ -0,0 +1,92 @@ +package golinters + +import ( + "bytes" + "fmt" + "io/ioutil" + "sync" + + "github.com/pkg/errors" + "github.com/shazow/go-diff/difflib" + "golang.org/x/tools/go/analysis" + "mvdan.cc/gofumpt/format" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" +) + +const gofumptName = "gofumpt" + +func NewGofumpt() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + differ := difflib.New() + + analyzer := &analysis.Analyzer{ + Name: gofumptName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + gofumptName, + "Gofumpt checks whether code was gofumpt-ed.", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.PositionFor(f.Pos(), false) + fileNames = append(fileNames, pos.Filename) + } + + var issues []goanalysis.Issue + + for _, f := range fileNames { + input, err := ioutil.ReadFile(f) + if err != nil { + return nil, fmt.Errorf("unable to open file %s: %w", f, err) + } + output, err := format.Source(input, format.Options{ + ExtraRules: lintCtx.Settings().Gofumpt.ExtraRules, + }) + if err != nil { + return nil, fmt.Errorf("error while running gofumpt: %w", err) + } + if !bytes.Equal(input, output) { + out := bytes.Buffer{} + _, err = out.WriteString(fmt.Sprintf("--- %[1]s\n+++ %[1]s\n", f)) + if err != nil { + return nil, fmt.Errorf("error while running gofumpt: %w", err) + } + + err = differ.Diff(&out, bytes.NewReader(input), bytes.NewReader(output)) + if err != nil { + return nil, fmt.Errorf("error while running gofumpt: %w", err) + } + + diff := out.String() + is, err := extractIssuesFromPatch(diff, lintCtx.Log, lintCtx, gofumptName) + if err != nil { + return nil, errors.Wrapf(err, "can't extract issues from gofumpt diff output %q", diff) + } + + for i := range is { + issues = append(issues, goanalysis.NewIssue(&is[i], pass)) + } + } + } + + if len(issues) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, issues...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goheader.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goheader.go new file mode 100644 index 00000000000..8517e173d3f --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goheader.go @@ -0,0 +1,81 @@ +package golinters + +import ( + "go/token" + "sync" + + goheader "github.com/denis-tingajkin/go-header" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/result" +) + +const goHeaderName = "goheader" + +func NewGoHeader() *goanalysis.Linter { + var mu sync.Mutex + var issues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: goHeaderName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + goHeaderName, + "Checks is file header matches to pattern", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + cfg := lintCtx.Cfg.LintersSettings.Goheader + c := &goheader.Configuration{ + Values: cfg.Values, + Template: cfg.Template, + TemplatePath: cfg.TemplatePath, + } + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + if c.TemplatePath == "" && c.Template == "" { + // User did not pass template, so then do not run go-header linter + return nil, nil + } + template, err := c.GetTemplate() + if err != nil { + return nil, err + } + values, err := c.GetValues() + if err != nil { + return nil, err + } + a := goheader.New(goheader.WithTemplate(template), goheader.WithValues(values)) + var res []goanalysis.Issue + for _, file := range pass.Files { + i := a.Analyze(file) + if i == nil { + continue + } + issue := result.Issue{ + Pos: token.Position{ + Line: i.Location().Line + 1, + Column: i.Location().Position, + Filename: pass.Fset.Position(file.Pos()).Filename, + }, + Text: i.Message(), + FromLinter: goHeaderName, + } + res = append(res, goanalysis.NewIssue(&issue, pass)) + } + if len(res) == 0 { + return nil, nil + } + + mu.Lock() + issues = append(issues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return issues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go index 90e19b0e85d..9ea4558f40c 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go @@ -32,7 +32,7 @@ func NewGoimports() *goanalysis.Linter { analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { var fileNames []string for _, f := range pass.Files { - pos := pass.Fset.Position(f.Pos()) + pos := pass.Fset.PositionFor(f.Pos(), false) fileNames = append(fileNames, pos.Filename) } @@ -47,7 +47,7 @@ func NewGoimports() *goanalysis.Linter { continue } - is, err := extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx, true) + is, err := extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx, goimportsName) if err != nil { return nil, errors.Wrapf(err, "can't extract issues from gofmt diff output %q", string(diff)) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomodguard.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomodguard.go index 29cc3c303ab..1376ad1572b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomodguard.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomodguard.go @@ -30,7 +30,9 @@ func NewGomodguard() *goanalysis.Linter { return goanalysis.NewLinter( gomodguardName, - "Allow and block list linter for direct Go module dependencies.", + "Allow and block list linter for direct Go module dependencies. "+ + "This is different from depguard where there are different block "+ + "types for example version constraints and module recommendations.", []*analysis.Analyzer{analyzer}, nil, ).WithContextSetter(func(lintCtx *linter.Context) { @@ -44,7 +46,7 @@ func NewGomodguard() *goanalysis.Linter { processorCfg.Allowed.Domains = linterCfg.Allowed.Domains for n := range linterCfg.Blocked.Modules { for k, v := range linterCfg.Blocked.Modules[n] { - m := gomodguard.BlockedModule{k: gomodguard.Recommendations{ + m := map[string]gomodguard.BlockedModule{k: { Recommendations: v.Recommendations, Reason: v.Reason, }} @@ -53,8 +55,19 @@ func NewGomodguard() *goanalysis.Linter { } } + for n := range linterCfg.Blocked.Versions { + for k, v := range linterCfg.Blocked.Versions[n] { + m := map[string]gomodguard.BlockedVersion{k: { + Version: v.Version, + Reason: v.Reason, + }} + processorCfg.Blocked.Versions = append(processorCfg.Blocked.Versions, m) + break + } + } + for _, file := range pass.Files { - files = append(files, pass.Fset.Position(file.Pos()).Filename) + files = append(files, pass.Fset.PositionFor(file.Pos(), false).Filename) } processor, err := gomodguard.NewProcessor(processorCfg, log.New(os.Stderr, "", 0)) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go index 974429583b9..08b3e660f8c 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go @@ -8,8 +8,8 @@ import ( "strconv" "sync" - "github.com/securego/gosec" - "github.com/securego/gosec/rules" + "github.com/securego/gosec/v2" + "github.com/securego/gosec/v2/rules" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/packages" diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go index 601252f729a..93c1fb11bbb 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go @@ -31,7 +31,7 @@ func NewIneffassign() *goanalysis.Linter { analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { var fileNames []string for _, f := range pass.Files { - pos := pass.Fset.Position(f.Pos()) + pos := pass.Fset.PositionFor(f.Pos(), false) fileNames = append(fileNames, pos.Filename) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go index c24b4d14814..5f26e91ddbf 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go @@ -92,7 +92,7 @@ func NewLLL() *goanalysis.Linter { analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { var fileNames []string for _, f := range pass.Files { - pos := pass.Fset.Position(f.Pos()) + pos := pass.Fset.PositionFor(f.Pos(), false) fileNames = append(fileNames, pos.Filename) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go index 6cd421e5e93..80ecf9bb668 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go @@ -102,7 +102,7 @@ func NewMisspell() *goanalysis.Linter { var fileNames []string for _, f := range pass.Files { - pos := pass.Fset.Position(f.Pos()) + pos := pass.Fset.PositionFor(f.Pos(), false) fileNames = append(fileNames, pos.Filename) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/nlreturn.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/nlreturn.go new file mode 100644 index 00000000000..3b661c64c83 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/nlreturn.go @@ -0,0 +1,19 @@ +package golinters + +import ( + "github.com/ssgreg/nlreturn/v2/pkg/nlreturn" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewNLReturn() *goanalysis.Linter { + return goanalysis.NewLinter( + "nlreturn", + "nlreturn checks for a new line before return and branch statements to increase code clarity", + []*analysis.Analyzer{ + nlreturn.NewAnalyzer(), + }, + nil, + ).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/noctx.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/noctx.go new file mode 100644 index 00000000000..b5c4a4be240 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/noctx.go @@ -0,0 +1,21 @@ +package golinters + +import ( + "github.com/sonatard/noctx" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewNoctx() *goanalysis.Linter { + analyzers := []*analysis.Analyzer{ + noctx.Analyzer, + } + + return goanalysis.NewLinter( + "noctx", + "noctx finds sending http request without context.Context", + analyzers, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck.go new file mode 100644 index 00000000000..48ca246e70a --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck.go @@ -0,0 +1,21 @@ +package golinters + +import ( + "github.com/ryanrolds/sqlclosecheck/pkg/analyzer" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewSQLCloseCheck() *goanalysis.Linter { + analyzers := []*analysis.Analyzer{ + analyzer.NewAnalyzer(), + } + + return goanalysis.NewLinter( + "sqlclosecheck", + "Checks that sql.Rows and sql.Stmt are closed.", + analyzers, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go index ac5a90d4185..bbe1e4b6903 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go @@ -55,7 +55,10 @@ func NewUnused() *goanalysis.Linter { } return issues }).WithContextSetter(func(lintCtx *linter.Context) { - u.WholeProgram = lintCtx.Settings().Unused.CheckExported + if lintCtx.Settings().Unused.CheckExported { + lintCtx.Log.Infof("Using whole program analysis for unused, it can be memory-heavy") + u.WholeProgram = true + } }).WithLoadMode(goanalysis.LoadModeWholeProgram) lnt.UseOriginalPackages() return lnt diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go index f44d09f245c..ca659ac4e0e 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go @@ -52,7 +52,7 @@ func NewWSL() *goanalysis.Linter { ) for _, file := range pass.Files { - files = append(files, pass.Fset.Position(file.Pos()).Filename) + files = append(files, pass.Fset.PositionFor(file.Pos(), false).Filename) } wslErrors, _ := wsl.NewProcessorWithConfig(processorCfg). diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go index 52ff9b90d43..4ec835254f7 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go @@ -22,9 +22,10 @@ type Config struct { InPresets []string AlternativeNames []string - OriginalURL string // URL of original (not forked) repo, needed for autogenerated README - CanAutoFix bool - IsSlow bool + OriginalURL string // URL of original (not forked) repo, needed for autogenerated README + CanAutoFix bool + IsSlow bool + DoesChangeTypes bool } func (lc *Config) ConsiderSlow() *Config { @@ -67,6 +68,11 @@ func (lc *Config) WithAutoFix() *Config { return lc } +func (lc *Config) WithChangeTypes() *Config { + lc.DoesChangeTypes = true + return lc +} + func (lc *Config) AllNames() []string { return append([]string{lc.Name()}, lc.AlternativeNames...) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go index 73e3bcfed29..eced95f6552 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go @@ -1,7 +1,9 @@ package lintersdb import ( + "os" "sort" + "strings" "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" @@ -28,6 +30,7 @@ func NewEnabledSet(m *Manager, v *Validator, log logutils.Log, cfg *config.Confi } func (es EnabledSet) build(lcfg *config.Linters, enabledByDefaultLinters []*linter.Config) map[string]*linter.Config { + es.debugf("Linters config: %#v", lcfg) resultLintersSet := map[string]*linter.Config{} switch { case len(lcfg.Presets) != 0: @@ -76,22 +79,44 @@ func (es EnabledSet) build(lcfg *config.Linters, enabledByDefaultLinters []*lint return resultLintersSet } -func (es EnabledSet) Get(optimize bool) ([]*linter.Config, error) { +func (es EnabledSet) GetEnabledLintersMap() (map[string]*linter.Config, error) { + if err := es.v.validateEnabledDisabledLintersConfig(&es.cfg.Linters); err != nil { + return nil, err + } + + enabledLinters := es.build(&es.cfg.Linters, es.m.GetAllEnabledByDefaultLinters()) + if os.Getenv("GL_TEST_RUN") == "1" { + es.verbosePrintLintersStatus(enabledLinters) + } + return enabledLinters, nil +} + +// GetOptimizedLinters returns enabled linters after optimization (merging) of multiple linters +// into a fewer number of linters. E.g. some go/analysis linters can be optimized into +// one metalinter for data reuse and speed up. +func (es EnabledSet) GetOptimizedLinters() ([]*linter.Config, error) { if err := es.v.validateEnabledDisabledLintersConfig(&es.cfg.Linters); err != nil { return nil, err } resultLintersSet := es.build(&es.cfg.Linters, es.m.GetAllEnabledByDefaultLinters()) es.verbosePrintLintersStatus(resultLintersSet) - if optimize { - es.combineGoAnalysisLinters(resultLintersSet) - } + es.combineGoAnalysisLinters(resultLintersSet) var resultLinters []*linter.Config for _, lc := range resultLintersSet { resultLinters = append(resultLinters, lc) } + // Make order of execution of linters (go/analysis metalinter and unused) stable. + sort.Slice(resultLinters, func(i, j int) bool { + a, b := resultLinters[i], resultLinters[j] + if a.DoesChangeTypes != b.DoesChangeTypes { + return b.DoesChangeTypes // move type-changing linters to the end to optimize speed + } + return strings.Compare(a.Name(), b.Name()) < 0 + }) + return resultLinters, nil } @@ -122,6 +147,10 @@ func (es EnabledSet) combineGoAnalysisLinters(linters map[string]*linter.Config) delete(linters, lnt.Name()) } + // Make order of execution of go/analysis analyzers stable. + sort.Slice(goanalysisLinters, func(i, j int) bool { + return strings.Compare(goanalysisLinters[i].Name(), goanalysisLinters[j].Name()) <= 0 + }) ml := goanalysis.NewMetaLinter(goanalysisLinters) var presets []string diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go index 492b92256f6..7ffaf9c2e22 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go @@ -87,9 +87,11 @@ func enableLinterConfigs(lcs []*linter.Config, isEnabled func(lc *linter.Config) func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { var govetCfg *config.GovetSettings var testpackageCfg *config.TestpackageSettings + var exhaustiveCfg *config.ExhaustiveSettings if m.cfg != nil { govetCfg = &m.cfg.LintersSettings.Govet testpackageCfg = &m.cfg.LintersSettings.Testpackage + exhaustiveCfg = &m.cfg.LintersSettings.Exhaustive } const megacheckName = "megacheck" lcs := []*linter.Config{ @@ -102,6 +104,10 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithLoadForGoAnalysis(). WithPresets(linter.PresetPerformance, linter.PresetBugs). WithURL("https://github.com/timakin/bodyclose"), + linter.NewConfig(golinters.NewNoctx()). + WithLoadForGoAnalysis(). + WithPresets(linter.PresetPerformance, linter.PresetBugs). + WithURL("https://github.com/sonatard/noctx"), linter.NewConfig(golinters.NewErrcheck()). WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). @@ -125,6 +131,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithPresets(linter.PresetUnused). WithAlternativeNames(megacheckName). ConsiderSlow(). + WithChangeTypes(). WithURL("https://github.com/dominikh/go-tools/tree/master/unused"), linter.NewConfig(golinters.NewGosimple()). WithLoadForGoAnalysis(). @@ -188,10 +195,22 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithPresets(linter.PresetFormatting). WithAutoFix(). WithURL("https://golang.org/cmd/gofmt/"), + linter.NewConfig(golinters.NewGofumpt()). + WithPresets(linter.PresetFormatting). + WithAutoFix(). + WithURL("https://github.com/mvdan/gofumpt"), linter.NewConfig(golinters.NewGoimports()). WithPresets(linter.PresetFormatting). WithAutoFix(). WithURL("https://godoc.org/golang.org/x/tools/cmd/goimports"), + linter.NewConfig(golinters.NewGoHeader()). + WithPresets(linter.PresetStyle). + WithLoadForGoAnalysis(). + WithURL("https://github.com/denis-tingajkin/go-header"), + linter.NewConfig(golinters.NewGci()). + WithLoadForGoAnalysis(). + WithAutoFix(). + WithURL("https://github.com/daixiang0/gci"), linter.NewConfig(golinters.NewMaligned()). WithLoadForGoAnalysis(). WithPresets(linter.PresetPerformance). @@ -254,6 +273,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithURL("https://github.com/tommy-muehle/go-mnd"), linter.NewConfig(golinters.NewGoerr113()). WithPresets(linter.PresetStyle). + WithLoadForGoAnalysis(). WithURL("https://github.com/Djarvur/go-err113"), linter.NewConfig(golinters.NewGomodguard()). WithPresets(linter.PresetStyle). @@ -261,6 +281,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithURL("https://github.com/ryancurrah/gomodguard"), linter.NewConfig(golinters.NewGodot()). WithPresets(linter.PresetStyle). + WithAutoFix(). WithURL("https://github.com/tetafro/godot"), linter.NewConfig(golinters.NewTestpackage(testpackageCfg)). WithPresets(linter.PresetStyle). @@ -269,10 +290,25 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { linter.NewConfig(golinters.NewNestif()). WithPresets(linter.PresetComplexity). WithURL("https://github.com/nakabonne/nestif"), + linter.NewConfig(golinters.NewExportLoopRef()). + WithPresets(linter.PresetBugs). + WithURL("https://github.com/kyoh86/exportloopref"), + linter.NewConfig(golinters.NewExhaustive(exhaustiveCfg)). + WithPresets(linter.PresetBugs). + WithLoadForGoAnalysis(). + WithURL("https://github.com/nishanths/exhaustive"), + linter.NewConfig(golinters.NewSQLCloseCheck()). + WithPresets(linter.PresetBugs). + WithLoadForGoAnalysis(). + WithURL("https://github.com/ryanrolds/sqlclosecheck"), + linter.NewConfig(golinters.NewNLReturn()). + WithPresets(linter.PresetStyle). + WithLoadForGoAnalysis(). + WithURL("https://github.com/ssgreg/nlreturn"), // nolintlint must be last because it looks at the results of all the previous linters for unused nolint directives linter.NewConfig(golinters.NewNoLintLint()). WithPresets(linter.PresetStyle). - WithURL("https://github.com/golangci-lint/pkg/golinters/nolintlint"), + WithURL("https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md"), } isLocalRun := os.Getenv("GOLANGCI_COM_RUN") == "" diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go index d7e3699c851..dead59657ab 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go @@ -22,7 +22,7 @@ func (v Validator) validateLintersNames(cfg *config.Linters) error { allNames = append(allNames, cfg.Disable...) for _, name := range allNames { if v.m.GetLinterConfigs(name) == nil { - return fmt.Errorf("no such linter %q", name) + return fmt.Errorf("no such linter %v, run 'golangci-lint linters' to see the list of supported linters", name) } } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go index de0ab4117c3..3525396bc56 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go @@ -98,6 +98,7 @@ func (cl *ContextLoader) makeBuildFlags() ([]string, error) { if len(cl.cfg.Run.BuildTags) != 0 { // go help build buildFlags = append(buildFlags, "-tags", strings.Join(cl.cfg.Run.BuildTags, " ")) + cl.log.Infof("Using build tags: %v", cl.cfg.Run.BuildTags) } mod := cl.cfg.Run.ModulesDownloadMode @@ -198,7 +199,14 @@ func (cl *ContextLoader) loadPackages(ctx context.Context, loadMode packages.Loa cl.debugf("Built loader args are %s", args) pkgs, err := packages.Load(conf, args...) if err != nil { - return nil, errors.Wrap(err, "failed to load program with go/packages") + return nil, errors.Wrap(err, "failed to load with go/packages") + } + + // Currently, go/packages doesn't guarantee that error will be returned + // if context was canceled. See + // https://github.com/golang/tools/commit/c5cec6710e927457c3c29d6c156415e8539a5111#r39261855 + if ctx.Err() != nil { + return nil, errors.Wrap(ctx.Err(), "timed out to load packages") } if loadMode&packages.NeedSyntax == 0 { @@ -279,7 +287,7 @@ func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*l loadMode := cl.findLoadMode(linters) pkgs, err := cl.loadPackages(ctx, loadMode) if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed to load packages") } deduplicatedPkgs := cl.filterDuplicatePackages(pkgs) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go index e8f427e0214..084912226b6 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go @@ -7,6 +7,8 @@ import ( "runtime/debug" "strings" + "github.com/pkg/errors" + "github.com/golangci/golangci-lint/internal/errorutil" "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/fsutils" @@ -27,26 +29,8 @@ type Runner struct { Log logutils.Log } -func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, +func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, es *lintersdb.EnabledSet, lineCache *fsutils.LineCache, dbManager *lintersdb.Manager, pkgs []*gopackages.Package) (*Runner, error) { - icfg := cfg.Issues - excludePatterns := icfg.ExcludePatterns - if icfg.UseDefaultExcludes { - excludePatterns = append(excludePatterns, config.GetExcludePatternsStrings(icfg.IncludeDefaultExcludes)...) - } - - var excludeTotalPattern string - if len(excludePatterns) != 0 { - excludeTotalPattern = fmt.Sprintf("(%s)", strings.Join(excludePatterns, "|")) - } - - var excludeProcessor processors.Processor - if cfg.Issues.ExcludeCaseSensitive { - excludeProcessor = processors.NewExcludeCaseSensitive(excludeTotalPattern) - } else { - excludeProcessor = processors.NewExclude(excludeTotalPattern) - } - skipFilesProcessor, err := processors.NewSkipFiles(cfg.Run.SkipFiles) if err != nil { return nil, err @@ -61,27 +45,9 @@ func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, return nil, err } - var excludeRules []processors.ExcludeRule - for _, r := range icfg.ExcludeRules { - excludeRules = append(excludeRules, processors.ExcludeRule{ - Text: r.Text, - Source: r.Source, - Path: r.Path, - Linters: r.Linters, - }) - } - var excludeRulesProcessor processors.Processor - if cfg.Issues.ExcludeCaseSensitive { - excludeRulesProcessor = processors.NewExcludeRulesCaseSensitive(excludeRules, lineCache, log.Child("exclude_rules")) - } else { - excludeRulesProcessor = processors.NewExcludeRules(excludeRules, lineCache, log.Child("exclude_rules")) - } - - enabledLintersSet := lintersdb.NewEnabledSet(dbManager, - lintersdb.NewValidator(dbManager), log.Child("enabledLinters"), cfg) - lcs, err := enabledLintersSet.Get(false) + enabledLinters, err := es.GetEnabledLintersMap() if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed to get enabled linters") } return &Runner{ @@ -101,17 +67,20 @@ func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, // Must be before exclude because users see already marked output and configure excluding by it. processors.NewIdentifierMarker(), - excludeProcessor, - excludeRulesProcessor, - processors.NewNolint(log.Child("nolint"), dbManager, lcs), + getExcludeProcessor(&cfg.Issues), + getExcludeRulesProcessor(&cfg.Issues, log, lineCache), + processors.NewNolint(log.Child("nolint"), dbManager, enabledLinters), processors.NewUniqByLine(cfg), - processors.NewDiff(icfg.Diff, icfg.DiffFromRevision, icfg.DiffPatchFilePath), + processors.NewDiff(cfg.Issues.Diff, cfg.Issues.DiffFromRevision, cfg.Issues.DiffPatchFilePath), processors.NewMaxPerFileFromLinter(cfg), - processors.NewMaxSameIssues(icfg.MaxSameIssues, log.Child("max_same_issues"), cfg), - processors.NewMaxFromLinter(icfg.MaxIssuesPerLinter, log.Child("max_from_linter"), cfg), + processors.NewMaxSameIssues(cfg.Issues.MaxSameIssues, log.Child("max_same_issues"), cfg), + processors.NewMaxFromLinter(cfg.Issues.MaxIssuesPerLinter, log.Child("max_from_linter"), cfg), processors.NewSourceCode(lineCache, log.Child("source_code")), processors.NewPathShortener(), + getSeverityRulesProcessor(&cfg.Severity, log, lineCache), + processors.NewPathPrefixer(cfg.Output.PathPrefix), + processors.NewSortResults(cfg), }, Log: log, }, nil @@ -131,14 +100,17 @@ func (r *Runner) runLinterSafe(ctx context.Context, lintCtx *linter.Context, } }() - specificLintCtx := *lintCtx - specificLintCtx.Log = r.Log.Child(lc.Name()) + issues, err := lc.Linter.Run(ctx, lintCtx) + + if lc.DoesChangeTypes { + // Packages in lintCtx might be dirty due to the last analysis, + // which affects to the next analysis. + // To avoid this issue, we clear type information from the packages. + // See https://github.com/golangci/golangci-lint/pull/944. + // Currently DoesChangeTypes is true only for `unused`. + lintCtx.ClearTypesInPackages() + } - // Packages in lintCtx might be dirty due to the last analysis, - // which affects to the next analysis. - // To avoid this issue, we clear type information from the packages. - specificLintCtx.ClearTypesInPackages() - issues, err := lc.Linter.Run(ctx, &specificLintCtx) if err != nil { return nil, err } @@ -251,3 +223,89 @@ func (r *Runner) processIssues(issues []result.Issue, sw *timeutils.Stopwatch, s return issues } + +func getExcludeProcessor(cfg *config.Issues) processors.Processor { + excludePatterns := cfg.ExcludePatterns + if cfg.UseDefaultExcludes { + excludePatterns = append(excludePatterns, config.GetExcludePatternsStrings(cfg.IncludeDefaultExcludes)...) + } + + var excludeTotalPattern string + if len(excludePatterns) != 0 { + excludeTotalPattern = fmt.Sprintf("(%s)", strings.Join(excludePatterns, "|")) + } + + var excludeProcessor processors.Processor + if cfg.ExcludeCaseSensitive { + excludeProcessor = processors.NewExcludeCaseSensitive(excludeTotalPattern) + } else { + excludeProcessor = processors.NewExclude(excludeTotalPattern) + } + + return excludeProcessor +} + +func getExcludeRulesProcessor(cfg *config.Issues, log logutils.Log, lineCache *fsutils.LineCache) processors.Processor { + var excludeRules []processors.ExcludeRule + for _, r := range cfg.ExcludeRules { + excludeRules = append(excludeRules, processors.ExcludeRule{ + BaseRule: processors.BaseRule{ + Text: r.Text, + Source: r.Source, + Path: r.Path, + Linters: r.Linters, + }, + }) + } + + var excludeRulesProcessor processors.Processor + if cfg.ExcludeCaseSensitive { + excludeRulesProcessor = processors.NewExcludeRulesCaseSensitive( + excludeRules, + lineCache, + log.Child("exclude_rules"), + ) + } else { + excludeRulesProcessor = processors.NewExcludeRules( + excludeRules, + lineCache, + log.Child("exclude_rules"), + ) + } + + return excludeRulesProcessor +} + +func getSeverityRulesProcessor(cfg *config.Severity, log logutils.Log, lineCache *fsutils.LineCache) processors.Processor { + var severityRules []processors.SeverityRule + for _, r := range cfg.Rules { + severityRules = append(severityRules, processors.SeverityRule{ + Severity: r.Severity, + BaseRule: processors.BaseRule{ + Text: r.Text, + Source: r.Source, + Path: r.Path, + Linters: r.Linters, + }, + }) + } + + var severityRulesProcessor processors.Processor + if cfg.CaseSensitive { + severityRulesProcessor = processors.NewSeverityRulesCaseSensitive( + cfg.Default, + severityRules, + lineCache, + log.Child("severity_rules"), + ) + } else { + severityRulesProcessor = processors.NewSeverityRules( + cfg.Default, + severityRules, + lineCache, + log.Child("severity_rules"), + ) + } + + return severityRulesProcessor +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go index f36bc108adc..c5b948a98d2 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go @@ -5,6 +5,8 @@ import ( "encoding/xml" "fmt" + "github.com/go-xmlfmt/xmlfmt" + "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" ) @@ -28,7 +30,7 @@ type checkstyleError struct { Source string `xml:"source,attr"` } -const defaultSeverity = "error" +const defaultCheckstyleSeverity = "error" type Checkstyle struct{} @@ -54,12 +56,17 @@ func (Checkstyle) Print(ctx context.Context, issues []result.Issue) error { files[issue.FilePath()] = file } + severity := defaultCheckstyleSeverity + if issue.Severity != "" { + severity = issue.Severity + } + newError := &checkstyleError{ Column: issue.Column(), Line: issue.Line(), Message: issue.Text, Source: issue.FromLinter, - Severity: defaultSeverity, + Severity: severity, } file.Errors = append(file.Errors, newError) @@ -75,6 +82,6 @@ func (Checkstyle) Print(ctx context.Context, issues []result.Issue) error { return err } - fmt.Fprintf(logutils.StdOut, "%s%s\n", xml.Header, data) + fmt.Fprintf(logutils.StdOut, "%s%s\n", xml.Header, xmlfmt.FormatXML(string(data), "", " ")) return nil } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go index 26878056884..35a22ce99a7 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go @@ -2,7 +2,6 @@ package printers import ( "context" - "crypto/md5" //nolint:gosec "encoding/json" "fmt" @@ -14,6 +13,7 @@ import ( // It is just enough to support GitLab CI Code Quality - https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html type CodeClimateIssue struct { Description string `json:"description"` + Severity string `json:"severity,omitempty"` Fingerprint string `json:"fingerprint"` Location struct { Path string `json:"path"` @@ -31,23 +31,23 @@ func NewCodeClimate() *CodeClimate { } func (p CodeClimate) Print(ctx context.Context, issues []result.Issue) error { - allIssues := []CodeClimateIssue{} - for ind := range issues { - i := &issues[ind] - var issue CodeClimateIssue - issue.Description = i.FromLinter + ": " + i.Text - issue.Location.Path = i.Pos.Filename - issue.Location.Lines.Begin = i.Pos.Line - - // Need a checksum of the issue, so we use MD5 of the filename, text, and first line of source - hash := md5.New() //nolint:gosec - _, _ = hash.Write([]byte(i.Pos.Filename + i.Text + i.SourceLines[0])) - issue.Fingerprint = fmt.Sprintf("%X", hash.Sum(nil)) - - allIssues = append(allIssues, issue) + codeClimateIssues := []CodeClimateIssue{} + for i := range issues { + issue := &issues[i] + codeClimateIssue := CodeClimateIssue{} + codeClimateIssue.Description = issue.Description() + codeClimateIssue.Location.Path = issue.Pos.Filename + codeClimateIssue.Location.Lines.Begin = issue.Pos.Line + codeClimateIssue.Fingerprint = issue.Fingerprint() + + if issue.Severity != "" { + codeClimateIssue.Severity = issue.Severity + } + + codeClimateIssues = append(codeClimateIssues, codeClimateIssue) } - outputJSON, err := json.Marshal(allIssues) + outputJSON, err := json.Marshal(codeClimateIssues) if err != nil { return err } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/github.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/github.go index fa11a2839a3..b8d70140a80 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/github.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/github.go @@ -11,6 +11,8 @@ import ( type github struct { } +const defaultGithubSeverity = "error" + // Github output format outputs issues according to Github actions format: // https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message func NewGithub() Printer { @@ -19,7 +21,12 @@ func NewGithub() Printer { // print each line as: ::error file=app.js,line=10,col=15::Something went wrong func formatIssueAsGithub(issue *result.Issue) string { - ret := fmt.Sprintf("::error file=%s,line=%d", issue.FilePath(), issue.Line()) + severity := defaultGithubSeverity + if issue.Severity != "" { + severity = issue.Severity + } + + ret := fmt.Sprintf("::%s file=%s,line=%d", severity, issue.FilePath(), issue.Line()) if issue.Pos.Column != 0 { ret += fmt.Sprintf(",col=%d", issue.Pos.Column) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go index b3d4280961c..9277cd66f2f 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go @@ -17,6 +17,9 @@ type testSuitesXML struct { type testSuiteXML struct { XMLName xml.Name `xml:"testsuite"` Suite string `xml:"name,attr"` + Tests int `xml:"tests,attr"` + Errors int `xml:"errors,attr"` + Failures int `xml:"failures,attr"` TestCases []testCaseXML `xml:"testcase"` } @@ -46,6 +49,8 @@ func (JunitXML) Print(ctx context.Context, issues []result.Issue) error { suiteName := i.FilePath() testSuite := suites[suiteName] testSuite.Suite = i.FilePath() + testSuite.Tests++ + testSuite.Failures++ tc := testCaseXML{ Name: i.FromLinter, diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go b/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go index 16d9a8a8c19..eafdbc4a958 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go @@ -1,6 +1,8 @@ package result import ( + "crypto/md5" //nolint:gosec + "fmt" "go/token" "golang.org/x/tools/go/packages" @@ -26,6 +28,8 @@ type Issue struct { FromLinter string Text string + Severity string + // Source lines of a code with the issue to show SourceLines []string @@ -76,3 +80,19 @@ func (i *Issue) GetLineRange() Range { return *i.LineRange } + +func (i *Issue) Description() string { + return fmt.Sprintf("%s: %s", i.FromLinter, i.Text) +} + +func (i *Issue) Fingerprint() string { + firstLine := "" + if len(i.SourceLines) > 0 { + firstLine = i.SourceLines[0] + } + + hash := md5.New() //nolint:gosec + _, _ = hash.Write([]byte(fmt.Sprintf("%s%s%s", i.Pos.Filename, i.Text, firstLine))) + + return fmt.Sprintf("%X", hash.Sum(nil)) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go index 249ba9d4437..112217952e7 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go @@ -1,9 +1,9 @@ package processors import ( - "bufio" "fmt" - "os" + "go/parser" + "go/token" "path/filepath" "strings" @@ -113,37 +113,15 @@ func (p *AutogeneratedExclude) getOrCreateFileSummary(i *result.Issue) (*ageFile } func getDoc(filePath string) (string, error) { - file, err := os.Open(filePath) + fset := token.NewFileSet() + syntax, err := parser.ParseFile(fset, filePath, nil, parser.PackageClauseOnly|parser.ParseComments) if err != nil { - return "", errors.Wrap(err, "failed to open file") + return "", errors.Wrap(err, "failed to parse file") } - defer file.Close() - - scanner := bufio.NewScanner(file) - - // Issue 954: Some lines can be very long, e.g. auto-generated - // embedded resources. Reported on file of 86.2KB. - const ( - maxSize = 10 * 1024 * 1024 // 10MB should be enough - initialSize = 4096 // same as startBufSize in bufio - ) - scanner.Buffer(make([]byte, initialSize), maxSize) var docLines []string - for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) - if strings.HasPrefix(line, "//") { - text := strings.TrimSpace(strings.TrimPrefix(line, "//")) - docLines = append(docLines, text) - } else if line == "" || strings.HasPrefix(line, "package") { - // go to next line - } else { - break - } - } - - if err := scanner.Err(); err != nil { - return "", errors.Wrap(err, "failed to scan file") + for _, c := range syntax.Comments { + docLines = append(docLines, strings.TrimSpace(c.Text())) } return strings.Join(docLines, "\n"), nil diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/base_rule.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/base_rule.go new file mode 100644 index 00000000000..b6ce4f2159e --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/base_rule.go @@ -0,0 +1,69 @@ +package processors + +import ( + "regexp" + + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/result" +) + +type BaseRule struct { + Text string + Source string + Path string + Linters []string +} + +type baseRule struct { + text *regexp.Regexp + source *regexp.Regexp + path *regexp.Regexp + linters []string +} + +func (r *baseRule) isEmpty() bool { + return r.text == nil && r.source == nil && r.path == nil && len(r.linters) == 0 +} + +func (r *baseRule) match(issue *result.Issue, lineCache *fsutils.LineCache, log logutils.Log) bool { + if r.isEmpty() { + return false + } + if r.text != nil && !r.text.MatchString(issue.Text) { + return false + } + if r.path != nil && !r.path.MatchString(issue.FilePath()) { + return false + } + if len(r.linters) != 0 && !r.matchLinter(issue) { + return false + } + + // the most heavyweight checking last + if r.source != nil && !r.matchSource(issue, lineCache, log) { + return false + } + + return true +} + +func (r *baseRule) matchLinter(issue *result.Issue) bool { + for _, linter := range r.linters { + if linter == issue.FromLinter { + return true + } + } + + return false +} + +func (r *baseRule) matchSource(issue *result.Issue, lineCache *fsutils.LineCache, log logutils.Log) bool { // nolint:interfacer + sourceLine, errSourceLine := lineCache.GetLine(issue.FilePath(), issue.Line()) + if errSourceLine != nil { + log.Warnf("Failed to get line %s:%d from line cache: %s", issue.FilePath(), issue.Line(), errSourceLine) + return false // can't properly match + } + + return r.source.MatchString(sourceLine) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go index b926af5b1d4..d4d6569f4ce 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go @@ -9,21 +9,11 @@ import ( ) type excludeRule struct { - text *regexp.Regexp - source *regexp.Regexp - path *regexp.Regexp - linters []string -} - -func (r *excludeRule) isEmpty() bool { - return r.text == nil && r.path == nil && len(r.linters) == 0 + baseRule } type ExcludeRule struct { - Text string - Source string - Path string - Linters []string + BaseRule } type ExcludeRules struct { @@ -45,9 +35,8 @@ func NewExcludeRules(rules []ExcludeRule, lineCache *fsutils.LineCache, log logu func createRules(rules []ExcludeRule, prefix string) []excludeRule { parsedRules := make([]excludeRule, 0, len(rules)) for _, rule := range rules { - parsedRule := excludeRule{ - linters: rule.Linters, - } + parsedRule := excludeRule{} + parsedRule.linters = rule.Linters if rule.Text != "" { parsedRule.text = regexp.MustCompile(prefix + rule.Text) } @@ -69,7 +58,7 @@ func (p ExcludeRules) Process(issues []result.Issue) ([]result.Issue, error) { return filterIssues(issues, func(i *result.Issue) bool { for _, rule := range p.rules { rule := rule - if p.match(i, &rule) { + if rule.match(i, p.lineCache, p.log) { return false } } @@ -77,48 +66,6 @@ func (p ExcludeRules) Process(issues []result.Issue) ([]result.Issue, error) { }), nil } -func (p ExcludeRules) matchLinter(i *result.Issue, r *excludeRule) bool { - for _, linter := range r.linters { - if linter == i.FromLinter { - return true - } - } - - return false -} - -func (p ExcludeRules) matchSource(i *result.Issue, r *excludeRule) bool { //nolint:interfacer - sourceLine, err := p.lineCache.GetLine(i.FilePath(), i.Line()) - if err != nil { - p.log.Warnf("Failed to get line %s:%d from line cache: %s", i.FilePath(), i.Line(), err) - return false // can't properly match - } - - return r.source.MatchString(sourceLine) -} - -func (p ExcludeRules) match(i *result.Issue, r *excludeRule) bool { - if r.isEmpty() { - return false - } - if r.text != nil && !r.text.MatchString(i.Text) { - return false - } - if r.path != nil && !r.path.MatchString(i.FilePath()) { - return false - } - if len(r.linters) != 0 && !p.matchLinter(i, r) { - return false - } - - // the most heavyweight checking last - if r.source != nil && !p.matchSource(i, r) { - return false - } - - return true -} - func (ExcludeRules) Name() string { return "exclude-rules" } func (ExcludeRules) Finish() {} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go index 5e692ceba2e..96540245b36 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go @@ -16,6 +16,11 @@ import ( type posMapper func(pos token.Position) token.Position +type adjustMap struct { + sync.Mutex + m map[string]posMapper +} + // FilenameUnadjuster is needed because a lot of linters use fset.Position(f.Pos()) // to get filename. And they return adjusted filename (e.g. *.qtpl) for an issue. We need // restore real .go filename to properly output it, parse it, etc. @@ -27,7 +32,7 @@ type FilenameUnadjuster struct { var _ Processor = &FilenameUnadjuster{} -func processUnadjusterPkg(m map[string]posMapper, pkg *packages.Package, log logutils.Log) { +func processUnadjusterPkg(m *adjustMap, pkg *packages.Package, log logutils.Log) { fset := token.NewFileSet() // it's more memory efficient to not store all in one fset for _, filename := range pkg.CompiledGoFiles { @@ -36,7 +41,7 @@ func processUnadjusterPkg(m map[string]posMapper, pkg *packages.Package, log log } } -func processUnadjusterFile(filename string, m map[string]posMapper, log logutils.Log, fset *token.FileSet) { +func processUnadjusterFile(filename string, m *adjustMap, log logutils.Log, fset *token.FileSet) { syntax, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) if err != nil { // Error will be reported by typecheck @@ -57,7 +62,9 @@ func processUnadjusterFile(filename string, m map[string]posMapper, log logutils return // file.go -> /caches/cgo-xxx } - m[adjustedFilename] = func(adjustedPos token.Position) token.Position { + m.Lock() + defer m.Unlock() + m.m[adjustedFilename] = func(adjustedPos token.Position) token.Position { tokenFile := fset.File(syntax.Pos()) if tokenFile == nil { log.Warnf("Failed to get token file for %s", adjustedFilename) @@ -68,22 +75,23 @@ func processUnadjusterFile(filename string, m map[string]posMapper, log logutils } func NewFilenameUnadjuster(pkgs []*packages.Package, log logutils.Log) *FilenameUnadjuster { - m := map[string]posMapper{} + m := adjustMap{m: map[string]posMapper{}} + startedAt := time.Now() var wg sync.WaitGroup wg.Add(len(pkgs)) for _, pkg := range pkgs { go func(pkg *packages.Package) { // It's important to call func here to run GC - processUnadjusterPkg(m, pkg, log) + processUnadjusterPkg(&m, pkg, log) wg.Done() }(pkg) } wg.Wait() - log.Infof("Pre-built %d adjustments in %s", len(m), time.Since(startedAt)) + log.Infof("Pre-built %d adjustments in %s", len(m.m), time.Since(startedAt)) return &FilenameUnadjuster{ - m: m, + m: m.m, log: log, loggedUnadjustments: map[string]bool{}, } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go index 2f1e48db4e9..cda1017849d 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go @@ -60,18 +60,13 @@ type filesCache map[string]*fileData type Nolint struct { cache filesCache dbManager *lintersdb.Manager - enabledLinters map[string]bool + enabledLinters map[string]*linter.Config log logutils.Log unknownLintersSet map[string]bool } -func NewNolint(log logutils.Log, dbManager *lintersdb.Manager, enabledLCs []*linter.Config) *Nolint { - enabledLinters := make(map[string]bool, len(enabledLCs)) - for _, lc := range enabledLCs { - enabledLinters[lc.Name()] = true - } - +func NewNolint(log logutils.Log, dbManager *lintersdb.Manager, enabledLinters map[string]*linter.Config) *Nolint { return &Nolint{ cache: filesCache{}, dbManager: dbManager, @@ -154,7 +149,7 @@ func (p *Nolint) shouldPassIssue(i *result.Issue) (bool, error) { if i.ExpectedNoLintLinter != "" { // don't expect disabled linters to cover their nolint statements nolintDebugf("enabled linters: %v", p.enabledLinters) - if !p.enabledLinters[i.ExpectedNoLintLinter] { + if p.enabledLinters[i.ExpectedNoLintLinter] == nil { return false, nil } nolintDebugf("checking that lint issue was used for %s: %v", i.ExpectedNoLintLinter, i) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/path_prefixer.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/path_prefixer.go new file mode 100644 index 00000000000..5ce940b39bf --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/path_prefixer.go @@ -0,0 +1,37 @@ +package processors + +import ( + "path" + + "github.com/golangci/golangci-lint/pkg/result" +) + +// PathPrefixer adds a customizable prefix to every output path +type PathPrefixer struct { + prefix string +} + +var _ Processor = new(PathPrefixer) + +// NewPathPrefixer returns a new path prefixer for the provided string +func NewPathPrefixer(prefix string) *PathPrefixer { + return &PathPrefixer{prefix: prefix} +} + +// Name returns the name of this processor +func (*PathPrefixer) Name() string { + return "path_prefixer" +} + +// Process adds the prefix to each path +func (p *PathPrefixer) Process(issues []result.Issue) ([]result.Issue, error) { + if p.prefix != "" { + for i := range issues { + issues[i].Pos.Filename = path.Join(p.prefix, issues[i].Pos.Filename) + } + } + return issues, nil +} + +// Finish is implemented to satisfy the Processor interface +func (*PathPrefixer) Finish() {} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/severity_rules.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/severity_rules.go new file mode 100644 index 00000000000..5f11b54101c --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/severity_rules.go @@ -0,0 +1,103 @@ +package processors + +import ( + "regexp" + + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/result" +) + +type severityRule struct { + baseRule + severity string +} + +type SeverityRule struct { + BaseRule + Severity string +} + +type SeverityRules struct { + defaultSeverity string + rules []severityRule + lineCache *fsutils.LineCache + log logutils.Log +} + +func NewSeverityRules(defaultSeverity string, rules []SeverityRule, lineCache *fsutils.LineCache, log logutils.Log) *SeverityRules { + r := &SeverityRules{ + lineCache: lineCache, + log: log, + defaultSeverity: defaultSeverity, + } + r.rules = createSeverityRules(rules, "(?i)") + + return r +} + +func createSeverityRules(rules []SeverityRule, prefix string) []severityRule { + parsedRules := make([]severityRule, 0, len(rules)) + for _, rule := range rules { + parsedRule := severityRule{} + parsedRule.linters = rule.Linters + parsedRule.severity = rule.Severity + if rule.Text != "" { + parsedRule.text = regexp.MustCompile(prefix + rule.Text) + } + if rule.Source != "" { + parsedRule.source = regexp.MustCompile(prefix + rule.Source) + } + if rule.Path != "" { + parsedRule.path = regexp.MustCompile(rule.Path) + } + parsedRules = append(parsedRules, parsedRule) + } + return parsedRules +} + +func (p SeverityRules) Process(issues []result.Issue) ([]result.Issue, error) { + if len(p.rules) == 0 { + return issues, nil + } + return transformIssues(issues, func(i *result.Issue) *result.Issue { + for _, rule := range p.rules { + rule := rule + + ruleSeverity := p.defaultSeverity + if rule.severity != "" { + ruleSeverity = rule.severity + } + + if rule.match(i, p.lineCache, p.log) { + i.Severity = ruleSeverity + return i + } + } + i.Severity = p.defaultSeverity + return i + }), nil +} + +func (SeverityRules) Name() string { return "severity-rules" } +func (SeverityRules) Finish() {} + +var _ Processor = SeverityRules{} + +type SeverityRulesCaseSensitive struct { + *SeverityRules +} + +func NewSeverityRulesCaseSensitive(defaultSeverity string, rules []SeverityRule, + lineCache *fsutils.LineCache, log logutils.Log) *SeverityRulesCaseSensitive { + r := &SeverityRules{ + lineCache: lineCache, + log: log, + defaultSeverity: defaultSeverity, + } + r.rules = createSeverityRules(rules, "") + + return &SeverityRulesCaseSensitive{r} +} + +func (SeverityRulesCaseSensitive) Name() string { return "severity-rules-case-sensitive" } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_dirs.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_dirs.go index 5107814f0db..6488c109ecf 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_dirs.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_dirs.go @@ -31,6 +31,7 @@ const goFileSuffix = ".go" func NewSkipDirs(patterns []string, log logutils.Log, runArgs []string) (*SkipDirs, error) { var patternsRe []*regexp.Regexp for _, p := range patterns { + p = normalizePathInRegex(p) patternRe, err := regexp.Compile(p) if err != nil { return nil, errors.Wrapf(err, "can't compile regexp %q", p) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_files.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_files.go index 92fd1a29be3..522b07e4f25 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_files.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_files.go @@ -16,6 +16,7 @@ var _ Processor = SkipFiles{} func NewSkipFiles(patterns []string) (*SkipFiles, error) { var patternsRe []*regexp.Regexp for _, p := range patterns { + p = normalizePathInRegex(p) patternRe, err := regexp.Compile(p) if err != nil { return nil, fmt.Errorf("can't compile regexp %q: %s", p, err) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/sort_results.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/sort_results.go new file mode 100644 index 00000000000..e726c3adfe0 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/sort_results.go @@ -0,0 +1,173 @@ +package processors + +import ( + "sort" + "strings" + + "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/result" +) + +// Base propose of this functionality to sort results (issues) +// produced by various linters by analyzing code. We achieving this +// by sorting results.Issues using processor step, and chain based +// rules that can compare different properties of the Issues struct. + +var _ Processor = (*SortResults)(nil) + +type SortResults struct { + cmp comparator + cfg *config.Config +} + +func NewSortResults(cfg *config.Config) *SortResults { + // For sorting we are comparing (in next order): file names, line numbers, + // position, and finally - giving up. + return &SortResults{ + cmp: ByName{ + next: ByLine{ + next: ByColumn{}, + }, + }, + cfg: cfg, + } +} + +// Process is performing sorting of the result issues. +func (sr SortResults) Process(issues []result.Issue) ([]result.Issue, error) { + if !sr.cfg.Output.SortResults { + return issues, nil + } + + sort.Slice(issues, func(i, j int) bool { + return sr.cmp.Compare(&issues[i], &issues[j]) == Less + }) + + return issues, nil +} + +func (sr SortResults) Name() string { return "sort_results" } +func (sr SortResults) Finish() {} + +type compareResult int + +const ( + Less compareResult = iota - 1 + Equal + Greater + None +) + +func (c compareResult) isNeutral() bool { + // return true if compare result is incomparable or equal. + return c == None || c == Equal +} + +//nolint:exhaustive +func (c compareResult) String() string { + switch c { + case Less: + return "Less" + case Equal: + return "Equal" + case Greater: + return "Greater" + } + + return "None" +} + +// comparator describe how to implement compare for two "issues" lexicographically +type comparator interface { + Compare(a, b *result.Issue) compareResult + Next() comparator +} + +var ( + _ comparator = (*ByName)(nil) + _ comparator = (*ByLine)(nil) + _ comparator = (*ByColumn)(nil) +) + +type ByName struct{ next comparator } + +//nolint:golint +func (cmp ByName) Next() comparator { return cmp.next } + +//nolint:golint +func (cmp ByName) Compare(a, b *result.Issue) compareResult { + var res compareResult + + if res = compareResult(strings.Compare(a.FilePath(), b.FilePath())); !res.isNeutral() { + return res + } + + if next := cmp.Next(); next != nil { + return next.Compare(a, b) + } + + return res +} + +type ByLine struct{ next comparator } + +//nolint:golint +func (cmp ByLine) Next() comparator { return cmp.next } + +//nolint:golint +func (cmp ByLine) Compare(a, b *result.Issue) compareResult { + var res compareResult + + if res = numericCompare(a.Line(), b.Line()); !res.isNeutral() { + return res + } + + if next := cmp.Next(); next != nil { + return next.Compare(a, b) + } + + return res +} + +type ByColumn struct{ next comparator } + +//nolint:golint +func (cmp ByColumn) Next() comparator { return cmp.next } + +//nolint:golint +func (cmp ByColumn) Compare(a, b *result.Issue) compareResult { + var res compareResult + + if res = numericCompare(a.Column(), b.Column()); !res.isNeutral() { + return res + } + + if next := cmp.Next(); next != nil { + return next.Compare(a, b) + } + + return res +} + +func numericCompare(a, b int) compareResult { + var ( + isValuesInvalid = a < 0 || b < 0 + isZeroValuesBoth = a == 0 && b == 0 + isEqual = a == b + isZeroValueInA = b > 0 && a == 0 + isZeroValueInB = a > 0 && b == 0 + ) + + switch { + case isZeroValuesBoth || isEqual: + return Equal + case isValuesInvalid || isZeroValueInA || isZeroValueInB: + return None + case a > b: + return Greater + case a < b: + return Less + } + + return Equal +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go index 8bc3d847d65..7108fd3b3c2 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go @@ -1,6 +1,10 @@ package processors import ( + "path/filepath" + "regexp" + "strings" + "github.com/pkg/errors" "github.com/golangci/golangci-lint/pkg/result" @@ -44,3 +48,15 @@ func transformIssues(issues []result.Issue, transform func(i *result.Issue) *res return retIssues } + +var separatorToReplace = regexp.QuoteMeta(string(filepath.Separator)) + +func normalizePathInRegex(path string) string { + if filepath.Separator == '/' { + return path + } + + // This replacing should be safe because "/" are disallowed in Windows + // https://docs.microsoft.com/ru-ru/windows/win32/fileio/naming-a-file + return strings.ReplaceAll(path, "/", separatorToReplace) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/sliceutil/sliceutil.go b/vendor/github.com/golangci/golangci-lint/pkg/sliceutil/sliceutil.go new file mode 100644 index 00000000000..cb89e34e0c3 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/sliceutil/sliceutil.go @@ -0,0 +1,17 @@ +package sliceutil + +// IndexOf get the index of the given value in the given string slice, +// or -1 if not found. +func IndexOf(slice []string, value string) int { + for i, v := range slice { + if v == value { + return i + } + } + return -1 +} + +// Contains check if a string slice contains a value. +func Contains(slice []string, value string) bool { + return IndexOf(slice, value) != -1 +} diff --git a/vendor/github.com/golangci/revgrep/revgrep.go b/vendor/github.com/golangci/revgrep/revgrep.go index 1a56dcf4ec9..3650d646ab1 100644 --- a/vendor/github.com/golangci/revgrep/revgrep.go +++ b/vendor/github.com/golangci/revgrep/revgrep.go @@ -80,6 +80,7 @@ func (c *Checker) preparePatch() error { return nil } +// InputIssue represents issue found by some linter type InputIssue interface { FilePath() string Line() int @@ -98,12 +99,14 @@ func (i simpleInputIssue) Line() int { return i.lineNumber } +// Prepare extracts a patch and changed lines func (c *Checker) Prepare() error { returnErr := c.preparePatch() c.changes = c.linesChanged() return returnErr } +// IsNewIssue checks whether issue found by linter is new: it was found in changed lines func (c Checker) IsNewIssue(i InputIssue) (hunkPos int, isNew bool) { fchanges, ok := c.changes[i.FilePath()] if !ok { // file wasn't changed @@ -116,7 +119,7 @@ func (c Checker) IsNewIssue(i InputIssue) (hunkPos int, isNew bool) { ) // found file, see if lines matched for _, pos := range fchanges { - if pos.lineNo == int(i.Line()) { + if pos.lineNo == i.Line() { fpos = pos changed = true break @@ -338,7 +341,7 @@ func GitPatch(revisionFrom, revisionTo string) (io.Reader, []string, error) { // make a patch for untracked files var newFiles []string - ls, err := exec.Command("git", "ls-files", "-o").CombinedOutput() + ls, err := exec.Command("git", "ls-files", "--others", "--exclude-standard").CombinedOutput() if err != nil { return nil, nil, fmt.Errorf("error executing git ls-files: %s", err) } diff --git a/vendor/github.com/google/go-cmp/cmp/compare.go b/vendor/github.com/google/go-cmp/cmp/compare.go index c9a63ceda5e..6656186846e 100644 --- a/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/vendor/github.com/google/go-cmp/cmp/compare.go @@ -6,6 +6,10 @@ // // This package is intended to be a more powerful and safer alternative to // reflect.DeepEqual for comparing whether two values are semantically equal. +// It is intended to only be used in tests, as performance is not a goal and +// it may panic if it cannot compare the values. Its propensity towards +// panicking means that its unsuitable for production environments where a +// spurious panic may be fatal. // // The primary features of cmp are: // @@ -86,6 +90,52 @@ import ( // If there is a cycle, then the pointed at values are considered equal // only if both addresses were previously visited in the same path step. func Equal(x, y interface{}, opts ...Option) bool { + s := newState(opts) + s.compareAny(rootStep(x, y)) + return s.result.Equal() +} + +// Diff returns a human-readable report of the differences between two values: +// y - x. It returns an empty string if and only if Equal returns true for the +// same input values and options. +// +// The output is displayed as a literal in pseudo-Go syntax. +// At the start of each line, a "-" prefix indicates an element removed from y, +// a "+" prefix to indicates an element added to y, and the lack of a prefix +// indicates an element common to both x and y. If possible, the output +// uses fmt.Stringer.String or error.Error methods to produce more humanly +// readable outputs. In such cases, the string is prefixed with either an +// 's' or 'e' character, respectively, to indicate that the method was called. +// +// Do not depend on this output being stable. If you need the ability to +// programmatically interpret the difference, consider using a custom Reporter. +func Diff(x, y interface{}, opts ...Option) string { + s := newState(opts) + + // Optimization: If there are no other reporters, we can optimize for the + // common case where the result is equal (and thus no reported difference). + // This avoids the expensive construction of a difference tree. + if len(s.reporters) == 0 { + s.compareAny(rootStep(x, y)) + if s.result.Equal() { + return "" + } + s.result = diff.Result{} // Reset results + } + + r := new(defaultReporter) + s.reporters = append(s.reporters, reporter{r}) + s.compareAny(rootStep(x, y)) + d := r.String() + if (d == "") != s.result.Equal() { + panic("inconsistent difference and equality results") + } + return d +} + +// rootStep constructs the first path step. If x and y have differing types, +// then they are stored within an empty interface type. +func rootStep(x, y interface{}) PathStep { vx := reflect.ValueOf(x) vy := reflect.ValueOf(y) @@ -108,33 +158,7 @@ func Equal(x, y interface{}, opts ...Option) bool { t = vx.Type() } - s := newState(opts) - s.compareAny(&pathStep{t, vx, vy}) - return s.result.Equal() -} - -// Diff returns a human-readable report of the differences between two values. -// It returns an empty string if and only if Equal returns true for the same -// input values and options. -// -// The output is displayed as a literal in pseudo-Go syntax. -// At the start of each line, a "-" prefix indicates an element removed from x, -// a "+" prefix to indicates an element added to y, and the lack of a prefix -// indicates an element common to both x and y. If possible, the output -// uses fmt.Stringer.String or error.Error methods to produce more humanly -// readable outputs. In such cases, the string is prefixed with either an -// 's' or 'e' character, respectively, to indicate that the method was called. -// -// Do not depend on this output being stable. If you need the ability to -// programmatically interpret the difference, consider using a custom Reporter. -func Diff(x, y interface{}, opts ...Option) string { - r := new(defaultReporter) - eq := Equal(x, y, Options(opts), Reporter(r)) - d := r.String() - if (d == "") != eq { - panic("inconsistent difference and equality results") - } - return d + return &pathStep{t, vx, vy} } type state struct { @@ -352,7 +376,7 @@ func detectRaces(c chan<- reflect.Value, f reflect.Value, vs ...reflect.Value) { // assuming that T is assignable to R. // Otherwise, it returns the input value as is. func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value { - // TODO(dsnet): Workaround for reflect bug (https://golang.org/issue/22143). + // TODO(≥go1.10): Workaround for reflect bug (https://golang.org/issue/22143). if !flags.AtLeastGo110 { if v.Kind() == reflect.Interface && v.IsNil() && v.Type() != t { return reflect.New(t).Elem() @@ -362,6 +386,7 @@ func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value { } func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { + var addr bool var vax, vay reflect.Value // Addressable versions of vx and vy var mayForce, mayForceInit bool @@ -383,6 +408,7 @@ func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { // For retrieveUnexportedField to work, the parent struct must // be addressable. Create a new copy of the values if // necessary to make them addressable. + addr = vx.CanAddr() || vy.CanAddr() vax = makeAddressable(vx) vay = makeAddressable(vy) } @@ -393,6 +419,7 @@ func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { mayForceInit = true } step.mayForce = mayForce + step.paddr = addr step.pvx = vax step.pvy = vay step.field = t.Field(i) diff --git a/vendor/github.com/google/go-cmp/cmp/export_panic.go b/vendor/github.com/google/go-cmp/cmp/export_panic.go index dd032354fef..dfa5d213769 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_panic.go +++ b/vendor/github.com/google/go-cmp/cmp/export_panic.go @@ -10,6 +10,6 @@ import "reflect" const supportExporters = false -func retrieveUnexportedField(reflect.Value, reflect.StructField) reflect.Value { +func retrieveUnexportedField(reflect.Value, reflect.StructField, bool) reflect.Value { panic("no support for forcibly accessing unexported fields") } diff --git a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go index 57020e26ca7..351f1a34b46 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go @@ -17,9 +17,19 @@ const supportExporters = true // a struct such that the value has read-write permissions. // // The parent struct, v, must be addressable, while f must be a StructField -// describing the field to retrieve. -func retrieveUnexportedField(v reflect.Value, f reflect.StructField) reflect.Value { - // See https://github.com/google/go-cmp/issues/167 for discussion of the - // following expression. - return reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() +// describing the field to retrieve. If addr is false, +// then the returned value will be shallowed copied to be non-addressable. +func retrieveUnexportedField(v reflect.Value, f reflect.StructField, addr bool) reflect.Value { + ve := reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() + if !addr { + // A field is addressable if and only if the struct is addressable. + // If the original parent value was not addressable, shallow copy the + // value to make it non-addressable to avoid leaking an implementation + // detail of how forcibly exporting a field works. + if ve.Kind() == reflect.Interface && ve.IsNil() { + return reflect.Zero(f.Type) + } + return reflect.ValueOf(ve.Interface()).Convert(f.Type) + } + return ve } diff --git a/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go b/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go index 3d2e42662ca..730e223ee7b 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go @@ -12,6 +12,13 @@ // is more important than obtaining a minimal Levenshtein distance. package diff +import ( + "math/rand" + "time" + + "github.com/google/go-cmp/cmp/internal/flags" +) + // EditType represents a single operation within an edit-script. type EditType uint8 @@ -112,6 +119,8 @@ func (r Result) Similar() bool { return r.NumSame+1 >= r.NumDiff } +var randInt = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) + // Difference reports whether two lists of lengths nx and ny are equal // given the definition of equality provided as f. // @@ -159,6 +168,17 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { // A vertical edge is equivalent to inserting a symbol from list Y. // A diagonal edge is equivalent to a matching symbol between both X and Y. + // To ensure flexibility in changing the algorithm in the future, + // introduce some degree of deliberate instability. + // This is achieved by fiddling the zigzag iterator to start searching + // the graph starting from the bottom-right versus than the top-left. + // The result may differ depending on the starting search location, + // but still produces a valid edit script. + zigzagInit := randInt // either 0 or 1 + if flags.Deterministic { + zigzagInit = 0 + } + // Invariants: // • 0 ≤ fwdPath.X ≤ (fwdFrontier.X, revFrontier.X) ≤ revPath.X ≤ nx // • 0 ≤ fwdPath.Y ≤ (fwdFrontier.Y, revFrontier.Y) ≤ revPath.Y ≤ ny @@ -209,7 +229,7 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 { break } - for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ { + for stop1, stop2, i := false, false, zigzagInit; !(stop1 && stop2) && searchBudget > 0; i++ { // Search in a diagonal pattern for a match. z := zigzag(i) p := point{fwdFrontier.X + z, fwdFrontier.Y - z} diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/name.go b/vendor/github.com/google/go-cmp/cmp/internal/value/name.go new file mode 100644 index 00000000000..8228e7d512a --- /dev/null +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/name.go @@ -0,0 +1,157 @@ +// Copyright 2020, 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.md file. + +package value + +import ( + "reflect" + "strconv" +) + +// TypeString is nearly identical to reflect.Type.String, +// but has an additional option to specify that full type names be used. +func TypeString(t reflect.Type, qualified bool) string { + return string(appendTypeName(nil, t, qualified, false)) +} + +func appendTypeName(b []byte, t reflect.Type, qualified, elideFunc bool) []byte { + // BUG: Go reflection provides no way to disambiguate two named types + // of the same name and within the same package, + // but declared within the namespace of different functions. + + // Named type. + if t.Name() != "" { + if qualified && t.PkgPath() != "" { + b = append(b, '"') + b = append(b, t.PkgPath()...) + b = append(b, '"') + b = append(b, '.') + b = append(b, t.Name()...) + } else { + b = append(b, t.String()...) + } + return b + } + + // Unnamed type. + switch k := t.Kind(); k { + case reflect.Bool, reflect.String, reflect.UnsafePointer, + 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.Complex64, reflect.Complex128: + b = append(b, k.String()...) + case reflect.Chan: + if t.ChanDir() == reflect.RecvDir { + b = append(b, "<-"...) + } + b = append(b, "chan"...) + if t.ChanDir() == reflect.SendDir { + b = append(b, "<-"...) + } + b = append(b, ' ') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Func: + if !elideFunc { + b = append(b, "func"...) + } + b = append(b, '(') + for i := 0; i < t.NumIn(); i++ { + if i > 0 { + b = append(b, ", "...) + } + if i == t.NumIn()-1 && t.IsVariadic() { + b = append(b, "..."...) + b = appendTypeName(b, t.In(i).Elem(), qualified, false) + } else { + b = appendTypeName(b, t.In(i), qualified, false) + } + } + b = append(b, ')') + switch t.NumOut() { + case 0: + // Do nothing + case 1: + b = append(b, ' ') + b = appendTypeName(b, t.Out(0), qualified, false) + default: + b = append(b, " ("...) + for i := 0; i < t.NumOut(); i++ { + if i > 0 { + b = append(b, ", "...) + } + b = appendTypeName(b, t.Out(i), qualified, false) + } + b = append(b, ')') + } + case reflect.Struct: + b = append(b, "struct{ "...) + for i := 0; i < t.NumField(); i++ { + if i > 0 { + b = append(b, "; "...) + } + sf := t.Field(i) + if !sf.Anonymous { + if qualified && sf.PkgPath != "" { + b = append(b, '"') + b = append(b, sf.PkgPath...) + b = append(b, '"') + b = append(b, '.') + } + b = append(b, sf.Name...) + b = append(b, ' ') + } + b = appendTypeName(b, sf.Type, qualified, false) + if sf.Tag != "" { + b = append(b, ' ') + b = strconv.AppendQuote(b, string(sf.Tag)) + } + } + if b[len(b)-1] == ' ' { + b = b[:len(b)-1] + } else { + b = append(b, ' ') + } + b = append(b, '}') + case reflect.Slice, reflect.Array: + b = append(b, '[') + if k == reflect.Array { + b = strconv.AppendUint(b, uint64(t.Len()), 10) + } + b = append(b, ']') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Map: + b = append(b, "map["...) + b = appendTypeName(b, t.Key(), qualified, false) + b = append(b, ']') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Ptr: + b = append(b, '*') + b = appendTypeName(b, t.Elem(), qualified, false) + case reflect.Interface: + b = append(b, "interface{ "...) + for i := 0; i < t.NumMethod(); i++ { + if i > 0 { + b = append(b, "; "...) + } + m := t.Method(i) + if qualified && m.PkgPath != "" { + b = append(b, '"') + b = append(b, m.PkgPath...) + b = append(b, '"') + b = append(b, '.') + } + b = append(b, m.Name...) + b = appendTypeName(b, m.Type, qualified, true) + } + if b[len(b)-1] == ' ' { + b = b[:len(b)-1] + } else { + b = append(b, ' ') + } + b = append(b, '}') + default: + panic("invalid kind: " + k.String()) + } + return b +} diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go index 0a01c4796f1..e9e384a1c89 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go @@ -21,3 +21,13 @@ func PointerOf(v reflect.Value) Pointer { // assumes that the GC implementation does not use a moving collector. return Pointer{v.Pointer(), v.Type()} } + +// IsNil reports whether the pointer is nil. +func (p Pointer) IsNil() bool { + return p.p == 0 +} + +// Uintptr returns the pointer as a uintptr. +func (p Pointer) Uintptr() uintptr { + return p.p +} diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go index da134ae2a80..b50c17ec725 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go @@ -24,3 +24,13 @@ func PointerOf(v reflect.Value) Pointer { // which is necessary if the GC ever uses a moving collector. return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} } + +// IsNil reports whether the pointer is nil. +func (p Pointer) IsNil() bool { + return p.p == nil +} + +// Uintptr returns the pointer as a uintptr. +func (p Pointer) Uintptr() uintptr { + return uintptr(p.p) +} diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index abbd2a63b69..4b0407a7f88 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -225,11 +225,14 @@ func (validator) apply(s *state, vx, vy reflect.Value) { // Unable to Interface implies unexported field without visibility access. if !vx.CanInterface() || !vy.CanInterface() { - const help = "consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported" + help := "consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported" var name string if t := s.curPath.Index(-2).Type(); t.Name() != "" { // Named type with unexported fields. name = fmt.Sprintf("%q.%v", t.PkgPath(), t.Name()) // e.g., "path/to/package".MyType + if _, ok := reflect.New(t).Interface().(error); ok { + help = "consider using cmpopts.EquateErrors to compare error values" + } } else { // Unnamed type with unexported fields. Derive PkgPath from field. var pkgPath string diff --git a/vendor/github.com/google/go-cmp/cmp/path.go b/vendor/github.com/google/go-cmp/cmp/path.go index 509d6b8527d..603dbb0026e 100644 --- a/vendor/github.com/google/go-cmp/cmp/path.go +++ b/vendor/github.com/google/go-cmp/cmp/path.go @@ -177,7 +177,8 @@ type structField struct { // pvx, pvy, and field are only valid if unexported is true. unexported bool mayForce bool // Forcibly allow visibility - pvx, pvy reflect.Value // Parent values + paddr bool // Was parent addressable? + pvx, pvy reflect.Value // Parent values (always addressible) field reflect.StructField // Field information } @@ -189,8 +190,8 @@ func (sf StructField) Values() (vx, vy reflect.Value) { // Forcibly obtain read-write access to an unexported struct field. if sf.mayForce { - vx = retrieveUnexportedField(sf.pvx, sf.field) - vy = retrieveUnexportedField(sf.pvy, sf.field) + vx = retrieveUnexportedField(sf.pvx, sf.field, sf.paddr) + vy = retrieveUnexportedField(sf.pvy, sf.field, sf.paddr) return vx, vy // CanInterface reports true } return sf.vx, sf.vy // CanInterface reports false diff --git a/vendor/github.com/google/go-cmp/cmp/report.go b/vendor/github.com/google/go-cmp/cmp/report.go index 6ddf29993e5..aafcb363545 100644 --- a/vendor/github.com/google/go-cmp/cmp/report.go +++ b/vendor/github.com/google/go-cmp/cmp/report.go @@ -41,7 +41,10 @@ func (r *defaultReporter) String() string { if r.root.NumDiff == 0 { return "" } - return formatOptions{}.FormatDiff(r.root).String() + ptrs := new(pointerReferences) + text := formatOptions{}.FormatDiff(r.root, ptrs) + resolveReferences(text) + return text.String() } func assert(ok bool) { diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 17a05eede48..9e2180964f1 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -11,14 +11,6 @@ import ( "github.com/google/go-cmp/cmp/internal/value" ) -// TODO: Enforce limits? -// * Enforce maximum number of records to print per node? -// * Enforce maximum size in bytes allowed? -// * As a heuristic, use less verbosity for equal nodes than unequal nodes. -// TODO: Enforce unique outputs? -// * Avoid Stringer methods if it results in same output? -// * Print pointer address if outputs still equal? - // numContextRecords is the number of surrounding equal records to print. const numContextRecords = 2 @@ -71,24 +63,66 @@ func (opts formatOptions) WithTypeMode(t typeMode) formatOptions { opts.TypeMode = t return opts } +func (opts formatOptions) WithVerbosity(level int) formatOptions { + opts.VerbosityLevel = level + opts.LimitVerbosity = true + return opts +} +func (opts formatOptions) verbosity() uint { + switch { + case opts.VerbosityLevel < 0: + return 0 + case opts.VerbosityLevel > 16: + return 16 // some reasonable maximum to avoid shift overflow + default: + return uint(opts.VerbosityLevel) + } +} + +const maxVerbosityPreset = 3 + +// verbosityPreset modifies the verbosity settings given an index +// between 0 and maxVerbosityPreset, inclusive. +func verbosityPreset(opts formatOptions, i int) formatOptions { + opts.VerbosityLevel = int(opts.verbosity()) + 2*i + if i > 0 { + opts.AvoidStringer = true + } + if i >= maxVerbosityPreset { + opts.PrintAddresses = true + opts.QualifiedNames = true + } + return opts +} // FormatDiff converts a valueNode tree into a textNode tree, where the later // is a textual representation of the differences detected in the former. -func (opts formatOptions) FormatDiff(v *valueNode) textNode { +func (opts formatOptions) FormatDiff(v *valueNode, ptrs *pointerReferences) (out textNode) { + if opts.DiffMode == diffIdentical { + opts = opts.WithVerbosity(1) + } else { + opts = opts.WithVerbosity(3) + } + // Check whether we have specialized formatting for this node. // This is not necessary, but helpful for producing more readable outputs. if opts.CanFormatDiffSlice(v) { return opts.FormatDiffSlice(v) } + var parentKind reflect.Kind + if v.parent != nil && v.parent.TransformerName == "" { + parentKind = v.parent.Type.Kind() + } + // For leaf nodes, format the value based on the reflect.Values alone. if v.MaxDepth == 0 { switch opts.DiffMode { case diffUnknown, diffIdentical: // Format Equal. if v.NumDiff == 0 { - outx := opts.FormatValue(v.ValueX, visitedPointers{}) - outy := opts.FormatValue(v.ValueY, visitedPointers{}) + outx := opts.FormatValue(v.ValueX, parentKind, ptrs) + outy := opts.FormatValue(v.ValueY, parentKind, ptrs) if v.NumIgnored > 0 && v.NumSame == 0 { return textEllipsis } else if outx.Len() < outy.Len() { @@ -101,8 +135,13 @@ func (opts formatOptions) FormatDiff(v *valueNode) textNode { // Format unequal. assert(opts.DiffMode == diffUnknown) var list textList - outx := opts.WithTypeMode(elideType).FormatValue(v.ValueX, visitedPointers{}) - outy := opts.WithTypeMode(elideType).FormatValue(v.ValueY, visitedPointers{}) + outx := opts.WithTypeMode(elideType).FormatValue(v.ValueX, parentKind, ptrs) + outy := opts.WithTypeMode(elideType).FormatValue(v.ValueY, parentKind, ptrs) + for i := 0; i <= maxVerbosityPreset && outx != nil && outy != nil && outx.Equal(outy); i++ { + opts2 := verbosityPreset(opts, i).WithTypeMode(elideType) + outx = opts2.FormatValue(v.ValueX, parentKind, ptrs) + outy = opts2.FormatValue(v.ValueY, parentKind, ptrs) + } if outx != nil { list = append(list, textRecord{Diff: '-', Value: outx}) } @@ -111,34 +150,57 @@ func (opts formatOptions) FormatDiff(v *valueNode) textNode { } return opts.WithTypeMode(emitType).FormatType(v.Type, list) case diffRemoved: - return opts.FormatValue(v.ValueX, visitedPointers{}) + return opts.FormatValue(v.ValueX, parentKind, ptrs) case diffInserted: - return opts.FormatValue(v.ValueY, visitedPointers{}) + return opts.FormatValue(v.ValueY, parentKind, ptrs) default: panic("invalid diff mode") } } + // Register slice element to support cycle detection. + if parentKind == reflect.Slice { + ptrRefs := ptrs.PushPair(v.ValueX, v.ValueY, opts.DiffMode, true) + defer ptrs.Pop() + defer func() { out = wrapTrunkReferences(ptrRefs, out) }() + } + // Descend into the child value node. if v.TransformerName != "" { - out := opts.WithTypeMode(emitType).FormatDiff(v.Value) - out = textWrap{"Inverse(" + v.TransformerName + ", ", out, ")"} + out := opts.WithTypeMode(emitType).FormatDiff(v.Value, ptrs) + out = &textWrap{Prefix: "Inverse(" + v.TransformerName + ", ", Value: out, Suffix: ")"} return opts.FormatType(v.Type, out) } else { switch k := v.Type.Kind(); k { - case reflect.Struct, reflect.Array, reflect.Slice, reflect.Map: - return opts.FormatType(v.Type, opts.formatDiffList(v.Records, k)) + case reflect.Struct, reflect.Array, reflect.Slice: + out = opts.formatDiffList(v.Records, k, ptrs) + out = opts.FormatType(v.Type, out) + case reflect.Map: + // Register map to support cycle detection. + ptrRefs := ptrs.PushPair(v.ValueX, v.ValueY, opts.DiffMode, false) + defer ptrs.Pop() + + out = opts.formatDiffList(v.Records, k, ptrs) + out = wrapTrunkReferences(ptrRefs, out) + out = opts.FormatType(v.Type, out) case reflect.Ptr: - return textWrap{"&", opts.FormatDiff(v.Value), ""} + // Register pointer to support cycle detection. + ptrRefs := ptrs.PushPair(v.ValueX, v.ValueY, opts.DiffMode, false) + defer ptrs.Pop() + + out = opts.FormatDiff(v.Value, ptrs) + out = wrapTrunkReferences(ptrRefs, out) + out = &textWrap{Prefix: "&", Value: out} case reflect.Interface: - return opts.WithTypeMode(emitType).FormatDiff(v.Value) + out = opts.WithTypeMode(emitType).FormatDiff(v.Value, ptrs) default: panic(fmt.Sprintf("%v cannot have children", k)) } + return out } } -func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) textNode { +func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind, ptrs *pointerReferences) textNode { // Derive record name based on the data structure kind. var name string var formatKey func(reflect.Value) string @@ -154,7 +216,17 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te case reflect.Map: name = "entry" opts = opts.WithTypeMode(elideType) - formatKey = formatMapKey + formatKey = func(v reflect.Value) string { return formatMapKey(v, false, ptrs) } + } + + maxLen := -1 + if opts.LimitVerbosity { + if opts.DiffMode == diffIdentical { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + } else { + maxLen = (1 << opts.verbosity()) << 1 // 2, 4, 8, 16, 32, 64, etc... + } + opts.VerbosityLevel-- } // Handle unification. @@ -163,6 +235,11 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te var list textList var deferredEllipsis bool // Add final "..." to indicate records were dropped for _, r := range recs { + if len(list) == maxLen { + deferredEllipsis = true + break + } + // Elide struct fields that are zero value. if k == reflect.Struct { var isZero bool @@ -186,23 +263,31 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te } continue } - if out := opts.FormatDiff(r.Value); out != nil { + if out := opts.FormatDiff(r.Value, ptrs); out != nil { list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) } } if deferredEllipsis { list.AppendEllipsis(diffStats{}) } - return textWrap{"{", list, "}"} + return &textWrap{Prefix: "{", Value: list, Suffix: "}"} case diffUnknown: default: panic("invalid diff mode") } // Handle differencing. + var numDiffs int var list textList + var keys []reflect.Value // invariant: len(list) == len(keys) groups := coalesceAdjacentRecords(name, recs) + maxGroup := diffStats{Name: name} for i, ds := range groups { + if maxLen >= 0 && numDiffs >= maxLen { + maxGroup = maxGroup.Append(ds) + continue + } + // Handle equal records. if ds.NumDiff() == 0 { // Compute the number of leading and trailing records to print. @@ -226,16 +311,21 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te // Format the equal values. for _, r := range recs[:numLo] { - out := opts.WithDiffMode(diffIdentical).FormatDiff(r.Value) + out := opts.WithDiffMode(diffIdentical).FormatDiff(r.Value, ptrs) list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) } if numEqual > numLo+numHi { ds.NumIdentical -= numLo + numHi list.AppendEllipsis(ds) + for len(keys) < len(list) { + keys = append(keys, reflect.Value{}) + } } for _, r := range recs[numEqual-numHi : numEqual] { - out := opts.WithDiffMode(diffIdentical).FormatDiff(r.Value) + out := opts.WithDiffMode(diffIdentical).FormatDiff(r.Value, ptrs) list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) } recs = recs[numEqual:] continue @@ -247,24 +337,70 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te case opts.CanFormatDiffSlice(r.Value): out := opts.FormatDiffSlice(r.Value) list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) case r.Value.NumChildren == r.Value.MaxDepth: - outx := opts.WithDiffMode(diffRemoved).FormatDiff(r.Value) - outy := opts.WithDiffMode(diffInserted).FormatDiff(r.Value) + outx := opts.WithDiffMode(diffRemoved).FormatDiff(r.Value, ptrs) + outy := opts.WithDiffMode(diffInserted).FormatDiff(r.Value, ptrs) + for i := 0; i <= maxVerbosityPreset && outx != nil && outy != nil && outx.Equal(outy); i++ { + opts2 := verbosityPreset(opts, i) + outx = opts2.WithDiffMode(diffRemoved).FormatDiff(r.Value, ptrs) + outy = opts2.WithDiffMode(diffInserted).FormatDiff(r.Value, ptrs) + } if outx != nil { list = append(list, textRecord{Diff: diffRemoved, Key: formatKey(r.Key), Value: outx}) + keys = append(keys, r.Key) } if outy != nil { list = append(list, textRecord{Diff: diffInserted, Key: formatKey(r.Key), Value: outy}) + keys = append(keys, r.Key) } default: - out := opts.FormatDiff(r.Value) + out := opts.FormatDiff(r.Value, ptrs) list = append(list, textRecord{Key: formatKey(r.Key), Value: out}) + keys = append(keys, r.Key) } } recs = recs[ds.NumDiff():] + numDiffs += ds.NumDiff() + } + if maxGroup.IsZero() { + assert(len(recs) == 0) + } else { + list.AppendEllipsis(maxGroup) + for len(keys) < len(list) { + keys = append(keys, reflect.Value{}) + } } - assert(len(recs) == 0) - return textWrap{"{", list, "}"} + assert(len(list) == len(keys)) + + // For maps, the default formatting logic uses fmt.Stringer which may + // produce ambiguous output. Avoid calling String to disambiguate. + if k == reflect.Map { + var ambiguous bool + seenKeys := map[string]reflect.Value{} + for i, currKey := range keys { + if currKey.IsValid() { + strKey := list[i].Key + prevKey, seen := seenKeys[strKey] + if seen && prevKey.CanInterface() && currKey.CanInterface() { + ambiguous = prevKey.Interface() != currKey.Interface() + if ambiguous { + break + } + } + seenKeys[strKey] = currKey + } + } + if ambiguous { + for i, k := range keys { + if k.IsValid() { + list[i].Key = formatMapKey(k, true, ptrs) + } + } + } + } + + return &textWrap{Prefix: "{", Value: list, Suffix: "}"} } // coalesceAdjacentRecords coalesces the list of records into groups of diff --git a/vendor/github.com/google/go-cmp/cmp/report_references.go b/vendor/github.com/google/go-cmp/cmp/report_references.go new file mode 100644 index 00000000000..d620c2c20e7 --- /dev/null +++ b/vendor/github.com/google/go-cmp/cmp/report_references.go @@ -0,0 +1,264 @@ +// Copyright 2020, 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.md file. + +package cmp + +import ( + "fmt" + "reflect" + "strings" + + "github.com/google/go-cmp/cmp/internal/flags" + "github.com/google/go-cmp/cmp/internal/value" +) + +const ( + pointerDelimPrefix = "⟪" + pointerDelimSuffix = "⟫" +) + +// formatPointer prints the address of the pointer. +func formatPointer(p value.Pointer, withDelims bool) string { + v := p.Uintptr() + if flags.Deterministic { + v = 0xdeadf00f // Only used for stable testing purposes + } + if withDelims { + return pointerDelimPrefix + formatHex(uint64(v)) + pointerDelimSuffix + } + return formatHex(uint64(v)) +} + +// pointerReferences is a stack of pointers visited so far. +type pointerReferences [][2]value.Pointer + +func (ps *pointerReferences) PushPair(vx, vy reflect.Value, d diffMode, deref bool) (pp [2]value.Pointer) { + if deref && vx.IsValid() { + vx = vx.Addr() + } + if deref && vy.IsValid() { + vy = vy.Addr() + } + switch d { + case diffUnknown, diffIdentical: + pp = [2]value.Pointer{value.PointerOf(vx), value.PointerOf(vy)} + case diffRemoved: + pp = [2]value.Pointer{value.PointerOf(vx), value.Pointer{}} + case diffInserted: + pp = [2]value.Pointer{value.Pointer{}, value.PointerOf(vy)} + } + *ps = append(*ps, pp) + return pp +} + +func (ps *pointerReferences) Push(v reflect.Value) (p value.Pointer, seen bool) { + p = value.PointerOf(v) + for _, pp := range *ps { + if p == pp[0] || p == pp[1] { + return p, true + } + } + *ps = append(*ps, [2]value.Pointer{p, p}) + return p, false +} + +func (ps *pointerReferences) Pop() { + *ps = (*ps)[:len(*ps)-1] +} + +// trunkReferences is metadata for a textNode indicating that the sub-tree +// represents the value for either pointer in a pair of references. +type trunkReferences struct{ pp [2]value.Pointer } + +// trunkReference is metadata for a textNode indicating that the sub-tree +// represents the value for the given pointer reference. +type trunkReference struct{ p value.Pointer } + +// leafReference is metadata for a textNode indicating that the value is +// truncated as it refers to another part of the tree (i.e., a trunk). +type leafReference struct{ p value.Pointer } + +func wrapTrunkReferences(pp [2]value.Pointer, s textNode) textNode { + switch { + case pp[0].IsNil(): + return &textWrap{Value: s, Metadata: trunkReference{pp[1]}} + case pp[1].IsNil(): + return &textWrap{Value: s, Metadata: trunkReference{pp[0]}} + case pp[0] == pp[1]: + return &textWrap{Value: s, Metadata: trunkReference{pp[0]}} + default: + return &textWrap{Value: s, Metadata: trunkReferences{pp}} + } +} +func wrapTrunkReference(p value.Pointer, printAddress bool, s textNode) textNode { + var prefix string + if printAddress { + prefix = formatPointer(p, true) + } + return &textWrap{Prefix: prefix, Value: s, Metadata: trunkReference{p}} +} +func makeLeafReference(p value.Pointer, printAddress bool) textNode { + out := &textWrap{Prefix: "(", Value: textEllipsis, Suffix: ")"} + var prefix string + if printAddress { + prefix = formatPointer(p, true) + } + return &textWrap{Prefix: prefix, Value: out, Metadata: leafReference{p}} +} + +// resolveReferences walks the textNode tree searching for any leaf reference +// metadata and resolves each against the corresponding trunk references. +// Since pointer addresses in memory are not particularly readable to the user, +// it replaces each pointer value with an arbitrary and unique reference ID. +func resolveReferences(s textNode) { + var walkNodes func(textNode, func(textNode)) + walkNodes = func(s textNode, f func(textNode)) { + f(s) + switch s := s.(type) { + case *textWrap: + walkNodes(s.Value, f) + case textList: + for _, r := range s { + walkNodes(r.Value, f) + } + } + } + + // Collect all trunks and leaves with reference metadata. + var trunks, leaves []*textWrap + walkNodes(s, func(s textNode) { + if s, ok := s.(*textWrap); ok { + switch s.Metadata.(type) { + case leafReference: + leaves = append(leaves, s) + case trunkReference, trunkReferences: + trunks = append(trunks, s) + } + } + }) + + // No leaf references to resolve. + if len(leaves) == 0 { + return + } + + // Collect the set of all leaf references to resolve. + leafPtrs := make(map[value.Pointer]bool) + for _, leaf := range leaves { + leafPtrs[leaf.Metadata.(leafReference).p] = true + } + + // Collect the set of trunk pointers that are always paired together. + // This allows us to assign a single ID to both pointers for brevity. + // If a pointer in a pair ever occurs by itself or as a different pair, + // then the pair is broken. + pairedTrunkPtrs := make(map[value.Pointer]value.Pointer) + unpair := func(p value.Pointer) { + if !pairedTrunkPtrs[p].IsNil() { + pairedTrunkPtrs[pairedTrunkPtrs[p]] = value.Pointer{} // invalidate other half + } + pairedTrunkPtrs[p] = value.Pointer{} // invalidate this half + } + for _, trunk := range trunks { + switch p := trunk.Metadata.(type) { + case trunkReference: + unpair(p.p) // standalone pointer cannot be part of a pair + case trunkReferences: + p0, ok0 := pairedTrunkPtrs[p.pp[0]] + p1, ok1 := pairedTrunkPtrs[p.pp[1]] + switch { + case !ok0 && !ok1: + // Register the newly seen pair. + pairedTrunkPtrs[p.pp[0]] = p.pp[1] + pairedTrunkPtrs[p.pp[1]] = p.pp[0] + case ok0 && ok1 && p0 == p.pp[1] && p1 == p.pp[0]: + // Exact pair already seen; do nothing. + default: + // Pair conflicts with some other pair; break all pairs. + unpair(p.pp[0]) + unpair(p.pp[1]) + } + } + } + + // Correlate each pointer referenced by leaves to a unique identifier, + // and print the IDs for each trunk that matches those pointers. + var nextID uint + ptrIDs := make(map[value.Pointer]uint) + newID := func() uint { + id := nextID + nextID++ + return id + } + for _, trunk := range trunks { + switch p := trunk.Metadata.(type) { + case trunkReference: + if print := leafPtrs[p.p]; print { + id, ok := ptrIDs[p.p] + if !ok { + id = newID() + ptrIDs[p.p] = id + } + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id)) + } + case trunkReferences: + print0 := leafPtrs[p.pp[0]] + print1 := leafPtrs[p.pp[1]] + if print0 || print1 { + id0, ok0 := ptrIDs[p.pp[0]] + id1, ok1 := ptrIDs[p.pp[1]] + isPair := pairedTrunkPtrs[p.pp[0]] == p.pp[1] && pairedTrunkPtrs[p.pp[1]] == p.pp[0] + if isPair { + var id uint + assert(ok0 == ok1) // must be seen together or not at all + if ok0 { + assert(id0 == id1) // must have the same ID + id = id0 + } else { + id = newID() + ptrIDs[p.pp[0]] = id + ptrIDs[p.pp[1]] = id + } + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id)) + } else { + if print0 && !ok0 { + id0 = newID() + ptrIDs[p.pp[0]] = id0 + } + if print1 && !ok1 { + id1 = newID() + ptrIDs[p.pp[1]] = id1 + } + switch { + case print0 && print1: + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id0)+","+formatReference(id1)) + case print0: + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id0)) + case print1: + trunk.Prefix = updateReferencePrefix(trunk.Prefix, formatReference(id1)) + } + } + } + } + } + + // Update all leaf references with the unique identifier. + for _, leaf := range leaves { + if id, ok := ptrIDs[leaf.Metadata.(leafReference).p]; ok { + leaf.Prefix = updateReferencePrefix(leaf.Prefix, formatReference(id)) + } + } +} + +func formatReference(id uint) string { + return fmt.Sprintf("ref#%d", id) +} + +func updateReferencePrefix(prefix, ref string) string { + if prefix == "" { + return pointerDelimPrefix + ref + pointerDelimSuffix + } + suffix := strings.TrimPrefix(prefix, pointerDelimPrefix) + return pointerDelimPrefix + ref + ": " + suffix +} diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 2761b628921..786f671269c 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -5,13 +5,14 @@ package cmp import ( + "bytes" "fmt" "reflect" "strconv" "strings" "unicode" + "unicode/utf8" - "github.com/google/go-cmp/cmp/internal/flags" "github.com/google/go-cmp/cmp/internal/value" ) @@ -20,14 +21,22 @@ type formatValueOptions struct { // methods like error.Error or fmt.Stringer.String. AvoidStringer bool - // ShallowPointers controls whether to avoid descending into pointers. - // Useful when printing map keys, where pointer comparison is performed - // on the pointer address rather than the pointed-at value. - ShallowPointers bool - // PrintAddresses controls whether to print the address of all pointers, // slice elements, and maps. PrintAddresses bool + + // QualifiedNames controls whether FormatType uses the fully qualified name + // (including the full package path as opposed to just the package name). + QualifiedNames bool + + // VerbosityLevel controls the amount of output to produce. + // A higher value produces more output. A value of zero or lower produces + // no output (represented using an ellipsis). + // If LimitVerbosity is false, then the level is treated as infinite. + VerbosityLevel int + + // LimitVerbosity specifies that formatting should respect VerbosityLevel. + LimitVerbosity bool } // FormatType prints the type as if it were wrapping s. @@ -44,12 +53,15 @@ func (opts formatOptions) FormatType(t reflect.Type, s textNode) textNode { default: return s } + if opts.DiffMode == diffIdentical { + return s // elide type for identical nodes + } case elideType: return s } // Determine the type label, applying special handling for unnamed types. - typeName := t.String() + typeName := value.TypeString(t, opts.QualifiedNames) if t.Name() == "" { // According to Go grammar, certain type literals contain symbols that // do not strongly bind to the next lexicographical token (e.g., *T). @@ -57,39 +69,77 @@ func (opts formatOptions) FormatType(t reflect.Type, s textNode) textNode { case reflect.Chan, reflect.Func, reflect.Ptr: typeName = "(" + typeName + ")" } - typeName = strings.Replace(typeName, "struct {", "struct{", -1) - typeName = strings.Replace(typeName, "interface {", "interface{", -1) } + return &textWrap{Prefix: typeName, Value: wrapParens(s)} +} + +// wrapParens wraps s with a set of parenthesis, but avoids it if the +// wrapped node itself is already surrounded by a pair of parenthesis or braces. +// It handles unwrapping one level of pointer-reference nodes. +func wrapParens(s textNode) textNode { + var refNode *textWrap + if s2, ok := s.(*textWrap); ok { + // Unwrap a single pointer reference node. + switch s2.Metadata.(type) { + case leafReference, trunkReference, trunkReferences: + refNode = s2 + if s3, ok := refNode.Value.(*textWrap); ok { + s2 = s3 + } + } - // Avoid wrap the value in parenthesis if unnecessary. - if s, ok := s.(textWrap); ok { - hasParens := strings.HasPrefix(s.Prefix, "(") && strings.HasSuffix(s.Suffix, ")") - hasBraces := strings.HasPrefix(s.Prefix, "{") && strings.HasSuffix(s.Suffix, "}") + // Already has delimiters that make parenthesis unnecessary. + hasParens := strings.HasPrefix(s2.Prefix, "(") && strings.HasSuffix(s2.Suffix, ")") + hasBraces := strings.HasPrefix(s2.Prefix, "{") && strings.HasSuffix(s2.Suffix, "}") if hasParens || hasBraces { - return textWrap{typeName, s, ""} + return s } } - return textWrap{typeName + "(", s, ")"} + if refNode != nil { + refNode.Value = &textWrap{Prefix: "(", Value: refNode.Value, Suffix: ")"} + return s + } + return &textWrap{Prefix: "(", Value: s, Suffix: ")"} } // FormatValue prints the reflect.Value, taking extra care to avoid descending -// into pointers already in m. As pointers are visited, m is also updated. -func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out textNode) { +// into pointers already in ptrs. As pointers are visited, ptrs is also updated. +func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, ptrs *pointerReferences) (out textNode) { if !v.IsValid() { return nil } t := v.Type() + // Check slice element for cycles. + if parentKind == reflect.Slice { + ptrRef, visited := ptrs.Push(v.Addr()) + if visited { + return makeLeafReference(ptrRef, false) + } + defer ptrs.Pop() + defer func() { out = wrapTrunkReference(ptrRef, false, out) }() + } + // Check whether there is an Error or String method to call. if !opts.AvoidStringer && v.CanInterface() { // Avoid calling Error or String methods on nil receivers since many // implementations crash when doing so. if (t.Kind() != reflect.Ptr && t.Kind() != reflect.Interface) || !v.IsNil() { - switch v := v.Interface().(type) { - case error: - return textLine("e" + formatString(v.Error())) - case fmt.Stringer: - return textLine("s" + formatString(v.String())) + var prefix, strVal string + func() { + // Swallow and ignore any panics from String or Error. + defer func() { recover() }() + switch v := v.Interface().(type) { + case error: + strVal = v.Error() + prefix = "e" + case fmt.Stringer: + strVal = v.String() + prefix = "s" + } + }() + if prefix != "" { + return opts.formatString(prefix, strVal) } } } @@ -102,94 +152,140 @@ func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out t } }() - var ptr string switch t.Kind() { case reflect.Bool: return textLine(fmt.Sprint(v.Bool())) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return textLine(fmt.Sprint(v.Int())) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - // Unnamed uints are usually bytes or words, so use hexadecimal. - if t.PkgPath() == "" || t.Kind() == reflect.Uintptr { + case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return textLine(fmt.Sprint(v.Uint())) + case reflect.Uint8: + if parentKind == reflect.Slice || parentKind == reflect.Array { return textLine(formatHex(v.Uint())) } return textLine(fmt.Sprint(v.Uint())) + case reflect.Uintptr: + return textLine(formatHex(v.Uint())) case reflect.Float32, reflect.Float64: return textLine(fmt.Sprint(v.Float())) case reflect.Complex64, reflect.Complex128: return textLine(fmt.Sprint(v.Complex())) case reflect.String: - return textLine(formatString(v.String())) + return opts.formatString("", v.String()) case reflect.UnsafePointer, reflect.Chan, reflect.Func: - return textLine(formatPointer(v)) + return textLine(formatPointer(value.PointerOf(v), true)) case reflect.Struct: var list textList + v := makeAddressable(v) // needed for retrieveUnexportedField + maxLen := v.NumField() + if opts.LimitVerbosity { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + opts.VerbosityLevel-- + } for i := 0; i < v.NumField(); i++ { vv := v.Field(i) if value.IsZero(vv) { continue // Elide fields with zero values } - s := opts.WithTypeMode(autoType).FormatValue(vv, m) - list = append(list, textRecord{Key: t.Field(i).Name, Value: s}) + if len(list) == maxLen { + list.AppendEllipsis(diffStats{}) + break + } + sf := t.Field(i) + if supportExporters && !isExported(sf.Name) { + vv = retrieveUnexportedField(v, sf, true) + } + s := opts.WithTypeMode(autoType).FormatValue(vv, t.Kind(), ptrs) + list = append(list, textRecord{Key: sf.Name, Value: s}) } - return textWrap{"{", list, "}"} + return &textWrap{Prefix: "{", Value: list, Suffix: "}"} case reflect.Slice: if v.IsNil() { return textNil } - if opts.PrintAddresses { - ptr = formatPointer(v) + + // Check whether this is a []byte of text data. + if t.Elem() == reflect.TypeOf(byte(0)) { + b := v.Bytes() + isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) && unicode.IsSpace(r) } + if len(b) > 0 && utf8.Valid(b) && len(bytes.TrimFunc(b, isPrintSpace)) == 0 { + out = opts.formatString("", string(b)) + return opts.WithTypeMode(emitType).FormatType(t, out) + } } + fallthrough case reflect.Array: + maxLen := v.Len() + if opts.LimitVerbosity { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + opts.VerbosityLevel-- + } var list textList for i := 0; i < v.Len(); i++ { - vi := v.Index(i) - if vi.CanAddr() { // Check for cyclic elements - p := vi.Addr() - if m.Visit(p) { - var out textNode - out = textLine(formatPointer(p)) - out = opts.WithTypeMode(emitType).FormatType(p.Type(), out) - out = textWrap{"*", out, ""} - list = append(list, textRecord{Value: out}) - continue - } + if len(list) == maxLen { + list.AppendEllipsis(diffStats{}) + break } - s := opts.WithTypeMode(elideType).FormatValue(vi, m) + s := opts.WithTypeMode(elideType).FormatValue(v.Index(i), t.Kind(), ptrs) list = append(list, textRecord{Value: s}) } - return textWrap{ptr + "{", list, "}"} + + out = &textWrap{Prefix: "{", Value: list, Suffix: "}"} + if t.Kind() == reflect.Slice && opts.PrintAddresses { + header := fmt.Sprintf("ptr:%v, len:%d, cap:%d", formatPointer(value.PointerOf(v), false), v.Len(), v.Cap()) + out = &textWrap{Prefix: pointerDelimPrefix + header + pointerDelimSuffix, Value: out} + } + return out case reflect.Map: if v.IsNil() { return textNil } - if m.Visit(v) { - return textLine(formatPointer(v)) + + // Check pointer for cycles. + ptrRef, visited := ptrs.Push(v) + if visited { + return makeLeafReference(ptrRef, opts.PrintAddresses) } + defer ptrs.Pop() + maxLen := v.Len() + if opts.LimitVerbosity { + maxLen = ((1 << opts.verbosity()) >> 1) << 2 // 0, 4, 8, 16, 32, etc... + opts.VerbosityLevel-- + } var list textList for _, k := range value.SortKeys(v.MapKeys()) { - sk := formatMapKey(k) - sv := opts.WithTypeMode(elideType).FormatValue(v.MapIndex(k), m) + if len(list) == maxLen { + list.AppendEllipsis(diffStats{}) + break + } + sk := formatMapKey(k, false, ptrs) + sv := opts.WithTypeMode(elideType).FormatValue(v.MapIndex(k), t.Kind(), ptrs) list = append(list, textRecord{Key: sk, Value: sv}) } - if opts.PrintAddresses { - ptr = formatPointer(v) - } - return textWrap{ptr + "{", list, "}"} + + out = &textWrap{Prefix: "{", Value: list, Suffix: "}"} + out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) + return out case reflect.Ptr: if v.IsNil() { return textNil } - if m.Visit(v) || opts.ShallowPointers { - return textLine(formatPointer(v)) - } - if opts.PrintAddresses { - ptr = formatPointer(v) + + // Check pointer for cycles. + ptrRef, visited := ptrs.Push(v) + if visited { + out = makeLeafReference(ptrRef, opts.PrintAddresses) + return &textWrap{Prefix: "&", Value: out} } + defer ptrs.Pop() + skipType = true // Let the underlying value print the type instead - return textWrap{"&" + ptr, opts.FormatValue(v.Elem(), m), ""} + out = opts.FormatValue(v.Elem(), t.Kind(), ptrs) + out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) + out = &textWrap{Prefix: "&", Value: out} + return out case reflect.Interface: if v.IsNil() { return textNil @@ -197,19 +293,65 @@ func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out t // Interfaces accept different concrete types, // so configure the underlying value to explicitly print the type. skipType = true // Print the concrete type instead - return opts.WithTypeMode(emitType).FormatValue(v.Elem(), m) + return opts.WithTypeMode(emitType).FormatValue(v.Elem(), t.Kind(), ptrs) default: panic(fmt.Sprintf("%v kind not handled", v.Kind())) } } +func (opts formatOptions) formatString(prefix, s string) textNode { + maxLen := len(s) + maxLines := strings.Count(s, "\n") + 1 + if opts.LimitVerbosity { + maxLen = (1 << opts.verbosity()) << 5 // 32, 64, 128, 256, etc... + maxLines = (1 << opts.verbosity()) << 2 // 4, 8, 16, 32, 64, etc... + } + + // For multiline strings, use the triple-quote syntax, + // but only use it when printing removed or inserted nodes since + // we only want the extra verbosity for those cases. + lines := strings.Split(strings.TrimSuffix(s, "\n"), "\n") + isTripleQuoted := len(lines) >= 4 && (opts.DiffMode == '-' || opts.DiffMode == '+') + for i := 0; i < len(lines) && isTripleQuoted; i++ { + lines[i] = strings.TrimPrefix(strings.TrimSuffix(lines[i], "\r"), "\r") // trim leading/trailing carriage returns for legacy Windows endline support + isPrintable := func(r rune) bool { + return unicode.IsPrint(r) || r == '\t' // specially treat tab as printable + } + line := lines[i] + isTripleQuoted = !strings.HasPrefix(strings.TrimPrefix(line, prefix), `"""`) && !strings.HasPrefix(line, "...") && strings.TrimFunc(line, isPrintable) == "" && len(line) <= maxLen + } + if isTripleQuoted { + var list textList + list = append(list, textRecord{Diff: opts.DiffMode, Value: textLine(prefix + `"""`), ElideComma: true}) + for i, line := range lines { + if numElided := len(lines) - i; i == maxLines-1 && numElided > 1 { + comment := commentString(fmt.Sprintf("%d elided lines", numElided)) + list = append(list, textRecord{Diff: opts.DiffMode, Value: textEllipsis, ElideComma: true, Comment: comment}) + break + } + list = append(list, textRecord{Diff: opts.DiffMode, Value: textLine(line), ElideComma: true}) + } + list = append(list, textRecord{Diff: opts.DiffMode, Value: textLine(prefix + `"""`), ElideComma: true}) + return &textWrap{Prefix: "(", Value: list, Suffix: ")"} + } + + // Format the string as a single-line quoted string. + if len(s) > maxLen+len(textEllipsis) { + return textLine(prefix + formatString(s[:maxLen]) + string(textEllipsis)) + } + return textLine(prefix + formatString(s)) +} + // formatMapKey formats v as if it were a map key. // The result is guaranteed to be a single line. -func formatMapKey(v reflect.Value) string { +func formatMapKey(v reflect.Value, disambiguate bool, ptrs *pointerReferences) string { var opts formatOptions + opts.DiffMode = diffIdentical opts.TypeMode = elideType - opts.ShallowPointers = true - s := opts.FormatValue(v, visitedPointers{}).String() + opts.PrintAddresses = disambiguate + opts.AvoidStringer = disambiguate + opts.QualifiedNames = disambiguate + s := opts.FormatValue(v, reflect.Map, ptrs).String() return strings.TrimSpace(s) } @@ -227,7 +369,7 @@ func formatString(s string) string { rawInvalid := func(r rune) bool { return r == '`' || r == '\n' || !(unicode.IsPrint(r) || r == '\t') } - if strings.IndexFunc(s, rawInvalid) < 0 { + if utf8.ValidString(s) && strings.IndexFunc(s, rawInvalid) < 0 { return "`" + s + "`" } return qs @@ -256,23 +398,3 @@ func formatHex(u uint64) string { } return fmt.Sprintf(f, u) } - -// formatPointer prints the address of the pointer. -func formatPointer(v reflect.Value) string { - p := v.Pointer() - if flags.Deterministic { - p = 0xdeadf00f // Only used for stable testing purposes - } - return fmt.Sprintf("⟪0x%x⟫", p) -} - -type visitedPointers map[value.Pointer]struct{} - -// Visit inserts pointer v into the visited map and reports whether it had -// already been visited before. -func (m visitedPointers) Visit(v reflect.Value) bool { - p := value.PointerOf(v) - _, visited := m[p] - m[p] = struct{}{} - return visited -} diff --git a/vendor/github.com/google/go-cmp/cmp/report_slices.go b/vendor/github.com/google/go-cmp/cmp/report_slices.go index eafcf2e4c0b..35315dad355 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "reflect" + "strconv" "strings" "unicode" "unicode/utf8" @@ -23,11 +24,25 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { return false // Must be formatting in diff mode case v.NumDiff == 0: return false // No differences detected - case v.NumIgnored+v.NumCompared+v.NumTransformed > 0: - // TODO: Handle the case where someone uses bytes.Equal on a large slice. - return false // Some custom option was used to determined equality case !v.ValueX.IsValid() || !v.ValueY.IsValid(): return false // Both values must be valid + case v.Type.Kind() == reflect.Slice && (v.ValueX.Len() == 0 || v.ValueY.Len() == 0): + return false // Both slice values have to be non-empty + case v.NumIgnored > 0: + return false // Some ignore option was used + case v.NumTransformed > 0: + return false // Some transform option was used + case v.NumCompared > 1: + return false // More than one comparison was used + case v.NumCompared == 1 && v.Type.Name() != "": + // The need for cmp to check applicability of options on every element + // in a slice is a significant performance detriment for large []byte. + // The workaround is to specify Comparer(bytes.Equal), + // which enables cmp to compare []byte more efficiently. + // If they differ, we still want to provide batched diffing. + // The logic disallows named types since they tend to have their own + // String method, with nicer formatting than what this provides. + return false } switch t := v.Type; t.Kind() { @@ -82,7 +97,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } if isText || isBinary { var numLines, lastLineIdx, maxLineLen int - isBinary = false + isBinary = !utf8.ValidString(sx) || !utf8.ValidString(sy) for i, r := range sx + sy { if !(unicode.IsPrint(r) || unicode.IsSpace(r)) || r == utf8.RuneError { isBinary = true @@ -97,7 +112,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } } isText = !isBinary - isLinedText = isText && numLines >= 4 && maxLineLen <= 256 + isLinedText = isText && numLines >= 4 && maxLineLen <= 1024 } // Format the string into printable records. @@ -117,6 +132,83 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { }, ) delim = "\n" + + // If possible, use a custom triple-quote (""") syntax for printing + // differences in a string literal. This format is more readable, + // but has edge-cases where differences are visually indistinguishable. + // This format is avoided under the following conditions: + // • A line starts with `"""` + // • A line starts with "..." + // • A line contains non-printable characters + // • Adjacent different lines differ only by whitespace + // + // For example: + // """ + // ... // 3 identical lines + // foo + // bar + // - baz + // + BAZ + // """ + isTripleQuoted := true + prevRemoveLines := map[string]bool{} + prevInsertLines := map[string]bool{} + var list2 textList + list2 = append(list2, textRecord{Value: textLine(`"""`), ElideComma: true}) + for _, r := range list { + if !r.Value.Equal(textEllipsis) { + line, _ := strconv.Unquote(string(r.Value.(textLine))) + line = strings.TrimPrefix(strings.TrimSuffix(line, "\r"), "\r") // trim leading/trailing carriage returns for legacy Windows endline support + normLine := strings.Map(func(r rune) rune { + if unicode.IsSpace(r) { + return -1 // drop whitespace to avoid visually indistinguishable output + } + return r + }, line) + isPrintable := func(r rune) bool { + return unicode.IsPrint(r) || r == '\t' // specially treat tab as printable + } + isTripleQuoted = !strings.HasPrefix(line, `"""`) && !strings.HasPrefix(line, "...") && strings.TrimFunc(line, isPrintable) == "" + switch r.Diff { + case diffRemoved: + isTripleQuoted = isTripleQuoted && !prevInsertLines[normLine] + prevRemoveLines[normLine] = true + case diffInserted: + isTripleQuoted = isTripleQuoted && !prevRemoveLines[normLine] + prevInsertLines[normLine] = true + } + if !isTripleQuoted { + break + } + r.Value = textLine(line) + r.ElideComma = true + } + if !(r.Diff == diffRemoved || r.Diff == diffInserted) { // start a new non-adjacent difference group + prevRemoveLines = map[string]bool{} + prevInsertLines = map[string]bool{} + } + list2 = append(list2, r) + } + if r := list2[len(list2)-1]; r.Diff == diffIdentical && len(r.Value.(textLine)) == 0 { + list2 = list2[:len(list2)-1] // elide single empty line at the end + } + list2 = append(list2, textRecord{Value: textLine(`"""`), ElideComma: true}) + if isTripleQuoted { + var out textNode = &textWrap{Prefix: "(", Value: list2, Suffix: ")"} + switch t.Kind() { + case reflect.String: + if t != reflect.TypeOf(string("")) { + out = opts.FormatType(t, out) + } + case reflect.Slice: + // Always emit type for slices since the triple-quote syntax + // looks like a string (not a slice). + opts = opts.WithTypeMode(emitType) + out = opts.FormatType(t, out) + } + return out + } + // If the text appears to be single-lined text, // then perform differencing in approximately fixed-sized chunks. // The output is printed as quoted strings. @@ -129,6 +221,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { }, ) delim = "" + // If the text appears to be binary data, // then perform differencing in approximately fixed-sized chunks. // The output is inspired by hexdump. @@ -145,6 +238,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { return textRecord{Diff: d, Value: textLine(s), Comment: comment} }, ) + // For all other slices of primitive types, // then perform differencing in approximately fixed-sized chunks. // The size of each chunk depends on the width of the element kind. @@ -172,7 +266,9 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { switch t.Elem().Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: ss = append(ss, fmt.Sprint(v.Index(i).Int())) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: + ss = append(ss, fmt.Sprint(v.Index(i).Uint())) + case reflect.Uint8, reflect.Uintptr: ss = append(ss, formatHex(v.Index(i).Uint())) case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: ss = append(ss, fmt.Sprint(v.Index(i).Interface())) @@ -185,7 +281,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } // Wrap the output with appropriate type information. - var out textNode = textWrap{"{", list, "}"} + var out textNode = &textWrap{Prefix: "{", Value: list, Suffix: "}"} if !isText { // The "{...}" byte-sequence literal is not valid Go syntax for strings. // Emit the type for extra clarity (e.g. "string{...}"). @@ -196,12 +292,12 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } switch t.Kind() { case reflect.String: - out = textWrap{"strings.Join(", out, fmt.Sprintf(", %q)", delim)} + out = &textWrap{Prefix: "strings.Join(", Value: out, Suffix: fmt.Sprintf(", %q)", delim)} if t != reflect.TypeOf(string("")) { out = opts.FormatType(t, out) } case reflect.Slice: - out = textWrap{"bytes.Join(", out, fmt.Sprintf(", %q)", delim)} + out = &textWrap{Prefix: "bytes.Join(", Value: out, Suffix: fmt.Sprintf(", %q)", delim)} if t != reflect.TypeOf([]byte(nil)) { out = opts.FormatType(t, out) } @@ -242,9 +338,22 @@ func (opts formatOptions) formatDiffSlice( return n0 - v.Len() } + var numDiffs int + maxLen := -1 + if opts.LimitVerbosity { + maxLen = (1 << opts.verbosity()) << 2 // 4, 8, 16, 32, 64, etc... + opts.VerbosityLevel-- + } + groups := coalesceAdjacentEdits(name, es) groups = coalesceInterveningIdentical(groups, chunkSize/4) + maxGroup := diffStats{Name: name} for i, ds := range groups { + if maxLen >= 0 && numDiffs >= maxLen { + maxGroup = maxGroup.Append(ds) + continue + } + // Print equal. if ds.NumDiff() == 0 { // Compute the number of leading and trailing equal bytes to print. @@ -273,12 +382,18 @@ func (opts formatOptions) formatDiffSlice( } // Print unequal. + len0 := len(list) nx := appendChunks(vx.Slice(0, ds.NumIdentical+ds.NumRemoved+ds.NumModified), diffRemoved) vx = vx.Slice(nx, vx.Len()) ny := appendChunks(vy.Slice(0, ds.NumIdentical+ds.NumInserted+ds.NumModified), diffInserted) vy = vy.Slice(ny, vy.Len()) + numDiffs += len(list) - len0 + } + if maxGroup.IsZero() { + assert(vx.Len() == 0 && vy.Len() == 0) + } else { + list.AppendEllipsis(maxGroup) } - assert(vx.Len() == 0 && vy.Len() == 0) return list } diff --git a/vendor/github.com/google/go-cmp/cmp/report_text.go b/vendor/github.com/google/go-cmp/cmp/report_text.go index 8b8fcab7bdf..8b12c05cd4f 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_text.go +++ b/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -10,12 +10,15 @@ import ( "math/rand" "strings" "time" + "unicode/utf8" "github.com/google/go-cmp/cmp/internal/flags" ) var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 +const maxColumnLength = 80 + type indentMode int func (n indentMode) appendIndent(b []byte, d diffMode) []byte { @@ -91,21 +94,22 @@ type textNode interface { // textWrap is a wrapper that concatenates a prefix and/or a suffix // to the underlying node. type textWrap struct { - Prefix string // e.g., "bytes.Buffer{" - Value textNode // textWrap | textList | textLine - Suffix string // e.g., "}" + Prefix string // e.g., "bytes.Buffer{" + Value textNode // textWrap | textList | textLine + Suffix string // e.g., "}" + Metadata interface{} // arbitrary metadata; has no effect on formatting } -func (s textWrap) Len() int { +func (s *textWrap) Len() int { return len(s.Prefix) + s.Value.Len() + len(s.Suffix) } -func (s1 textWrap) Equal(s2 textNode) bool { - if s2, ok := s2.(textWrap); ok { +func (s1 *textWrap) Equal(s2 textNode) bool { + if s2, ok := s2.(*textWrap); ok { return s1.Prefix == s2.Prefix && s1.Value.Equal(s2.Value) && s1.Suffix == s2.Suffix } return false } -func (s textWrap) String() string { +func (s *textWrap) String() string { var d diffMode var n indentMode _, s2 := s.formatCompactTo(nil, d) @@ -114,7 +118,7 @@ func (s textWrap) String() string { b = append(b, '\n') // Trailing newline return string(b) } -func (s textWrap) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { +func (s *textWrap) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { n0 := len(b) // Original buffer length b = append(b, s.Prefix...) b, s.Value = s.Value.formatCompactTo(b, d) @@ -124,7 +128,7 @@ func (s textWrap) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { } return b, s } -func (s textWrap) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { +func (s *textWrap) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { b = append(b, s.Prefix...) b = s.Value.formatExpandedTo(b, d, n) b = append(b, s.Suffix...) @@ -136,22 +140,23 @@ func (s textWrap) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { // of the textList.formatCompactTo method. type textList []textRecord type textRecord struct { - Diff diffMode // e.g., 0 or '-' or '+' - Key string // e.g., "MyField" - Value textNode // textWrap | textLine - Comment fmt.Stringer // e.g., "6 identical fields" + Diff diffMode // e.g., 0 or '-' or '+' + Key string // e.g., "MyField" + Value textNode // textWrap | textLine + ElideComma bool // avoid trailing comma + Comment fmt.Stringer // e.g., "6 identical fields" } // AppendEllipsis appends a new ellipsis node to the list if none already // exists at the end. If cs is non-zero it coalesces the statistics with the // previous diffStats. func (s *textList) AppendEllipsis(ds diffStats) { - hasStats := ds != diffStats{} + hasStats := !ds.IsZero() if len(*s) == 0 || !(*s)[len(*s)-1].Value.Equal(textEllipsis) { if hasStats { - *s = append(*s, textRecord{Value: textEllipsis, Comment: ds}) + *s = append(*s, textRecord{Value: textEllipsis, ElideComma: true, Comment: ds}) } else { - *s = append(*s, textRecord{Value: textEllipsis}) + *s = append(*s, textRecord{Value: textEllipsis, ElideComma: true}) } return } @@ -191,7 +196,7 @@ func (s1 textList) Equal(s2 textNode) bool { } func (s textList) String() string { - return textWrap{"{", s, "}"}.String() + return (&textWrap{Prefix: "{", Value: s, Suffix: "}"}).String() } func (s textList) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { @@ -221,7 +226,7 @@ func (s textList) formatCompactTo(b []byte, d diffMode) ([]byte, textNode) { } // Force multi-lined output when printing a removed/inserted node that // is sufficiently long. - if (d == diffInserted || d == diffRemoved) && len(b[n0:]) > 80 { + if (d == diffInserted || d == diffRemoved) && len(b[n0:]) > maxColumnLength { multiLine = true } if !multiLine { @@ -236,16 +241,50 @@ func (s textList) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { _, isLine := r.Value.(textLine) return r.Key == "" || !isLine }, - func(r textRecord) int { return len(r.Key) }, + func(r textRecord) int { return utf8.RuneCountInString(r.Key) }, ) alignValueLens := s.alignLens( func(r textRecord) bool { _, isLine := r.Value.(textLine) return !isLine || r.Value.Equal(textEllipsis) || r.Comment == nil }, - func(r textRecord) int { return len(r.Value.(textLine)) }, + func(r textRecord) int { return utf8.RuneCount(r.Value.(textLine)) }, ) + // Format lists of simple lists in a batched form. + // If the list is sequence of only textLine values, + // then batch multiple values on a single line. + var isSimple bool + for _, r := range s { + _, isLine := r.Value.(textLine) + isSimple = r.Diff == 0 && r.Key == "" && isLine && r.Comment == nil + if !isSimple { + break + } + } + if isSimple { + n++ + var batch []byte + emitBatch := func() { + if len(batch) > 0 { + b = n.appendIndent(append(b, '\n'), d) + b = append(b, bytes.TrimRight(batch, " ")...) + batch = batch[:0] + } + } + for _, r := range s { + line := r.Value.(textLine) + if len(batch)+len(line)+len(", ") > maxColumnLength { + emitBatch() + } + batch = append(batch, line...) + batch = append(batch, ", "...) + } + emitBatch() + n-- + return n.appendIndent(append(b, '\n'), d) + } + // Format the list as a multi-lined output. n++ for i, r := range s { @@ -256,7 +295,7 @@ func (s textList) formatExpandedTo(b []byte, d diffMode, n indentMode) []byte { b = alignKeyLens[i].appendChar(b, ' ') b = r.Value.formatExpandedTo(b, d|r.Diff, n) - if !r.Value.Equal(textEllipsis) { + if !r.ElideComma { b = append(b, ',') } b = alignValueLens[i].appendChar(b, ' ') @@ -332,6 +371,11 @@ type diffStats struct { NumModified int } +func (s diffStats) IsZero() bool { + s.Name = "" + return s == diffStats{} +} + func (s diffStats) NumDiff() int { return s.NumRemoved + s.NumInserted + s.NumModified } diff --git a/vendor/github.com/google/gofuzz/.travis.yml b/vendor/github.com/google/gofuzz/.travis.yml index f8684d99fc4..061d72ae079 100644 --- a/vendor/github.com/google/gofuzz/.travis.yml +++ b/vendor/github.com/google/gofuzz/.travis.yml @@ -1,13 +1,10 @@ language: go go: - - 1.4 - - 1.3 - - 1.2 - - tip - -install: - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi + - 1.11.x + - 1.12.x + - 1.13.x + - master script: - go test -cover diff --git a/vendor/github.com/google/gofuzz/CONTRIBUTING.md b/vendor/github.com/google/gofuzz/CONTRIBUTING.md index 51cf5cd1ada..97c1b34fd5e 100644 --- a/vendor/github.com/google/gofuzz/CONTRIBUTING.md +++ b/vendor/github.com/google/gofuzz/CONTRIBUTING.md @@ -1,7 +1,7 @@ # How to contribute # We'd love to accept your patches and contributions to this project. There are -a just a few small guidelines you need to follow. +just a few small guidelines you need to follow. ## Contributor License Agreement ## diff --git a/vendor/github.com/google/gofuzz/README.md b/vendor/github.com/google/gofuzz/README.md index 386c2a457a8..b503aae7d71 100644 --- a/vendor/github.com/google/gofuzz/README.md +++ b/vendor/github.com/google/gofuzz/README.md @@ -68,4 +68,22 @@ f.Fuzz(&myObject) // Type will correspond to whether A or B info is set. See more examples in ```example_test.go```. +You can use this library for easier [go-fuzz](https://github.com/dvyukov/go-fuzz)ing. +go-fuzz provides the user a byte-slice, which should be converted to different inputs +for the tested function. This library can help convert the byte slice. Consider for +example a fuzz test for a the function `mypackage.MyFunc` that takes an int arguments: +```go +// +build gofuzz +package mypackage + +import fuzz "github.com/google/gofuzz" + +func Fuzz(data []byte) int { + var i int + fuzz.NewFromGoFuzz(data).Fuzz(&i) + MyFunc(i) + return 0 +} +``` + Happy testing! diff --git a/vendor/github.com/google/gofuzz/bytesource/bytesource.go b/vendor/github.com/google/gofuzz/bytesource/bytesource.go new file mode 100644 index 00000000000..5bb36594969 --- /dev/null +++ b/vendor/github.com/google/gofuzz/bytesource/bytesource.go @@ -0,0 +1,81 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +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 bytesource provides a rand.Source64 that is determined by a slice of bytes. +package bytesource + +import ( + "bytes" + "encoding/binary" + "io" + "math/rand" +) + +// ByteSource implements rand.Source64 determined by a slice of bytes. The random numbers are +// generated from each 8 bytes in the slice, until the last bytes are consumed, from which a +// fallback pseudo random source is created in case more random numbers are required. +// It also exposes a `bytes.Reader` API, which lets callers consume the bytes directly. +type ByteSource struct { + *bytes.Reader + fallback rand.Source +} + +// New returns a new ByteSource from a given slice of bytes. +func New(input []byte) *ByteSource { + s := &ByteSource{ + Reader: bytes.NewReader(input), + fallback: rand.NewSource(0), + } + if len(input) > 0 { + s.fallback = rand.NewSource(int64(s.consumeUint64())) + } + return s +} + +func (s *ByteSource) Uint64() uint64 { + // Return from input if it was not exhausted. + if s.Len() > 0 { + return s.consumeUint64() + } + + // Input was exhausted, return random number from fallback (in this case fallback should not be + // nil). Try first having a Uint64 output (Should work in current rand implementation), + // otherwise return a conversion of Int63. + if s64, ok := s.fallback.(rand.Source64); ok { + return s64.Uint64() + } + return uint64(s.fallback.Int63()) +} + +func (s *ByteSource) Int63() int64 { + return int64(s.Uint64() >> 1) +} + +func (s *ByteSource) Seed(seed int64) { + s.fallback = rand.NewSource(seed) + s.Reader = bytes.NewReader(nil) +} + +// consumeUint64 reads 8 bytes from the input and convert them to a uint64. It assumes that the the +// bytes reader is not empty. +func (s *ByteSource) consumeUint64() uint64 { + var bytes [8]byte + _, err := s.Read(bytes[:]) + if err != nil && err != io.EOF { + panic("failed reading source") // Should not happen. + } + return binary.BigEndian.Uint64(bytes[:]) +} diff --git a/vendor/github.com/google/gofuzz/fuzz.go b/vendor/github.com/google/gofuzz/fuzz.go index da0a5f93800..761520a8cee 100644 --- a/vendor/github.com/google/gofuzz/fuzz.go +++ b/vendor/github.com/google/gofuzz/fuzz.go @@ -22,6 +22,9 @@ import ( "reflect" "regexp" "time" + + "github.com/google/gofuzz/bytesource" + "strings" ) // fuzzFuncMap is a map from a type to a fuzzFunc that handles that type. @@ -61,6 +64,34 @@ func NewWithSeed(seed int64) *Fuzzer { return f } +// NewFromGoFuzz is a helper function that enables using gofuzz (this +// project) with go-fuzz (https://github.com/dvyukov/go-fuzz) for continuous +// fuzzing. Essentially, it enables translating the fuzzing bytes from +// go-fuzz to any Go object using this library. +// +// This implementation promises a constant translation from a given slice of +// bytes to the fuzzed objects. This promise will remain over future +// versions of Go and of this library. +// +// Note: the returned Fuzzer should not be shared between multiple goroutines, +// as its deterministic output will no longer be available. +// +// Example: use go-fuzz to test the function `MyFunc(int)` in the package +// `mypackage`. Add the file: "mypacakge_fuzz.go" with the content: +// +// // +build gofuzz +// package mypacakge +// import fuzz "github.com/google/gofuzz" +// func Fuzz(data []byte) int { +// var i int +// fuzz.NewFromGoFuzz(data).Fuzz(&i) +// MyFunc(i) +// return 0 +// } +func NewFromGoFuzz(data []byte) *Fuzzer { + return New().RandSource(bytesource.New(data)) +} + // Funcs adds each entry in fuzzFuncs as a custom fuzzing function. // // Each entry in fuzzFuncs must be a function taking two parameters. @@ -141,7 +172,7 @@ func (f *Fuzzer) genElementCount() int { } func (f *Fuzzer) genShouldFill() bool { - return f.r.Float64() > f.nilChance + return f.r.Float64() >= f.nilChance } // MaxDepth sets the maximum number of recursive fuzz calls that will be made @@ -240,6 +271,7 @@ func (fc *fuzzerContext) doFuzz(v reflect.Value, flags uint64) { fn(v, fc.fuzzer.r) return } + switch v.Kind() { case reflect.Map: if fc.fuzzer.genShouldFill() { @@ -450,10 +482,10 @@ var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ v.SetFloat(r.Float64()) }, reflect.Complex64: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") + v.SetComplex(complex128(complex(r.Float32(), r.Float32()))) }, reflect.Complex128: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") + v.SetComplex(complex(r.Float64(), r.Float64())) }, reflect.String: func(v reflect.Value, r *rand.Rand) { v.SetString(randString(r)) @@ -465,38 +497,105 @@ var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ // randBool returns true or false randomly. func randBool(r *rand.Rand) bool { - if r.Int()&1 == 1 { - return true - } - return false + return r.Int31()&(1<<30) == 0 +} + +type int63nPicker interface { + Int63n(int64) int64 } -type charRange struct { - first, last rune +// UnicodeRange describes a sequential range of unicode characters. +// Last must be numerically greater than First. +type UnicodeRange struct { + First, Last rune } +// UnicodeRanges describes an arbitrary number of sequential ranges of unicode characters. +// To be useful, each range must have at least one character (First <= Last) and +// there must be at least one range. +type UnicodeRanges []UnicodeRange + // choose returns a random unicode character from the given range, using the // given randomness source. -func (r *charRange) choose(rand *rand.Rand) rune { - count := int64(r.last - r.first) - return r.first + rune(rand.Int63n(count)) +func (ur UnicodeRange) choose(r int63nPicker) rune { + count := int64(ur.Last - ur.First + 1) + return ur.First + rune(r.Int63n(count)) +} + +// CustomStringFuzzFunc constructs a FuzzFunc which produces random strings. +// Each character is selected from the range ur. If there are no characters +// in the range (cr.Last < cr.First), this will panic. +func (ur UnicodeRange) CustomStringFuzzFunc() func(s *string, c Continue) { + ur.check() + return func(s *string, c Continue) { + *s = ur.randString(c.Rand) + } } -var unicodeRanges = []charRange{ +// check is a function that used to check whether the first of ur(UnicodeRange) +// is greater than the last one. +func (ur UnicodeRange) check() { + if ur.Last < ur.First { + panic("The last encoding must be greater than the first one.") + } +} + +// randString of UnicodeRange makes a random string up to 20 characters long. +// Each character is selected form ur(UnicodeRange). +func (ur UnicodeRange) randString(r *rand.Rand) string { + n := r.Intn(20) + sb := strings.Builder{} + sb.Grow(n) + for i := 0; i < n; i++ { + sb.WriteRune(ur.choose(r)) + } + return sb.String() +} + +// defaultUnicodeRanges sets a default unicode range when user do not set +// CustomStringFuzzFunc() but wants fuzz string. +var defaultUnicodeRanges = UnicodeRanges{ {' ', '~'}, // ASCII characters {'\u00a0', '\u02af'}, // Multi-byte encoded characters {'\u4e00', '\u9fff'}, // Common CJK (even longer encodings) } +// CustomStringFuzzFunc constructs a FuzzFunc which produces random strings. +// Each character is selected from one of the ranges of ur(UnicodeRanges). +// Each range has an equal probability of being chosen. If there are no ranges, +// or a selected range has no characters (.Last < .First), this will panic. +// Do not modify any of the ranges in ur after calling this function. +func (ur UnicodeRanges) CustomStringFuzzFunc() func(s *string, c Continue) { + // Check unicode ranges slice is empty. + if len(ur) == 0 { + panic("UnicodeRanges is empty.") + } + // if not empty, each range should be checked. + for i := range ur { + ur[i].check() + } + return func(s *string, c Continue) { + *s = ur.randString(c.Rand) + } +} + +// randString of UnicodeRanges makes a random string up to 20 characters long. +// Each character is selected form one of the ranges of ur(UnicodeRanges), +// and each range has an equal probability of being chosen. +func (ur UnicodeRanges) randString(r *rand.Rand) string { + n := r.Intn(20) + sb := strings.Builder{} + sb.Grow(n) + for i := 0; i < n; i++ { + sb.WriteRune(ur[r.Intn(len(ur))].choose(r)) + } + return sb.String() +} + // randString makes a random string up to 20 characters long. The returned string // may include a variety of (valid) UTF-8 encodings. func randString(r *rand.Rand) string { - n := r.Intn(20) - runes := make([]rune, n) - for i := range runes { - runes[i] = unicodeRanges[r.Intn(len(unicodeRanges))].choose(r) - } - return string(runes) + return defaultUnicodeRanges.randString(r) } // randUint64 makes random 64 bit numbers. diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md index 9d92c11f16f..f765a46f915 100644 --- a/vendor/github.com/google/uuid/README.md +++ b/vendor/github.com/google/uuid/README.md @@ -16,4 +16,4 @@ change is the ability to represent an invalid UUID (vs a NIL UUID). Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: -http://godoc.org/github.com/google/uuid +http://pkg.go.dev/github.com/google/uuid diff --git a/vendor/github.com/google/uuid/marshal.go b/vendor/github.com/google/uuid/marshal.go index 7f9e0c6c0e3..14bd34072b6 100644 --- a/vendor/github.com/google/uuid/marshal.go +++ b/vendor/github.com/google/uuid/marshal.go @@ -16,10 +16,11 @@ func (uuid UUID) MarshalText() ([]byte, error) { // UnmarshalText implements encoding.TextUnmarshaler. func (uuid *UUID) UnmarshalText(data []byte) error { id, err := ParseBytes(data) - if err == nil { - *uuid = id + if err != nil { + return err } - return err + *uuid = id + return nil } // MarshalBinary implements encoding.BinaryMarshaler. diff --git a/vendor/github.com/google/uuid/version1.go b/vendor/github.com/google/uuid/version1.go index 199a1ac6540..463109629ee 100644 --- a/vendor/github.com/google/uuid/version1.go +++ b/vendor/github.com/google/uuid/version1.go @@ -17,12 +17,6 @@ import ( // // In most cases, New should be used. func NewUUID() (UUID, error) { - nodeMu.Lock() - if nodeID == zeroID { - setNodeInterface("") - } - nodeMu.Unlock() - var uuid UUID now, seq, err := GetTime() if err != nil { @@ -38,7 +32,13 @@ func NewUUID() (UUID, error) { binary.BigEndian.PutUint16(uuid[4:], timeMid) binary.BigEndian.PutUint16(uuid[6:], timeHi) binary.BigEndian.PutUint16(uuid[8:], seq) + + nodeMu.Lock() + if nodeID == zeroID { + setNodeInterface("") + } copy(uuid[10:], nodeID[:]) + nodeMu.Unlock() return uuid, nil } diff --git a/vendor/github.com/google/uuid/version4.go b/vendor/github.com/google/uuid/version4.go index 84af91c9f54..c110465db59 100644 --- a/vendor/github.com/google/uuid/version4.go +++ b/vendor/github.com/google/uuid/version4.go @@ -27,8 +27,13 @@ func New() UUID { // equivalent to the odds of creating a few tens of trillions of UUIDs in a // year and having one duplicate. func NewRandom() (UUID, error) { + return NewRandomFromReader(rander) +} + +// NewRandomFromReader returns a UUID based on bytes read from a given io.Reader. +func NewRandomFromReader(r io.Reader) (UUID, error) { var uuid UUID - _, err := io.ReadFull(rander, uuid[:]) + _, err := io.ReadFull(r, uuid[:]) if err != nil { return Nil, err } diff --git a/vendor/github.com/gophercloud/gophercloud/.zuul.yaml b/vendor/github.com/gophercloud/gophercloud/.zuul.yaml index 67c71a6983f..5da89829150 100644 --- a/vendor/github.com/gophercloud/gophercloud/.zuul.yaml +++ b/vendor/github.com/gophercloud/gophercloud/.zuul.yaml @@ -23,6 +23,24 @@ run: .zuul/playbooks/gophercloud-acceptance-test-ironic/run.yaml nodeset: ubuntu-bionic +- job: + name: gophercloud-acceptance-test-ussuri + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on ussuri branch + vars: + global_env: + OS_BRANCH: stable/ussuri + +- job: + name: gophercloud-acceptance-test-train + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on train branch + vars: + global_env: + OS_BRANCH: stable/train + - job: name: gophercloud-acceptance-test-stein parent: gophercloud-acceptance-test @@ -37,7 +55,6 @@ parent: gophercloud-acceptance-test description: | Run gophercloud acceptance test on rocky branch - nodeset: ubuntu-xenial vars: global_env: OS_BRANCH: stable/rocky @@ -52,6 +69,8 @@ global_env: OS_BRANCH: stable/queens +# NOTE: A Pike-based devstack environment is currently +# not building correctly. This might be a temporary issue. - job: name: gophercloud-acceptance-test-pike parent: gophercloud-acceptance-test @@ -72,6 +91,8 @@ global_env: OS_BRANCH: stable/ocata +# NOTE: A Newton-based devstack environment is currently +# not building correctly. This might be a temporary issue. - job: name: gophercloud-acceptance-test-newton parent: gophercloud-acceptance-test @@ -107,3 +128,9 @@ recheck-stein: jobs: - gophercloud-acceptance-test-stein + recheck-train: + jobs: + - gophercloud-acceptance-test-train + recheck-ussuri: + jobs: + - gophercloud-acceptance-test-ussuri diff --git a/vendor/github.com/gostaticanalysis/analysisutil/call.go b/vendor/github.com/gostaticanalysis/analysisutil/call.go new file mode 100644 index 00000000000..e3d98d1dc75 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/analysisutil/call.go @@ -0,0 +1,405 @@ +package analysisutil + +import ( + "go/types" + + "golang.org/x/tools/go/ssa" +) + +// CalledChecker checks a function is called. +// See From and Func. +type CalledChecker struct { + Ignore func(instr ssa.Instruction) bool +} + +// NotIn checks whether receiver's method is called in a function. +// If there is no methods calling at a path from an instruction +// which type is receiver to all return instruction, NotIn returns these instructions. +func (c *CalledChecker) NotIn(f *ssa.Function, receiver types.Type, methods ...*types.Func) []ssa.Instruction { + done := map[ssa.Value]bool{} + var instrs []ssa.Instruction + for _, b := range f.Blocks { + for i, instr := range b.Instrs { + v, _ := instr.(ssa.Value) + if v == nil || done[v] { + continue + } + + if v, _ := v.(*ssa.UnOp); v != nil && done[v.X] { + continue + } + + called, ok := c.From(b, i, receiver, methods...) + if ok && !called { + instrs = append(instrs, instr) + done[v] = true + if v, _ := v.(*ssa.UnOp); v != nil { + done[v.X] = true + } + } + } + } + return instrs +} + +// Func returns true when f is called in the instr. +// If recv is not nil, Func also checks the receiver. +func (c *CalledChecker) Func(instr ssa.Instruction, recv ssa.Value, f *types.Func) bool { + + if c.Ignore != nil && c.Ignore(instr) { + return false + } + + call, ok := instr.(ssa.CallInstruction) + if !ok { + return false + } + + common := call.Common() + if common == nil { + return false + } + + callee := common.StaticCallee() + if callee == nil { + return false + } + + fn, ok := callee.Object().(*types.Func) + if !ok { + return false + } + + if recv != nil && + common.Signature().Recv() != nil && + (len(common.Args) == 0 && recv != nil || common.Args[0] != recv && + !referrer(recv, common.Args[0])) { + return false + } + + return fn == f +} + +func referrer(a, b ssa.Value) bool { + return isReferrerOf(a, b) || isReferrerOf(b, a) +} + +func isReferrerOf(a, b ssa.Value) bool { + if a == nil || b == nil { + return false + } + if b.Referrers() != nil { + brs := *b.Referrers() + + for _, br := range brs { + brv, ok := br.(ssa.Value) + if !ok { + continue + } + if brv == a { + return true + } + } + } + return false +} + +// From checks whether receiver's method is called in an instruction +// which belogns to after i-th instructions, or in succsor blocks of b. +// The first result is above value. +// The second result is whether type of i-th instruction does not much receiver +// or matches with ignore cases. +func (c *CalledChecker) From(b *ssa.BasicBlock, i int, receiver types.Type, methods ...*types.Func) (called, ok bool) { + if b == nil || i < 0 || i >= len(b.Instrs) || + receiver == nil || len(methods) == 0 { + return false, false + } + + v, ok := b.Instrs[i].(ssa.Value) + if !ok { + return false, false + } + + from := &calledFrom{recv: v, fs: methods, ignore: c.Ignore} + + if !from.isRecv(receiver, v.Type()) { + return false, false + } + + if from.ignored() { + return false, false + } + + if from.instrs(b.Instrs[i+1:]) || + from.succs(b) { + return true, true + } + + from.done = nil + if from.storedInInstrs(b.Instrs[i+1:]) || + from.storedInSuccs(b) { + return false, false + } + + return false, true +} + +type calledFrom struct { + recv ssa.Value + fs []*types.Func + done map[*ssa.BasicBlock]bool + ignore func(ssa.Instruction) bool +} + +func (c *calledFrom) ignored() bool { + + switch v := c.recv.(type) { + case *ssa.UnOp: + switch v.X.(type) { + case *ssa.FreeVar, *ssa.Global: + return true + } + } + + refs := c.recv.Referrers() + if refs == nil { + return false + } + + for _, ref := range *refs { + done := map[ssa.Instruction]bool{} + if !c.isOwn(ref) && + ((c.ignore != nil && c.ignore(ref)) || + c.isRet(ref, done) || c.isArg(ref)) { + return true + } + } + + return false +} + +func (c *calledFrom) isOwn(instr ssa.Instruction) bool { + v, ok := instr.(ssa.Value) + if !ok { + return false + } + return v == c.recv +} + +func (c *calledFrom) isRet(instr ssa.Instruction, done map[ssa.Instruction]bool) bool { + if done[instr] { + return false + } + done[instr] = true + + switch instr := instr.(type) { + case *ssa.Return: + return true + case *ssa.MapUpdate: + return c.isRetInRefs(instr.Map, done) + case *ssa.Store: + if instr, _ := instr.Addr.(ssa.Instruction); instr != nil { + return c.isRet(instr, done) + } + return c.isRetInRefs(instr.Addr, done) + case *ssa.FieldAddr: + return c.isRetInRefs(instr.X, done) + case ssa.Value: + return c.isRetInRefs(instr, done) + default: + return false + } +} + +func (c *calledFrom) isRetInRefs(v ssa.Value, done map[ssa.Instruction]bool) bool { + refs := v.Referrers() + if refs == nil { + return false + } + for _, ref := range *refs { + if c.isRet(ref, done) { + return true + } + } + return false +} + +func (c *calledFrom) isArg(instr ssa.Instruction) bool { + + call, ok := instr.(ssa.CallInstruction) + if !ok { + return false + } + + common := call.Common() + if common == nil { + return false + } + + args := common.Args + if common.Signature().Recv() != nil { + args = args[1:] + } + + for i := range args { + if args[i] == c.recv { + return true + } + } + + return false +} + +func (c *calledFrom) instrs(instrs []ssa.Instruction) bool { + for _, instr := range instrs { + for _, f := range c.fs { + if Called(instr, c.recv, f) { + return true + } + } + } + return false +} + +func (c *calledFrom) succs(b *ssa.BasicBlock) bool { + if c.done == nil { + c.done = map[*ssa.BasicBlock]bool{} + } + + if c.done[b] { + return true + } + c.done[b] = true + + if len(b.Succs) == 0 { + return false + } + + for _, s := range b.Succs { + if !c.instrs(s.Instrs) && !c.succs(s) { + return false + } + } + + return true +} + +func (c *calledFrom) storedInInstrs(instrs []ssa.Instruction) bool { + for _, instr := range instrs { + switch instr := instr.(type) { + case *ssa.Store: + if instr.Val == c.recv { + return true + } + } + } + return false +} + +func (c *calledFrom) storedInSuccs(b *ssa.BasicBlock) bool { + if c.done == nil { + c.done = map[*ssa.BasicBlock]bool{} + } + + if c.done[b] { + return true + } + c.done[b] = true + + if len(b.Succs) == 0 { + return false + } + + for _, s := range b.Succs { + if !c.storedInInstrs(s.Instrs) && !c.succs(s) { + return false + } + } + + return true +} + +func (c *calledFrom) isRecv(recv, typ types.Type) bool { + return recv == typ || identical(recv, typ) || + c.isRecvInTuple(recv, typ) || c.isRecvInEmbedded(recv, typ) +} + +func (c *calledFrom) isRecvInTuple(recv, typ types.Type) bool { + tuple, _ := typ.(*types.Tuple) + if tuple == nil { + return false + } + + for i := 0; i < tuple.Len(); i++ { + if c.isRecv(recv, tuple.At(i).Type()) { + return true + } + } + + return false +} + +func (c *calledFrom) isRecvInEmbedded(recv, typ types.Type) bool { + + var st *types.Struct + switch typ := typ.(type) { + case *types.Struct: + st = typ + case *types.Pointer: + return c.isRecvInEmbedded(recv, typ.Elem()) + case *types.Named: + return c.isRecvInEmbedded(recv, typ.Underlying()) + default: + return false + } + + for i := 0; i < st.NumFields(); i++ { + field := st.Field(i) + if !field.Embedded() { + continue + } + + ft := field.Type() + if c.isRecv(recv, ft) { + return true + } + + var ptrOrUnptr types.Type + switch ft := ft.(type) { + case *types.Pointer: + // struct { *T } -> T + ptrOrUnptr = ft.Elem() + default: + // struct { T } -> *T + ptrOrUnptr = types.NewPointer(ft) + } + + if c.isRecv(recv, ptrOrUnptr) { + return true + } + } + + return false +} + +// NotCalledIn checks whether receiver's method is called in a function. +// If there is no methods calling at a path from an instruction +// which type is receiver to all return instruction, NotCalledIn returns these instructions. +func NotCalledIn(f *ssa.Function, receiver types.Type, methods ...*types.Func) []ssa.Instruction { + return new(CalledChecker).NotIn(f, receiver, methods...) +} + +// CalledFrom checks whether receiver's method is called in an instruction +// which belogns to after i-th instructions, or in succsor blocks of b. +// The first result is above value. +// The second result is whether type of i-th instruction does not much receiver +// or matches with ignore cases. +func CalledFrom(b *ssa.BasicBlock, i int, receiver types.Type, methods ...*types.Func) (called, ok bool) { + return new(CalledChecker).From(b, i, receiver, methods...) +} + +// Called returns true when f is called in the instr. +// If recv is not nil, Called also checks the receiver. +func Called(instr ssa.Instruction, recv ssa.Value, f *types.Func) bool { + return new(CalledChecker).Func(instr, recv, f) +} diff --git a/vendor/github.com/gostaticanalysis/analysisutil/diagnostic.go b/vendor/github.com/gostaticanalysis/analysisutil/diagnostic.go new file mode 100644 index 00000000000..a911db6f192 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/analysisutil/diagnostic.go @@ -0,0 +1,45 @@ +package analysisutil + +import ( + "go/token" + + "github.com/gostaticanalysis/comment" + "github.com/gostaticanalysis/comment/passes/commentmap" + "golang.org/x/tools/go/analysis" +) + +// ReportWithoutIgnore returns a report function which can set to (analysis.Pass).Report. +// The report function ignores a diagnostic which annotated by ignore comment as the below. +// //lint:ignore Check1[,Check2,...,CheckN] reason +// names is a list of checker names. +// If names was omitted, the report function ignores by pass.Analyzer.Name. +func ReportWithoutIgnore(pass *analysis.Pass, names ...string) func(analysis.Diagnostic) { + cmaps, _ := pass.ResultOf[commentmap.Analyzer].(comment.Maps) + if cmaps == nil { + cmaps = comment.New(pass.Fset, pass.Files) + } + + if len(names) == 0 { + names = []string{pass.Analyzer.Name} + } + + report := pass.Report // original report func + + return func(d analysis.Diagnostic) { + start := pass.Fset.File(d.Pos).Line(d.Pos) + end := start + if d.End != token.NoPos { + end = pass.Fset.File(d.End).Line(d.End) + } + + for l := start; l <= end; l++ { + for _, n := range names { + if cmaps.IgnoreLine(pass.Fset, l, n) { + return + } + } + } + + report(d) + } +} diff --git a/vendor/github.com/gostaticanalysis/analysisutil/go.mod b/vendor/github.com/gostaticanalysis/analysisutil/go.mod index 7e3e55be1bd..5ca7c62b845 100644 --- a/vendor/github.com/gostaticanalysis/analysisutil/go.mod +++ b/vendor/github.com/gostaticanalysis/analysisutil/go.mod @@ -2,4 +2,7 @@ module github.com/gostaticanalysis/analysisutil go 1.12 -require golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5 +require ( + github.com/gostaticanalysis/comment v1.4.1 + golang.org/x/tools v0.0.0-20200820010801-b793a1359eac +) diff --git a/vendor/github.com/gostaticanalysis/analysisutil/go.sum b/vendor/github.com/gostaticanalysis/analysisutil/go.sum index 16c8787c4cc..134e67dbd85 100644 --- a/vendor/github.com/gostaticanalysis/analysisutil/go.sum +++ b/vendor/github.com/gostaticanalysis/analysisutil/go.sum @@ -1,6 +1,37 @@ +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gostaticanalysis/comment v1.3.0 h1:wTVgynbFu8/nz6SGgywA0TcyIoAVsYc7ai/Zp5xNGlw= +github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= +github.com/gostaticanalysis/comment v1.4.1 h1:xHopR5L2lRz6OsjH4R2HG5wRhW9ySl3FsHIvi5pcXwc= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +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/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5 h1:ZcPpqKMdoZeNQ/4GHlyY4COf8n8SmpPv6mcqF1+VPSM= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3 h1:2oZsfYnKfYzL4I57uYiRFsUf0bqlLkiuw8nnj3+voUA= +golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff h1:foic6oVZ4MKltJC6MXzuFZFswE7NCjjtc0Hxbyblawc= +golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac h1:DugppSxw0LSF8lcjaODPJZoDzq0ElTGskTst3ZaBkHI= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/github.com/gostaticanalysis/analysisutil/pkg.go b/vendor/github.com/gostaticanalysis/analysisutil/pkg.go index c98710d187a..b64150d8104 100644 --- a/vendor/github.com/gostaticanalysis/analysisutil/pkg.go +++ b/vendor/github.com/gostaticanalysis/analysisutil/pkg.go @@ -2,14 +2,17 @@ package analysisutil import ( "go/types" + "strconv" "strings" + + "golang.org/x/tools/go/analysis" ) -// RemoVendor removes vendoring infomation from import path. +// RemoVendor removes vendoring information from import path. func RemoveVendor(path string) string { - i := strings.Index(path, "vendor") + i := strings.Index(path, "vendor/") if i >= 0 { - return path[i+len("vendor")+1:] + return path[i+len("vendor/"):] } return path } @@ -24,3 +27,23 @@ func LookupFromImports(imports []*types.Package, path, name string) types.Object } return nil } + +// Imported returns true when the given pass imports the pkg. +func Imported(pkgPath string, pass *analysis.Pass) bool { + fs := pass.Files + if len(fs) == 0 { + return false + } + for _, f := range fs { + for _, i := range f.Imports { + path, err := strconv.Unquote(i.Path.Value) + if err != nil { + continue + } + if RemoveVendor(path) == pkgPath { + return true + } + } + } + return false +} diff --git a/vendor/github.com/gostaticanalysis/analysisutil/ssa.go b/vendor/github.com/gostaticanalysis/analysisutil/ssa.go index 3791586675b..ce3af580bac 100644 --- a/vendor/github.com/gostaticanalysis/analysisutil/ssa.go +++ b/vendor/github.com/gostaticanalysis/analysisutil/ssa.go @@ -1,6 +1,8 @@ package analysisutil -import "golang.org/x/tools/go/ssa" +import ( + "golang.org/x/tools/go/ssa" +) // IfInstr returns *ssa.If which is contained in the block b. // If the block b has not any if instruction, IfInstr returns nil. @@ -29,3 +31,53 @@ func Phi(b *ssa.BasicBlock) (phis []*ssa.Phi) { } return } + +// Returns returns a slice of *ssa.Return in the function. +func Returns(v ssa.Value) []*ssa.Return { + var fn *ssa.Function + switch v := v.(type) { + case *ssa.Function: + fn = v + case *ssa.MakeClosure: + return Returns(v.Fn) + default: + return nil + } + + var rets []*ssa.Return + done := map[*ssa.BasicBlock]bool{} + for _, b := range fn.Blocks { + rets = append(rets, returnsInBlock(b, done)...) + } + return rets +} + +func returnsInBlock(b *ssa.BasicBlock, done map[*ssa.BasicBlock]bool) (rets []*ssa.Return) { + if done[b] { + return + } + done[b] = true + + if len(b.Instrs) != 0 { + switch instr := b.Instrs[len(b.Instrs)-1].(type) { + case *ssa.Return: + rets = append(rets, instr) + } + } + + for _, s := range b.Succs { + rets = append(rets, returnsInBlock(s, done)...) + } + return +} + +// BinOp returns binary operator values which are contained in the block b. +func BinOp(b *ssa.BasicBlock) ([]*ssa.BinOp) { + var binops []*ssa.BinOp + for _, instr := range b.Instrs { + if binop, ok := instr.(*ssa.BinOp); ok { + binops = append(binops, binop) + } + } + return binops +} diff --git a/vendor/github.com/gostaticanalysis/analysisutil/ssainspect.go b/vendor/github.com/gostaticanalysis/analysisutil/ssainspect.go new file mode 100644 index 00000000000..2f8a1657659 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/analysisutil/ssainspect.go @@ -0,0 +1,37 @@ +package analysisutil + +import "golang.org/x/tools/go/ssa" + +// InspectInstr inspects from i-th instruction of start block to succsessor blocks. +func InspectInstr(start *ssa.BasicBlock, i int, f func(i int, instr ssa.Instruction) bool) { + new(instrInspector).block(start, i, f) +} + +type instrInspector struct { + done map[*ssa.BasicBlock]bool +} + +func (ins *instrInspector) block(b *ssa.BasicBlock, i int, f func(i int, instr ssa.Instruction) bool) { + if ins.done == nil { + ins.done = map[*ssa.BasicBlock]bool{} + } + + if b == nil || ins.done[b] || len(b.Instrs) <= i { + return + } + + ins.done[b] = true + ins.instrs(i, b.Instrs[i:], f) + for _, s := range b.Succs { + ins.block(s, 0, f) + } + +} + +func (ins *instrInspector) instrs(offset int, instrs []ssa.Instruction, f func(i int, instr ssa.Instruction) bool) { + for i, instr := range instrs { + if !f(offset+i, instr) { + break + } + } +} diff --git a/vendor/github.com/gostaticanalysis/analysisutil/types.go b/vendor/github.com/gostaticanalysis/analysisutil/types.go new file mode 100644 index 00000000000..4773ac43e61 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/analysisutil/types.go @@ -0,0 +1,198 @@ +package analysisutil + +import ( + "go/ast" + "go/types" + + "golang.org/x/tools/go/analysis" +) + +var errType = types.Universe.Lookup("error").Type().Underlying().(*types.Interface) + +// ImplementsError return whether t implements error interface. +func ImplementsError(t types.Type) bool { + return types.Implements(t, errType) +} + +// ObjectOf returns types.Object by given name in the package. +func ObjectOf(pass *analysis.Pass, pkg, name string) types.Object { + obj := LookupFromImports(pass.Pkg.Imports(), pkg, name) + if obj != nil { + return obj + } + if RemoveVendor(pass.Pkg.Name()) != RemoveVendor(pkg) { + return nil + } + return pass.Pkg.Scope().Lookup(name) +} + +// TypeOf returns types.Type by given name in the package. +// TypeOf accepts pointer types such as *T. +func TypeOf(pass *analysis.Pass, pkg, name string) types.Type { + if name == "" { + return nil + } + + if name[0] == '*' { + obj := TypeOf(pass, pkg, name[1:]) + if obj == nil { + return nil + } + return types.NewPointer(obj) + } + + obj := ObjectOf(pass, pkg, name) + if obj == nil { + return nil + } + + return obj.Type() +} + +// MethodOf returns a method which has given name in the type. +func MethodOf(typ types.Type, name string) *types.Func { + switch typ := typ.(type) { + case *types.Named: + for i := 0; i < typ.NumMethods(); i++ { + if f := typ.Method(i); f.Name() == name { + return f + } + } + case *types.Pointer: + return MethodOf(typ.Elem(), name) + } + return nil +} + +// see: https://github.com/golang/go/issues/19670 +func identical(x, y types.Type) (ret bool) { + defer func() { + r := recover() + switch r := r.(type) { + case string: + if r == "unreachable" { + ret = false + return + } + case nil: + return + } + panic(r) + }() + return types.Identical(x, y) +} + +// Interfaces returns a map of interfaces which are declared in the package. +func Interfaces(pkg *types.Package) map[string]*types.Interface { + ifs := map[string]*types.Interface{} + + for _, n := range pkg.Scope().Names() { + o := pkg.Scope().Lookup(n) + if o != nil { + i, ok := o.Type().Underlying().(*types.Interface) + if ok { + ifs[n] = i + } + } + } + + return ifs +} + +// Structs returns a map of structs which are declared in the package. +func Structs(pkg *types.Package) map[string]*types.Struct { + structs := map[string]*types.Struct{} + + for _, n := range pkg.Scope().Names() { + o := pkg.Scope().Lookup(n) + if o != nil { + s, ok := o.Type().Underlying().(*types.Struct) + if ok { + structs[n] = s + } + } + } + + return structs +} + +// HasField returns whether the struct has the field. +func HasField(s *types.Struct, f *types.Var) bool { + if s == nil || f == nil { + return false + } + + for i := 0; i < s.NumFields(); i++ { + if s.Field(i) == f { + return true + } + } + + return false +} + +func TypesInfo(info ...*types.Info) *types.Info { + if len(info) == 0 { + return nil + } + + var merged types.Info + for i := range info { + mergeTypesInfo(&merged, info[i]) + } + + return &merged +} + +func mergeTypesInfo(i1, i2 *types.Info) { + // Types + if i1.Types == nil && i2.Types != nil { + i1.Types = map[ast.Expr]types.TypeAndValue{} + } + for expr, tv := range i2.Types { + i1.Types[expr] = tv + } + + // Defs + if i1.Defs == nil && i2.Defs != nil { + i1.Defs = map[*ast.Ident]types.Object{} + } + for ident, obj := range i2.Defs { + i1.Defs[ident] = obj + } + + // Uses + if i1.Uses == nil && i2.Uses != nil { + i1.Uses = map[*ast.Ident]types.Object{} + } + for ident, obj := range i2.Uses { + i1.Uses[ident] = obj + } + + // Implicits + if i1.Implicits == nil && i2.Implicits != nil { + i1.Implicits = map[ast.Node]types.Object{} + } + for n, obj := range i2.Implicits { + i1.Implicits[n] = obj + } + + // Selections + if i1.Selections == nil && i2.Selections != nil { + i1.Selections = map[*ast.SelectorExpr]*types.Selection{} + } + for expr, sel := range i2.Selections { + i1.Selections[expr] = sel + } + + // Scopes + if i1.Scopes == nil && i2.Scopes != nil { + i1.Scopes = map[ast.Node]*types.Scope{} + } + for n, s := range i2.Scopes { + i1.Scopes[n] = s + } + + // InitOrder + i1.InitOrder = append(i1.InitOrder, i2.InitOrder...) +} diff --git a/vendor/github.com/gostaticanalysis/comment/LICENSE b/vendor/github.com/gostaticanalysis/comment/LICENSE new file mode 100644 index 00000000000..4f7eeff5bad --- /dev/null +++ b/vendor/github.com/gostaticanalysis/comment/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Takuya Ueda + +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. diff --git a/vendor/github.com/gostaticanalysis/comment/README.md b/vendor/github.com/gostaticanalysis/comment/README.md new file mode 100644 index 00000000000..53355531373 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/comment/README.md @@ -0,0 +1,10 @@ +# gostaticanalysis/comment + +[![godoc.org][godoc-badge]][godoc] + +`comment` provides utilities for [ast.CommentMap](https://golang.org/pkg/go/ast/#CommentMap). + + +[godoc]: https://godoc.org/github.com/gostaticanalysis/comment +[godoc-badge]: https://img.shields.io/badge/godoc-reference-4F73B3.svg?style=flat-square&label=%20godoc.org + diff --git a/vendor/github.com/gostaticanalysis/comment/comment.go b/vendor/github.com/gostaticanalysis/comment/comment.go new file mode 100644 index 00000000000..2fe67fa9657 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/comment/comment.go @@ -0,0 +1,147 @@ +package comment + +import ( + "go/ast" + "go/token" + "strings" +) + +// Maps is slice of ast.CommentMap. +type Maps []ast.CommentMap + +// New creates new a CommentMap slice from specified files. +func New(fset *token.FileSet, files []*ast.File) Maps { + maps := make(Maps, len(files)) + for i := range files { + maps[i] = ast.NewCommentMap(fset, files[i], files[i].Comments) + } + return maps +} + +// Comments returns correspond a CommentGroup slice to specified AST node. +func (maps Maps) Comments(n ast.Node) []*ast.CommentGroup { + for i := range maps { + if maps[i][n] != nil { + return maps[i][n] + } + } + return nil +} + +// CommentsByPos returns correspond a CommentGroup slice to specified pos. +func (maps Maps) CommentsByPos(pos token.Pos) []*ast.CommentGroup { + for i := range maps { + for n, cgs := range maps[i] { + if n.Pos() == pos { + return cgs + } + } + } + return nil +} + +// Annotated checks either specified AST node is annotated or not. +func (maps Maps) Annotated(n ast.Node, annotation string) bool { + for _, cg := range maps.Comments(n) { + if strings.HasPrefix(strings.TrimSpace(cg.Text()), annotation) { + return true + } + } + return false +} + +// Ignore checks either specified AST node is ignored by the check. +// It follows staticcheck style as the below. +// //lint:ignore Check1[,Check2,...,CheckN] reason +func (maps Maps) Ignore(n ast.Node, check string) bool { + for _, cg := range maps.Comments(n) { + if hasIgnoreCheck(cg, check) { + return true + } + } + return false +} + +// IgnorePos checks either specified postion of AST node is ignored by the check. +// It follows staticcheck style as the below. +// //lint:ignore Check1[,Check2,...,CheckN] reason +func (maps Maps) IgnorePos(pos token.Pos, check string) bool { + for _, cg := range maps.CommentsByPos(pos) { + if hasIgnoreCheck(cg, check) { + return true + } + } + return false +} + +// Deprecated: This function does not work with multiple files. +// CommentsByPosLine can be used instead of CommentsByLine. +// +// CommentsByLine returns correspond a CommentGroup slice to specified line. +func (maps Maps) CommentsByLine(fset *token.FileSet, line int) []*ast.CommentGroup { + for i := range maps { + for n, cgs := range maps[i] { + l := fset.File(n.Pos()).Line(n.Pos()) + if l == line { + return cgs + } + } + } + return nil +} + +// CommentsByPosLine returns correspond a CommentGroup slice to specified line. +func (maps Maps) CommentsByPosLine(fset *token.FileSet, pos token.Pos) []*ast.CommentGroup { + f1 := fset.File(pos) + for i := range maps { + for n, cgs := range maps[i] { + f2 := fset.File(n.Pos()) + if f1 != f2 { + // different file + continue + } + + if f1.Line(pos) == f2.Line(n.Pos()) { + return cgs + } + } + } + return nil +} + +// IgnoreLine checks either specified lineof AST node is ignored by the check. +// It follows staticcheck style as the below. +// //lint:ignore Check1[,Check2,...,CheckN] reason +func (maps Maps) IgnoreLine(fset *token.FileSet, line int, check string) bool { + for _, cg := range maps.CommentsByLine(fset, line) { + if hasIgnoreCheck(cg, check) { + return true + } + } + return false +} + +// hasIgnoreCheck returns true if the provided CommentGroup starts with a comment +// of the form "//lint:ignore Check1[,Check2,...,CheckN] reason" and one of the +// checks matches the provided check. The *ast.CommentGroup is checked directly +// rather than using "cg.Text()" because, starting in Go 1.15, the "cg.Text()" call +// no longer returns directive-style comments (see https://github.com/golang/go/issues/37974). +func hasIgnoreCheck(cg *ast.CommentGroup, check string) bool { + if !strings.HasPrefix(cg.List[0].Text, "//") { + return false + } + + s := strings.TrimSpace(cg.List[0].Text[2:]) + txt := strings.Split(s, " ") + if len(txt) < 3 || txt[0] != "lint:ignore" { + return false + } + + checks := strings.Split(txt[1], ",") + for i := range checks { + if check == checks[i] { + return true + } + } + return false +} diff --git a/vendor/github.com/gostaticanalysis/comment/go.mod b/vendor/github.com/gostaticanalysis/comment/go.mod new file mode 100644 index 00000000000..27556811317 --- /dev/null +++ b/vendor/github.com/gostaticanalysis/comment/go.mod @@ -0,0 +1,8 @@ +module github.com/gostaticanalysis/comment + +go 1.12 + +require ( + github.com/google/go-cmp v0.5.1 + golang.org/x/tools v0.0.0-20200820010801-b793a1359eac +) diff --git a/vendor/github.com/gostaticanalysis/comment/go.sum b/vendor/github.com/gostaticanalysis/comment/go.sum new file mode 100644 index 00000000000..425807ce1ea --- /dev/null +++ b/vendor/github.com/gostaticanalysis/comment/go.sum @@ -0,0 +1,24 @@ +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +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/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +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-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac h1:DugppSxw0LSF8lcjaODPJZoDzq0ElTGskTst3ZaBkHI= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/github.com/gostaticanalysis/comment/passes/commentmap/commentmap.go b/vendor/github.com/gostaticanalysis/comment/passes/commentmap/commentmap.go new file mode 100644 index 00000000000..9266d9895de --- /dev/null +++ b/vendor/github.com/gostaticanalysis/comment/passes/commentmap/commentmap.go @@ -0,0 +1,20 @@ +package commentmap + +import ( + "reflect" + + "github.com/gostaticanalysis/comment" + "golang.org/x/tools/go/analysis" +) + +var Analyzer = &analysis.Analyzer{ + Name: "commentmap", + Doc: "create comment map", + Run: run, + RunDespiteErrors: true, + ResultType: reflect.TypeOf(comment.Maps{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + return comment.New(pass.Fset, pass.Files), nil +} diff --git a/vendor/github.com/gregjones/httpcache/.travis.yml b/vendor/github.com/gregjones/httpcache/.travis.yml index b5ffbe03d86..597bc9996f0 100644 --- a/vendor/github.com/gregjones/httpcache/.travis.yml +++ b/vendor/github.com/gregjones/httpcache/.travis.yml @@ -1,19 +1,18 @@ sudo: false language: go -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - master matrix: allow_failures: - go: master fast_finish: true + include: + - go: 1.10.x + - go: 1.11.x + env: GOFMT=1 + - go: master install: - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). script: - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d .) + - if test -n "${GOFMT}"; then gofmt -w -s . && git diff --exit-code; fi - go tool vet . - go test -v -race ./... diff --git a/vendor/github.com/gregjones/httpcache/README.md b/vendor/github.com/gregjones/httpcache/README.md index 09c9e7c173a..51e7d23d094 100644 --- a/vendor/github.com/gregjones/httpcache/README.md +++ b/vendor/github.com/gregjones/httpcache/README.md @@ -7,6 +7,8 @@ Package httpcache provides a http.RoundTripper implementation that works as a mo It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy). +This project isn't actively maintained; it works for what I, and seemingly others, want to do with it, and I consider it "done". That said, if you find any issues, please open a Pull Request and I will try to review it. Any changes now that change the public API won't be considered. + Cache Backends -------------- @@ -19,6 +21,8 @@ Cache Backends - [`github.com/die-net/lrucache/twotier`](https://github.com/die-net/lrucache/tree/master/twotier) allows caches to be combined, for example to use lrucache above with a persistent disk-cache. - [`github.com/birkelund/boltdbcache`](https://github.com/birkelund/boltdbcache) provides a BoltDB implementation (based on the [bbolt](https://github.com/coreos/bbolt) fork). +If you implement any other backend and wish it to be linked here, please send a PR editing this file. + License ------- diff --git a/vendor/github.com/gregjones/httpcache/httpcache.go b/vendor/github.com/gregjones/httpcache/httpcache.go index f6a2ec4a53e..b41a63d1ff5 100644 --- a/vendor/github.com/gregjones/httpcache/httpcache.go +++ b/vendor/github.com/gregjones/httpcache/httpcache.go @@ -416,14 +416,14 @@ func canStaleOnError(respHeaders, reqHeaders http.Header) bool { func getEndToEndHeaders(respHeaders http.Header) []string { // These headers are always hop-by-hop hopByHopHeaders := map[string]struct{}{ - "Connection": struct{}{}, - "Keep-Alive": struct{}{}, - "Proxy-Authenticate": struct{}{}, - "Proxy-Authorization": struct{}{}, - "Te": struct{}{}, - "Trailers": struct{}{}, - "Transfer-Encoding": struct{}{}, - "Upgrade": struct{}{}, + "Connection": {}, + "Keep-Alive": {}, + "Proxy-Authenticate": {}, + "Proxy-Authorization": {}, + "Te": {}, + "Trailers": {}, + "Transfer-Encoding": {}, + "Upgrade": {}, } for _, extra := range strings.Split(respHeaders.Get("connection"), ",") { @@ -433,7 +433,7 @@ func getEndToEndHeaders(respHeaders http.Header) []string { } } endToEndHeaders := []string{} - for respHeader, _ := range respHeaders { + for respHeader := range respHeaders { if _, ok := hopByHopHeaders[respHeader]; !ok { endToEndHeaders = append(endToEndHeaders, respHeader) } diff --git a/vendor/github.com/imdario/mergo/README.md b/vendor/github.com/imdario/mergo/README.md index 02fc81e0626..876abb500a4 100644 --- a/vendor/github.com/imdario/mergo/README.md +++ b/vendor/github.com/imdario/mergo/README.md @@ -1,44 +1,54 @@ # Mergo -A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. - -Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche. - -## Status - -It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild). [![GoDoc][3]][4] -[![GoCard][5]][6] +[![GitHub release][5]][6] +[![GoCard][7]][8] [![Build Status][1]][2] -[![Coverage Status][7]][8] -[![Sourcegraph][9]][10] -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield) +[![Coverage Status][9]][10] +[![Sourcegraph][11]][12] +[![FOSSA Status][13]][14] + +[![GoCenter Kudos][15]][16] [1]: https://travis-ci.org/imdario/mergo.png [2]: https://travis-ci.org/imdario/mergo [3]: https://godoc.org/github.com/imdario/mergo?status.svg [4]: https://godoc.org/github.com/imdario/mergo -[5]: https://goreportcard.com/badge/imdario/mergo -[6]: https://goreportcard.com/report/github.com/imdario/mergo -[7]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master -[8]: https://coveralls.io/github/imdario/mergo?branch=master -[9]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg -[10]: https://sourcegraph.com/github.com/imdario/mergo?badge +[5]: https://img.shields.io/github/release/imdario/mergo.svg +[6]: https://github.com/imdario/mergo/releases +[7]: https://goreportcard.com/badge/imdario/mergo +[8]: https://goreportcard.com/report/github.com/imdario/mergo +[9]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master +[10]: https://coveralls.io/github/imdario/mergo?branch=master +[11]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg +[12]: https://sourcegraph.com/github.com/imdario/mergo?badge +[13]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=shield +[14]: https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield +[15]: https://search.gocenter.io/api/ui/badge/github.com%2Fimdario%2Fmergo +[16]: https://search.gocenter.io/github.com/imdario/mergo -### Latest release +A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. -[Release v0.3.7](https://github.com/imdario/mergo/releases/tag/v0.3.7). +Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). + +Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche. + +## Status + +It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild). ### Important note -Please keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2) Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code. +Please keep in mind that a problematic PR broke [0.3.9](//github.com/imdario/mergo/releases/tag/0.3.9). I reverted it in [0.3.10](//github.com/imdario/mergo/releases/tag/0.3.10), and I consider it stable but not bug-free. Also, this version adds suppot for go modules. -If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0). +Keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2), Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). I added an optional/variadic argument so that it won't break the existing code. + +If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). ### Donations -If Mergo is useful to you, consider buying me a coffee, a beer or making a monthly donation so I can keep building great free software. :heart_eyes: +If Mergo is useful to you, consider buying me a coffee, a beer, or making a monthly donation to allow me to keep building great free software. :heart_eyes: Buy Me a Coffee at ko-fi.com [![Beerpay](https://beerpay.io/imdario/mergo/badge.svg)](https://beerpay.io/imdario/mergo) @@ -87,8 +97,9 @@ If Mergo is useful to you, consider buying me a coffee, a beer or making a month - [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server) - [jnuthong/item_search](https://github.com/jnuthong/item_search) - [bukalapak/snowboard](https://github.com/bukalapak/snowboard) +- [janoszen/containerssh](https://github.com/janoszen/containerssh) -## Installation +## Install go get github.com/imdario/mergo @@ -99,7 +110,7 @@ If Mergo is useful to you, consider buying me a coffee, a beer or making a month ## Usage -You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are not considered zero values](https://golang.org/ref/spec#The_zero_value) either. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). +You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are zero values](https://golang.org/ref/spec#The_zero_value) too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). ```go if err := mergo.Merge(&dst, src); err != nil { @@ -125,9 +136,7 @@ if err := mergo.Map(&dst, srcMap); err != nil { Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as `map[string]interface{}`. They will be just assigned as values. -More information and examples in [godoc documentation](http://godoc.org/github.com/imdario/mergo). - -### Nice example +Here is a nice example: ```go package main @@ -175,10 +184,10 @@ import ( "time" ) -type timeTransfomer struct { +type timeTransformer struct { } -func (t timeTransfomer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { +func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { if typ == reflect.TypeOf(time.Time{}) { return func(dst, src reflect.Value) error { if dst.CanSet() { @@ -202,7 +211,7 @@ type Snapshot struct { func main() { src := Snapshot{time.Now()} dest := Snapshot{} - mergo.Merge(&dest, src, mergo.WithTransformers(timeTransfomer{})) + mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{})) fmt.Println(dest) // Will print // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } diff --git a/vendor/github.com/imdario/mergo/doc.go b/vendor/github.com/imdario/mergo/doc.go index 6e9aa7baf35..fcd985f995d 100644 --- a/vendor/github.com/imdario/mergo/doc.go +++ b/vendor/github.com/imdario/mergo/doc.go @@ -4,41 +4,140 @@ // license that can be found in the LICENSE file. /* -Package mergo merges same-type structs and maps by setting default values in zero-value fields. +A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. -Mergo won't merge unexported (private) fields but will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). +Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). + +Status + +It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc. + +Important note + +Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules. + +Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code. + +If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u github.com/imdario/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). + +Install + +Do your usual installation procedure: + + go get github.com/imdario/mergo + + // use in your .go code + import ( + "github.com/imdario/mergo" + ) Usage -From my own work-in-progress project: +You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). + + if err := mergo.Merge(&dst, src); err != nil { + // ... + } + +Also, you can merge overwriting values using the transformer WithOverride. + + if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { + // ... + } + +Additionally, you can map a map[string]interface{} to a struct (and otherwise, from struct to map), following the same restrictions as in Merge(). Keys are capitalized to find each corresponding exported field. + + if err := mergo.Map(&dst, srcMap); err != nil { + // ... + } + +Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as map[string]interface{}. They will be just assigned as values. + +Here is a nice example: + + package main + + import ( + "fmt" + "github.com/imdario/mergo" + ) - type networkConfig struct { - Protocol string - Address string - ServerType string `json: "server_type"` - Port uint16 + type Foo struct { + A string + B int64 } - type FssnConfig struct { - Network networkConfig + func main() { + src := Foo{ + A: "one", + B: 2, + } + dest := Foo{ + A: "two", + } + mergo.Merge(&dest, src) + fmt.Println(dest) + // Will print + // {two 2} } - var fssnDefault = FssnConfig { - networkConfig { - "tcp", - "127.0.0.1", - "http", - 31560, - }, +Transformers + +Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time? + + package main + + import ( + "fmt" + "github.com/imdario/mergo" + "reflect" + "time" + ) + + type timeTransformer struct { } - // Inside a function [...] + func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { + if typ == reflect.TypeOf(time.Time{}) { + return func(dst, src reflect.Value) error { + if dst.CanSet() { + isZero := dst.MethodByName("IsZero") + result := isZero.Call([]reflect.Value{}) + if result[0].Bool() { + dst.Set(src) + } + } + return nil + } + } + return nil + } + + type Snapshot struct { + Time time.Time + // ... + } - if err := mergo.Merge(&config, fssnDefault); err != nil { - log.Fatal(err) + func main() { + src := Snapshot{time.Now()} + dest := Snapshot{} + mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{})) + fmt.Println(dest) + // Will print + // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } } - // More code [...] +Contact me + +If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): https://twitter.com/im_dario + +About + +Written by Dario Castañé: https://da.rio.hn + +License + +BSD 3-Clause license, as Go language. */ package mergo diff --git a/vendor/github.com/imdario/mergo/go.mod b/vendor/github.com/imdario/mergo/go.mod new file mode 100644 index 00000000000..3d689d93eb3 --- /dev/null +++ b/vendor/github.com/imdario/mergo/go.mod @@ -0,0 +1,5 @@ +module github.com/imdario/mergo + +go 1.13 + +require gopkg.in/yaml.v2 v2.3.0 diff --git a/vendor/github.com/imdario/mergo/go.sum b/vendor/github.com/imdario/mergo/go.sum new file mode 100644 index 00000000000..168980da5f7 --- /dev/null +++ b/vendor/github.com/imdario/mergo/go.sum @@ -0,0 +1,4 @@ +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/github.com/imdario/mergo/map.go index d83258b4dda..a13a7ee46c7 100644 --- a/vendor/github.com/imdario/mergo/map.go +++ b/vendor/github.com/imdario/mergo/map.go @@ -99,11 +99,11 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf continue } if srcKind == dstKind { - if _, err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { + if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface { - if _, err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { + if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if srcKind == reflect.Map { @@ -141,6 +141,9 @@ func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { } func _map(dst, src interface{}, opts ...func(*Config)) error { + if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr { + return ErrNonPointerAgument + } var ( vDst, vSrc reflect.Value err error @@ -157,8 +160,7 @@ func _map(dst, src interface{}, opts ...func(*Config)) error { // To be friction-less, we redirect equal-type arguments // to deepMerge. Only because arguments can be anything. if vSrc.Kind() == vDst.Kind() { - _, err := deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) - return err + return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) } switch vSrc.Kind() { case reflect.Struct: diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/github.com/imdario/mergo/merge.go index 3332c9c2a7a..afa84a1e298 100644 --- a/vendor/github.com/imdario/mergo/merge.go +++ b/vendor/github.com/imdario/mergo/merge.go @@ -11,26 +11,26 @@ package mergo import ( "fmt" "reflect" - "unsafe" ) -func hasExportedField(dst reflect.Value) (exported bool) { +func hasMergeableFields(dst reflect.Value) (exported bool) { for i, n := 0, dst.NumField(); i < n; i++ { field := dst.Type().Field(i) - if isExportedComponent(&field) { - return true + if field.Anonymous && dst.Field(i).Kind() == reflect.Struct { + exported = exported || hasMergeableFields(dst.Field(i)) + } else if isExportedComponent(&field) { + exported = exported || len(field.PkgPath) == 0 } } return } func isExportedComponent(field *reflect.StructField) bool { - name := field.Name pkgPath := field.PkgPath if len(pkgPath) > 0 { return false } - c := name[0] + c := field.Name[0] if 'a' <= c && c <= 'z' || c == '_' { return false } @@ -44,6 +44,8 @@ type Config struct { Transformers Transformers overwriteWithEmptyValue bool overwriteSliceWithEmptyValue bool + sliceDeepCopy bool + debug bool } type Transformers interface { @@ -53,17 +55,16 @@ type Transformers interface { // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. -func deepMerge(dstIn, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (dst reflect.Value, err error) { - dst = dstIn +func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { overwrite := config.Overwrite typeCheck := config.TypeCheck overwriteWithEmptySrc := config.overwriteWithEmptyValue overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue + sliceDeepCopy := config.sliceDeepCopy if !src.IsValid() { return } - if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr @@ -71,7 +72,7 @@ func deepMerge(dstIn, src reflect.Value, visited map[uintptr]*visit, depth int, typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { - return dst, nil + return nil } } // Remember, remember... @@ -85,126 +86,154 @@ func deepMerge(dstIn, src reflect.Value, visited map[uintptr]*visit, depth int, } } - if dst.IsValid() && src.IsValid() && src.Type() != dst.Type() { - err = fmt.Errorf("cannot append two different types (%s, %s)", src.Kind(), dst.Kind()) - return - } - switch dst.Kind() { case reflect.Struct: - if hasExportedField(dst) { - dstCp := reflect.New(dst.Type()).Elem() + if hasMergeableFields(dst) { for i, n := 0, dst.NumField(); i < n; i++ { - dstField := dst.Field(i) - structField := dst.Type().Field(i) - // copy un-exported struct fields - if !isExportedComponent(&structField) { - rf := dstCp.Field(i) - rf = reflect.NewAt(rf.Type(), unsafe.Pointer(rf.UnsafeAddr())).Elem() //nolint:gosec - dstRF := dst.Field(i) - if !dst.Field(i).CanAddr() { - continue - } - - dstRF = reflect.NewAt(dstRF.Type(), unsafe.Pointer(dstRF.UnsafeAddr())).Elem() //nolint:gosec - rf.Set(dstRF) - continue - } - dstField, err = deepMerge(dstField, src.Field(i), visited, depth+1, config) - if err != nil { + if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil { return } - dstCp.Field(i).Set(dstField) } - - if dst.CanSet() { - dst.Set(dstCp) - } else { - dst = dstCp - } - return } else { if (isReflectNil(dst) || overwrite) && (!isEmptyValue(src) || overwriteWithEmptySrc) { - dst = src + dst.Set(src) } } - case reflect.Map: if dst.IsNil() && !src.IsNil() { - if dst.CanSet() { - dst.Set(reflect.MakeMap(dst.Type())) - } else { - dst = src - return + dst.Set(reflect.MakeMap(dst.Type())) + } + + if src.Kind() != reflect.Map { + if overwrite { + dst.Set(src) } + return } + for _, key := range src.MapKeys() { srcElement := src.MapIndex(key) - dstElement := dst.MapIndex(key) if !srcElement.IsValid() { continue } - if dst.MapIndex(key).IsValid() { - k := dstElement.Interface() - dstElement = reflect.ValueOf(k) - } - if isReflectNil(srcElement) { - if overwrite || isReflectNil(dstElement) { - dst.SetMapIndex(key, srcElement) + dstElement := dst.MapIndex(key) + switch srcElement.Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice: + if srcElement.IsNil() { + if overwrite { + dst.SetMapIndex(key, srcElement) + } + continue + } + fallthrough + default: + if !srcElement.CanInterface() { + continue + } + switch reflect.TypeOf(srcElement.Interface()).Kind() { + case reflect.Struct: + fallthrough + case reflect.Ptr: + fallthrough + case reflect.Map: + srcMapElm := srcElement + dstMapElm := dstElement + if srcMapElm.CanInterface() { + srcMapElm = reflect.ValueOf(srcMapElm.Interface()) + if dstMapElm.IsValid() { + dstMapElm = reflect.ValueOf(dstMapElm.Interface()) + } + } + if err = deepMerge(dstMapElm, srcMapElm, visited, depth+1, config); err != nil { + return + } + case reflect.Slice: + srcSlice := reflect.ValueOf(srcElement.Interface()) + + var dstSlice reflect.Value + if !dstElement.IsValid() || dstElement.IsNil() { + dstSlice = reflect.MakeSlice(srcSlice.Type(), 0, srcSlice.Len()) + } else { + dstSlice = reflect.ValueOf(dstElement.Interface()) + } + + if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice && !sliceDeepCopy { + if typeCheck && srcSlice.Type() != dstSlice.Type() { + return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) + } + dstSlice = srcSlice + } else if config.AppendSlice { + if srcSlice.Type() != dstSlice.Type() { + return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) + } + dstSlice = reflect.AppendSlice(dstSlice, srcSlice) + } else if sliceDeepCopy { + i := 0 + for ; i < srcSlice.Len() && i < dstSlice.Len(); i++ { + srcElement := srcSlice.Index(i) + dstElement := dstSlice.Index(i) + + if srcElement.CanInterface() { + srcElement = reflect.ValueOf(srcElement.Interface()) + } + if dstElement.CanInterface() { + dstElement = reflect.ValueOf(dstElement.Interface()) + } + + if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { + return + } + } + + } + dst.SetMapIndex(key, dstSlice) } - continue } - if !srcElement.CanInterface() { + if dstElement.IsValid() && !isEmptyValue(dstElement) && (reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map || reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice) { continue } - if srcElement.CanInterface() { - srcElement = reflect.ValueOf(srcElement.Interface()) - if dstElement.IsValid() { - dstElement = reflect.ValueOf(dstElement.Interface()) + if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement)) { + if dst.IsNil() { + dst.Set(reflect.MakeMap(dst.Type())) } + dst.SetMapIndex(key, srcElement) } - dstElement, err = deepMerge(dstElement, srcElement, visited, depth+1, config) - if err != nil { - return - } - dst.SetMapIndex(key, dstElement) - } case reflect.Slice: - newSlice := dst - if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { - if typeCheck && src.Type() != dst.Type() { - return dst, fmt.Errorf("cannot override two slices with different type (%s, %s)", src.Type(), dst.Type()) - } - newSlice = src - } else if config.AppendSlice { - if typeCheck && src.Type() != dst.Type() { - err = fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) - return - } - newSlice = reflect.AppendSlice(dst, src) - } - if dst.CanSet() { - dst.Set(newSlice) - } else { - dst = newSlice - } - case reflect.Ptr, reflect.Interface: - if isReflectNil(src) { + if !dst.CanSet() { break } + if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice && !sliceDeepCopy { + dst.Set(src) + } else if config.AppendSlice { + if src.Type() != dst.Type() { + return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) + } + dst.Set(reflect.AppendSlice(dst, src)) + } else if sliceDeepCopy { + for i := 0; i < src.Len() && i < dst.Len(); i++ { + srcElement := src.Index(i) + dstElement := dst.Index(i) + if srcElement.CanInterface() { + srcElement = reflect.ValueOf(srcElement.Interface()) + } + if dstElement.CanInterface() { + dstElement = reflect.ValueOf(dstElement.Interface()) + } - if dst.Kind() != reflect.Ptr && src.Type().AssignableTo(dst.Type()) { - if dst.IsNil() || overwrite { - if overwrite || isEmptyValue(dst) { - if dst.CanSet() { - dst.Set(src) - } else { - dst = src - } + if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { + return } } + } + case reflect.Ptr: + fallthrough + case reflect.Interface: + if isReflectNil(src) { + if overwriteWithEmptySrc && dst.CanSet() && src.Type().AssignableTo(dst.Type()) { + dst.Set(src) + } break } @@ -214,33 +243,35 @@ func deepMerge(dstIn, src reflect.Value, visited map[uintptr]*visit, depth int, dst.Set(src) } } else if src.Kind() == reflect.Ptr { - if dst, err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { + if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } - dst = dst.Addr() } else if dst.Elem().Type() == src.Type() { - if dst, err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { + if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { return } } else { - return dst, ErrDifferentArgumentsTypes + return ErrDifferentArgumentsTypes } break } + if dst.IsNil() || overwrite { - if (overwrite || isEmptyValue(dst)) && (overwriteWithEmptySrc || !isEmptyValue(src)) { - if dst.CanSet() { - dst.Set(src) - } else { - dst = src - } + if dst.CanSet() && (overwrite || isEmptyValue(dst)) { + dst.Set(src) } - } else if _, err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { - return + break + } + + if dst.Elem().Kind() == src.Elem().Kind() { + if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { + return + } + break } default: - overwriteFull := (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) - if overwriteFull { + mustSet := (isEmptyValue(dst) || overwrite) && (!isEmptyValue(src) || overwriteWithEmptySrc) + if mustSet { if dst.CanSet() { dst.Set(src) } else { @@ -281,6 +312,7 @@ func WithOverride(config *Config) { // WithOverwriteWithEmptyValue will make merge override non empty dst attributes with empty src attributes values. func WithOverwriteWithEmptyValue(config *Config) { + config.Overwrite = true config.overwriteWithEmptyValue = true } @@ -299,7 +331,16 @@ func WithTypeCheck(config *Config) { config.TypeCheck = true } +// WithSliceDeepCopy will merge slice element one by one with Overwrite flag. +func WithSliceDeepCopy(config *Config) { + config.sliceDeepCopy = true + config.Overwrite = true +} + func merge(dst, src interface{}, opts ...func(*Config)) error { + if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr { + return ErrNonPointerAgument + } var ( vDst, vSrc reflect.Value err error @@ -314,14 +355,10 @@ func merge(dst, src interface{}, opts ...func(*Config)) error { if vDst, vSrc, err = resolveValues(dst, src); err != nil { return err } - if !vDst.CanSet() { - return fmt.Errorf("cannot set dst, needs reference") - } if vDst.Type() != vSrc.Type() { return ErrDifferentArgumentsTypes } - _, err = deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) - return err + return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) } // IsReflectNil is the reflect value provided nil diff --git a/vendor/github.com/imdario/mergo/mergo.go b/vendor/github.com/imdario/mergo/mergo.go index a82fea2fdcc..3cc926c7f62 100644 --- a/vendor/github.com/imdario/mergo/mergo.go +++ b/vendor/github.com/imdario/mergo/mergo.go @@ -20,6 +20,7 @@ var ( ErrNotSupported = errors.New("only structs and maps are supported") ErrExpectedMapAsDestination = errors.New("dst was expected to be a map") ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct") + ErrNonPointerAgument = errors.New("dst must be a pointer") ) // During deepMerge, must keep track of checks that are @@ -75,23 +76,3 @@ func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) { } return } - -// Traverses recursively both values, assigning src's fields values to dst. -// The map argument tracks comparisons that have already been seen, which allows -// short circuiting on recursive types. -func deeper(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) { - if dst.CanAddr() { - addr := dst.UnsafeAddr() - h := 17 * addr - seen := visited[h] - typ := dst.Type() - for p := seen; p != nil; p = p.next { - if p.ptr == addr && p.typ == typ { - return nil - } - } - // Remember, remember... - visited[h] = &visit{addr, typ, seen} - } - return // TODO refactor -} diff --git a/vendor/github.com/jirfag/go-printf-func-name/LICENSE b/vendor/github.com/jirfag/go-printf-func-name/LICENSE new file mode 100644 index 00000000000..d06a809c264 --- /dev/null +++ b/vendor/github.com/jirfag/go-printf-func-name/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Isaev Denis + +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. diff --git a/vendor/github.com/josharian/intern/README.md b/vendor/github.com/josharian/intern/README.md new file mode 100644 index 00000000000..ffc44b219b2 --- /dev/null +++ b/vendor/github.com/josharian/intern/README.md @@ -0,0 +1,5 @@ +Docs: https://godoc.org/github.com/josharian/intern + +See also [Go issue 5160](https://golang.org/issue/5160). + +License: MIT diff --git a/vendor/github.com/josharian/intern/go.mod b/vendor/github.com/josharian/intern/go.mod new file mode 100644 index 00000000000..f2262ff0d54 --- /dev/null +++ b/vendor/github.com/josharian/intern/go.mod @@ -0,0 +1,3 @@ +module github.com/josharian/intern + +go 1.5 diff --git a/vendor/github.com/josharian/intern/intern.go b/vendor/github.com/josharian/intern/intern.go new file mode 100644 index 00000000000..7acb1fe90a1 --- /dev/null +++ b/vendor/github.com/josharian/intern/intern.go @@ -0,0 +1,44 @@ +// Package intern interns strings. +// Interning is best effort only. +// Interned strings may be removed automatically +// at any time without notification. +// All functions may be called concurrently +// with themselves and each other. +package intern + +import "sync" + +var ( + pool sync.Pool = sync.Pool{ + New: func() interface{} { + return make(map[string]string) + }, + } +) + +// String returns s, interned. +func String(s string) string { + m := pool.Get().(map[string]string) + c, ok := m[s] + if ok { + pool.Put(m) + return c + } + m[s] = s + pool.Put(m) + return s +} + +// Bytes returns b converted to a string, interned. +func Bytes(b []byte) string { + m := pool.Get().(map[string]string) + c, ok := m[string(b)] + if ok { + pool.Put(m) + return c + } + s := string(b) + m[s] = s + pool.Put(m) + return s +} diff --git a/vendor/github.com/josharian/intern/license.md b/vendor/github.com/josharian/intern/license.md new file mode 100644 index 00000000000..353d3055f0b --- /dev/null +++ b/vendor/github.com/josharian/intern/license.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Josh Bleecher Snyder + +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. diff --git a/vendor/github.com/kyoh86/exportloopref/.golangci.yml b/vendor/github.com/kyoh86/exportloopref/.golangci.yml new file mode 100644 index 00000000000..58667b2157e --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/.golangci.yml @@ -0,0 +1,4 @@ +linters: + enable: + - unparam + - scopelint diff --git a/vendor/github.com/kyoh86/exportloopref/.goreleaser.yml b/vendor/github.com/kyoh86/exportloopref/.goreleaser.yml new file mode 100644 index 00000000000..22ff44040c1 --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/.goreleaser.yml @@ -0,0 +1,43 @@ +project_name: exportloopref +release: + github: + owner: kyoh86 + name: exportloopref +brews: +- install: | + bin.install "exportloopref" + github: + owner: kyoh86 + name: homebrew-tap + folder: Formula + homepage: https://github.com/kyoh86/exportloopref + description: An analyzer that finds exporting pointers for loop variables. +builds: +- goos: + - linux + - darwin + - windows + goarch: + - amd64 + - "386" + main: ./cmd/exportloopref + ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} + binary: exportloopref +archives: +- id: gzip + format: tar.gz + format_overrides: + - goos: windows + format: zip + name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + files: + - licence* + - LICENCE* + - license* + - LICENSE* + - readme* + - README* + - changelog* + - CHANGELOG* +snapshot: + name_template: SNAPSHOT-{{ .Commit }} diff --git a/vendor/github.com/kyoh86/exportloopref/LICENSE b/vendor/github.com/kyoh86/exportloopref/LICENSE new file mode 100644 index 00000000000..7ac9dba4a0c --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 kyoh86 + +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. diff --git a/vendor/github.com/kyoh86/exportloopref/Makefile b/vendor/github.com/kyoh86/exportloopref/Makefile new file mode 100644 index 00000000000..4d3ef22f7f4 --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/Makefile @@ -0,0 +1,16 @@ +.PHONY: gen lint test install man + +VERSION := `git vertag get` +COMMIT := `git rev-parse HEAD` + +gen: + go generate ./... + +lint: gen + golangci-lint run + +test: lint + go test -v --race ./... + +install: test + go install -a -ldflags "-X=main.version=$(VERSION) -X=main.commit=$(COMMIT)" ./... diff --git a/vendor/github.com/kyoh86/exportloopref/README.md b/vendor/github.com/kyoh86/exportloopref/README.md new file mode 100644 index 00000000000..5b154915924 --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/README.md @@ -0,0 +1,178 @@ +# exportloopref + +An analyzer that finds exporting pointers for loop variables. + +[![Go Report Card](https://goreportcard.com/badge/github.com/kyoh86/exportloopref)](https://goreportcard.com/report/github.com/kyoh86/exportloopref) +[![Coverage Status](https://img.shields.io/codecov/c/github/kyoh86/exportloopref.svg)](https://codecov.io/gh/kyoh86/exportloopref) +[![Release](https://github.com/kyoh86/exportloopref/workflows/Release/badge.svg)](https://github.com/kyoh86/exportloopref/releases) + +## What's this? + +Sample problem code from: https://github.com/kyoh86/exportloopref/blob/master/testdata/simple/simple.go + +```go +package main + +func main() { + var intArray [4]*int + var intSlice []*int + var intRef *int + var intStr struct{ x *int } + + println("loop expecting 10, 11, 12, 13") + for i, p := range []int{10, 11, 12, 13} { + printp(&p) // not a diagnostic + intSlice = append(intSlice, &p) // want "exporting a pointer for the loop variable p" + intArray[i] = &p // want "exporting a pointer for the loop variable p" + if i%2 == 0 { + intRef = &p // want "exporting a pointer for the loop variable p" + intStr.x = &p // want "exporting a pointer for the loop variable p" + } + var vStr struct{ x *int } + var vArray [4]*int + var v *int + if i%2 == 0 { + v = &p // not a diagnostic (x is inner variable) + vArray[1] = &p // not a diagnostic (x is inner variable) + vStr.x = &p + } + _ = v + } + + println(`slice expecting "10, 11, 12, 13" but "13, 13, 13, 13"`) + for _, p := range intSlice { + printp(p) + } + println(`array expecting "10, 11, 12, 13" but "13, 13, 13, 13"`) + for _, p := range intArray { + printp(p) + } + println(`captured value expecting "12" but "13"`) + printp(intRef) +} + +func printp(p *int) { + println(*p) +} +``` + +In Go, the `p` variable in the above loops is actually a single variable. +So in many case (like the above), using it makes for us annoying bugs. + +You can find them with `exportloopref`, and fix it. + +```go +package main + +func main() { + var intArray [4]*int + var intSlice []*int + var intRef *int + var intStr struct{ x *int } + + println("loop expecting 10, 11, 12, 13") + for i, p := range []int{10, 11, 12, 13} { + p := p // FIX variable into the inner variable + printp(&p) + intSlice = append(intSlice, &p) + intArray[i] = &p + if i%2 == 0 { + intRef = &p + intStr.x = &p + } + var vStr struct{ x *int } + var vArray [4]*int + var v *int + if i%2 == 0 { + v = &p + vArray[1] = &p + vStr.x = &p + } + _ = v + } + + println(`slice expecting "10, 11, 12, 13"`) + for _, p := range intSlice { + printp(p) + } + println(`array expecting "10, 11, 12, 13"`) + for _, p := range intArray { + printp(p) + } + println(`captured value expecting "12"`) + printp(intRef) +} + +func printp(p *int) { + println(*p) +} +``` + +ref: https://github.com/kyoh86/exportloopref/blob/master/testdata/fixed/fixed.go + +## Sensing policy + +I want to make exportloopref as accurately as possible. +So some cases of lints will be ignored. + +e.g. + +```go +var s Foo +for _, p := []int{10, 11, 12, 13} { + s.Bar(&p) // If s stores the pointer, it will be bug. +} +``` + +If you want to report all of lints (with some false-positives), +you should use [looppointer](https://github.com/kyoh86/looppointer). + +## Install + +go: + +```console +$ go get github.com/kyoh86/exportloopref/cmd/exportloopref +``` + +[homebrew](https://brew.sh/): + +```console +$ brew install kyoh86/tap/exportloopref +``` + +[gordon](https://github.com/kyoh86/gordon): + +```console +$ gordon install kyoh86/exportloopref +``` + +## Usage + +``` +exportloopref [-flag] [package] +``` + +### Flags + +| Flag | Description | +| --- | --- | +| -V | print version and exit | +| -all | no effect (deprecated) | +| -c int | display offending line with this many lines of context (default -1) | +| -cpuprofile string | write CPU profile to this file | +| -debug string | debug flags, any subset of "fpstv" | +| -fix | apply all suggested fixes | +| -flags | print analyzer flags in JSON | +| -json | emit JSON output | +| -memprofile string | write memory profile to this file | +| -source | no effect (deprecated) | +| -tags string | no effect (deprecated) | +| -trace string | write trace log to this file | +| -v | no effect (deprecated) | + +# LICENSE + +[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg)](http://www.opensource.org/licenses/MIT) + +This is distributed under the [MIT License](http://www.opensource.org/licenses/MIT). diff --git a/vendor/github.com/kyoh86/exportloopref/exportloopref.go b/vendor/github.com/kyoh86/exportloopref/exportloopref.go new file mode 100644 index 00000000000..0b310b3c9c0 --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/exportloopref.go @@ -0,0 +1,276 @@ +package exportloopref + +import ( + "go/ast" + "go/token" + "go/types" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "exportloopref", + Doc: "checks for pointers to enclosing loop variables", + Run: run, + RunDespiteErrors: true, + Requires: []*analysis.Analyzer{inspect.Analyzer}, + // ResultType reflect.Type + // FactTypes []Fact +} + +func init() { + // Analyzer.Flags.StringVar(&v, "name", "default", "description") +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + + search := &Searcher{ + Stats: map[token.Pos]struct{}{}, + Vars: map[token.Pos]map[token.Pos]struct{}{}, + Types: pass.TypesInfo.Types, + } + + nodeFilter := []ast.Node{ + (*ast.RangeStmt)(nil), + (*ast.ForStmt)(nil), + (*ast.DeclStmt)(nil), + (*ast.AssignStmt)(nil), + (*ast.UnaryExpr)(nil), + } + + inspect.WithStack(nodeFilter, func(n ast.Node, push bool, stack []ast.Node) bool { + id, digg := search.Check(n, stack) + if id != nil { + pass.ReportRangef(id, "exporting a pointer for the loop variable %s", id.Name) + } + return digg + }) + + return nil, nil +} + +type Searcher struct { + // Statement variables : map to collect positions that + // variables are declared like below. + // - for , := range ... + // - var int + // - D := ... + Stats map[token.Pos]struct{} + // Internal variables maps loop-position, decl-location to ignore + // safe pointers for variable which declared in the loop. + Vars map[token.Pos]map[token.Pos]struct{} + Types map[ast.Expr]types.TypeAndValue +} + +func (s *Searcher) Check(n ast.Node, stack []ast.Node) (*ast.Ident, bool) { + switch typed := n.(type) { + case *ast.RangeStmt: + s.parseRangeStmt(typed) + case *ast.ForStmt: + s.parseForStmt(typed) + case *ast.DeclStmt: + s.parseDeclStmt(typed, stack) + case *ast.AssignStmt: + s.parseAssignStmt(typed, stack) + + case *ast.UnaryExpr: + return s.checkUnaryExpr(typed, stack) + } + return nil, true +} + +func (s *Searcher) parseRangeStmt(n *ast.RangeStmt) { + s.addStat(n.Key) + s.addStat(n.Value) +} + +func (s *Searcher) parseForStmt(n *ast.ForStmt) { + switch post := n.Post.(type) { + case *ast.AssignStmt: + // e.g. for p = head; p != nil; p = p.next + for _, lhs := range post.Lhs { + s.addStat(lhs) + } + case *ast.IncDecStmt: + // e.g. for i := 0; i < n; i++ + s.addStat(post.X) + } +} + +func (s *Searcher) addStat(expr ast.Expr) { + if id, ok := expr.(*ast.Ident); ok { + s.Stats[id.Pos()] = struct{}{} + } +} + +func (s *Searcher) parseDeclStmt(n *ast.DeclStmt, stack []ast.Node) { + loop := s.innermostLoop(stack) + if loop == nil { + return + } + + // Register declaring variables + if genDecl, ok := n.Decl.(*ast.GenDecl); ok && genDecl.Tok == token.VAR { + for _, spec := range genDecl.Specs { + for _, name := range spec.(*ast.ValueSpec).Names { + s.addVar(loop, name) + } + } + } +} + +func (s *Searcher) parseAssignStmt(n *ast.AssignStmt, stack []ast.Node) { + loop := s.innermostLoop(stack) + if loop == nil { + return + } + + // Find statements declaring internal variable + if n.Tok == token.DEFINE { + for _, h := range n.Lhs { + s.addVar(loop, h) + } + } +} + +func (s *Searcher) addVar(loop ast.Node, expr ast.Expr) { + loopPos := loop.Pos() + id, ok := expr.(*ast.Ident) + if !ok { + return + } + vars, ok := s.Vars[loopPos] + if !ok { + vars = map[token.Pos]struct{}{} + } + vars[id.Obj.Pos()] = struct{}{} + s.Vars[loopPos] = vars +} + +func (s *Searcher) innermostLoop(stack []ast.Node) ast.Node { + for i := len(stack) - 1; i >= 0; i-- { + switch stack[i].(type) { + case *ast.RangeStmt, *ast.ForStmt: + return stack[i] + } + } + return nil +} + +func (s *Searcher) checkUnaryExpr(n *ast.UnaryExpr, stack []ast.Node) (*ast.Ident, bool) { + loop := s.innermostLoop(stack) + if loop == nil { + return nil, true + } + + if n.Op != token.AND { + return nil, true + } + + // Get identity of the referred item + id := s.getIdentity(n.X) + if id == nil { + return nil, true + } + + // If the identity is not the loop statement variable, + // it will not be reported. + if _, isStat := s.Stats[id.Obj.Pos()]; !isStat { + return nil, true + } + + // check stack append(), []X{}, map[Type]X{}, Struct{}, &Struct{}, X.(Type), (X) + // in the = + var mayRHPos token.Pos + for i := len(stack) - 2; i >= 0; i-- { + switch typed := stack[i].(type) { + case (*ast.UnaryExpr): + // noop + case (*ast.CompositeLit): + // noop + case (*ast.KeyValueExpr): + // noop + case (*ast.CallExpr): + fun, ok := typed.Fun.(*ast.Ident) + if !ok { + return nil, false // it's calling a function other of `append`. It cannot be checked + } + + if fun.Name != "append" { + return nil, false // it's calling a function other of `append`. It cannot be checked + } + + case (*ast.AssignStmt): + if len(typed.Rhs) != len(typed.Lhs) { + return nil, false // dead logic + } + + // search x where Rhs[x].Pos() == mayRHPos + var index int + for ri, rh := range typed.Rhs { + if rh.Pos() == mayRHPos { + index = ri + break + } + } + + // check Lhs[x] is not inner variable + lh := typed.Lhs[index] + isVar := s.isVar(loop, lh) + if !isVar { + return id, false + } + + return nil, true + default: + // Other statement is not able to be checked. + return nil, false + } + + // memory an expr that may be right-hand in the AssignStmt + mayRHPos = stack[i].Pos() + } + return nil, true +} + +func (s *Searcher) isVar(loop ast.Node, expr ast.Expr) bool { + vars := s.Vars[loop.Pos()] // map[token.Pos]struct{} + if vars == nil { + return false + } + switch typed := expr.(type) { + case (*ast.Ident): + _, isVar := vars[typed.Obj.Pos()] + return isVar + case (*ast.IndexExpr): // like X[Y], check X + return s.isVar(loop, typed.X) + case (*ast.SelectorExpr): // like X.Y, check X + return s.isVar(loop, typed.X) + } + return false +} + +// Get variable identity +func (s *Searcher) getIdentity(expr ast.Expr) *ast.Ident { + switch typed := expr.(type) { + case *ast.SelectorExpr: + // Ignore if the parent is pointer ref (fix for #2) + if _, ok := s.Types[typed.X].Type.(*types.Pointer); ok { + return nil + } + + // Get parent identity; i.e. `a.b` of the `a.b.c`. + return s.getIdentity(typed.X) + + case *ast.Ident: + // Get simple identity; i.e. `a` of the `a`. + if typed.Obj == nil { + return nil + } + return typed + } + return nil +} diff --git a/vendor/github.com/kyoh86/exportloopref/go.mod b/vendor/github.com/kyoh86/exportloopref/go.mod new file mode 100644 index 00000000000..2b61b220b35 --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/go.mod @@ -0,0 +1,5 @@ +module github.com/kyoh86/exportloopref + +go 1.14 + +require golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed diff --git a/vendor/github.com/kyoh86/exportloopref/go.sum b/vendor/github.com/kyoh86/exportloopref/go.sum new file mode 100644 index 00000000000..eb0e5ab1e4c --- /dev/null +++ b/vendor/github.com/kyoh86/exportloopref/go.sum @@ -0,0 +1,20 @@ +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +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/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +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/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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed h1:OCZDlBlLYiUK6T33/8+3BnojrS2W+Dg1rKYJhR89xGE= +golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/github.com/magiconair/properties/.travis.yml b/vendor/github.com/magiconair/properties/.travis.yml index f07376f9cbe..6cee379fb04 100644 --- a/vendor/github.com/magiconair/properties/.travis.yml +++ b/vendor/github.com/magiconair/properties/.travis.yml @@ -1,5 +1,6 @@ language: go go: + - 1.3.x - 1.4.x - 1.5.x - 1.6.x @@ -9,4 +10,6 @@ go: - "1.10.x" - "1.11.x" - "1.12.x" + - "1.13.x" + - "1.14.x" - tip diff --git a/vendor/github.com/magiconair/properties/CHANGELOG.md b/vendor/github.com/magiconair/properties/CHANGELOG.md index 176626a15a3..ff8d02535ac 100644 --- a/vendor/github.com/magiconair/properties/CHANGELOG.md +++ b/vendor/github.com/magiconair/properties/CHANGELOG.md @@ -1,8 +1,29 @@ ## Changelog +### [1.8.2](https://github.com/magiconair/properties/tree/v1.8.2) - 25 Aug 2020 + + * [PR #36](https://github.com/magiconair/properties/pull/36): Escape backslash on write + + This patch ensures that backslashes are escaped on write. Existing applications which + rely on the old behavior may need to be updated. + + Thanks to [@apesternikov](https://github.com/apesternikov) for the patch. + + * [PR #42](https://github.com/magiconair/properties/pull/42): Made Content-Type check whitespace agnostic in LoadURL() + + Thanks to [@aliras1](https://github.com/aliras1) for the patch. + + * [PR #41](https://github.com/magiconair/properties/pull/41): Make key/value separator configurable on Write() + + Thanks to [@mkjor](https://github.com/mkjor) for the patch. + + * [PR #40](https://github.com/magiconair/properties/pull/40): Add method to return a sorted list of keys + + Thanks to [@mkjor](https://github.com/mkjor) for the patch. + ### [1.8.1](https://github.com/magiconair/properties/tree/v1.8.1) - 10 May 2019 - * [PR #26](https://github.com/magiconair/properties/pull/35): Close body always after request + * [PR #35](https://github.com/magiconair/properties/pull/35): Close body always after request This patch ensures that in `LoadURL` the response body is always closed. diff --git a/vendor/github.com/magiconair/properties/LICENSE b/vendor/github.com/magiconair/properties/LICENSE.md similarity index 84% rename from vendor/github.com/magiconair/properties/LICENSE rename to vendor/github.com/magiconair/properties/LICENSE.md index b387087c556..79c87e3e6ff 100644 --- a/vendor/github.com/magiconair/properties/LICENSE +++ b/vendor/github.com/magiconair/properties/LICENSE.md @@ -1,15 +1,14 @@ -goproperties - properties file decoder for Go - -Copyright (c) 2013-2018 - Frank Schroeder +Copyright (c) 2013-2020, Frank Schroeder All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, + + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. diff --git a/vendor/github.com/magiconair/properties/go.mod b/vendor/github.com/magiconair/properties/go.mod index 02a6f86557f..4ff090bdcc9 100644 --- a/vendor/github.com/magiconair/properties/go.mod +++ b/vendor/github.com/magiconair/properties/go.mod @@ -1 +1,3 @@ module github.com/magiconair/properties + +go 1.13 diff --git a/vendor/github.com/magiconair/properties/load.go b/vendor/github.com/magiconair/properties/load.go index ab953253547..c83c2dadd6c 100644 --- a/vendor/github.com/magiconair/properties/load.go +++ b/vendor/github.com/magiconair/properties/load.go @@ -132,11 +132,12 @@ func (l *Loader) LoadURL(url string) (*Properties, error) { } ct := resp.Header.Get("Content-Type") + ct = strings.Join(strings.Fields(ct), "") var enc Encoding switch strings.ToLower(ct) { - case "text/plain", "text/plain; charset=iso-8859-1", "text/plain; charset=latin1": + case "text/plain", "text/plain;charset=iso-8859-1", "text/plain;charset=latin1": enc = ISO_8859_1 - case "", "text/plain; charset=utf-8": + case "", "text/plain;charset=utf-8": enc = UTF8 default: return nil, fmt.Errorf("properties: invalid content type %s", ct) diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go index cb3d1a3326f..bdfdd4b3fd6 100644 --- a/vendor/github.com/magiconair/properties/properties.go +++ b/vendor/github.com/magiconair/properties/properties.go @@ -13,6 +13,7 @@ import ( "log" "os" "regexp" + "sort" "strconv" "strings" "time" @@ -69,6 +70,9 @@ type Properties struct { // Stores the keys in order of appearance. k []string + + // WriteSeparator specifies the separator of key and value while writing the properties. + WriteSeparator string } // NewProperties creates a new Properties struct with the default @@ -586,6 +590,12 @@ func (p *Properties) String() string { return s } +// Sort sorts the properties keys in alphabetical order. +// This is helpfully before writing the properties. +func (p *Properties) Sort() { + sort.Strings(p.k) +} + // Write writes all unexpanded 'key = value' pairs to the given writer. // Write returns the number of bytes written and any write error encountered. func (p *Properties) Write(w io.Writer, enc Encoding) (n int, err error) { @@ -635,8 +645,11 @@ func (p *Properties) WriteComment(w io.Writer, prefix string, enc Encoding) (n i } } } - - x, err = fmt.Fprintf(w, "%s = %s\n", encode(key, " :", enc), encode(value, "", enc)) + sep := " = " + if p.WriteSeparator != "" { + sep = p.WriteSeparator + } + x, err = fmt.Fprintf(w, "%s%s%s\n", encode(key, " :", enc), sep, encode(value, "", enc)) if err != nil { return } @@ -820,6 +833,8 @@ func escape(r rune, special string) string { return "\\r" case '\t': return "\\t" + case '\\': + return "\\\\" default: if strings.ContainsRune(special, r) { return "\\" + string(r) diff --git a/vendor/github.com/mailru/easyjson/buffer/pool.go b/vendor/github.com/mailru/easyjson/buffer/pool.go index 07fb4bc1f7b..598a54af9db 100644 --- a/vendor/github.com/mailru/easyjson/buffer/pool.go +++ b/vendor/github.com/mailru/easyjson/buffer/pool.go @@ -4,6 +4,7 @@ package buffer import ( "io" + "net" "sync" ) @@ -52,14 +53,12 @@ func putBuf(buf []byte) { // getBuf gets a chunk from reuse pool or creates a new one if reuse failed. func getBuf(size int) []byte { - if size < config.PooledSize { - return make([]byte, 0, size) - } - - if c := buffers[size]; c != nil { - v := c.Get() - if v != nil { - return v.([]byte) + if size >= config.PooledSize { + if c := buffers[size]; c != nil { + v := c.Get() + if v != nil { + return v.([]byte) + } } } return make([]byte, 0, size) @@ -78,9 +77,12 @@ type Buffer struct { // EnsureSpace makes sure that the current chunk contains at least s free bytes, // possibly creating a new chunk. func (b *Buffer) EnsureSpace(s int) { - if cap(b.Buf)-len(b.Buf) >= s { - return + if cap(b.Buf)-len(b.Buf) < s { + b.ensureSpaceSlow(s) } +} + +func (b *Buffer) ensureSpaceSlow(s int) { l := len(b.Buf) if l > 0 { if cap(b.toPool) != cap(b.Buf) { @@ -105,18 +107,22 @@ func (b *Buffer) EnsureSpace(s int) { // AppendByte appends a single byte to buffer. func (b *Buffer) AppendByte(data byte) { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) b.Buf = append(b.Buf, data) } // AppendBytes appends a byte slice to buffer. func (b *Buffer) AppendBytes(data []byte) { + if len(data) <= cap(b.Buf)-len(b.Buf) { + b.Buf = append(b.Buf, data...) // fast path + } else { + b.appendBytesSlow(data) + } +} + +func (b *Buffer) appendBytesSlow(data []byte) { for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) sz := cap(b.Buf) - len(b.Buf) if sz > len(data) { @@ -128,12 +134,18 @@ func (b *Buffer) AppendBytes(data []byte) { } } -// AppendBytes appends a string to buffer. +// AppendString appends a string to buffer. func (b *Buffer) AppendString(data string) { + if len(data) <= cap(b.Buf)-len(b.Buf) { + b.Buf = append(b.Buf, data...) // fast path + } else { + b.appendStringSlow(data) + } +} + +func (b *Buffer) appendStringSlow(data string) { for len(data) > 0 { - if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined. - b.EnsureSpace(1) - } + b.EnsureSpace(1) sz := cap(b.Buf) - len(b.Buf) if sz > len(data) { @@ -156,18 +168,14 @@ func (b *Buffer) Size() int { // DumpTo outputs the contents of a buffer to a writer and resets the buffer. func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { - var n int - for _, buf := range b.bufs { - if err == nil { - n, err = w.Write(buf) - written += n - } - putBuf(buf) + bufs := net.Buffers(b.bufs) + if len(b.Buf) > 0 { + bufs = append(bufs, b.Buf) } + n, err := bufs.WriteTo(w) - if err == nil { - n, err = w.Write(b.Buf) - written += n + for _, buf := range b.bufs { + putBuf(buf) } putBuf(b.toPool) @@ -175,7 +183,7 @@ func (b *Buffer) DumpTo(w io.Writer) (written int, err error) { b.Buf = nil b.toPool = nil - return + return int(n), err } // BuildBytes creates a single byte slice with all the contents of the buffer. Data is @@ -192,7 +200,7 @@ func (b *Buffer) BuildBytes(reuse ...[]byte) []byte { var ret []byte size := b.Size() - // If we got a buffer as argument and it is big enought, reuse it. + // If we got a buffer as argument and it is big enough, reuse it. if len(reuse) == 1 && cap(reuse[0]) >= size { ret = reuse[0][:0] } else { diff --git a/vendor/github.com/mailru/easyjson/jlexer/lexer.go b/vendor/github.com/mailru/easyjson/jlexer/lexer.go index ddd376b844c..a42e9d65ad7 100644 --- a/vendor/github.com/mailru/easyjson/jlexer/lexer.go +++ b/vendor/github.com/mailru/easyjson/jlexer/lexer.go @@ -5,6 +5,7 @@ package jlexer import ( + "bytes" "encoding/base64" "encoding/json" "errors" @@ -14,6 +15,8 @@ import ( "unicode" "unicode/utf16" "unicode/utf8" + + "github.com/josharian/intern" ) // tokenKind determines type of a token. @@ -32,9 +35,10 @@ const ( type token struct { kind tokenKind // Type of a token. - boolValue bool // Value if a boolean literal token. - byteValue []byte // Raw value of a token. - delimValue byte + boolValue bool // Value if a boolean literal token. + byteValueCloned bool // true if byteValue was allocated and does not refer to original json body + byteValue []byte // Raw value of a token. + delimValue byte } // Lexer is a JSON lexer: it iterates over JSON tokens in a byte slice. @@ -240,23 +244,65 @@ func (r *Lexer) fetchNumber() { // findStringLen tries to scan into the string literal for ending quote char to determine required size. // The size will be exact if no escapes are present and may be inexact if there are escaped chars. -func findStringLen(data []byte) (isValid, hasEscapes bool, length int) { - delta := 0 - - for i := 0; i < len(data); i++ { - switch data[i] { - case '\\': - i++ - delta++ - if i < len(data) && data[i] == 'u' { - delta++ - } - case '"': - return true, (delta > 0), (i - delta) +func findStringLen(data []byte) (isValid bool, length int) { + for { + idx := bytes.IndexByte(data, '"') + if idx == -1 { + return false, len(data) + } + if idx == 0 || (idx > 0 && data[idx-1] != '\\') { + return true, length + idx + } + + // count \\\\\\\ sequences. even number of slashes means quote is not really escaped + cnt := 1 + for idx-cnt-1 >= 0 && data[idx-cnt-1] == '\\' { + cnt++ + } + if cnt%2 == 0 { + return true, length + idx + } + + length += idx + 1 + data = data[idx+1:] + } +} + +// unescapeStringToken performs unescaping of string token. +// if no escaping is needed, original string is returned, otherwise - a new one allocated +func (r *Lexer) unescapeStringToken() (err error) { + data := r.token.byteValue + var unescapedData []byte + + for { + i := bytes.IndexByte(data, '\\') + if i == -1 { + break + } + + escapedRune, escapedBytes, err := decodeEscape(data[i:]) + if err != nil { + r.errParse(err.Error()) + return err } + + if unescapedData == nil { + unescapedData = make([]byte, 0, len(r.token.byteValue)) + } + + var d [4]byte + s := utf8.EncodeRune(d[:], escapedRune) + unescapedData = append(unescapedData, data[:i]...) + unescapedData = append(unescapedData, d[:s]...) + + data = data[i+escapedBytes:] } - return false, false, len(data) + if unescapedData != nil { + r.token.byteValue = append(unescapedData, data...) + r.token.byteValueCloned = true + } + return } // getu4 decodes \uXXXX from the beginning of s, returning the hex value, @@ -286,36 +332,30 @@ func getu4(s []byte) rune { return val } -// processEscape processes a single escape sequence and returns number of bytes processed. -func (r *Lexer) processEscape(data []byte) (int, error) { +// decodeEscape processes a single escape sequence and returns number of bytes processed. +func decodeEscape(data []byte) (decoded rune, bytesProcessed int, err error) { if len(data) < 2 { - return 0, fmt.Errorf("syntax error at %v", string(data)) + return 0, 0, errors.New("incorrect escape symbol \\ at the end of token") } c := data[1] switch c { case '"', '/', '\\': - r.token.byteValue = append(r.token.byteValue, c) - return 2, nil + return rune(c), 2, nil case 'b': - r.token.byteValue = append(r.token.byteValue, '\b') - return 2, nil + return '\b', 2, nil case 'f': - r.token.byteValue = append(r.token.byteValue, '\f') - return 2, nil + return '\f', 2, nil case 'n': - r.token.byteValue = append(r.token.byteValue, '\n') - return 2, nil + return '\n', 2, nil case 'r': - r.token.byteValue = append(r.token.byteValue, '\r') - return 2, nil + return '\r', 2, nil case 't': - r.token.byteValue = append(r.token.byteValue, '\t') - return 2, nil + return '\t', 2, nil case 'u': rr := getu4(data) if rr < 0 { - return 0, errors.New("syntax error") + return 0, 0, errors.New("incorrectly escaped \\uXXXX sequence") } read := 6 @@ -328,13 +368,10 @@ func (r *Lexer) processEscape(data []byte) (int, error) { rr = unicode.ReplacementChar } } - var d [4]byte - s := utf8.EncodeRune(d[:], rr) - r.token.byteValue = append(r.token.byteValue, d[:s]...) - return read, nil + return rr, read, nil } - return 0, errors.New("syntax error") + return 0, 0, errors.New("incorrectly escaped bytes") } // fetchString scans a string literal token. @@ -342,43 +379,14 @@ func (r *Lexer) fetchString() { r.pos++ data := r.Data[r.pos:] - isValid, hasEscapes, length := findStringLen(data) + isValid, length := findStringLen(data) if !isValid { r.pos += length r.errParse("unterminated string literal") return } - if !hasEscapes { - r.token.byteValue = data[:length] - r.pos += length + 1 - return - } - - r.token.byteValue = make([]byte, 0, length) - p := 0 - for i := 0; i < len(data); { - switch data[i] { - case '"': - r.pos += i + 1 - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - i++ - return - - case '\\': - r.token.byteValue = append(r.token.byteValue, data[p:i]...) - off, err := r.processEscape(data[i:]) - if err != nil { - r.errParse(err.Error()) - return - } - i += off - p = i - - default: - i++ - } - } - r.errParse("unterminated string literal") + r.token.byteValue = data[:length] + r.pos += length + 1 // skip closing '"' as well } // scanToken scans the next token if no token is currently available in the lexer. @@ -602,7 +610,7 @@ func (r *Lexer) Consumed() { } } -func (r *Lexer) unsafeString() (string, []byte) { +func (r *Lexer) unsafeString(skipUnescape bool) (string, []byte) { if r.token.kind == tokenUndef && r.Ok() { r.FetchToken() } @@ -610,6 +618,13 @@ func (r *Lexer) unsafeString() (string, []byte) { r.errInvalidToken("string") return "", nil } + if !skipUnescape { + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "", nil + } + } + bytes := r.token.byteValue ret := bytesToStr(r.token.byteValue) r.consume() @@ -621,13 +636,19 @@ func (r *Lexer) unsafeString() (string, []byte) { // Warning: returned string may point to the input buffer, so the string should not outlive // the input buffer. Intended pattern of usage is as an argument to a switch statement. func (r *Lexer) UnsafeString() string { - ret, _ := r.unsafeString() + ret, _ := r.unsafeString(false) return ret } // UnsafeBytes returns the byte slice if the token is a string literal. func (r *Lexer) UnsafeBytes() []byte { - _, ret := r.unsafeString() + _, ret := r.unsafeString(false) + return ret +} + +// UnsafeFieldName returns current member name string token +func (r *Lexer) UnsafeFieldName(skipUnescape bool) string { + ret, _ := r.unsafeString(skipUnescape) return ret } @@ -640,7 +661,34 @@ func (r *Lexer) String() string { r.errInvalidToken("string") return "" } - ret := string(r.token.byteValue) + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "" + } + var ret string + if r.token.byteValueCloned { + ret = bytesToStr(r.token.byteValue) + } else { + ret = string(r.token.byteValue) + } + r.consume() + return ret +} + +// StringIntern reads a string literal, and performs string interning on it. +func (r *Lexer) StringIntern() string { + if r.token.kind == tokenUndef && r.Ok() { + r.FetchToken() + } + if !r.Ok() || r.token.kind != tokenString { + r.errInvalidToken("string") + return "" + } + if err := r.unescapeStringToken(); err != nil { + r.errInvalidToken("string") + return "" + } + ret := intern.Bytes(r.token.byteValue) r.consume() return ret } @@ -839,7 +887,7 @@ func (r *Lexer) Int() int { } func (r *Lexer) Uint8Str() uint8 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -856,7 +904,7 @@ func (r *Lexer) Uint8Str() uint8 { } func (r *Lexer) Uint16Str() uint16 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -873,7 +921,7 @@ func (r *Lexer) Uint16Str() uint16 { } func (r *Lexer) Uint32Str() uint32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -890,7 +938,7 @@ func (r *Lexer) Uint32Str() uint32 { } func (r *Lexer) Uint64Str() uint64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -915,7 +963,7 @@ func (r *Lexer) UintptrStr() uintptr { } func (r *Lexer) Int8Str() int8 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -932,7 +980,7 @@ func (r *Lexer) Int8Str() int8 { } func (r *Lexer) Int16Str() int16 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -949,7 +997,7 @@ func (r *Lexer) Int16Str() int16 { } func (r *Lexer) Int32Str() int32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -966,7 +1014,7 @@ func (r *Lexer) Int32Str() int32 { } func (r *Lexer) Int64Str() int64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -1004,7 +1052,7 @@ func (r *Lexer) Float32() float32 { } func (r *Lexer) Float32Str() float32 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } @@ -1037,7 +1085,7 @@ func (r *Lexer) Float64() float64 { } func (r *Lexer) Float64Str() float64 { - s, b := r.unsafeString() + s, b := r.unsafeString(false) if !r.Ok() { return 0 } diff --git a/vendor/github.com/mailru/easyjson/jwriter/writer.go b/vendor/github.com/mailru/easyjson/jwriter/writer.go index b9ed7ccaa8b..2c5b20105bb 100644 --- a/vendor/github.com/mailru/easyjson/jwriter/writer.go +++ b/vendor/github.com/mailru/easyjson/jwriter/writer.go @@ -270,16 +270,25 @@ func (w *Writer) Bool(v bool) { const chars = "0123456789abcdef" -func isNotEscapedSingleChar(c byte, escapeHTML bool) bool { - // Note: might make sense to use a table if there are more chars to escape. With 4 chars - // it benchmarks the same. - if escapeHTML { - return c != '<' && c != '>' && c != '&' && c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf - } else { - return c != '\\' && c != '"' && c >= 0x20 && c < utf8.RuneSelf +func getTable(falseValues ...int) [128]bool { + table := [128]bool{} + + for i := 0; i < 128; i++ { + table[i] = true + } + + for _, v := range falseValues { + table[v] = false } + + return table } +var ( + htmlEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '&', '<', '>', '\\') + htmlNoEscapeTable = getTable(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, '"', '\\') +) + func (w *Writer) String(s string) { w.Buffer.AppendByte('"') @@ -288,15 +297,21 @@ func (w *Writer) String(s string) { p := 0 // last non-escape symbol + escapeTable := &htmlEscapeTable + if w.NoEscapeHTML { + escapeTable = &htmlNoEscapeTable + } + for i := 0; i < len(s); { c := s[i] - if isNotEscapedSingleChar(c, !w.NoEscapeHTML) { - // single-width character, no escaping is required - i++ - continue - } else if c < utf8.RuneSelf { - // single-with character, need to escape + if c < utf8.RuneSelf { + if escapeTable[c] { + // single-width character, no escaping is required + i++ + continue + } + w.Buffer.AppendString(s[p:i]) switch c { case '\t': diff --git a/vendor/github.com/matoous/godox/godox.go b/vendor/github.com/matoous/godox/godox.go index 13f3f3bec41..6d7104b09d8 100644 --- a/vendor/github.com/matoous/godox/godox.go +++ b/vendor/github.com/matoous/godox/godox.go @@ -49,7 +49,7 @@ func getMessages(c *ast.Comment, fset *token.FileSet, keywords []string) []Messa pos := fset.Position(c.Pos()) // trim the comment if len(sComment) > 40 { - sComment = []byte(fmt.Sprintf("%s...", sComment[:40])) + sComment = []byte(fmt.Sprintf("%.40s...", sComment)) } comments = append(comments, Message{ Pos: pos, diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index b9e936344ce..41215d7fc4f 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -10,6 +10,7 @@ import ( "os" "strconv" "strings" + "sync" "syscall" "unsafe" @@ -27,6 +28,7 @@ const ( backgroundRed = 0x40 backgroundIntensity = 0x80 backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity) + commonLvbUnderscore = 0x8000 cENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4 ) @@ -93,6 +95,7 @@ type Writer struct { oldattr word oldpos coord rest bytes.Buffer + mutex sync.Mutex } // NewColorable returns new instance of Writer which handles escape sequence from File. @@ -432,6 +435,8 @@ func atoiWithDefault(s string, def int) (int, error) { // Write writes data on console func (w *Writer) Write(data []byte) (n int, err error) { + w.mutex.Lock() + defer w.mutex.Unlock() var csbi consoleScreenBufferInfo procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) @@ -683,14 +688,19 @@ loop: switch { case n == 0 || n == 100: attr = w.oldattr - case 1 <= n && n <= 5: + case n == 4: + attr |= commonLvbUnderscore + case (1 <= n && n <= 3) || n == 5: attr |= foregroundIntensity - case n == 7: - attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4) - case n == 22 || n == 25: - attr |= foregroundIntensity - case n == 27: - attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4) + case n == 7 || n == 27: + attr = + (attr &^ (foregroundMask | backgroundMask)) | + ((attr & foregroundMask) << 4) | + ((attr & backgroundMask) >> 4) + case n == 22: + attr &^= foregroundIntensity + case n == 24: + attr &^= commonLvbUnderscore case 30 <= n && n <= 37: attr &= backgroundMask if (n-30)&1 != 0 { @@ -709,7 +719,7 @@ loop: n256setup() } attr &= backgroundMask - attr |= n256foreAttr[n256] + attr |= n256foreAttr[n256%len(n256foreAttr)] i += 2 } } else if len(token) == 5 && token[i+1] == "2" { @@ -751,7 +761,7 @@ loop: n256setup() } attr &= foregroundMask - attr |= n256backAttr[n256] + attr |= n256backAttr[n256%len(n256backAttr)] i += 2 } } else if len(token) == 5 && token[i+1] == "2" { diff --git a/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md b/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md index b3a36fefa16..20eea2b7ade 100644 --- a/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md +++ b/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md @@ -1,3 +1,15 @@ +## 1.3.3 + +* Decoding maps from maps creates a settable value for decode hooks [GH-203] + +## 1.3.2 + +* Decode into interface type with a struct value is supported [GH-187] + +## 1.3.1 + +* Squash should only squash embedded structs. [GH-194] + ## 1.3.0 * Added `",omitempty"` support. This will ignore zero values in the source diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go index cc456138897..f41bcc58fbb 100644 --- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -463,7 +463,34 @@ func (d *Decoder) decode(name string, input interface{}, outVal reflect.Value) e // value to "data" of that type. func (d *Decoder) decodeBasic(name string, data interface{}, val reflect.Value) error { if val.IsValid() && val.Elem().IsValid() { - return d.decode(name, data, val.Elem()) + elem := val.Elem() + + // If we can't address this element, then its not writable. Instead, + // we make a copy of the value (which is a pointer and therefore + // writable), decode into that, and replace the whole value. + copied := false + if !elem.CanAddr() { + copied = true + + // Make *T + copy := reflect.New(elem.Type()) + + // *T = elem + copy.Elem().Set(elem) + + // Set elem so we decode into it + elem = copy + } + + // Decode. If we have an error then return. We also return right + // away if we're not a copy because that means we decoded directly. + if err := d.decode(name, data, elem); err != nil || !copied { + return err + } + + // If we're a copy, we need to set te final result + val.Set(elem.Elem()) + return nil } dataVal := reflect.ValueOf(data) @@ -840,42 +867,31 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re } tagValue := f.Tag.Get(d.config.TagName) - tagParts := strings.Split(tagValue, ",") - - // If "omitempty" is specified in the tag, it ignores empty values. - omitempty := false - for _, tag := range tagParts[1:] { - if tag == "omitempty" { - omitempty = true - break - } - } - if omitempty && isEmptyValue(v) { - continue - } + keyName := f.Name + // If Squash is set in the config, we squash the field down. + squash := d.config.Squash && v.Kind() == reflect.Struct && f.Anonymous // Determine the name of the key in the map - keyName := f.Name - if tagParts[0] != "" { - if tagParts[0] == "-" { + if index := strings.Index(tagValue, ","); index != -1 { + if tagValue[:index] == "-" { continue } - keyName = tagParts[0] - } - - // If Squash is set in the config, we squash the field down. - squash := d.config.Squash && v.Kind() == reflect.Struct - // If "squash" is specified in the tag, we squash the field down. - if !squash { - for _, tag := range tagParts[1:] { - if tag == "squash" { - squash = true - break - } + // If "omitempty" is specified in the tag, it ignores empty values. + if strings.Index(tagValue[index+1:], "omitempty") != -1 && isEmptyValue(v) { + continue } + + // If "squash" is specified in the tag, we squash the field down. + squash = !squash && strings.Index(tagValue[index+1:], "squash") != -1 if squash && v.Kind() != reflect.Struct { return fmt.Errorf("cannot squash non-struct type '%s'", v.Type()) } + keyName = tagValue[:index] + } else if len(tagValue) > 0 { + if tagValue == "-" { + continue + } + keyName = tagValue } switch v.Kind() { @@ -890,11 +906,22 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re mType := reflect.MapOf(vKeyType, vElemType) vMap := reflect.MakeMap(mType) - err := d.decode(keyName, x.Interface(), vMap) + // Creating a pointer to a map so that other methods can completely + // overwrite the map if need be (looking at you decodeMapFromMap). The + // indirection allows the underlying map to be settable (CanSet() == true) + // where as reflect.MakeMap returns an unsettable map. + addrVal := reflect.New(vMap.Type()) + reflect.Indirect(addrVal).Set(vMap) + + err := d.decode(keyName, x.Interface(), reflect.Indirect(addrVal)) if err != nil { return err } + // the underlying map may have been completely overwritten so pull + // it indirectly out of the enclosing value. + vMap = reflect.Indirect(addrVal) + if squash { for _, k := range vMap.MapKeys() { valMap.SetMapIndex(k, vMap.MapIndex(k)) @@ -1138,13 +1165,23 @@ func (d *Decoder) decodeStruct(name string, data interface{}, val reflect.Value) // Not the most efficient way to do this but we can optimize later if // we want to. To convert from struct to struct we go to map first // as an intermediary. - m := make(map[string]interface{}) - mval := reflect.Indirect(reflect.ValueOf(&m)) - if err := d.decodeMapFromStruct(name, dataVal, mval, mval); err != nil { + + // Make a new map to hold our result + mapType := reflect.TypeOf((map[string]interface{})(nil)) + mval := reflect.MakeMap(mapType) + + // Creating a pointer to a map so that other methods can completely + // overwrite the map if need be (looking at you decodeMapFromMap). The + // indirection allows the underlying map to be settable (CanSet() == true) + // where as reflect.MakeMap returns an unsettable map. + addrVal := reflect.New(mval.Type()) + + reflect.Indirect(addrVal).Set(mval) + if err := d.decodeMapFromStruct(name, dataVal, reflect.Indirect(addrVal), mval); err != nil { return err } - result := d.decodeStructFromMap(name, mval, val) + result := d.decodeStructFromMap(name, reflect.Indirect(addrVal), val) return result default: @@ -1198,7 +1235,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e fieldKind := fieldType.Type.Kind() // If "squash" is specified in the tag, we squash the field down. - squash := d.config.Squash && fieldKind == reflect.Struct + squash := d.config.Squash && fieldKind == reflect.Struct && fieldType.Anonymous remain := false // We always parse the tags cause we're looking for other tags too @@ -1226,9 +1263,8 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e } // Build our field - fieldCurrent := field{fieldType, structVal.Field(i)} if remain { - remainField = &fieldCurrent + remainField = &field{fieldType, structVal.Field(i)} } else { // Normal struct field, store it away fields = append(fields, field{fieldType, structVal.Field(i)}) diff --git a/vendor/github.com/moby/term/.gitignore b/vendor/github.com/moby/term/.gitignore index df63b129a79..b0747ff010a 100644 --- a/vendor/github.com/moby/term/.gitignore +++ b/vendor/github.com/moby/term/.gitignore @@ -1,24 +1,8 @@ -# Docker project generated files to ignore -# if you want to ignore files created by your editor/tools, -# please consider a global .gitignore https://help.github.com/articles/ignoring-files -*.exe -*.exe~ -*.gz -*.orig -test.main -.*.swp -.DS_Store -# a .bashrc may be added to customize the build environment -.bashrc -.editorconfig -.gopath/ -.go-pkg-cache/ -.idea/ -autogen/ -bundles/ -cmd/dockerd/dockerd -contrib/builder/rpm/*/changelog -vendor/pkg/ -go-test-report.json +# if you want to ignore files created by your editor/tools, consider using a +# global .gitignore or .git/info/exclude see https://help.github.com/articles/ignoring-files +.* +!.github +!.gitignore profile.out -junit-report.xml +# support running go modules in vendor mode for local development +vendor/ diff --git a/vendor/github.com/moby/term/README.md b/vendor/github.com/moby/term/README.md new file mode 100644 index 00000000000..0ce92cc3398 --- /dev/null +++ b/vendor/github.com/moby/term/README.md @@ -0,0 +1,36 @@ +# term - utilities for dealing with terminals + +![Test](https://github.com/moby/term/workflows/Test/badge.svg) [![GoDoc](https://godoc.org/github.com/moby/term?status.svg)](https://godoc.org/github.com/moby/term) [![Go Report Card](https://goreportcard.com/badge/github.com/moby/term)](https://goreportcard.com/report/github.com/moby/term) + +term provides structures and helper functions to work with terminal (state, sizes). + +#### Using term + +```go +package main + +import ( + "log" + "os" + + "github.com/moby/term" +) + +func main() { + fd := os.Stdin.Fd() + if term.IsTerminal(fd) { + ws, err := term.GetWinsize(fd) + if err != nil { + log.Fatalf("term.GetWinsize: %s", err) + } + log.Printf("%d:%d\n", ws.Height, ws.Width) + } +} +``` + +## Contributing + +Want to hack on term? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply. + +## Copyright and license +Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons. diff --git a/vendor/github.com/moby/term/ascii.go b/vendor/github.com/moby/term/ascii.go index 7c445686f3b..55873c0556c 100644 --- a/vendor/github.com/moby/term/ascii.go +++ b/vendor/github.com/moby/term/ascii.go @@ -1,4 +1,4 @@ -package term // import "github.com/moby/term" +package term import ( "fmt" diff --git a/vendor/github.com/moby/term/go.mod b/vendor/github.com/moby/term/go.mod index 9f23ce0d5e4..4088df8db18 100644 --- a/vendor/github.com/moby/term/go.mod +++ b/vendor/github.com/moby/term/go.mod @@ -4,10 +4,9 @@ go 1.13 require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 - github.com/google/go-cmp v0.3.1 + github.com/creack/pty v1.1.9 + github.com/google/go-cmp v0.4.0 github.com/pkg/errors v0.9.1 // indirect - github.com/sirupsen/logrus v1.4.2 - golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 - gotest.tools v2.2.0+incompatible - gotest.tools/v3 v3.0.2 // indirect + golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a + gotest.tools/v3 v3.0.2 ) diff --git a/vendor/github.com/moby/term/go.sum b/vendor/github.com/moby/term/go.sum index 413bf366683..64d7ef7fab0 100644 --- a/vendor/github.com/moby/term/go.sum +++ b/vendor/github.com/moby/term/go.sum @@ -1,33 +1,23 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= diff --git a/vendor/github.com/moby/term/proxy.go b/vendor/github.com/moby/term/proxy.go index 9573222f9fa..c47756b89a9 100644 --- a/vendor/github.com/moby/term/proxy.go +++ b/vendor/github.com/moby/term/proxy.go @@ -1,4 +1,4 @@ -package term // import "github.com/moby/term" +package term import ( "io" @@ -19,6 +19,7 @@ type escapeProxy struct { escapeKeys []byte escapeKeyPos int r io.Reader + buf []byte } // NewEscapeProxy returns a new TTY proxy reader which wraps the given reader @@ -31,48 +32,57 @@ func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader { } } -func (r *escapeProxy) Read(buf []byte) (int, error) { - nr, err := r.r.Read(buf) +func (r *escapeProxy) Read(buf []byte) (n int, err error) { + if len(r.escapeKeys) > 0 && r.escapeKeyPos == len(r.escapeKeys) { + return 0, EscapeError{} + } - if len(r.escapeKeys) == 0 { - return nr, err + if len(r.buf) > 0 { + n = copy(buf, r.buf) + r.buf = r.buf[n:] } - preserve := func() { - // this preserves the original key presses in the passed in buffer - nr += r.escapeKeyPos - preserve := make([]byte, 0, r.escapeKeyPos+len(buf)) - preserve = append(preserve, r.escapeKeys[:r.escapeKeyPos]...) - preserve = append(preserve, buf...) - r.escapeKeyPos = 0 - copy(buf[0:nr], preserve) + nr, err := r.r.Read(buf[n:]) + n += nr + if len(r.escapeKeys) == 0 { + return n, err } - if nr != 1 || err != nil { - if r.escapeKeyPos > 0 { - preserve() + for i := 0; i < n; i++ { + if buf[i] == r.escapeKeys[r.escapeKeyPos] { + r.escapeKeyPos++ + + // Check if the full escape sequence is matched. + if r.escapeKeyPos == len(r.escapeKeys) { + n = i + 1 - r.escapeKeyPos + if n < 0 { + n = 0 + } + return n, EscapeError{} + } + continue } - return nr, err - } - if buf[0] != r.escapeKeys[r.escapeKeyPos] { - if r.escapeKeyPos > 0 { - preserve() + // If we need to prepend a partial escape sequence from the previous + // read, make sure the new buffer size doesn't exceed len(buf). + // Otherwise, preserve any extra data in a buffer for the next read. + if i < r.escapeKeyPos { + preserve := make([]byte, 0, r.escapeKeyPos+n) + preserve = append(preserve, r.escapeKeys[:r.escapeKeyPos]...) + preserve = append(preserve, buf[:n]...) + n = copy(buf, preserve) + i += r.escapeKeyPos + r.buf = append(r.buf, preserve[n:]...) } - return nr, nil + r.escapeKeyPos = 0 } - if r.escapeKeyPos == len(r.escapeKeys)-1 { - return 0, EscapeError{} + // If we're in the middle of reading an escape sequence, make sure we don't + // let the caller read it. If later on we find that this is not the escape + // sequence, we'll prepend it back to buf. + n -= r.escapeKeyPos + if n < 0 { + n = 0 } - - // Looks like we've got an escape key, but we need to match again on the next - // read. - // Store the current escape key we found so we can look for the next one on - // the next read. - // Since this is an escape key, make sure we don't let the caller read it - // If later on we find that this is not the escape sequence, we'll add the - // keys back - r.escapeKeyPos++ - return nr - r.escapeKeyPos, nil + return n, err } diff --git a/vendor/github.com/moby/term/tc.go b/vendor/github.com/moby/term/tc.go index 162dfb2b2f5..65556027a6d 100644 --- a/vendor/github.com/moby/term/tc.go +++ b/vendor/github.com/moby/term/tc.go @@ -1,20 +1,19 @@ // +build !windows -package term // import "github.com/moby/term" +package term import ( - "syscall" - "unsafe" - "golang.org/x/sys/unix" ) -func tcget(fd uintptr, p *Termios) syscall.Errno { - _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) - return err +func tcget(fd uintptr) (*Termios, error) { + p, err := unix.IoctlGetTermios(int(fd), getTermios) + if err != nil { + return nil, err + } + return p, nil } -func tcset(fd uintptr, p *Termios) syscall.Errno { - _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) - return err +func tcset(fd uintptr, p *Termios) error { + return unix.IoctlSetTermios(int(fd), setTermios, p) } diff --git a/vendor/github.com/moby/term/term.go b/vendor/github.com/moby/term/term.go index 6d643516f39..29c6acf1c7e 100644 --- a/vendor/github.com/moby/term/term.go +++ b/vendor/github.com/moby/term/term.go @@ -2,7 +2,7 @@ // Package term provides structures and helper functions to work with // terminal (state, sizes). -package term // import "github.com/moby/term" +package term import ( "errors" @@ -50,8 +50,8 @@ func GetFdInfo(in interface{}) (uintptr, bool) { // IsTerminal returns true if the given file descriptor is a terminal. func IsTerminal(fd uintptr) bool { - var termios Termios - return tcget(fd, &termios) == 0 + _, err := tcget(fd) + return err == nil } // RestoreTerminal restores the terminal connected to the given file descriptor @@ -60,20 +60,16 @@ func RestoreTerminal(fd uintptr, state *State) error { if state == nil { return ErrInvalidState } - if err := tcset(fd, &state.termios); err != 0 { - return err - } - return nil + return tcset(fd, &state.termios) } // SaveState saves the state of the terminal connected to the given file descriptor. func SaveState(fd uintptr) (*State, error) { - var oldState State - if err := tcget(fd, &oldState.termios); err != 0 { + termios, err := tcget(fd) + if err != nil { return nil, err } - - return &oldState, nil + return &State{termios: *termios}, nil } // DisableEcho applies the specified state to the terminal connected to the file @@ -82,7 +78,7 @@ func DisableEcho(fd uintptr, state *State) error { newState := state.termios newState.Lflag &^= unix.ECHO - if err := tcset(fd, &newState); err != 0 { + if err := tcset(fd, &newState); err != nil { return err } handleInterrupt(fd, state) diff --git a/vendor/github.com/moby/term/term_windows.go b/vendor/github.com/moby/term/term_windows.go index 1649c230647..2e512759e5c 100644 --- a/vendor/github.com/moby/term/term_windows.go +++ b/vendor/github.com/moby/term/term_windows.go @@ -1,13 +1,12 @@ -package term // import "github.com/moby/term" +package term import ( "io" "os" "os/signal" - "syscall" // used for STD_INPUT_HANDLE, STD_OUTPUT_HANDLE and STD_ERROR_HANDLE - "github.com/Azure/go-ansiterm/winterm" windowsconsole "github.com/moby/term/windows" + "golang.org/x/sys/windows" ) // State holds the console mode for the terminal. @@ -28,37 +27,42 @@ var vtInputSupported bool func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) { // Turn on VT handling on all std handles, if possible. This might // fail, in which case we will fall back to terminal emulation. - var emulateStdin, emulateStdout, emulateStderr bool - fd := os.Stdin.Fd() - if mode, err := winterm.GetConsoleMode(fd); err == nil { + var ( + emulateStdin, emulateStdout, emulateStderr bool + + mode uint32 + ) + + fd := windows.Handle(os.Stdin.Fd()) + if err := windows.GetConsoleMode(fd, &mode); err == nil { // Validate that winterm.ENABLE_VIRTUAL_TERMINAL_INPUT is supported, but do not set it. - if err = winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_INPUT); err != nil { + if err = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_INPUT); err != nil { emulateStdin = true } else { vtInputSupported = true } // Unconditionally set the console mode back even on failure because SetConsoleMode // remembers invalid bits on input handles. - winterm.SetConsoleMode(fd, mode) + _ = windows.SetConsoleMode(fd, mode) } - fd = os.Stdout.Fd() - if mode, err := winterm.GetConsoleMode(fd); err == nil { + fd = windows.Handle(os.Stdout.Fd()) + if err := windows.GetConsoleMode(fd, &mode); err == nil { // Validate winterm.DISABLE_NEWLINE_AUTO_RETURN is supported, but do not set it. - if err = winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING|winterm.DISABLE_NEWLINE_AUTO_RETURN); err != nil { + if err = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING|windows.DISABLE_NEWLINE_AUTO_RETURN); err != nil { emulateStdout = true } else { - winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING) + _ = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING) } } - fd = os.Stderr.Fd() - if mode, err := winterm.GetConsoleMode(fd); err == nil { + fd = windows.Handle(os.Stderr.Fd()) + if err := windows.GetConsoleMode(fd, &mode); err == nil { // Validate winterm.DISABLE_NEWLINE_AUTO_RETURN is supported, but do not set it. - if err = winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING|winterm.DISABLE_NEWLINE_AUTO_RETURN); err != nil { + if err = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING|windows.DISABLE_NEWLINE_AUTO_RETURN); err != nil { emulateStderr = true } else { - winterm.SetConsoleMode(fd, mode|winterm.ENABLE_VIRTUAL_TERMINAL_PROCESSING) + _ = windows.SetConsoleMode(fd, mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING) } } @@ -67,19 +71,19 @@ func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) { // go-ansiterm hasn't switch to x/sys/windows. // TODO: switch back to x/sys/windows once go-ansiterm has switched if emulateStdin { - stdIn = windowsconsole.NewAnsiReader(syscall.STD_INPUT_HANDLE) + stdIn = windowsconsole.NewAnsiReader(windows.STD_INPUT_HANDLE) } else { stdIn = os.Stdin } if emulateStdout { - stdOut = windowsconsole.NewAnsiWriter(syscall.STD_OUTPUT_HANDLE) + stdOut = windowsconsole.NewAnsiWriter(windows.STD_OUTPUT_HANDLE) } else { stdOut = os.Stdout } if emulateStderr { - stdErr = windowsconsole.NewAnsiWriter(syscall.STD_ERROR_HANDLE) + stdErr = windowsconsole.NewAnsiWriter(windows.STD_ERROR_HANDLE) } else { stdErr = os.Stderr } @@ -94,8 +98,8 @@ func GetFdInfo(in interface{}) (uintptr, bool) { // GetWinsize returns the window size based on the specified file descriptor. func GetWinsize(fd uintptr) (*Winsize, error) { - info, err := winterm.GetConsoleScreenBufferInfo(fd) - if err != nil { + var info windows.ConsoleScreenBufferInfo + if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { return nil, err } @@ -109,20 +113,23 @@ func GetWinsize(fd uintptr) (*Winsize, error) { // IsTerminal returns true if the given file descriptor is a terminal. func IsTerminal(fd uintptr) bool { - return windowsconsole.IsConsole(fd) + var mode uint32 + err := windows.GetConsoleMode(windows.Handle(fd), &mode) + return err == nil } // RestoreTerminal restores the terminal connected to the given file descriptor // to a previous state. func RestoreTerminal(fd uintptr, state *State) error { - return winterm.SetConsoleMode(fd, state.mode) + return windows.SetConsoleMode(windows.Handle(fd), state.mode) } // SaveState saves the state of the terminal connected to the given file descriptor. func SaveState(fd uintptr) (*State, error) { - mode, e := winterm.GetConsoleMode(fd) - if e != nil { - return nil, e + var mode uint32 + + if err := windows.GetConsoleMode(windows.Handle(fd), &mode); err != nil { + return nil, err } return &State{mode: mode}, nil @@ -132,9 +139,9 @@ func SaveState(fd uintptr) (*State, error) { // -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx func DisableEcho(fd uintptr, state *State) error { mode := state.mode - mode &^= winterm.ENABLE_ECHO_INPUT - mode |= winterm.ENABLE_PROCESSED_INPUT | winterm.ENABLE_LINE_INPUT - err := winterm.SetConsoleMode(fd, mode) + mode &^= windows.ENABLE_ECHO_INPUT + mode |= windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT + err := windows.SetConsoleMode(windows.Handle(fd), mode) if err != nil { return err } @@ -169,7 +176,7 @@ func SetRawTerminalOutput(fd uintptr) (*State, error) { // Ignore failures, since winterm.DISABLE_NEWLINE_AUTO_RETURN might not be supported on this // version of Windows. - winterm.SetConsoleMode(fd, state.mode|winterm.DISABLE_NEWLINE_AUTO_RETURN) + _ = windows.SetConsoleMode(windows.Handle(fd), state.mode|windows.DISABLE_NEWLINE_AUTO_RETURN) return state, err } @@ -188,21 +195,21 @@ func MakeRaw(fd uintptr) (*State, error) { // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx // Disable these modes - mode &^= winterm.ENABLE_ECHO_INPUT - mode &^= winterm.ENABLE_LINE_INPUT - mode &^= winterm.ENABLE_MOUSE_INPUT - mode &^= winterm.ENABLE_WINDOW_INPUT - mode &^= winterm.ENABLE_PROCESSED_INPUT + mode &^= windows.ENABLE_ECHO_INPUT + mode &^= windows.ENABLE_LINE_INPUT + mode &^= windows.ENABLE_MOUSE_INPUT + mode &^= windows.ENABLE_WINDOW_INPUT + mode &^= windows.ENABLE_PROCESSED_INPUT // Enable these modes - mode |= winterm.ENABLE_EXTENDED_FLAGS - mode |= winterm.ENABLE_INSERT_MODE - mode |= winterm.ENABLE_QUICK_EDIT_MODE + mode |= windows.ENABLE_EXTENDED_FLAGS + mode |= windows.ENABLE_INSERT_MODE + mode |= windows.ENABLE_QUICK_EDIT_MODE if vtInputSupported { - mode |= winterm.ENABLE_VIRTUAL_TERMINAL_INPUT + mode |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT } - err = winterm.SetConsoleMode(fd, mode) + err = windows.SetConsoleMode(windows.Handle(fd), mode) if err != nil { return nil, err } @@ -215,7 +222,7 @@ func restoreAtInterrupt(fd uintptr, state *State) { go func() { _ = <-sigchan - RestoreTerminal(fd, state) + _ = RestoreTerminal(fd, state) os.Exit(0) }() } diff --git a/vendor/github.com/moby/term/termios_linux.go b/vendor/github.com/moby/term/termios.go similarity index 62% rename from vendor/github.com/moby/term/termios_linux.go rename to vendor/github.com/moby/term/termios.go index be39ff56cc0..0f028e2273a 100644 --- a/vendor/github.com/moby/term/termios_linux.go +++ b/vendor/github.com/moby/term/termios.go @@ -1,28 +1,24 @@ -package term // import "github.com/moby/term" +// +build !windows + +package term import ( "golang.org/x/sys/unix" ) -const ( - getTermios = unix.TCGETS - setTermios = unix.TCSETS -) - // Termios is the Unix API for terminal I/O. -type Termios unix.Termios +type Termios = unix.Termios -// MakeRaw put the terminal connected to the given file descriptor into raw +// MakeRaw puts the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd uintptr) (*State, error) { - termios, err := unix.IoctlGetTermios(int(fd), getTermios) + termios, err := tcget(fd) if err != nil { return nil, err } - var oldState State - oldState.termios = Termios(*termios) + oldState := State{termios: *termios} termios.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) termios.Oflag &^= unix.OPOST @@ -32,7 +28,7 @@ func MakeRaw(fd uintptr) (*State, error) { termios.Cc[unix.VMIN] = 1 termios.Cc[unix.VTIME] = 0 - if err := unix.IoctlSetTermios(int(fd), setTermios, termios); err != nil { + if err := tcset(fd, termios); err != nil { return nil, err } return &oldState, nil diff --git a/vendor/github.com/moby/term/termios_bsd.go b/vendor/github.com/moby/term/termios_bsd.go index da785106657..922dd4baab0 100644 --- a/vendor/github.com/moby/term/termios_bsd.go +++ b/vendor/github.com/moby/term/termios_bsd.go @@ -1,10 +1,8 @@ // +build darwin freebsd openbsd netbsd -package term // import "github.com/moby/term" +package term import ( - "unsafe" - "golang.org/x/sys/unix" ) @@ -12,31 +10,3 @@ const ( getTermios = unix.TIOCGETA setTermios = unix.TIOCSETA ) - -// Termios is the Unix API for terminal I/O. -type Termios unix.Termios - -// MakeRaw put the terminal connected to the given file descriptor into raw -// mode and returns the previous state of the terminal so that it can be -// restored. -func MakeRaw(fd uintptr) (*State, error) { - var oldState State - if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { - return nil, err - } - - newState := oldState.termios - newState.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) - newState.Oflag &^= unix.OPOST - newState.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) - newState.Cflag &^= (unix.CSIZE | unix.PARENB) - newState.Cflag |= unix.CS8 - newState.Cc[unix.VMIN] = 1 - newState.Cc[unix.VTIME] = 0 - - if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 { - return nil, err - } - - return &oldState, nil -} diff --git a/vendor/github.com/moby/term/termios_nonbsd.go b/vendor/github.com/moby/term/termios_nonbsd.go new file mode 100644 index 00000000000..038fd61ba1e --- /dev/null +++ b/vendor/github.com/moby/term/termios_nonbsd.go @@ -0,0 +1,12 @@ +//+build !darwin,!freebsd,!netbsd,!openbsd,!windows + +package term + +import ( + "golang.org/x/sys/unix" +) + +const ( + getTermios = unix.TCGETS + setTermios = unix.TCSETS +) diff --git a/vendor/github.com/moby/term/windows/ansi_reader.go b/vendor/github.com/moby/term/windows/ansi_reader.go index 5114b63ebf1..155251521b0 100644 --- a/vendor/github.com/moby/term/windows/ansi_reader.go +++ b/vendor/github.com/moby/term/windows/ansi_reader.go @@ -1,6 +1,6 @@ // +build windows -package windowsconsole // import "github.com/moby/term/windows" +package windowsconsole import ( "bytes" @@ -31,7 +31,6 @@ type ansiReader struct { // NewAnsiReader returns an io.ReadCloser that provides VT100 terminal emulation on top of a // Windows console input handle. func NewAnsiReader(nFile int) io.ReadCloser { - initLogger() file, fd := winterm.GetStdFile(nFile) return &ansiReader{ file: file, @@ -59,8 +58,6 @@ func (ar *ansiReader) Read(p []byte) (int, error) { // Previously read bytes exist, read as much as we can and return if len(ar.buffer) > 0 { - logger.Debugf("Reading previously cached bytes") - originalLength := len(ar.buffer) copiedLength := copy(p, ar.buffer) @@ -70,16 +67,14 @@ func (ar *ansiReader) Read(p []byte) (int, error) { ar.buffer = ar.buffer[copiedLength:] } - logger.Debugf("Read from cache p[%d]: % x", copiedLength, p) return copiedLength, nil } // Read and translate key events - events, err := readInputEvents(ar.fd, len(p)) + events, err := readInputEvents(ar, len(p)) if err != nil { return 0, err } else if len(events) == 0 { - logger.Debug("No input events detected") return 0, nil } @@ -87,11 +82,9 @@ func (ar *ansiReader) Read(p []byte) (int, error) { // Save excess bytes and right-size keyBytes if len(keyBytes) > len(p) { - logger.Debugf("Received %d keyBytes, only room for %d bytes", len(keyBytes), len(p)) ar.buffer = keyBytes[len(p):] keyBytes = keyBytes[:len(p)] } else if len(keyBytes) == 0 { - logger.Debug("No key bytes returned from the translator") return 0, nil } @@ -100,13 +93,11 @@ func (ar *ansiReader) Read(p []byte) (int, error) { return 0, errors.New("unexpected copy length encountered") } - logger.Debugf("Read p[%d]: % x", copiedLength, p) - logger.Debugf("Read keyBytes[%d]: % x", copiedLength, keyBytes) return copiedLength, nil } // readInputEvents polls until at least one event is available. -func readInputEvents(fd uintptr, maxBytes int) ([]winterm.INPUT_RECORD, error) { +func readInputEvents(ar *ansiReader, maxBytes int) ([]winterm.INPUT_RECORD, error) { // Determine the maximum number of records to retrieve // -- Cast around the type system to obtain the size of a single INPUT_RECORD. // unsafe.Sizeof requires an expression vs. a type-reference; the casting @@ -118,25 +109,23 @@ func readInputEvents(fd uintptr, maxBytes int) ([]winterm.INPUT_RECORD, error) { } else if countRecords == 0 { countRecords = 1 } - logger.Debugf("[windows] readInputEvents: Reading %v records (buffer size %v, record size %v)", countRecords, maxBytes, recordSize) // Wait for and read input events events := make([]winterm.INPUT_RECORD, countRecords) nEvents := uint32(0) - eventsExist, err := winterm.WaitForSingleObject(fd, winterm.WAIT_INFINITE) + eventsExist, err := winterm.WaitForSingleObject(ar.fd, winterm.WAIT_INFINITE) if err != nil { return nil, err } if eventsExist { - err = winterm.ReadConsoleInput(fd, events, &nEvents) + err = winterm.ReadConsoleInput(ar.fd, events, &nEvents) if err != nil { return nil, err } } // Return a slice restricted to the number of returned records - logger.Debugf("[windows] readInputEvents: Read %v events", nEvents) return events[:nEvents], nil } diff --git a/vendor/github.com/moby/term/windows/ansi_writer.go b/vendor/github.com/moby/term/windows/ansi_writer.go index 51bf9aa48cf..ccb5ef07757 100644 --- a/vendor/github.com/moby/term/windows/ansi_writer.go +++ b/vendor/github.com/moby/term/windows/ansi_writer.go @@ -1,6 +1,6 @@ // +build windows -package windowsconsole // import "github.com/moby/term/windows" +package windowsconsole import ( "io" @@ -24,7 +24,6 @@ type ansiWriter struct { // NewAnsiWriter returns an io.Writer that provides VT100 terminal emulation on top of a // Windows console output handle. func NewAnsiWriter(nFile int) io.Writer { - initLogger() file, fd := winterm.GetStdFile(nFile) info, err := winterm.GetConsoleScreenBufferInfo(fd) if err != nil { @@ -32,9 +31,8 @@ func NewAnsiWriter(nFile int) io.Writer { } parser := ansiterm.CreateParser("Ground", winterm.CreateWinEventHandler(fd, file)) - logger.Infof("newAnsiWriter: parser %p", parser) - aw := &ansiWriter{ + return &ansiWriter{ file: file, fd: fd, infoReset: info, @@ -42,10 +40,6 @@ func NewAnsiWriter(nFile int) io.Writer { escapeSequence: []byte(ansiterm.KEY_ESC_CSI), parser: parser, } - - logger.Infof("newAnsiWriter: aw.parser %p", aw.parser) - logger.Infof("newAnsiWriter: %v", aw) - return aw } func (aw *ansiWriter) Fd() uintptr { @@ -58,7 +52,5 @@ func (aw *ansiWriter) Write(p []byte) (total int, err error) { return 0, nil } - logger.Infof("Write: % x", p) - logger.Infof("Write: %s", string(p)) return aw.parser.Parse(p) } diff --git a/vendor/github.com/moby/term/windows/console.go b/vendor/github.com/moby/term/windows/console.go index 54e0fe839fc..01fdc0f2a1d 100644 --- a/vendor/github.com/moby/term/windows/console.go +++ b/vendor/github.com/moby/term/windows/console.go @@ -1,11 +1,11 @@ // +build windows -package windowsconsole // import "github.com/moby/term/windows" +package windowsconsole import ( "os" - "github.com/Azure/go-ansiterm/winterm" + "golang.org/x/sys/windows" ) // GetHandleInfo returns file descriptor and bool indicating whether the file is a console. @@ -22,14 +22,18 @@ func GetHandleInfo(in interface{}) (uintptr, bool) { if file, ok := in.(*os.File); ok { inFd = file.Fd() - isTerminal = IsConsole(inFd) + isTerminal = isConsole(inFd) } return inFd, isTerminal } // IsConsole returns true if the given file descriptor is a Windows Console. // The code assumes that GetConsoleMode will return an error for file descriptors that are not a console. -func IsConsole(fd uintptr) bool { - _, e := winterm.GetConsoleMode(fd) - return e == nil +// Deprecated: use golang.org/x/sys/windows.GetConsoleMode() or golang.org/x/crypto/ssh/terminal.IsTerminal() +var IsConsole = isConsole + +func isConsole(fd uintptr) bool { + var mode uint32 + err := windows.GetConsoleMode(windows.Handle(fd), &mode) + return err == nil } diff --git a/vendor/github.com/moby/term/windows/doc.go b/vendor/github.com/moby/term/windows/doc.go new file mode 100644 index 00000000000..54265fffaff --- /dev/null +++ b/vendor/github.com/moby/term/windows/doc.go @@ -0,0 +1,5 @@ +// These files implement ANSI-aware input and output streams for use by the Docker Windows client. +// When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create +// and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. + +package windowsconsole diff --git a/vendor/github.com/moby/term/windows/windows.go b/vendor/github.com/moby/term/windows/windows.go deleted file mode 100644 index bb03e060181..00000000000 --- a/vendor/github.com/moby/term/windows/windows.go +++ /dev/null @@ -1,34 +0,0 @@ -// +build windows -// These files implement ANSI-aware input and output streams for use by the Docker Windows client. -// When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create -// and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. - -package windowsconsole // import "github.com/moby/term/windows" - -import ( - "io/ioutil" - "os" - "sync" - - ansiterm "github.com/Azure/go-ansiterm" - "github.com/sirupsen/logrus" -) - -var logger *logrus.Logger -var initOnce sync.Once - -func initLogger() { - initOnce.Do(func() { - logFile := ioutil.Discard - - if isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == "1" { - logFile, _ = os.Create("ansiReaderWriter.log") - } - - logger = &logrus.Logger{ - Out: logFile, - Formatter: new(logrus.TextFormatter), - Level: logrus.DebugLevel, - } - }) -} diff --git a/vendor/github.com/moby/term/winsize.go b/vendor/github.com/moby/term/winsize.go index 29a0463dc46..1ef98d59961 100644 --- a/vendor/github.com/moby/term/winsize.go +++ b/vendor/github.com/moby/term/winsize.go @@ -1,6 +1,6 @@ // +build !windows -package term // import "github.com/moby/term" +package term import ( "golang.org/x/sys/unix" diff --git a/vendor/github.com/nishanths/exhaustive/.gitignore b/vendor/github.com/nishanths/exhaustive/.gitignore new file mode 100644 index 00000000000..a724b56a94f --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/.gitignore @@ -0,0 +1,5 @@ +.DS_Store + +# binary +cmd/exhaustive/exhaustive +exhaustive diff --git a/vendor/github.com/go-lintpack/lintpack/LICENSE b/vendor/github.com/nishanths/exhaustive/LICENSE similarity index 55% rename from vendor/github.com/go-lintpack/lintpack/LICENSE rename to vendor/github.com/nishanths/exhaustive/LICENSE index de0abccdf3d..32befa68f5a 100644 --- a/vendor/github.com/go-lintpack/lintpack/LICENSE +++ b/vendor/github.com/nishanths/exhaustive/LICENSE @@ -1,21 +1,22 @@ -Copyright (c) 2018, go-lintpack maintainers +BSD 2-Clause License + +Copyright (c) 2020, Nishanth Shanmugham +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER diff --git a/vendor/github.com/nishanths/exhaustive/README.md b/vendor/github.com/nishanths/exhaustive/README.md new file mode 100644 index 00000000000..ecc76c7c5dd --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/README.md @@ -0,0 +1,85 @@ +# exhaustive + +[![Godoc](https://godoc.org/github.com/nishanths/exhaustive?status.svg)](https://godoc.org/github.com/nishanths/exhaustive) + +The `exhaustive` package and command line program can be used to detect +enum switch statements that are not exhaustive. + +An enum switch statement is exhaustive if it has cases for each of the enum's members. See godoc for the definition of enum used by the program. + +The `exhaustive` package provides an `Analyzer` that follows the guidelines +described in the [go/analysis](https://godoc.org/golang.org/x/tools/go/analysis) package; this makes +it possible to integrate into existing analysis driver programs. + +## Install + +``` +go get github.com/nishanths/exhaustive/... +``` + +## Docs + +https://godoc.org/github.com/nishanths/exhaustive + +## Usage + +The command line usage is: + +``` +Usage: exhaustive [-flags] [packages...] + +Flags: + -default-signifies-exhaustive + indicates that switch statements are to be considered exhaustive if a 'default' case + is present, even if all enum members aren't listed in the switch (default false) + -fix + apply all suggested fixes (default false) + +Examples: + exhaustive code.org/proj/... + exhaustive -fix example.org/foo/pkg example.org/foo/bar +``` + +## Example + +Given the code: + +```diff +package token + +type Token int + +const ( + Add Token = iota + Subtract + Multiply ++ Quotient ++ Remainder +) +``` +``` +package calc + +import "token" + +func processToken(t token.Token) { + switch t { + case token.Add: + // ... + case token.Subtract: + // ... + case token.Multiply: + // ... + } +} +``` + +Running the `exhaustive` command will print: + +``` +calc.go:6:2: missing cases in switch of type token.Token: Quotient, Remainder +``` + +## License + +BSD 2-Clause diff --git a/vendor/github.com/nishanths/exhaustive/enum.go b/vendor/github.com/nishanths/exhaustive/enum.go new file mode 100644 index 00000000000..98b5656b6e1 --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/enum.go @@ -0,0 +1,99 @@ +package exhaustive + +import ( + "go/ast" + "go/token" + "go/types" + + "golang.org/x/tools/go/analysis" +) + +type enums map[string][]string // enum type name -> enum member names + +func findEnums(pass *analysis.Pass) enums { + pkgEnums := make(enums) + + // Gather enum types. + for _, f := range pass.Files { + for _, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + if gen.Tok != token.TYPE { + continue + } + for _, s := range gen.Specs { + // Must be TypeSpec since we've filtered on token.TYPE. + t, ok := s.(*ast.TypeSpec) + obj := pass.TypesInfo.Defs[t.Name] + if obj == nil { + continue + } + + named, ok := obj.Type().(*types.Named) + if !ok { + continue + } + basic, ok := named.Underlying().(*types.Basic) + if !ok { + continue + } + switch i := basic.Info(); { + case i&types.IsInteger != 0: + pkgEnums[named.Obj().Name()] = nil + case i&types.IsFloat != 0: + pkgEnums[named.Obj().Name()] = nil + case i&types.IsString != 0: + pkgEnums[named.Obj().Name()] = nil + } + } + } + } + + // Gather enum members. + for _, f := range pass.Files { + for _, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + if gen.Tok != token.CONST && gen.Tok != token.VAR { + continue + } + for _, s := range gen.Specs { + // Must be ValueSpec since we've filtered on token.CONST, token.VAR. + v := s.(*ast.ValueSpec) + for _, name := range v.Names { + obj := pass.TypesInfo.Defs[name] + if obj == nil { + continue + } + named, ok := obj.Type().(*types.Named) + if !ok { + continue + } + + members, ok := pkgEnums[named.Obj().Name()] + if !ok { + continue + } + members = append(members, obj.Name()) + pkgEnums[named.Obj().Name()] = members + } + } + } + } + + // Delete member-less enum types. + // We can't call these enums, since we can't be sure without + // the existence of members. (The type may just be a named type, + // for instance.) + for k, v := range pkgEnums { + if len(v) == 0 { + delete(pkgEnums, k) + } + } + + return pkgEnums +} diff --git a/vendor/github.com/nishanths/exhaustive/exhaustive.go b/vendor/github.com/nishanths/exhaustive/exhaustive.go new file mode 100644 index 00000000000..ef869f26833 --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/exhaustive.go @@ -0,0 +1,182 @@ +// Package exhaustive provides an analyzer that helps ensure enum switch statements +// are exhaustive. The analyzer also provides fixes to make the offending switch +// statements exhaustive (see "Fixes" section). +// +// See "cmd/exhaustive" subpackage for the related command line program. +// +// Definition of enum +// +// The language spec does not provide an explicit definition for enums. +// For the purpose of this program, an enum type is a package-level named type +// whose underlying type is an integer (includes byte and rune), a float, or +// a string type. An enum type must have associated with it one or more +// package-level variables of the named type in the package. These variables +// constitute the enum's members. +// +// In the code snippet below, Biome is an enum type with 3 members. +// +// type Biome int +// +// const ( +// Tundra Biome = iota +// Savanna +// Desert +// ) +// +// Switch statement exhaustiveness +// +// An enum switch statement is exhaustive if it has cases for each of the enum's members. +// +// For an enum type defined in the same package as the switch statement, both +// exported and unexported enum members must be present in order to consider +// the switch exhaustive. On the other hand, for an enum type defined +// in an external package it is sufficient for just exported enum members +// to be present in order to consider the switch exhaustive. +// +// Flags +// +// The analyzer accepts a boolean flag: -default-signifies-exhaustive. +// The flag, if set, indicates to the analyzer that switch statements +// are to be considered exhaustive as long as a 'default' case is present, even +// if all enum members aren't listed in the switch statements cases. +// +// The other relevant flag is the -fix flag. +// +// Fixes +// +// The analyzer suggests fixes for a switch statement if it is not exhaustive +// and does not have a 'default' case. The suggested fix always adds a single +// case clause for the missing enum members. +// +// case missingA, missingB, missingC: +// panic(fmt.Sprintf("unhandled value: %v", v)) +// +// where v is the expression in the switch statement's tag (in other words, the +// value being switched upon). If the switch statement's tag is a function or a +// method call the analyzer does not suggest a fix, as reusing the call expression +// in the panic/fmt.Sprintf call could be mutative. +// +// The rationale for the fix using panic is that it might be better to fail loudly on +// existing unhandled or impossible cases than to let them slip by quietly unnoticed. +// An even better fix may, of course, be to manually inspect the sites reported +// by the package and handle the missing cases if necessary. +// +// Imports will be adjusted automatically to account for the "fmt" dependency. +// +// Skip analysis of specific switch statements +// +// If the following directive comment: +// +// //exhaustive:ignore +// +// is associated with a switch statement, the analyzer skips +// checking of the switch statement and no diagnostics are reported. +package exhaustive + +import ( + "go/ast" + "go/types" + "sort" + "strings" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +const ( + // DefaultSignifiesExhaustiveFlag is a flag name used by the analyzer. It + // is exported for use by analyzer driver programs. + DefaultSignifiesExhaustiveFlag = "default-signifies-exhaustive" +) + +var ( + fCheckMaps bool + fDefaultSignifiesExhaustive bool +) + +func init() { + Analyzer.Flags.BoolVar(&fCheckMaps, "maps", false, "check key exhaustiveness for map literals of enum key type, in addition to checking switch statements") + Analyzer.Flags.BoolVar(&fDefaultSignifiesExhaustive, DefaultSignifiesExhaustiveFlag, false, "indicates that switch statements are to be considered exhaustive if a 'default' case is present, even if all enum members aren't listed in the switch") +} + +var Analyzer = &analysis.Analyzer{ + Name: "exhaustive", + Doc: "check exhaustiveness of enum switch statements", + Run: run, + Requires: []*analysis.Analyzer{inspect.Analyzer}, + FactTypes: []analysis.Fact{&enumsFact{}}, +} + +// IgnoreDirectivePrefix is used to exclude checking of specific switch statements. +// See https://godoc.org/github.com/nishanths/exhaustive#hdr-Skip_analysis_of_specific_switch_statements +// for details. +const IgnoreDirectivePrefix = "//exhaustive:ignore" + +func containsIgnoreDirective(comments []*ast.Comment) bool { + for _, c := range comments { + if strings.HasPrefix(c.Text, IgnoreDirectivePrefix) { + return true + } + } + return false +} + +type enumsFact struct { + Entries enums +} + +var _ analysis.Fact = (*enumsFact)(nil) + +func (e *enumsFact) AFact() {} + +func (e *enumsFact) String() string { + // sort for stability (required for testing) + var sortedKeys []string + for k := range e.Entries { + sortedKeys = append(sortedKeys, k) + } + sort.Strings(sortedKeys) + + var buf strings.Builder + for i, k := range sortedKeys { + v := e.Entries[k] + buf.WriteString(k) + buf.WriteString(":") + for j, vv := range v { + buf.WriteString(vv) + // add comma separator between each enum member in an enum type + if j != len(v)-1 { + buf.WriteString(",") + } + } + // add semicolon separator between each enum type + if i != len(sortedKeys)-1 { + buf.WriteString("; ") + } + } + return buf.String() +} + +func run(pass *analysis.Pass) (interface{}, error) { + e := findEnums(pass) + if len(e) != 0 { + pass.ExportPackageFact(&enumsFact{Entries: e}) + } + + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + comments := make(map[*ast.File]ast.CommentMap) // CommentMap per package file, lazily populated by reference + + checkSwitchStatements(pass, inspect, comments) + if fCheckMaps { + checkMapLiterals(pass, inspect, comments) + } + return nil, nil +} + +func enumTypeName(e *types.Named, samePkg bool) string { + if samePkg { + return e.Obj().Name() + } + return e.Obj().Pkg().Name() + "." + e.Obj().Name() +} diff --git a/vendor/github.com/nishanths/exhaustive/go.mod b/vendor/github.com/nishanths/exhaustive/go.mod new file mode 100644 index 00000000000..b15048eab4a --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/go.mod @@ -0,0 +1,5 @@ +module github.com/nishanths/exhaustive + +go 1.14 + +require golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a diff --git a/vendor/github.com/nishanths/exhaustive/go.sum b/vendor/github.com/nishanths/exhaustive/go.sum new file mode 100644 index 00000000000..01ba9996547 --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/go.sum @@ -0,0 +1,21 @@ +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +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/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +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/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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a h1:gILuVKC+ZPD6g/tj6zBOdnOH1ZHI0zZ86+KLMogc6/s= +golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200519142718-10921354bc51 h1:GtYAC9y+dpwWCXBwbcZgxcFfiqW4SI93yvQqpF+9+P8= +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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/vendor/github.com/nishanths/exhaustive/map.go b/vendor/github.com/nishanths/exhaustive/map.go new file mode 100644 index 00000000000..6d875e32af5 --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/map.go @@ -0,0 +1,158 @@ +package exhaustive + +import ( + "fmt" + "go/ast" + "go/token" + "go/types" + "sort" + "strings" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/ast/astutil" + "golang.org/x/tools/go/ast/inspector" +) + +func checkMapLiterals(pass *analysis.Pass, inspect *inspector.Inspector, comments map[*ast.File]ast.CommentMap) { + for _, f := range pass.Files { + for _, d := range f.Decls { + gen, ok := d.(*ast.GenDecl) + if !ok { + continue + } + if gen.Tok != token.VAR { + continue // map literals have to be declared as "var" + } + for _, s := range gen.Specs { + valueSpec := s.(*ast.ValueSpec) + for idx, name := range valueSpec.Names { + obj := pass.TypesInfo.Defs[name] + if obj == nil { + continue + } + + mapType, ok := obj.Type().(*types.Map) + if !ok { + continue + } + + keyType, ok := mapType.Key().(*types.Named) + if !ok { + continue + } + keyPkg := keyType.Obj().Pkg() + if keyPkg == nil { + // Doc comment: nil for labels and objects in the Universe scope. + // This happens for the `error` type, for example. + // Continuing would mean that ImportPackageFact panics. + continue + } + + var enums enumsFact + if !pass.ImportPackageFact(keyPkg, &enums) { + // Can't do anything further. + continue + } + + enumMembers, ok := enums.Entries[keyType.Obj().Name()] + if !ok { + // Key type is not a known enum. + continue + } + + // Check comments for the ignore directive. + + var allComments ast.CommentMap + if cm, ok := comments[f]; ok { + allComments = cm + } else { + allComments = ast.NewCommentMap(pass.Fset, f, f.Comments) + comments[f] = allComments + } + + genDeclComments := allComments.Filter(gen) + genDeclIgnore := false + for _, group := range genDeclComments.Comments() { + if containsIgnoreDirective(group.List) && gen.Lparen == token.NoPos && len(gen.Specs) == 1 { + genDeclIgnore = true + break + } + } + if genDeclIgnore { + continue + } + + if (valueSpec.Doc != nil && containsIgnoreDirective(valueSpec.Doc.List)) || + (valueSpec.Comment != nil && containsIgnoreDirective(valueSpec.Comment.List)) { + continue + } + + samePkg := keyPkg == pass.Pkg + checkUnexported := samePkg + + hitlist := hitlistFromEnumMembers(enumMembers, checkUnexported) + if len(hitlist) == 0 { + // can happen if external package and enum consists only of + // unexported members + continue + } + + if !(len(valueSpec.Values) > idx) { + continue // no value for name + } + comp, ok := valueSpec.Values[idx].(*ast.CompositeLit) + if !ok { + continue + } + for _, el := range comp.Elts { + kvExpr, ok := el.(*ast.KeyValueExpr) + if !ok { + continue + } + e := astutil.Unparen(kvExpr.Key) + if samePkg { + ident, ok := e.(*ast.Ident) + if !ok { + continue + } + delete(hitlist, ident.Name) + } else { + selExpr, ok := e.(*ast.SelectorExpr) + if !ok { + continue + } + + // ensure X is package identifier + ident, ok := selExpr.X.(*ast.Ident) + if !ok { + continue + } + if !isPackageNameIdentifier(pass, ident) { + continue + } + + delete(hitlist, selExpr.Sel.Name) + } + } + + if len(hitlist) > 0 { + reportMapLiteral(pass, name, samePkg, keyType, hitlist) + } + } + } + } + } +} + +func reportMapLiteral(pass *analysis.Pass, mapVarIdent *ast.Ident, samePkg bool, enumType *types.Named, missingMembers map[string]struct{}) { + missing := make([]string, 0, len(missingMembers)) + for m := range missingMembers { + missing = append(missing, m) + } + sort.Strings(missing) + + pass.Report(analysis.Diagnostic{ + Pos: mapVarIdent.Pos(), + Message: fmt.Sprintf("missing keys in map %s of key type %s: %s", mapVarIdent.Name, enumTypeName(enumType, samePkg), strings.Join(missing, ", ")), + }) +} diff --git a/vendor/github.com/nishanths/exhaustive/switch.go b/vendor/github.com/nishanths/exhaustive/switch.go new file mode 100644 index 00000000000..5889c293459 --- /dev/null +++ b/vendor/github.com/nishanths/exhaustive/switch.go @@ -0,0 +1,367 @@ +package exhaustive + +import ( + "bytes" + "fmt" + "go/ast" + "go/printer" + "go/token" + "go/types" + "sort" + "strconv" + "strings" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/ast/astutil" + "golang.org/x/tools/go/ast/inspector" +) + +func isDefaultCase(c *ast.CaseClause) bool { + return c.List == nil // see doc comment on field +} + +func checkSwitchStatements(pass *analysis.Pass, inspect *inspector.Inspector, comments map[*ast.File]ast.CommentMap) { + inspect.WithStack([]ast.Node{&ast.SwitchStmt{}}, func(n ast.Node, push bool, stack []ast.Node) bool { + if !push { + return true + } + sw := n.(*ast.SwitchStmt) + if sw.Tag == nil { + return true + } + t := pass.TypesInfo.Types[sw.Tag] + if !t.IsValue() { + return true + } + tagType, ok := t.Type.(*types.Named) + if !ok { + return true + } + + tagPkg := tagType.Obj().Pkg() + if tagPkg == nil { + // Doc comment: nil for labels and objects in the Universe scope. + // This happens for the `error` type, for example. + // Continuing would mean that ImportPackageFact panics. + return true + } + + var enums enumsFact + if !pass.ImportPackageFact(tagPkg, &enums) { + // Can't do anything further. + return true + } + + enumMembers, isEnum := enums.Entries[tagType.Obj().Name()] + if !isEnum { + // Tag's type is not a known enum. + return true + } + + // Get comment map. + file := stack[0].(*ast.File) + var allComments ast.CommentMap + if cm, ok := comments[file]; ok { + allComments = cm + } else { + allComments = ast.NewCommentMap(pass.Fset, file, file.Comments) + comments[file] = allComments + } + + specificComments := allComments.Filter(sw) + for _, group := range specificComments.Comments() { + if containsIgnoreDirective(group.List) { + return true // skip checking due to ignore directive + } + } + + samePkg := tagPkg == pass.Pkg + checkUnexported := samePkg + + hitlist := hitlistFromEnumMembers(enumMembers, checkUnexported) + if len(hitlist) == 0 { + // can happen if external package and enum consists only of + // unexported members + return true + } + + defaultCaseExists := false + for _, stmt := range sw.Body.List { + caseCl := stmt.(*ast.CaseClause) + if isDefaultCase(caseCl) { + defaultCaseExists = true + continue // nothing more to do if it's the default case + } + for _, e := range caseCl.List { + e = astutil.Unparen(e) + if samePkg { + ident, ok := e.(*ast.Ident) + if !ok { + continue + } + delete(hitlist, ident.Name) + } else { + selExpr, ok := e.(*ast.SelectorExpr) + if !ok { + continue + } + + // ensure X is package identifier + ident, ok := selExpr.X.(*ast.Ident) + if !ok { + continue + } + if !isPackageNameIdentifier(pass, ident) { + continue + } + + delete(hitlist, selExpr.Sel.Name) + } + } + } + + defaultSuffices := fDefaultSignifiesExhaustive && defaultCaseExists + shouldReport := len(hitlist) > 0 && !defaultSuffices + + if shouldReport { + reportSwitch(pass, sw, samePkg, tagType, hitlist, defaultCaseExists, file) + } + return true + }) +} + +func isPackageNameIdentifier(pass *analysis.Pass, ident *ast.Ident) bool { + obj := pass.TypesInfo.ObjectOf(ident) + if obj == nil { + return false + } + _, ok := obj.(*types.PkgName) + return ok +} + +func hitlistFromEnumMembers(enumMembers []string, checkUnexported bool) map[string]struct{} { + hitlist := make(map[string]struct{}) + for _, m := range enumMembers { + if m == "_" { + // blank identifier is often used to skip entries in iota lists + continue + } + if ast.IsExported(m) || checkUnexported { + hitlist[m] = struct{}{} + } + } + return hitlist +} + +func reportSwitch(pass *analysis.Pass, sw *ast.SwitchStmt, samePkg bool, enumType *types.Named, missingMembers map[string]struct{}, defaultCaseExists bool, f *ast.File) { + missing := make([]string, 0, len(missingMembers)) + for m := range missingMembers { + missing = append(missing, m) + } + sort.Strings(missing) + + var fixes []analysis.SuggestedFix + if !defaultCaseExists { + if fix, ok := computeFix(pass, pass.Fset, f, sw, enumType, samePkg, missingMembers); ok { + fixes = append(fixes, fix) + } + } + + pass.Report(analysis.Diagnostic{ + Pos: sw.Pos(), + End: sw.End(), + Message: fmt.Sprintf("missing cases in switch of type %s: %s", enumTypeName(enumType, samePkg), strings.Join(missing, ", ")), + SuggestedFixes: fixes, + }) +} + +func computeFix(pass *analysis.Pass, fset *token.FileSet, f *ast.File, sw *ast.SwitchStmt, enumType *types.Named, samePkg bool, missingMembers map[string]struct{}) (analysis.SuggestedFix, bool) { + // Function and method calls may be mutative, so we don't want to reuse the + // call expression in the about-to-be-inserted case clause body. So we just + // don't suggest a fix in such situations. + // + // However, we need to make an exception for type conversions, which are + // also call expressions in the AST. + // + // We'll need to lookup type information for this, and can't rely solely + // on the AST. + if containsFuncCall(pass, sw.Tag) { + return analysis.SuggestedFix{}, false + } + + textEdits := []analysis.TextEdit{ + missingCasesTextEdit(fset, f, samePkg, sw, enumType, missingMembers), + } + + // need to add "fmt" import if "fmt" import doesn't already exist + if !hasImportWithPath(fset, f, `"fmt"`) { + textEdits = append(textEdits, fmtImportTextEdit(fset, f)) + } + + missing := make([]string, 0, len(missingMembers)) + for m := range missingMembers { + missing = append(missing, m) + } + sort.Strings(missing) + + return analysis.SuggestedFix{ + Message: fmt.Sprintf("add case clause for: %s?", strings.Join(missing, ", ")), + TextEdits: textEdits, + }, true +} + +func containsFuncCall(pass *analysis.Pass, e ast.Expr) bool { + e = astutil.Unparen(e) + c, ok := e.(*ast.CallExpr) + if !ok { + return false + } + if _, isFunc := pass.TypesInfo.TypeOf(c.Fun).Underlying().(*types.Signature); isFunc { + return true + } + for _, a := range c.Args { + if containsFuncCall(pass, a) { + return true + } + } + return false +} + +func firstImportDecl(fset *token.FileSet, f *ast.File) *ast.GenDecl { + for _, decl := range f.Decls { + genDecl, ok := decl.(*ast.GenDecl) + if ok && genDecl.Tok == token.IMPORT { + // first IMPORT GenDecl + return genDecl + } + } + return nil +} + +// copies an GenDecl in a manner such that appending to the returned GenDecl's Specs field +// doesn't mutate the original GenDecl +func copyGenDecl(im *ast.GenDecl) *ast.GenDecl { + imCopy := *im + imCopy.Specs = make([]ast.Spec, len(im.Specs)) + for i := range im.Specs { + imCopy.Specs[i] = im.Specs[i] + } + return &imCopy +} + +func hasImportWithPath(fset *token.FileSet, f *ast.File, pathLiteral string) bool { + igroups := astutil.Imports(fset, f) + for _, igroup := range igroups { + for _, importSpec := range igroup { + if importSpec.Path.Value == pathLiteral { + return true + } + } + } + return false +} + +func fmtImportTextEdit(fset *token.FileSet, f *ast.File) analysis.TextEdit { + firstDecl := firstImportDecl(fset, f) + + if firstDecl == nil { + // file has no import declarations + // insert "fmt" import spec after package statement + return analysis.TextEdit{ + Pos: f.Name.End() + 1, // end of package name + 1 + End: f.Name.End() + 1, + NewText: []byte(`import ( + "fmt" + )`), + } + } + + // copy because we'll be mutating its Specs field + firstDeclCopy := copyGenDecl(firstDecl) + + // find insertion index for "fmt" import spec + var i int + for ; i < len(firstDeclCopy.Specs); i++ { + im := firstDeclCopy.Specs[i].(*ast.ImportSpec) + if v, _ := strconv.Unquote(im.Path.Value); v > "fmt" { + break + } + } + + // insert "fmt" import spec at the index + fmtSpec := &ast.ImportSpec{ + Path: &ast.BasicLit{ + // NOTE: Pos field doesn't seem to be required for our + // purposes here. + Kind: token.STRING, + Value: `"fmt"`, + }, + } + s := firstDeclCopy.Specs // local var for easier comprehension of next line + s = append(s[:i], append([]ast.Spec{fmtSpec}, s[i:]...)...) + firstDeclCopy.Specs = s + + // create the text edit + var buf bytes.Buffer + printer.Fprint(&buf, fset, firstDeclCopy) + + return analysis.TextEdit{ + Pos: firstDecl.Pos(), + End: firstDecl.End(), + NewText: buf.Bytes(), + } +} + +func missingCasesTextEdit(fset *token.FileSet, f *ast.File, samePkg bool, sw *ast.SwitchStmt, enumType *types.Named, missingMembers map[string]struct{}) analysis.TextEdit { + // ... Construct insertion text for case clause and its body ... + + var tag bytes.Buffer + printer.Fprint(&tag, fset, sw.Tag) + + // If possible and if necessary, determine the package identifier based on the AST of other `case` clauses. + var pkgIdent *ast.Ident + if !samePkg { + for _, stmt := range sw.Body.List { + caseCl := stmt.(*ast.CaseClause) + // At least one expression must exist in List at this point. + // List cannot be nil because we only arrive here if the "default" clause + // does not exist. Additionally, a syntactically valid case clause must + // have at least one expression. + if sel, ok := caseCl.List[0].(*ast.SelectorExpr); ok { + pkgIdent = sel.X.(*ast.Ident) + break + } + } + } + + missing := make([]string, 0, len(missingMembers)) + for m := range missingMembers { + if !samePkg { + if pkgIdent != nil { + // we were able to determine package identifier + missing = append(missing, pkgIdent.Name+"."+m) + } else { + // use the package name (may not be correct always) + // + // TODO: May need to also add import if the package isn't imported + // elsewhere. This (ie, a switch with zero case clauses) should + // happen rarely, so don't implement this for now. + missing = append(missing, enumType.Obj().Pkg().Name()+"."+m) + } + } else { + missing = append(missing, m) + } + } + sort.Strings(missing) + + insert := `case ` + strings.Join(missing, ", ") + `: + panic(fmt.Sprintf("unhandled value: %v",` + tag.String() + `))` + + // ... Create the text edit ... + + return analysis.TextEdit{ + Pos: sw.Body.Rbrace - 1, + End: sw.Body.Rbrace - 1, + NewText: []byte(insert), + } +} diff --git a/vendor/github.com/onsi/ginkgo/CHANGELOG.md b/vendor/github.com/onsi/ginkgo/CHANGELOG.md index 3df6db7b97f..6092fcb633d 100644 --- a/vendor/github.com/onsi/ginkgo/CHANGELOG.md +++ b/vendor/github.com/onsi/ginkgo/CHANGELOG.md @@ -1,3 +1,39 @@ +## 1.14.1 + +### Fixes +- Discard exported method declaration when running ginkgo bootstrap (#558) [f4b0240] + +## 1.14.0 + +### Features +- Defer running top-level container nodes until RunSpecs is called [d44dedf] +- [Document Ginkgo lifecycle](http://onsi.github.io/ginkgo/#understanding-ginkgos-lifecycle) +- Add `extensions/globals` package (#692) [3295c8f] - this can be helpful in contexts where you are test-driving your test-generation code (see [#692](https://github.com/onsi/ginkgo/pull/692)) +- Print Skip reason in JUnit reporter if one was provided [820dfab] + +## 1.13.0 + +### Features +- Add a version of table.Entry that allows dumping the entry parameters. (#689) [21eaef2] + +### Fixes +- Ensure integration tests pass in an environment sans GOPATH [606fba2] +- Add books package (#568) [fc0e44e] +- doc(readme): installation via "tools package" (#677) [83bb20e] +- Solve the undefined: unix.Dup2 compile error on mips64le (#680) [0624f75] +- Import package without dot (#687) [6321024] +- Fix integration tests to stop require GOPATH (#686) [a912ec5] + +## 1.12.3 + +### Fixes +- Print correct code location of failing table test (#666) [c6d7afb] + +## 1.12.2 + +### Fixes +- Update dependencies [ea4a036] + ## 1.12.1 ### Fixes diff --git a/vendor/github.com/onsi/ginkgo/README.md b/vendor/github.com/onsi/ginkgo/README.md index 2fda7b9eb5f..475e04994f7 100644 --- a/vendor/github.com/onsi/ginkgo/README.md +++ b/vendor/github.com/onsi/ginkgo/README.md @@ -4,7 +4,23 @@ Jump to the [docs](https://onsi.github.io/ginkgo/) to learn more. To start rolling your Ginkgo tests *now* [keep reading](#set-me-up)! -If you have a question, comment, bug report, feature request, etc. please open a GitHub issue. +If you have a question, comment, bug report, feature request, etc. please open a GitHub issue, or visit the [Ginkgo Slack channel](https://app.slack.com/client/T029RQSE6/CQQ50BBNW). + +## TLDR +Ginkgo builds on Go's `testing` package, allowing expressive [Behavior-Driven Development](https://en.wikipedia.org/wiki/Behavior-driven_development) ("BDD") style tests. +It is typically (and optionally) paired with the [Gomega](https://github.com/onsi/gomega) matcher library. + +```go +Describe("the strings package", func() { + Context("strings.Contains()", func() { + When("the string contains the substring in the middle", func() { + It("returns `true`", func() { + Expect(strings.Contains("Ginkgo is awesome", "is")).To(BeTrue()) + }) + }) + }) +}) +``` ## Feature List @@ -59,15 +75,37 @@ Ginkgo is best paired with Gomega. Learn more about Gomega [here](https://onsi. Agouti allows you run WebDriver integration tests. Learn more about Agouti [here](https://agouti.org) -## Set Me Up! +## Getting Started -You'll need the Go command-line tools. Ginkgo is tested with Go 1.6+, but preferably you should get the latest. Follow the [installation instructions](https://golang.org/doc/install) if you don't have it installed. +You'll need the Go command-line tools. Follow the [installation instructions](https://golang.org/doc/install) if you don't have it installed. +### Global installation +To install the Ginkgo command line interface: ```bash +go get -u github.com/onsi/ginkgo/ginkgo +``` +Note that this will install it to `$GOBIN`, which will need to be in the `$PATH` (or equivalent). Run `go help install` for more information. + +### Go module ["tools package"](https://github.com/golang/go/issues/25922): +Create (or update) a file called `tools/tools.go` with the following contents: +```go +// +build tools + +package tools -go get -u github.com/onsi/ginkgo/ginkgo # installs the ginkgo CLI -go get -u github.com/onsi/gomega/... # fetches the matcher library +import ( + _ "github.com/onsi/ginkgo/ginkgo" +) +// This file imports packages that are used when running go generate, or used +// during the development process but not otherwise depended on by built code. +``` +The Ginkgo command can then be run via `go run github.com/onsi/ginkgo/ginkgo`. +This approach allows the version of Ginkgo to be maintained under source control for reproducible results, +and is well suited to automated test pipelines. + +### Bootstrapping +```bash cd path/to/package/you/want/to/test ginkgo bootstrap # set up a new ginkgo suite diff --git a/vendor/github.com/onsi/ginkgo/config/config.go b/vendor/github.com/onsi/ginkgo/config/config.go index 9363d49bce2..feef2bcd6c8 100644 --- a/vendor/github.com/onsi/ginkgo/config/config.go +++ b/vendor/github.com/onsi/ginkgo/config/config.go @@ -1,7 +1,7 @@ /* Ginkgo accepts a number of configuration options. -These are documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) +These are documented [here](http://onsi.github.io/ginkgo/#the-ginkgo-cli) You can also learn more via @@ -20,7 +20,7 @@ import ( "fmt" ) -const VERSION = "1.12.1" +const VERSION = "1.14.1" type GinkgoConfigType struct { RandomSeed int64 diff --git a/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go b/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go index 3cbf89a35c7..30ff86f59f2 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go @@ -22,9 +22,8 @@ import ( "github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/failer" + "github.com/onsi/ginkgo/internal/global" "github.com/onsi/ginkgo/internal/remote" - "github.com/onsi/ginkgo/internal/suite" "github.com/onsi/ginkgo/internal/testingtproxy" "github.com/onsi/ginkgo/internal/writer" "github.com/onsi/ginkgo/reporters" @@ -46,16 +45,10 @@ To circumvent this, you should call at the top of the goroutine that caused this panic. ` -const defaultTimeout = 1 - -var globalSuite *suite.Suite -var globalFailer *failer.Failer func init() { config.Flags(flag.CommandLine, "ginkgo", true) GinkgoWriter = writer.New(os.Stdout) - globalFailer = failer.New() - globalSuite = suite.New(globalFailer) } //GinkgoWriter implements an io.Writer @@ -156,7 +149,7 @@ type GinkgoTestDescription struct { //CurrentGinkgoTestDescripton returns information about the current running test. func CurrentGinkgoTestDescription() GinkgoTestDescription { - summary, ok := globalSuite.CurrentRunningSpecSummary() + summary, ok := global.Suite.CurrentRunningSpecSummary() if !ok { return GinkgoTestDescription{} } @@ -223,7 +216,7 @@ func RunSpecsWithCustomReporters(t GinkgoTestingT, description string, specRepor for i, reporter := range specReporters { reporters[i] = reporter } - passed, hasFocusedTests := globalSuite.Run(t, description, reporters, writer, config.GinkgoConfig) + passed, hasFocusedTests := global.Suite.Run(t, description, reporters, writer, config.GinkgoConfig) if passed && hasFocusedTests && strings.TrimSpace(os.Getenv("GINKGO_EDITOR_INTEGRATION")) == "" { fmt.Println("PASS | FOCUSED") os.Exit(types.GINKGO_FOCUS_EXIT_CODE) @@ -252,7 +245,7 @@ func Skip(message string, callerSkip ...int) { skip = callerSkip[0] } - globalFailer.Skip(message, codelocation.New(skip+1)) + global.Failer.Skip(message, codelocation.New(skip+1)) panic(GINKGO_PANIC) } @@ -263,7 +256,7 @@ func Fail(message string, callerSkip ...int) { skip = callerSkip[0] } - globalFailer.Fail(message, codelocation.New(skip+1)) + global.Failer.Fail(message, codelocation.New(skip+1)) panic(GINKGO_PANIC) } @@ -280,7 +273,7 @@ func Fail(message string, callerSkip ...int) { func GinkgoRecover() { e := recover() if e != nil { - globalFailer.Panic(codelocation.New(1), e) + global.Failer.Panic(codelocation.New(1), e) } } @@ -291,25 +284,25 @@ func GinkgoRecover() { //equivalent. The difference is purely semantic -- you typically Describe the behavior of an object //or method and, within that Describe, outline a number of Contexts and Whens. func Describe(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypeNone, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypeNone, codelocation.New(1)) return true } //You can focus the tests within a describe block using FDescribe func FDescribe(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypeFocused, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypeFocused, codelocation.New(1)) return true } //You can mark the tests within a describe block as pending using PDescribe func PDescribe(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) return true } //You can mark the tests within a describe block as pending using XDescribe func XDescribe(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) return true } @@ -320,25 +313,25 @@ func XDescribe(text string, body func()) bool { //equivalent. The difference is purely semantic -- you typical Describe the behavior of an object //or method and, within that Describe, outline a number of Contexts and Whens. func Context(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypeNone, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypeNone, codelocation.New(1)) return true } //You can focus the tests within a describe block using FContext func FContext(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypeFocused, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypeFocused, codelocation.New(1)) return true } //You can mark the tests within a describe block as pending using PContext func PContext(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) return true } //You can mark the tests within a describe block as pending using XContext func XContext(text string, body func()) bool { - globalSuite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) + global.Suite.PushContainerNode(text, body, types.FlagTypePending, codelocation.New(1)) return true } @@ -349,25 +342,25 @@ func XContext(text string, body func()) bool { //equivalent. The difference is purely semantic -- you typical Describe the behavior of an object //or method and, within that Describe, outline a number of Contexts and Whens. func When(text string, body func()) bool { - globalSuite.PushContainerNode("when "+text, body, types.FlagTypeNone, codelocation.New(1)) + global.Suite.PushContainerNode("when "+text, body, types.FlagTypeNone, codelocation.New(1)) return true } //You can focus the tests within a describe block using FWhen func FWhen(text string, body func()) bool { - globalSuite.PushContainerNode("when "+text, body, types.FlagTypeFocused, codelocation.New(1)) + global.Suite.PushContainerNode("when "+text, body, types.FlagTypeFocused, codelocation.New(1)) return true } //You can mark the tests within a describe block as pending using PWhen func PWhen(text string, body func()) bool { - globalSuite.PushContainerNode("when "+text, body, types.FlagTypePending, codelocation.New(1)) + global.Suite.PushContainerNode("when "+text, body, types.FlagTypePending, codelocation.New(1)) return true } //You can mark the tests within a describe block as pending using XWhen func XWhen(text string, body func()) bool { - globalSuite.PushContainerNode("when "+text, body, types.FlagTypePending, codelocation.New(1)) + global.Suite.PushContainerNode("when "+text, body, types.FlagTypePending, codelocation.New(1)) return true } @@ -377,25 +370,25 @@ func XWhen(text string, body func()) bool { //Ginkgo will normally run It blocks synchronously. To perform asynchronous tests, pass a //function that accepts a Done channel. When you do this, you can also provide an optional timeout. func It(text string, body interface{}, timeout ...float64) bool { - globalSuite.PushItNode(text, body, types.FlagTypeNone, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushItNode(text, body, types.FlagTypeNone, codelocation.New(1), parseTimeout(timeout...)) return true } //You can focus individual Its using FIt func FIt(text string, body interface{}, timeout ...float64) bool { - globalSuite.PushItNode(text, body, types.FlagTypeFocused, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushItNode(text, body, types.FlagTypeFocused, codelocation.New(1), parseTimeout(timeout...)) return true } //You can mark Its as pending using PIt func PIt(text string, _ ...interface{}) bool { - globalSuite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) + global.Suite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) return true } //You can mark Its as pending using XIt func XIt(text string, _ ...interface{}) bool { - globalSuite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) + global.Suite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) return true } @@ -403,25 +396,25 @@ func XIt(text string, _ ...interface{}) bool { //which "It" does not fit into a natural sentence flow. All the same protocols apply for Specify blocks //which apply to It blocks. func Specify(text string, body interface{}, timeout ...float64) bool { - globalSuite.PushItNode(text, body, types.FlagTypeNone, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushItNode(text, body, types.FlagTypeNone, codelocation.New(1), parseTimeout(timeout...)) return true } //You can focus individual Specifys using FSpecify func FSpecify(text string, body interface{}, timeout ...float64) bool { - globalSuite.PushItNode(text, body, types.FlagTypeFocused, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushItNode(text, body, types.FlagTypeFocused, codelocation.New(1), parseTimeout(timeout...)) return true } //You can mark Specifys as pending using PSpecify func PSpecify(text string, is ...interface{}) bool { - globalSuite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) + global.Suite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) return true } //You can mark Specifys as pending using XSpecify func XSpecify(text string, is ...interface{}) bool { - globalSuite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) + global.Suite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0) return true } @@ -452,25 +445,25 @@ func By(text string, callbacks ...func()) { //The body function must have the signature: // func(b Benchmarker) func Measure(text string, body interface{}, samples int) bool { - globalSuite.PushMeasureNode(text, body, types.FlagTypeNone, codelocation.New(1), samples) + global.Suite.PushMeasureNode(text, body, types.FlagTypeNone, codelocation.New(1), samples) return true } //You can focus individual Measures using FMeasure func FMeasure(text string, body interface{}, samples int) bool { - globalSuite.PushMeasureNode(text, body, types.FlagTypeFocused, codelocation.New(1), samples) + global.Suite.PushMeasureNode(text, body, types.FlagTypeFocused, codelocation.New(1), samples) return true } //You can mark Measurements as pending using PMeasure func PMeasure(text string, _ ...interface{}) bool { - globalSuite.PushMeasureNode(text, func(b Benchmarker) {}, types.FlagTypePending, codelocation.New(1), 0) + global.Suite.PushMeasureNode(text, func(b Benchmarker) {}, types.FlagTypePending, codelocation.New(1), 0) return true } //You can mark Measurements as pending using XMeasure func XMeasure(text string, _ ...interface{}) bool { - globalSuite.PushMeasureNode(text, func(b Benchmarker) {}, types.FlagTypePending, codelocation.New(1), 0) + global.Suite.PushMeasureNode(text, func(b Benchmarker) {}, types.FlagTypePending, codelocation.New(1), 0) return true } @@ -481,7 +474,7 @@ func XMeasure(text string, _ ...interface{}) bool { // //You may only register *one* BeforeSuite handler per test suite. You typically do so in your bootstrap file at the top level. func BeforeSuite(body interface{}, timeout ...float64) bool { - globalSuite.SetBeforeSuiteNode(body, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.SetBeforeSuiteNode(body, codelocation.New(1), parseTimeout(timeout...)) return true } @@ -494,7 +487,7 @@ func BeforeSuite(body interface{}, timeout ...float64) bool { // //You may only register *one* AfterSuite handler per test suite. You typically do so in your bootstrap file at the top level. func AfterSuite(body interface{}, timeout ...float64) bool { - globalSuite.SetAfterSuiteNode(body, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.SetAfterSuiteNode(body, codelocation.New(1), parseTimeout(timeout...)) return true } @@ -539,7 +532,7 @@ func AfterSuite(body interface{}, timeout ...float64) bool { // Ω(err).ShouldNot(HaveOccurred()) // }) func SynchronizedBeforeSuite(node1Body interface{}, allNodesBody interface{}, timeout ...float64) bool { - globalSuite.SetSynchronizedBeforeSuiteNode( + global.Suite.SetSynchronizedBeforeSuiteNode( node1Body, allNodesBody, codelocation.New(1), @@ -566,7 +559,7 @@ func SynchronizedBeforeSuite(node1Body interface{}, allNodesBody interface{}, ti // dbRunner.Stop() // }) func SynchronizedAfterSuite(allNodesBody interface{}, node1Body interface{}, timeout ...float64) bool { - globalSuite.SetSynchronizedAfterSuiteNode( + global.Suite.SetSynchronizedAfterSuiteNode( allNodesBody, node1Body, codelocation.New(1), @@ -581,7 +574,7 @@ func SynchronizedAfterSuite(allNodesBody interface{}, node1Body interface{}, tim //Like It blocks, BeforeEach blocks can be made asynchronous by providing a body function that accepts //a Done channel func BeforeEach(body interface{}, timeout ...float64) bool { - globalSuite.PushBeforeEachNode(body, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushBeforeEachNode(body, codelocation.New(1), parseTimeout(timeout...)) return true } @@ -591,7 +584,7 @@ func BeforeEach(body interface{}, timeout ...float64) bool { //Like It blocks, BeforeEach blocks can be made asynchronous by providing a body function that accepts //a Done channel func JustBeforeEach(body interface{}, timeout ...float64) bool { - globalSuite.PushJustBeforeEachNode(body, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushJustBeforeEachNode(body, codelocation.New(1), parseTimeout(timeout...)) return true } @@ -601,7 +594,7 @@ func JustBeforeEach(body interface{}, timeout ...float64) bool { //Like It blocks, JustAfterEach blocks can be made asynchronous by providing a body function that accepts //a Done channel func JustAfterEach(body interface{}, timeout ...float64) bool { - globalSuite.PushJustAfterEachNode(body, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushJustAfterEachNode(body, codelocation.New(1), parseTimeout(timeout...)) return true } @@ -611,13 +604,13 @@ func JustAfterEach(body interface{}, timeout ...float64) bool { //Like It blocks, AfterEach blocks can be made asynchronous by providing a body function that accepts //a Done channel func AfterEach(body interface{}, timeout ...float64) bool { - globalSuite.PushAfterEachNode(body, codelocation.New(1), parseTimeout(timeout...)) + global.Suite.PushAfterEachNode(body, codelocation.New(1), parseTimeout(timeout...)) return true } func parseTimeout(timeout ...float64) time.Duration { if len(timeout) == 0 { - return time.Duration(defaultTimeout * int64(time.Second)) + return global.DefaultTimeout } else { return time.Duration(timeout[0] * float64(time.Second)) } diff --git a/vendor/github.com/onsi/ginkgo/go.mod b/vendor/github.com/onsi/ginkgo/go.mod index c5d523c58fd..1f712522803 100644 --- a/vendor/github.com/onsi/ginkgo/go.mod +++ b/vendor/github.com/onsi/ginkgo/go.mod @@ -1,9 +1,11 @@ module github.com/onsi/ginkgo require ( + github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/nxadm/tail v1.4.4 - github.com/onsi/gomega v1.7.1 - golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e + github.com/onsi/gomega v1.10.1 + golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 + golang.org/x/text v0.3.2 // indirect ) -go 1.12 +go 1.13 diff --git a/vendor/github.com/onsi/ginkgo/go.sum b/vendor/github.com/onsi/ginkgo/go.sum index 572650446e0..2b774f3e824 100644 --- a/vendor/github.com/onsi/ginkgo/go.sum +++ b/vendor/github.com/onsi/ginkgo/go.sum @@ -1,24 +1,60 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/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.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +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 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= 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/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-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 h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/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 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +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.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= @@ -27,3 +63,5 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/onsi/ginkgo/internal/global/init.go b/vendor/github.com/onsi/ginkgo/internal/global/init.go new file mode 100644 index 00000000000..109f617a5e1 --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/global/init.go @@ -0,0 +1,22 @@ +package global + +import ( + "time" + + "github.com/onsi/ginkgo/internal/failer" + "github.com/onsi/ginkgo/internal/suite" +) + +const DefaultTimeout = time.Duration(1 * time.Second) + +var Suite *suite.Suite +var Failer *failer.Failer + +func init() { + InitializeGlobals() +} + +func InitializeGlobals() { + Failer = failer.New() + Suite = suite.New(Failer) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_darwin.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_darwin.go new file mode 100644 index 00000000000..e3d09eadb8a --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_darwin.go @@ -0,0 +1,11 @@ +// +build darwin + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_dragonfly.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_dragonfly.go new file mode 100644 index 00000000000..72d38686a09 --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_dragonfly.go @@ -0,0 +1,11 @@ +// +build dragonfly + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_freebsd.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_freebsd.go new file mode 100644 index 00000000000..497d548d99d --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_freebsd.go @@ -0,0 +1,11 @@ +// +build freebsd + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux.go new file mode 100644 index 00000000000..29add0d330d --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux.go @@ -0,0 +1,12 @@ +// +build linux +// +build !mips64le + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux_mips64le.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux_mips64le.go new file mode 100644 index 00000000000..09bd0626062 --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux_mips64le.go @@ -0,0 +1,12 @@ +// +build linux +// +build mips64le + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup3(oldfd, newfd, 0) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_netbsd.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_netbsd.go new file mode 100644 index 00000000000..16ad6aeb294 --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_netbsd.go @@ -0,0 +1,11 @@ +// +build netbsd + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_openbsd.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_openbsd.go new file mode 100644 index 00000000000..4275f84210f --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_openbsd.go @@ -0,0 +1,11 @@ +// +build openbsd + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_solaris.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_solaris.go new file mode 100644 index 00000000000..882a38a9e00 --- /dev/null +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_solaris.go @@ -0,0 +1,11 @@ +// +build solaris + +package remote + +import ( + "golang.org/x/sys/unix" +) + +func interceptorDupx(oldfd int, newfd int) { + unix.Dup2(oldfd, newfd) +} diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go index 774967db66b..80614d0ce56 100644 --- a/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go +++ b/vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go @@ -8,7 +8,6 @@ import ( "os" "github.com/nxadm/tail" - "golang.org/x/sys/unix" ) func NewOutputInterceptor() OutputInterceptor { @@ -36,10 +35,8 @@ func (interceptor *outputInterceptor) StartInterceptingOutput() error { return err } - // This might call Dup3 if the dup2 syscall is not available, e.g. on - // linux/arm64 or linux/riscv64 - unix.Dup2(int(interceptor.redirectFile.Fd()), 1) - unix.Dup2(int(interceptor.redirectFile.Fd()), 2) + interceptorDupx(int(interceptor.redirectFile.Fd()), 1) + interceptorDupx(int(interceptor.redirectFile.Fd()), 2) if interceptor.streamTarget != nil { interceptor.tailer, _ = tail.TailFile(interceptor.redirectFile.Name(), tail.Config{Follow: true}) diff --git a/vendor/github.com/onsi/ginkgo/internal/suite/suite.go b/vendor/github.com/onsi/ginkgo/internal/suite/suite.go index 34f639ee416..e75da1f8961 100644 --- a/vendor/github.com/onsi/ginkgo/internal/suite/suite.go +++ b/vendor/github.com/onsi/ginkgo/internal/suite/suite.go @@ -22,25 +22,37 @@ type ginkgoTestingT interface { Fail() } +type deferredContainerNode struct { + text string + body func() + flag types.FlagType + codeLocation types.CodeLocation +} + type Suite struct { topLevelContainer *containernode.ContainerNode currentContainer *containernode.ContainerNode - containerIndex int - beforeSuiteNode leafnodes.SuiteNode - afterSuiteNode leafnodes.SuiteNode - runner *specrunner.SpecRunner - failer *failer.Failer - running bool + + deferredContainerNodes []deferredContainerNode + + containerIndex int + beforeSuiteNode leafnodes.SuiteNode + afterSuiteNode leafnodes.SuiteNode + runner *specrunner.SpecRunner + failer *failer.Failer + running bool + expandTopLevelNodes bool } func New(failer *failer.Failer) *Suite { topLevelContainer := containernode.New("[Top Level]", types.FlagTypeNone, types.CodeLocation{}) return &Suite{ - topLevelContainer: topLevelContainer, - currentContainer: topLevelContainer, - failer: failer, - containerIndex: 1, + topLevelContainer: topLevelContainer, + currentContainer: topLevelContainer, + failer: failer, + containerIndex: 1, + deferredContainerNodes: []deferredContainerNode{}, } } @@ -53,6 +65,11 @@ func (suite *Suite) Run(t ginkgoTestingT, description string, reporters []report panic("ginkgo.parallel.node is one-indexed and must be <= ginkgo.parallel.total") } + suite.expandTopLevelNodes = true + for _, deferredNode := range suite.deferredContainerNodes { + suite.PushContainerNode(deferredNode.text, deferredNode.body, deferredNode.flag, deferredNode.codeLocation) + } + r := rand.New(rand.NewSource(config.RandomSeed)) suite.topLevelContainer.Shuffle(r) iterator, hasProgrammaticFocus := suite.generateSpecsIterator(description, config) @@ -137,6 +154,23 @@ func (suite *Suite) SetSynchronizedAfterSuiteNode(bodyA interface{}, bodyB inter } func (suite *Suite) PushContainerNode(text string, body func(), flag types.FlagType, codeLocation types.CodeLocation) { + /* + We defer walking the container nodes (which immediately evaluates the `body` function) + until `RunSpecs` is called. We do this by storing off the deferred container nodes. Then, when + `RunSpecs` is called we actually go through and add the container nodes to the test structure. + + This allows us to defer calling all the `body` functions until _after_ the top level functions + have been walked, _after_ func init()s have been called, and _after_ `go test` has called `flag.Parse()`. + + This allows users to load up configuration information in the `TestX` go test hook just before `RunSpecs` + is invoked and solves issues like #693 and makes the lifecycle easier to reason about. + + */ + if !suite.expandTopLevelNodes { + suite.deferredContainerNodes = append(suite.deferredContainerNodes, deferredContainerNode{text, body, flag, codeLocation}) + return + } + container := containernode.New(text, flag, codeLocation) suite.currentContainer.PushContainerNode(container) diff --git a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go index d76e2fe77d9..963caaaff1b 100644 --- a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go +++ b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go @@ -50,7 +50,7 @@ type JUnitFailureMessage struct { } type JUnitSkipped struct { - XMLName xml.Name `xml:"skipped"` + Message string `xml:",chardata"` } type JUnitReporter struct { @@ -132,6 +132,9 @@ func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary) { } if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending { testCase.Skipped = &JUnitSkipped{} + if specSummary.Failure.Message != "" { + testCase.Skipped.Message = failureMessage(specSummary.Failure) + } } testCase.Time = specSummary.RunTime.Seconds() reporter.suite.TestCases = append(reporter.suite.TestCases, testCase) diff --git a/vendor/github.com/onsi/gomega/CHANGELOG.md b/vendor/github.com/onsi/gomega/CHANGELOG.md index 3aafdbcfcc2..0b6c2fb612d 100644 --- a/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.10.2 + +### Fixes +- Add ExpectWithOffset, EventuallyWithOffset and ConsistentlyWithOffset to WithT (#391) [990941a] + ## 1.10.1 ### Fixes diff --git a/vendor/github.com/onsi/gomega/gomega_dsl.go b/vendor/github.com/onsi/gomega/gomega_dsl.go index 8ff9611d539..b416d20ccf8 100644 --- a/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -24,7 +24,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.10.1" +const GOMEGA_VERSION = "1.10.2" const nilFailHandlerPanic = `You are trying to make an assertion, but Gomega's fail handler is nil. If you're using Ginkgo then you probably forgot to put your assertion in an It(). @@ -376,13 +376,13 @@ func NewGomegaWithT(t types.GomegaTestingT) *GomegaWithT { return NewWithT(t) } -// Expect is used to make assertions. See documentation for Expect. -func (g *WithT) Expect(actual interface{}, extra ...interface{}) Assertion { - return assertion.New(actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), 0, extra...) +// ExpectWithOffset is used to make assertions. See documentation for ExpectWithOffset. +func (g *WithT) ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) Assertion { + return assertion.New(actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), offset, extra...) } -// Eventually is used to make asynchronous assertions. See documentation for Eventually. -func (g *WithT) Eventually(actual interface{}, intervals ...interface{}) AsyncAssertion { +// EventuallyWithOffset is used to make asynchronous assertions. See documentation for EventuallyWithOffset. +func (g *WithT) EventuallyWithOffset(offset int, actual interface{}, intervals ...interface{}) AsyncAssertion { timeoutInterval := defaultEventuallyTimeout pollingInterval := defaultEventuallyPollingInterval if len(intervals) > 0 { @@ -391,11 +391,11 @@ func (g *WithT) Eventually(actual interface{}, intervals ...interface{}) AsyncAs if len(intervals) > 1 { pollingInterval = toDuration(intervals[1]) } - return asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, 0) + return asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, offset) } -// Consistently is used to make asynchronous assertions. See documentation for Consistently. -func (g *WithT) Consistently(actual interface{}, intervals ...interface{}) AsyncAssertion { +// ConsistentlyWithOffset is used to make asynchronous assertions. See documentation for ConsistentlyWithOffset. +func (g *WithT) ConsistentlyWithOffset(offset int, actual interface{}, intervals ...interface{}) AsyncAssertion { timeoutInterval := defaultConsistentlyDuration pollingInterval := defaultConsistentlyPollingInterval if len(intervals) > 0 { @@ -404,7 +404,22 @@ func (g *WithT) Consistently(actual interface{}, intervals ...interface{}) Async if len(intervals) > 1 { pollingInterval = toDuration(intervals[1]) } - return asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, 0) + return asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, actual, testingtsupport.BuildTestingTGomegaFailWrapper(g.t), timeoutInterval, pollingInterval, offset) +} + +// Expect is used to make assertions. See documentation for Expect. +func (g *WithT) Expect(actual interface{}, extra ...interface{}) Assertion { + return g.ExpectWithOffset(0, actual, extra...) +} + +// Eventually is used to make asynchronous assertions. See documentation for Eventually. +func (g *WithT) Eventually(actual interface{}, intervals ...interface{}) AsyncAssertion { + return g.EventuallyWithOffset(0, actual, intervals...) +} + +// Consistently is used to make asynchronous assertions. See documentation for Consistently. +func (g *WithT) Consistently(actual interface{}, intervals ...interface{}) AsyncAssertion { + return g.ConsistentlyWithOffset(0, actual, intervals...) } func toDuration(input interface{}) time.Duration { diff --git a/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk b/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk index 3a24a57e158..25f92fe9a1c 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk +++ b/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk @@ -51,7 +51,7 @@ update-codegen-crds: update-codegen-crds-$(1) verify-codegen-crds-$(1): VERIFY_CODEGEN_CRD_TMP_DIR:=$$(shell mktemp -d) verify-codegen-crds-$(1): ensure-controller-gen ensure-yq ensure-yaml-patch $(call run-crd-gen,$(2),$(3),$$(VERIFY_CODEGEN_CRD_TMP_DIR)) - $$(foreach p,$$(wildcard $(3)/*crd.yaml),$$(call diff-file,$$(p),$$(subst $(3),$$(VERIFY_CODEGEN_CRD_TMP_DIR),$$(p)))) + $$(foreach p,$$(wildcard $(4)/*crd.yaml),$$(call diff-file,$$(p),$$(subst $(4),$$(VERIFY_CODEGEN_CRD_TMP_DIR),$$(p)))) .PHONY: verify-codegen-crds-$(1) verify-codegen-crds: verify-codegen-crds-$(1) diff --git a/vendor/github.com/openshift/client-go/LICENSE b/vendor/github.com/openshift/client-go/LICENSE new file mode 100644 index 00000000000..c4ea8b6f9d8 --- /dev/null +++ b/vendor/github.com/openshift/client-go/LICENSE @@ -0,0 +1,191 @@ + + 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 + + Copyright 2014 Red Hat, Inc. + + 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/client-go/config/clientset/versioned/clientset.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go new file mode 100644 index 00000000000..70cd52cc073 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go @@ -0,0 +1,81 @@ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ConfigV1() configv1.ConfigV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + configV1 *configv1.ConfigV1Client +} + +// ConfigV1 retrieves the ConfigV1Client +func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { + return c.configV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.configV1, err = configv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.configV1 = configv1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.configV1 = configv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go new file mode 100644 index 00000000000..0e0c2a8900e --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000000..14db57a58f8 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go new file mode 100644 index 00000000000..00d32306d73 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go @@ -0,0 +1,40 @@ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + configv1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go new file mode 100644 index 00000000000..f9b22b322df --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/apiserver.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// APIServersGetter has a method to return a APIServerInterface. +// A group's client should implement this interface. +type APIServersGetter interface { + APIServers() APIServerInterface +} + +// APIServerInterface has methods to work with APIServer resources. +type APIServerInterface interface { + Create(ctx context.Context, aPIServer *v1.APIServer, opts metav1.CreateOptions) (*v1.APIServer, error) + Update(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (*v1.APIServer, error) + UpdateStatus(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (*v1.APIServer, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.APIServer, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.APIServerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIServer, err error) + APIServerExpansion +} + +// aPIServers implements APIServerInterface +type aPIServers struct { + client rest.Interface +} + +// newAPIServers returns a APIServers +func newAPIServers(c *ConfigV1Client) *aPIServers { + return &aPIServers{ + client: c.RESTClient(), + } +} + +// Get takes name of the aPIServer, and returns the corresponding aPIServer object, and an error if there is any. +func (c *aPIServers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.APIServer, err error) { + result = &v1.APIServer{} + err = c.client.Get(). + Resource("apiservers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of APIServers that match those selectors. +func (c *aPIServers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.APIServerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.APIServerList{} + err = c.client.Get(). + Resource("apiservers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested aPIServers. +func (c *aPIServers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("apiservers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a aPIServer and creates it. Returns the server's representation of the aPIServer, and an error, if there is any. +func (c *aPIServers) Create(ctx context.Context, aPIServer *v1.APIServer, opts metav1.CreateOptions) (result *v1.APIServer, err error) { + result = &v1.APIServer{} + err = c.client.Post(). + Resource("apiservers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aPIServer). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a aPIServer and updates it. Returns the server's representation of the aPIServer, and an error, if there is any. +func (c *aPIServers) Update(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (result *v1.APIServer, err error) { + result = &v1.APIServer{} + err = c.client.Put(). + Resource("apiservers"). + Name(aPIServer.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aPIServer). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *aPIServers) UpdateStatus(ctx context.Context, aPIServer *v1.APIServer, opts metav1.UpdateOptions) (result *v1.APIServer, err error) { + result = &v1.APIServer{} + err = c.client.Put(). + Resource("apiservers"). + Name(aPIServer.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aPIServer). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the aPIServer and deletes it. Returns an error if one occurs. +func (c *aPIServers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("apiservers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *aPIServers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apiservers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched aPIServer. +func (c *aPIServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.APIServer, err error) { + result = &v1.APIServer{} + err = c.client.Patch(pt). + Resource("apiservers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go new file mode 100644 index 00000000000..7c6c81d576b --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// AuthenticationsGetter has a method to return a AuthenticationInterface. +// A group's client should implement this interface. +type AuthenticationsGetter interface { + Authentications() AuthenticationInterface +} + +// AuthenticationInterface has methods to work with Authentication resources. +type AuthenticationInterface interface { + Create(ctx context.Context, authentication *v1.Authentication, opts metav1.CreateOptions) (*v1.Authentication, error) + Update(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (*v1.Authentication, error) + UpdateStatus(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (*v1.Authentication, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Authentication, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AuthenticationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Authentication, err error) + AuthenticationExpansion +} + +// authentications implements AuthenticationInterface +type authentications struct { + client rest.Interface +} + +// newAuthentications returns a Authentications +func newAuthentications(c *ConfigV1Client) *authentications { + return &authentications{ + client: c.RESTClient(), + } +} + +// Get takes name of the authentication, and returns the corresponding authentication object, and an error if there is any. +func (c *authentications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Get(). + Resource("authentications"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Authentications that match those selectors. +func (c *authentications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AuthenticationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AuthenticationList{} + err = c.client.Get(). + Resource("authentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested authentications. +func (c *authentications) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("authentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a authentication and creates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *authentications) Create(ctx context.Context, authentication *v1.Authentication, opts metav1.CreateOptions) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Post(). + Resource("authentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authentication). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a authentication and updates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *authentications) Update(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Put(). + Resource("authentications"). + Name(authentication.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authentication). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *authentications) UpdateStatus(ctx context.Context, authentication *v1.Authentication, opts metav1.UpdateOptions) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Put(). + Resource("authentications"). + Name(authentication.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authentication). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the authentication and deletes it. Returns an error if one occurs. +func (c *authentications) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("authentications"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *authentications) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("authentications"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched authentication. +func (c *authentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Patch(pt). + Resource("authentications"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go new file mode 100644 index 00000000000..10c7a4901ab --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go @@ -0,0 +1,152 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// BuildsGetter has a method to return a BuildInterface. +// A group's client should implement this interface. +type BuildsGetter interface { + Builds() BuildInterface +} + +// BuildInterface has methods to work with Build resources. +type BuildInterface interface { + Create(ctx context.Context, build *v1.Build, opts metav1.CreateOptions) (*v1.Build, error) + Update(ctx context.Context, build *v1.Build, opts metav1.UpdateOptions) (*v1.Build, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Build, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.BuildList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Build, err error) + BuildExpansion +} + +// builds implements BuildInterface +type builds struct { + client rest.Interface +} + +// newBuilds returns a Builds +func newBuilds(c *ConfigV1Client) *builds { + return &builds{ + client: c.RESTClient(), + } +} + +// Get takes name of the build, and returns the corresponding build object, and an error if there is any. +func (c *builds) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Get(). + Resource("builds"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Builds that match those selectors. +func (c *builds) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BuildList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.BuildList{} + err = c.client.Get(). + Resource("builds"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested builds. +func (c *builds) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("builds"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any. +func (c *builds) Create(ctx context.Context, build *v1.Build, opts metav1.CreateOptions) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Post(). + Resource("builds"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(build). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any. +func (c *builds) Update(ctx context.Context, build *v1.Build, opts metav1.UpdateOptions) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Put(). + Resource("builds"). + Name(build.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(build). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the build and deletes it. Returns an error if one occurs. +func (c *builds) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("builds"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *builds) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("builds"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched build. +func (c *builds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Patch(pt). + Resource("builds"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go new file mode 100644 index 00000000000..8802d34fbd6 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ClusterOperatorsGetter has a method to return a ClusterOperatorInterface. +// A group's client should implement this interface. +type ClusterOperatorsGetter interface { + ClusterOperators() ClusterOperatorInterface +} + +// ClusterOperatorInterface has methods to work with ClusterOperator resources. +type ClusterOperatorInterface interface { + Create(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.CreateOptions) (*v1.ClusterOperator, error) + Update(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (*v1.ClusterOperator, error) + UpdateStatus(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (*v1.ClusterOperator, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterOperator, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterOperatorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterOperator, err error) + ClusterOperatorExpansion +} + +// clusterOperators implements ClusterOperatorInterface +type clusterOperators struct { + client rest.Interface +} + +// newClusterOperators returns a ClusterOperators +func newClusterOperators(c *ConfigV1Client) *clusterOperators { + return &clusterOperators{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any. +func (c *clusterOperators) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Get(). + Resource("clusteroperators"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors. +func (c *clusterOperators) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterOperatorList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterOperatorList{} + err = c.client.Get(). + Resource("clusteroperators"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterOperators. +func (c *clusterOperators) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clusteroperators"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *clusterOperators) Create(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.CreateOptions) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Post(). + Resource("clusteroperators"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterOperator). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *clusterOperators) Update(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Put(). + Resource("clusteroperators"). + Name(clusterOperator.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterOperator). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *clusterOperators) UpdateStatus(ctx context.Context, clusterOperator *v1.ClusterOperator, opts metav1.UpdateOptions) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Put(). + Resource("clusteroperators"). + Name(clusterOperator.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterOperator). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs. +func (c *clusterOperators) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusteroperators"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterOperators) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusteroperators"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterOperator. +func (c *clusterOperators) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Patch(pt). + Resource("clusteroperators"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go new file mode 100644 index 00000000000..1f60d59d91a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ClusterVersionsGetter has a method to return a ClusterVersionInterface. +// A group's client should implement this interface. +type ClusterVersionsGetter interface { + ClusterVersions() ClusterVersionInterface +} + +// ClusterVersionInterface has methods to work with ClusterVersion resources. +type ClusterVersionInterface interface { + Create(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.CreateOptions) (*v1.ClusterVersion, error) + Update(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (*v1.ClusterVersion, error) + UpdateStatus(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (*v1.ClusterVersion, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterVersion, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterVersionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterVersion, err error) + ClusterVersionExpansion +} + +// clusterVersions implements ClusterVersionInterface +type clusterVersions struct { + client rest.Interface +} + +// newClusterVersions returns a ClusterVersions +func newClusterVersions(c *ConfigV1Client) *clusterVersions { + return &clusterVersions{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any. +func (c *clusterVersions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Get(). + Resource("clusterversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors. +func (c *clusterVersions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterVersionList{} + err = c.client.Get(). + Resource("clusterversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterVersions. +func (c *clusterVersions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clusterversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *clusterVersions) Create(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.CreateOptions) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Post(). + Resource("clusterversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *clusterVersions) Update(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Put(). + Resource("clusterversions"). + Name(clusterVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterVersion). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *clusterVersions) UpdateStatus(ctx context.Context, clusterVersion *v1.ClusterVersion, opts metav1.UpdateOptions) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Put(). + Resource("clusterversions"). + Name(clusterVersion.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs. +func (c *clusterVersions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusterversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterVersions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusterversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterVersion. +func (c *clusterVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Patch(pt). + Resource("clusterversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go new file mode 100644 index 00000000000..0f2182d2f5d --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go @@ -0,0 +1,153 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "github.com/openshift/client-go/config/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type ConfigV1Interface interface { + RESTClient() rest.Interface + APIServersGetter + AuthenticationsGetter + BuildsGetter + ClusterOperatorsGetter + ClusterVersionsGetter + ConsolesGetter + DNSesGetter + FeatureGatesGetter + ImagesGetter + InfrastructuresGetter + IngressesGetter + NetworksGetter + OAuthsGetter + OperatorHubsGetter + ProjectsGetter + ProxiesGetter + SchedulersGetter +} + +// ConfigV1Client is used to interact with features provided by the config.openshift.io group. +type ConfigV1Client struct { + restClient rest.Interface +} + +func (c *ConfigV1Client) APIServers() APIServerInterface { + return newAPIServers(c) +} + +func (c *ConfigV1Client) Authentications() AuthenticationInterface { + return newAuthentications(c) +} + +func (c *ConfigV1Client) Builds() BuildInterface { + return newBuilds(c) +} + +func (c *ConfigV1Client) ClusterOperators() ClusterOperatorInterface { + return newClusterOperators(c) +} + +func (c *ConfigV1Client) ClusterVersions() ClusterVersionInterface { + return newClusterVersions(c) +} + +func (c *ConfigV1Client) Consoles() ConsoleInterface { + return newConsoles(c) +} + +func (c *ConfigV1Client) DNSes() DNSInterface { + return newDNSes(c) +} + +func (c *ConfigV1Client) FeatureGates() FeatureGateInterface { + return newFeatureGates(c) +} + +func (c *ConfigV1Client) Images() ImageInterface { + return newImages(c) +} + +func (c *ConfigV1Client) Infrastructures() InfrastructureInterface { + return newInfrastructures(c) +} + +func (c *ConfigV1Client) Ingresses() IngressInterface { + return newIngresses(c) +} + +func (c *ConfigV1Client) Networks() NetworkInterface { + return newNetworks(c) +} + +func (c *ConfigV1Client) OAuths() OAuthInterface { + return newOAuths(c) +} + +func (c *ConfigV1Client) OperatorHubs() OperatorHubInterface { + return newOperatorHubs(c) +} + +func (c *ConfigV1Client) Projects() ProjectInterface { + return newProjects(c) +} + +func (c *ConfigV1Client) Proxies() ProxyInterface { + return newProxies(c) +} + +func (c *ConfigV1Client) Schedulers() SchedulerInterface { + return newSchedulers(c) +} + +// NewForConfig creates a new ConfigV1Client for the given config. +func NewForConfig(c *rest.Config) (*ConfigV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ConfigV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ConfigV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ConfigV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ConfigV1Client for the given RESTClient. +func New(c rest.Interface) *ConfigV1Client { + return &ConfigV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ConfigV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go new file mode 100644 index 00000000000..eeef3d8bdce --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ConsolesGetter has a method to return a ConsoleInterface. +// A group's client should implement this interface. +type ConsolesGetter interface { + Consoles() ConsoleInterface +} + +// ConsoleInterface has methods to work with Console resources. +type ConsoleInterface interface { + Create(ctx context.Context, console *v1.Console, opts metav1.CreateOptions) (*v1.Console, error) + Update(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (*v1.Console, error) + UpdateStatus(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (*v1.Console, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Console, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ConsoleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Console, err error) + ConsoleExpansion +} + +// consoles implements ConsoleInterface +type consoles struct { + client rest.Interface +} + +// newConsoles returns a Consoles +func newConsoles(c *ConfigV1Client) *consoles { + return &consoles{ + client: c.RESTClient(), + } +} + +// Get takes name of the console, and returns the corresponding console object, and an error if there is any. +func (c *consoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Get(). + Resource("consoles"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Consoles that match those selectors. +func (c *consoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConsoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ConsoleList{} + err = c.client.Get(). + Resource("consoles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested consoles. +func (c *consoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("consoles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a console and creates it. Returns the server's representation of the console, and an error, if there is any. +func (c *consoles) Create(ctx context.Context, console *v1.Console, opts metav1.CreateOptions) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Post(). + Resource("consoles"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(console). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a console and updates it. Returns the server's representation of the console, and an error, if there is any. +func (c *consoles) Update(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Put(). + Resource("consoles"). + Name(console.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(console). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *consoles) UpdateStatus(ctx context.Context, console *v1.Console, opts metav1.UpdateOptions) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Put(). + Resource("consoles"). + Name(console.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(console). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the console and deletes it. Returns an error if one occurs. +func (c *consoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("consoles"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *consoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("consoles"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched console. +func (c *consoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Patch(pt). + Resource("consoles"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go new file mode 100644 index 00000000000..574eda99027 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// DNSesGetter has a method to return a DNSInterface. +// A group's client should implement this interface. +type DNSesGetter interface { + DNSes() DNSInterface +} + +// DNSInterface has methods to work with DNS resources. +type DNSInterface interface { + Create(ctx context.Context, dNS *v1.DNS, opts metav1.CreateOptions) (*v1.DNS, error) + Update(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (*v1.DNS, error) + UpdateStatus(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (*v1.DNS, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DNS, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DNSList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNS, err error) + DNSExpansion +} + +// dNSes implements DNSInterface +type dNSes struct { + client rest.Interface +} + +// newDNSes returns a DNSes +func newDNSes(c *ConfigV1Client) *dNSes { + return &dNSes{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNS, and returns the corresponding dNS object, and an error if there is any. +func (c *dNSes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Get(). + Resource("dnses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSes that match those selectors. +func (c *dNSes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DNSList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DNSList{} + err = c.client.Get(). + Resource("dnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSes. +func (c *dNSes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("dnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dNS and creates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *dNSes) Create(ctx context.Context, dNS *v1.DNS, opts metav1.CreateOptions) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Post(). + Resource("dnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNS). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dNS and updates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *dNSes) Update(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Put(). + Resource("dnses"). + Name(dNS.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNS). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *dNSes) UpdateStatus(ctx context.Context, dNS *v1.DNS, opts metav1.UpdateOptions) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Put(). + Resource("dnses"). + Name(dNS.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dNS). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dNS and deletes it. Returns an error if one occurs. +func (c *dNSes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dnses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dNS. +func (c *dNSes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Patch(pt). + Resource("dnses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go new file mode 100644 index 00000000000..225e6b2be34 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go new file mode 100644 index 00000000000..dd784e1d203 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/featuregate.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// FeatureGatesGetter has a method to return a FeatureGateInterface. +// A group's client should implement this interface. +type FeatureGatesGetter interface { + FeatureGates() FeatureGateInterface +} + +// FeatureGateInterface has methods to work with FeatureGate resources. +type FeatureGateInterface interface { + Create(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.CreateOptions) (*v1.FeatureGate, error) + Update(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (*v1.FeatureGate, error) + UpdateStatus(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (*v1.FeatureGate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FeatureGate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.FeatureGateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureGate, err error) + FeatureGateExpansion +} + +// featureGates implements FeatureGateInterface +type featureGates struct { + client rest.Interface +} + +// newFeatureGates returns a FeatureGates +func newFeatureGates(c *ConfigV1Client) *featureGates { + return &featureGates{ + client: c.RESTClient(), + } +} + +// Get takes name of the featureGate, and returns the corresponding featureGate object, and an error if there is any. +func (c *featureGates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FeatureGate, err error) { + result = &v1.FeatureGate{} + err = c.client.Get(). + Resource("featuregates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FeatureGates that match those selectors. +func (c *featureGates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureGateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.FeatureGateList{} + err = c.client.Get(). + Resource("featuregates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested featureGates. +func (c *featureGates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("featuregates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a featureGate and creates it. Returns the server's representation of the featureGate, and an error, if there is any. +func (c *featureGates) Create(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.CreateOptions) (result *v1.FeatureGate, err error) { + result = &v1.FeatureGate{} + err = c.client.Post(). + Resource("featuregates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(featureGate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a featureGate and updates it. Returns the server's representation of the featureGate, and an error, if there is any. +func (c *featureGates) Update(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (result *v1.FeatureGate, err error) { + result = &v1.FeatureGate{} + err = c.client.Put(). + Resource("featuregates"). + Name(featureGate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(featureGate). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *featureGates) UpdateStatus(ctx context.Context, featureGate *v1.FeatureGate, opts metav1.UpdateOptions) (result *v1.FeatureGate, err error) { + result = &v1.FeatureGate{} + err = c.client.Put(). + Resource("featuregates"). + Name(featureGate.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(featureGate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the featureGate and deletes it. Returns an error if one occurs. +func (c *featureGates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("featuregates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *featureGates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("featuregates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched featureGate. +func (c *featureGates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FeatureGate, err error) { + result = &v1.FeatureGate{} + err = c.client.Patch(pt). + Resource("featuregates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go new file mode 100644 index 00000000000..50a4ec7f8f3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go @@ -0,0 +1,37 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type APIServerExpansion interface{} + +type AuthenticationExpansion interface{} + +type BuildExpansion interface{} + +type ClusterOperatorExpansion interface{} + +type ClusterVersionExpansion interface{} + +type ConsoleExpansion interface{} + +type DNSExpansion interface{} + +type FeatureGateExpansion interface{} + +type ImageExpansion interface{} + +type InfrastructureExpansion interface{} + +type IngressExpansion interface{} + +type NetworkExpansion interface{} + +type OAuthExpansion interface{} + +type OperatorHubExpansion interface{} + +type ProjectExpansion interface{} + +type ProxyExpansion interface{} + +type SchedulerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go new file mode 100644 index 00000000000..874ef211f63 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ImagesGetter has a method to return a ImageInterface. +// A group's client should implement this interface. +type ImagesGetter interface { + Images() ImageInterface +} + +// ImageInterface has methods to work with Image resources. +type ImageInterface interface { + Create(ctx context.Context, image *v1.Image, opts metav1.CreateOptions) (*v1.Image, error) + Update(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (*v1.Image, error) + UpdateStatus(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (*v1.Image, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Image, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ImageList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Image, err error) + ImageExpansion +} + +// images implements ImageInterface +type images struct { + client rest.Interface +} + +// newImages returns a Images +func newImages(c *ConfigV1Client) *images { + return &images{ + client: c.RESTClient(), + } +} + +// Get takes name of the image, and returns the corresponding image object, and an error if there is any. +func (c *images) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Get(). + Resource("images"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Images that match those selectors. +func (c *images) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImageList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ImageList{} + err = c.client.Get(). + Resource("images"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested images. +func (c *images) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("images"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any. +func (c *images) Create(ctx context.Context, image *v1.Image, opts metav1.CreateOptions) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Post(). + Resource("images"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(image). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any. +func (c *images) Update(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Put(). + Resource("images"). + Name(image.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(image). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *images) UpdateStatus(ctx context.Context, image *v1.Image, opts metav1.UpdateOptions) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Put(). + Resource("images"). + Name(image.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(image). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the image and deletes it. Returns an error if one occurs. +func (c *images) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("images"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *images) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("images"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched image. +func (c *images) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Patch(pt). + Resource("images"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go new file mode 100644 index 00000000000..661eff23157 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// InfrastructuresGetter has a method to return a InfrastructureInterface. +// A group's client should implement this interface. +type InfrastructuresGetter interface { + Infrastructures() InfrastructureInterface +} + +// InfrastructureInterface has methods to work with Infrastructure resources. +type InfrastructureInterface interface { + Create(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.CreateOptions) (*v1.Infrastructure, error) + Update(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (*v1.Infrastructure, error) + UpdateStatus(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (*v1.Infrastructure, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Infrastructure, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.InfrastructureList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Infrastructure, err error) + InfrastructureExpansion +} + +// infrastructures implements InfrastructureInterface +type infrastructures struct { + client rest.Interface +} + +// newInfrastructures returns a Infrastructures +func newInfrastructures(c *ConfigV1Client) *infrastructures { + return &infrastructures{ + client: c.RESTClient(), + } +} + +// Get takes name of the infrastructure, and returns the corresponding infrastructure object, and an error if there is any. +func (c *infrastructures) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Get(). + Resource("infrastructures"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Infrastructures that match those selectors. +func (c *infrastructures) List(ctx context.Context, opts metav1.ListOptions) (result *v1.InfrastructureList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.InfrastructureList{} + err = c.client.Get(). + Resource("infrastructures"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested infrastructures. +func (c *infrastructures) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("infrastructures"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a infrastructure and creates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *infrastructures) Create(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.CreateOptions) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Post(). + Resource("infrastructures"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(infrastructure). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a infrastructure and updates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *infrastructures) Update(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Put(). + Resource("infrastructures"). + Name(infrastructure.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(infrastructure). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *infrastructures) UpdateStatus(ctx context.Context, infrastructure *v1.Infrastructure, opts metav1.UpdateOptions) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Put(). + Resource("infrastructures"). + Name(infrastructure.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(infrastructure). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the infrastructure and deletes it. Returns an error if one occurs. +func (c *infrastructures) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("infrastructures"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *infrastructures) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("infrastructures"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched infrastructure. +func (c *infrastructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Patch(pt). + Resource("infrastructures"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go new file mode 100644 index 00000000000..ec4bf5d7177 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IngressesGetter has a method to return a IngressInterface. +// A group's client should implement this interface. +type IngressesGetter interface { + Ingresses() IngressInterface +} + +// IngressInterface has methods to work with Ingress resources. +type IngressInterface interface { + Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (*v1.Ingress, error) + Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) + UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Ingress, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) + IngressExpansion +} + +// ingresses implements IngressInterface +type ingresses struct { + client rest.Interface +} + +// newIngresses returns a Ingresses +func newIngresses(c *ConfigV1Client) *ingresses { + return &ingresses{ + client: c.RESTClient(), + } +} + +// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. +func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Get(). + Resource("ingresses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IngressList{} + err = c.client.Get(). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ingresses. +func (c *ingresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *ingresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Post(). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingress). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *ingresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Put(). + Resource("ingresses"). + Name(ingress.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingress). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Put(). + Resource("ingresses"). + Name(ingress.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingress). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ingress and deletes it. Returns an error if one occurs. +func (c *ingresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("ingresses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ingresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ingresses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ingress. +func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Patch(pt). + Resource("ingresses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go new file mode 100644 index 00000000000..f9016202ae8 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// NetworksGetter has a method to return a NetworkInterface. +// A group's client should implement this interface. +type NetworksGetter interface { + Networks() NetworkInterface +} + +// NetworkInterface has methods to work with Network resources. +type NetworkInterface interface { + Create(ctx context.Context, network *v1.Network, opts metav1.CreateOptions) (*v1.Network, error) + Update(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (*v1.Network, error) + UpdateStatus(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (*v1.Network, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Network, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Network, err error) + NetworkExpansion +} + +// networks implements NetworkInterface +type networks struct { + client rest.Interface +} + +// newNetworks returns a Networks +func newNetworks(c *ConfigV1Client) *networks { + return &networks{ + client: c.RESTClient(), + } +} + +// Get takes name of the network, and returns the corresponding network object, and an error if there is any. +func (c *networks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Get(). + Resource("networks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Networks that match those selectors. +func (c *networks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NetworkList{} + err = c.client.Get(). + Resource("networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networks. +func (c *networks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. +func (c *networks) Create(ctx context.Context, network *v1.Network, opts metav1.CreateOptions) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Post(). + Resource("networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(network). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. +func (c *networks) Update(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Put(). + Resource("networks"). + Name(network.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(network). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *networks) UpdateStatus(ctx context.Context, network *v1.Network, opts metav1.UpdateOptions) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Put(). + Resource("networks"). + Name(network.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(network). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the network and deletes it. Returns an error if one occurs. +func (c *networks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("networks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("networks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched network. +func (c *networks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Patch(pt). + Resource("networks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go new file mode 100644 index 00000000000..93fe9a521d0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// OAuthsGetter has a method to return a OAuthInterface. +// A group's client should implement this interface. +type OAuthsGetter interface { + OAuths() OAuthInterface +} + +// OAuthInterface has methods to work with OAuth resources. +type OAuthInterface interface { + Create(ctx context.Context, oAuth *v1.OAuth, opts metav1.CreateOptions) (*v1.OAuth, error) + Update(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (*v1.OAuth, error) + UpdateStatus(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (*v1.OAuth, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.OAuth, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.OAuthList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OAuth, err error) + OAuthExpansion +} + +// oAuths implements OAuthInterface +type oAuths struct { + client rest.Interface +} + +// newOAuths returns a OAuths +func newOAuths(c *ConfigV1Client) *oAuths { + return &oAuths{ + client: c.RESTClient(), + } +} + +// Get takes name of the oAuth, and returns the corresponding oAuth object, and an error if there is any. +func (c *oAuths) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Get(). + Resource("oauths"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OAuths that match those selectors. +func (c *oAuths) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OAuthList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.OAuthList{} + err = c.client.Get(). + Resource("oauths"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested oAuths. +func (c *oAuths) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("oauths"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a oAuth and creates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *oAuths) Create(ctx context.Context, oAuth *v1.OAuth, opts metav1.CreateOptions) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Post(). + Resource("oauths"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(oAuth). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a oAuth and updates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *oAuths) Update(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Put(). + Resource("oauths"). + Name(oAuth.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(oAuth). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *oAuths) UpdateStatus(ctx context.Context, oAuth *v1.OAuth, opts metav1.UpdateOptions) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Put(). + Resource("oauths"). + Name(oAuth.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(oAuth). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the oAuth and deletes it. Returns an error if one occurs. +func (c *oAuths) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("oauths"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *oAuths) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("oauths"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched oAuth. +func (c *oAuths) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Patch(pt). + Resource("oauths"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go new file mode 100644 index 00000000000..06a2b18442a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/operatorhub.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// OperatorHubsGetter has a method to return a OperatorHubInterface. +// A group's client should implement this interface. +type OperatorHubsGetter interface { + OperatorHubs() OperatorHubInterface +} + +// OperatorHubInterface has methods to work with OperatorHub resources. +type OperatorHubInterface interface { + Create(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.CreateOptions) (*v1.OperatorHub, error) + Update(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (*v1.OperatorHub, error) + UpdateStatus(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (*v1.OperatorHub, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.OperatorHub, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.OperatorHubList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OperatorHub, err error) + OperatorHubExpansion +} + +// operatorHubs implements OperatorHubInterface +type operatorHubs struct { + client rest.Interface +} + +// newOperatorHubs returns a OperatorHubs +func newOperatorHubs(c *ConfigV1Client) *operatorHubs { + return &operatorHubs{ + client: c.RESTClient(), + } +} + +// Get takes name of the operatorHub, and returns the corresponding operatorHub object, and an error if there is any. +func (c *operatorHubs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OperatorHub, err error) { + result = &v1.OperatorHub{} + err = c.client.Get(). + Resource("operatorhubs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OperatorHubs that match those selectors. +func (c *operatorHubs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OperatorHubList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.OperatorHubList{} + err = c.client.Get(). + Resource("operatorhubs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested operatorHubs. +func (c *operatorHubs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("operatorhubs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a operatorHub and creates it. Returns the server's representation of the operatorHub, and an error, if there is any. +func (c *operatorHubs) Create(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.CreateOptions) (result *v1.OperatorHub, err error) { + result = &v1.OperatorHub{} + err = c.client.Post(). + Resource("operatorhubs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(operatorHub). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a operatorHub and updates it. Returns the server's representation of the operatorHub, and an error, if there is any. +func (c *operatorHubs) Update(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (result *v1.OperatorHub, err error) { + result = &v1.OperatorHub{} + err = c.client.Put(). + Resource("operatorhubs"). + Name(operatorHub.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(operatorHub). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *operatorHubs) UpdateStatus(ctx context.Context, operatorHub *v1.OperatorHub, opts metav1.UpdateOptions) (result *v1.OperatorHub, err error) { + result = &v1.OperatorHub{} + err = c.client.Put(). + Resource("operatorhubs"). + Name(operatorHub.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(operatorHub). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the operatorHub and deletes it. Returns an error if one occurs. +func (c *operatorHubs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("operatorhubs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *operatorHubs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("operatorhubs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched operatorHub. +func (c *operatorHubs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OperatorHub, err error) { + result = &v1.OperatorHub{} + err = c.client.Patch(pt). + Resource("operatorhubs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go new file mode 100644 index 00000000000..d2f91a2ebae --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ProjectsGetter has a method to return a ProjectInterface. +// A group's client should implement this interface. +type ProjectsGetter interface { + Projects() ProjectInterface +} + +// ProjectInterface has methods to work with Project resources. +type ProjectInterface interface { + Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (*v1.Project, error) + Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) + UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Project, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProjectList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) + ProjectExpansion +} + +// projects implements ProjectInterface +type projects struct { + client rest.Interface +} + +// newProjects returns a Projects +func newProjects(c *ConfigV1Client) *projects { + return &projects{ + client: c.RESTClient(), + } +} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *projects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Get(). + Resource("projects"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *projects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProjectList{} + err = c.client.Get(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projects. +func (c *projects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Post(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Put(). + Resource("projects"). + Name(project.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *projects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Put(). + Resource("projects"). + Name(project.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *projects) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("projects"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("projects"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched project. +func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Patch(pt). + Resource("projects"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go new file mode 100644 index 00000000000..74c635c23de --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/proxy.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ProxiesGetter has a method to return a ProxyInterface. +// A group's client should implement this interface. +type ProxiesGetter interface { + Proxies() ProxyInterface +} + +// ProxyInterface has methods to work with Proxy resources. +type ProxyInterface interface { + Create(ctx context.Context, proxy *v1.Proxy, opts metav1.CreateOptions) (*v1.Proxy, error) + Update(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (*v1.Proxy, error) + UpdateStatus(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (*v1.Proxy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Proxy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProxyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Proxy, err error) + ProxyExpansion +} + +// proxies implements ProxyInterface +type proxies struct { + client rest.Interface +} + +// newProxies returns a Proxies +func newProxies(c *ConfigV1Client) *proxies { + return &proxies{ + client: c.RESTClient(), + } +} + +// Get takes name of the proxy, and returns the corresponding proxy object, and an error if there is any. +func (c *proxies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Proxy, err error) { + result = &v1.Proxy{} + err = c.client.Get(). + Resource("proxies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Proxies that match those selectors. +func (c *proxies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProxyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProxyList{} + err = c.client.Get(). + Resource("proxies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested proxies. +func (c *proxies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("proxies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a proxy and creates it. Returns the server's representation of the proxy, and an error, if there is any. +func (c *proxies) Create(ctx context.Context, proxy *v1.Proxy, opts metav1.CreateOptions) (result *v1.Proxy, err error) { + result = &v1.Proxy{} + err = c.client.Post(). + Resource("proxies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(proxy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a proxy and updates it. Returns the server's representation of the proxy, and an error, if there is any. +func (c *proxies) Update(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (result *v1.Proxy, err error) { + result = &v1.Proxy{} + err = c.client.Put(). + Resource("proxies"). + Name(proxy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(proxy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *proxies) UpdateStatus(ctx context.Context, proxy *v1.Proxy, opts metav1.UpdateOptions) (result *v1.Proxy, err error) { + result = &v1.Proxy{} + err = c.client.Put(). + Resource("proxies"). + Name(proxy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(proxy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the proxy and deletes it. Returns an error if one occurs. +func (c *proxies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("proxies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *proxies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("proxies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched proxy. +func (c *proxies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Proxy, err error) { + result = &v1.Proxy{} + err = c.client.Patch(pt). + Resource("proxies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go new file mode 100644 index 00000000000..8f9f9219cf1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduler.go @@ -0,0 +1,168 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SchedulersGetter has a method to return a SchedulerInterface. +// A group's client should implement this interface. +type SchedulersGetter interface { + Schedulers() SchedulerInterface +} + +// SchedulerInterface has methods to work with Scheduler resources. +type SchedulerInterface interface { + Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (*v1.Scheduler, error) + Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error) + UpdateStatus(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Scheduler, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SchedulerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) + SchedulerExpansion +} + +// schedulers implements SchedulerInterface +type schedulers struct { + client rest.Interface +} + +// newSchedulers returns a Schedulers +func newSchedulers(c *ConfigV1Client) *schedulers { + return &schedulers{ + client: c.RESTClient(), + } +} + +// Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any. +func (c *schedulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Scheduler, err error) { + result = &v1.Scheduler{} + err = c.client.Get(). + Resource("schedulers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Schedulers that match those selectors. +func (c *schedulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SchedulerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SchedulerList{} + err = c.client.Get(). + Resource("schedulers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested schedulers. +func (c *schedulers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("schedulers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any. +func (c *schedulers) Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (result *v1.Scheduler, err error) { + result = &v1.Scheduler{} + err = c.client.Post(). + Resource("schedulers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scheduler). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any. +func (c *schedulers) Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) { + result = &v1.Scheduler{} + err = c.client.Put(). + Resource("schedulers"). + Name(scheduler.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scheduler). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *schedulers) UpdateStatus(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) { + result = &v1.Scheduler{} + err = c.client.Put(). + Resource("schedulers"). + Name(scheduler.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scheduler). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the scheduler and deletes it. Returns an error if one occurs. +func (c *schedulers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("schedulers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *schedulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("schedulers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched scheduler. +func (c *schedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) { + result = &v1.Scheduler{} + err = c.client.Patch(pt). + Resource("schedulers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go index 6e402364a62..04aa60f95e0 100644 --- a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/gcpmachineproviderconfig_types.go @@ -35,6 +35,9 @@ type GCPMachineProviderSpec struct { Region string `json:"region"` Zone string `json:"zone"` ProjectID string `json:"projectID,omitempty"` + + // Preemptible indicates if created instance is preemptible + Preemptible bool `json:"preemptible,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -45,12 +48,13 @@ func init() { // GCPDisk describes disks for GCP. type GCPDisk struct { - AutoDelete bool `json:"autoDelete"` - Boot bool `json:"boot"` - SizeGb int64 `json:"sizeGb"` - Type string `json:"type"` - Image string `json:"image"` - Labels map[string]string `json:"labels"` + AutoDelete bool `json:"autoDelete"` + Boot bool `json:"boot"` + SizeGb int64 `json:"sizeGb"` + Type string `json:"type"` + Image string `json:"image"` + Labels map[string]string `json:"labels"` + EncryptionKey *GCPEncryptionKeyReference `json:"encryptionKey,omitempty"` } // GCPMetadata describes metadata for GCP. @@ -63,6 +67,7 @@ type GCPMetadata struct { type GCPNetworkInterface struct { PublicIP bool `json:"publicIP,omitempty"` Network string `json:"network,omitempty"` + ProjectID string `json:"projectID,omitempty"` Subnetwork string `json:"subnetwork,omitempty"` } @@ -71,3 +76,31 @@ type GCPServiceAccount struct { Email string `json:"email"` Scopes []string `json:"scopes"` } + +// GCPEncryptionKeyReference describes the encryptionKey to use for a disk's encryption. +type GCPEncryptionKeyReference struct { + KMSKey *GCPKMSKeyReference `json:"kmsKey,omitempty"` + + // 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. + // See https://cloud.google.com/compute/docs/access/service-accounts#compute_engine_service_account + // for details on the default service account. + KMSKeyServiceAccount string `json:"kmsKeyServiceAccount,omitempty"` +} + +// GCPKMSKeyReference gathers required fields for looking up a GCP KMS Key +type GCPKMSKeyReference struct { + // Name is the name of the customer managed encryption key to be used for the disk encryption. + Name string `json:"name"` + + // KeyRing is the name of the KMS Key Ring which the KMS Key belongs to. + KeyRing string `json:"keyRing"` + + // ProjectID is the ID of the Project in which the KMS Key Ring exists. + // Defaults to the VM ProjectID if not set. + ProjectID string `json:"projectID,omitempty"` + + // Location is the GCP location in which the Key Ring exists. + Location string `json:"location"` +} diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go index 8ce9dc5a147..3400d917a22 100644 --- a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/register.go @@ -12,7 +12,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/klog" + "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/scheme" "sigs.k8s.io/yaml" ) diff --git a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go index 08c506c2a33..9f3d6d44387 100644 --- a/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1/zz_generated.deepcopy.go @@ -35,6 +35,11 @@ func (in *GCPDisk) DeepCopyInto(out *GCPDisk) { (*out)[key] = val } } + if in.EncryptionKey != nil { + in, out := &in.EncryptionKey, &out.EncryptionKey + *out = new(GCPEncryptionKeyReference) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPDisk. @@ -47,6 +52,41 @@ func (in *GCPDisk) DeepCopy() *GCPDisk { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPEncryptionKeyReference) DeepCopyInto(out *GCPEncryptionKeyReference) { + *out = *in + if in.KMSKey != nil { + in, out := &in.KMSKey, &out.KMSKey + *out = new(GCPKMSKeyReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPEncryptionKeyReference. +func (in *GCPEncryptionKeyReference) DeepCopy() *GCPEncryptionKeyReference { + if in == nil { + return nil + } + out := new(GCPEncryptionKeyReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPKMSKeyReference) DeepCopyInto(out *GCPKMSKeyReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPKMSKeyReference. +func (in *GCPKMSKeyReference) DeepCopy() *GCPKMSKeyReference { + if in == nil { + return nil + } + out := new(GCPKMSKeyReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GCPMachineProviderCondition) DeepCopyInto(out *GCPMachineProviderCondition) { *out = *in diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/basedomain.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/basedomain.go index fb30f9803d9..484c0c217f7 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/basedomain.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/basedomain.go @@ -69,7 +69,7 @@ func GetBaseDomain() (string, error) { } return nil }); err != nil { - return "", errors.Wrap(err, "failed UserInput for base domain") + return "", errors.Wrap(err, "failed UserInput") } return domain, nil diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/permissions.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/permissions.go index d731517b565..b6f90cb125d 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/permissions.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/aws/permissions.go @@ -25,6 +25,9 @@ const ( // PermissionDeleteNetworking is a set of permissions required when the installer destroys networking resources. PermissionDeleteNetworking PermissionGroup = "delete-networking" + + // PermissionDeleteSharedNetworking is a set of permissions required when the installer destroys resources from a shared-network cluster. + PermissionDeleteSharedNetworking PermissionGroup = "delete-shared-networking" ) var permissions = map[PermissionGroup][]string{ @@ -215,6 +218,10 @@ var permissions = map[PermissionGroup][]string{ "ec2:DisassociateRouteTable", "ec2:ReplaceRouteTableAssociation", }, + // Permissions required for deleting a cluster with shared network resources + PermissionDeleteSharedNetworking: { + "tag:UnTagResources", + }, } // ValidateCreds will try to create an AWS session, and also verify that the current credentials diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/client.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/client.go index 439eb000313..281c4607b62 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/client.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/client.go @@ -22,6 +22,7 @@ type API interface { GetControlPlaneSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subnet string) (*aznetwork.Subnet, error) ListLocations(ctx context.Context) (*[]azsubs.Location, error) GetResourcesProvider(ctx context.Context, resourceProviderNamespace string) (*azres.Provider, error) + GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error) GetDiskSkus(ctx context.Context, region string) ([]azsku.ResourceSku, error) GetGroup(ctx context.Context, groupName string) (*azres.Group, error) ListResourceIDsByGroup(ctx context.Context, groupName string) ([]string, error) @@ -211,3 +212,34 @@ func (c *Client) ListResourceIDsByGroup(ctx context.Context, groupName string) ( } return res, nil } + +// GetVirtualMachineSku retrieves the resource SKU of a specified virtual machine SKU in the specified region. +func (c *Client) GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error) { + client := azsku.NewResourceSkusClientWithBaseURI(c.ssn.Environment.ResourceManagerEndpoint, c.ssn.Credentials.SubscriptionID) + client.Authorizer = c.ssn.Authorizer + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + + for page, err := client.List(ctx); page.NotDone(); err = page.NextWithContext(ctx) { + if err != nil { + return nil, errors.Wrap(err, "error fetching SKU pages") + } + for _, sku := range page.Values() { + // Filter out resources that are not virtualMachines + if !strings.EqualFold("virtualMachines", *sku.ResourceType) { + continue + } + // Filter out resources that do not match the provided name + if !strings.EqualFold(name, *sku.Name) { + continue + } + // Return the resource from the provided region + for _, location := range to.StringSlice(sku.Locations) { + if strings.EqualFold(location, region) { + return &sku, nil + } + } + } + } + return nil, nil +} diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/dns.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/dns.go index e367fd46508..e3bc16f6a52 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/dns.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/dns.go @@ -85,7 +85,7 @@ func (config DNSConfig) GetDNSZone() (*Zone, error) { }, }, &zoneName) if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed UserInput") } return &Zone{ diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/validation.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/validation.go index 11a23050589..e42bf732564 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/validation.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/azure/validation.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "sort" + "strconv" "strings" azdns "github.com/Azure/azure-sdk-for-go/profiles/latest/dns/mgmt/dns" @@ -17,15 +18,100 @@ import ( aztypes "github.com/openshift/installer/pkg/types/azure" ) +type resourceRequirements struct { + minimumVCpus int64 + minimumMemory int64 +} + +var controlPlaneReq = resourceRequirements{ + minimumVCpus: 4, + minimumMemory: 16, +} + +var computeReq = resourceRequirements{ + minimumVCpus: 2, + minimumMemory: 8, +} + // Validate executes platform-specific validation. func Validate(client API, ic *types.InstallConfig) error { allErrs := field.ErrorList{} allErrs = append(allErrs, validateNetworks(client, ic.Azure, ic.Networking.MachineNetwork, field.NewPath("platform").Child("azure"))...) allErrs = append(allErrs, validateRegion(client, field.NewPath("platform").Child("azure").Child("region"), ic.Azure)...) + allErrs = append(allErrs, validateInstanceTypes(client, ic)...) return allErrs.ToAggregate() } +// ValidateInstanceType ensures the instance type has sufficient Vcpu and Memory. +func ValidateInstanceType(client API, fieldPath *field.Path, region, instanceType string, req resourceRequirements) field.ErrorList { + allErrs := field.ErrorList{} + + typeMeta, err := client.GetVirtualMachineSku(context.TODO(), instanceType, region) + if err != nil { + return append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, err.Error())) + } + + if typeMeta == nil { + errMsg := fmt.Sprintf("not found in region %s", region) + return append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, errMsg)) + } + + for _, capability := range *typeMeta.Capabilities { + + if strings.EqualFold(*capability.Name, "vCPUs") { + cpus, err := strconv.ParseFloat(*capability.Value, 0) + if err != nil { + return append(allErrs, field.InternalError(fieldPath, err)) + } + if cpus < float64(req.minimumVCpus) { + errMsg := fmt.Sprintf("instance type does not meet minimum resource requirements of %d vCPUs", req.minimumVCpus) + allErrs = append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, errMsg)) + } + } else if strings.EqualFold(*capability.Name, "MemoryGB") { + memory, err := strconv.ParseFloat(*capability.Value, 0) + if err != nil { + return append(allErrs, field.InternalError(fieldPath, err)) + } + if memory < float64(req.minimumMemory) { + errMsg := fmt.Sprintf("instance type does not meet minimum resource requirements of %d GB Memory", req.minimumMemory) + allErrs = append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, errMsg)) + } + } + } + + return allErrs +} + +// validateInstanceTypes checks that the user-provided instance types are valid. +func validateInstanceTypes(client API, ic *types.InstallConfig) field.ErrorList { + allErrs := field.ErrorList{} + + // Default requirements need to be sufficient to support Control Plane instances. + defaultInstanceReq := controlPlaneReq + + if ic.ControlPlane != nil && ic.ControlPlane.Platform.Azure != nil && ic.ControlPlane.Platform.Azure.InstanceType != "" { + // Default requirements can be relaxed when the controlPlane type is set explicitly. + defaultInstanceReq = computeReq + + allErrs = append(allErrs, ValidateInstanceType(client, field.NewPath("controlPlane", "platform", "azure"), ic.Azure.Region, ic.ControlPlane.Platform.Azure.InstanceType, controlPlaneReq)...) + } + + if ic.Platform.Azure.DefaultMachinePlatform != nil && ic.Platform.Azure.DefaultMachinePlatform.InstanceType != "" { + allErrs = append(allErrs, ValidateInstanceType(client, field.NewPath("platform", "azure", "defaultMachinePlatform"), ic.Azure.Region, ic.Platform.Azure.DefaultMachinePlatform.InstanceType, defaultInstanceReq)...) + } + + for idx, compute := range ic.Compute { + fieldPath := field.NewPath("compute").Index(idx) + if compute.Platform.Azure != nil && compute.Platform.Azure.InstanceType != "" { + allErrs = append(allErrs, ValidateInstanceType(client, fieldPath.Child("platform", "azure"), + ic.Azure.Region, compute.Platform.Azure.InstanceType, computeReq)...) + } + } + + return allErrs +} + // validateNetworks checks that the user-provided VNet and subnets are valid. func validateNetworks(client API, p *aztypes.Platform, machineNetworks []types.MachineNetworkEntry, fieldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/client.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/client.go index 079d0e471f1..c0a146f19db 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/client.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/client.go @@ -19,11 +19,13 @@ import ( // API represents the calls made to the API. type API interface { GetNetwork(ctx context.Context, network, project string) (*compute.Network, error) + GetMachineType(ctx context.Context, project, zone, machineType string) (*compute.MachineType, error) GetPublicDomains(ctx context.Context, project string) ([]string, error) GetPublicDNSZone(ctx context.Context, project, baseDomain string) (*dns.ManagedZone, error) GetSubnetworks(ctx context.Context, network, project, region string) ([]*compute.Subnetwork, error) GetProjects(ctx context.Context) (map[string]string, error) GetRecordSets(ctx context.Context, project, zone string) ([]*dns.ResourceRecordSet, error) + GetZones(ctx context.Context, project, filter string) ([]*compute.Zone, error) GetEnabledServices(ctx context.Context, project string) ([]string, error) } @@ -48,6 +50,24 @@ func NewClient(ctx context.Context) (*Client, error) { return client, nil } +// GetMachineType uses the GCP Compute Service API to get the specified machine type. +func (c *Client) GetMachineType(ctx context.Context, project, zone, machineType string) (*compute.MachineType, error) { + ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + defer cancel() + + svc, err := c.getComputeService(ctx) + if err != nil { + return nil, err + } + + req, err := svc.MachineTypes.Get(project, zone, machineType).Context(ctx).Do() + if err != nil { + return nil, err + } + + return req, nil +} + // GetNetwork uses the GCP Compute Service API to get a network by name from a project. func (c *Client) GetNetwork(ctx context.Context, network, project string) (*compute.Network, error) { ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) @@ -202,6 +222,35 @@ func (c *Client) GetProjects(ctx context.Context) (map[string]string, error) { return projects, nil } +// GetZones uses the GCP Compute Service API to get a list of zones from a project. +func (c *Client) GetZones(ctx context.Context, project, filter string) ([]*compute.Zone, error) { + zones := []*compute.Zone{} + + ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) + defer cancel() + + svc, err := c.getComputeService(ctx) + if err != nil { + return nil, err + } + + req := svc.Zones.List(project) + if filter != "" { + req = req.Filter(filter) + } + + if err := req.Pages(ctx, func(page *compute.ZoneList) error { + for _, zone := range page.Items { + zones = append(zones, zone) + } + return nil + }); err != nil { + return nil, errors.Wrapf(err, "failed to get zones from project %s", project) + } + + return zones, nil +} + func (c *Client) getCloudResourceService(ctx context.Context) (*cloudresourcemanager.Service, error) { svc, err := cloudresourcemanager.NewService(ctx, option.WithCredentials(c.ssn.Credentials)) if err != nil { diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/dns.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/dns.go index 06f44602931..19e1c14b9a6 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/dns.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/dns.go @@ -59,7 +59,7 @@ func GetBaseDomain(project string) (string, error) { } return nil }); err != nil { - return "", errors.Wrap(err, "failed UserInput for base domain") + return "", errors.Wrap(err, "failed UserInput") } return domain, nil diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/gcp.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/gcp.go index 8f3dbcb718a..d7c8407c4c4 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/gcp.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/gcp.go @@ -24,6 +24,9 @@ func Platform() (*gcp.Platform, error) { } region, err := selectRegion(project) + if err != nil { + return nil, err + } return &gcp.Platform{ ProjectID: project, @@ -75,7 +78,7 @@ func selectProject(ctx context.Context) (string, error) { }, &selectedProject) selectedProject = ids[selectedProject] - return selectedProject, nil + return selectedProject, err } func selectRegion(project string) (string, error) { diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/validation.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/validation.go index 6ab3bd410fa..080b25747cb 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/validation.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/gcp/validation.go @@ -17,16 +17,93 @@ import ( "github.com/openshift/installer/pkg/types" ) +type resourceRequirements struct { + minimumVCpus int64 + minimumMemory int64 +} + +var controlPlaneReq = resourceRequirements{ + minimumVCpus: 4, + minimumMemory: 15360, +} + +var computeReq = resourceRequirements{ + minimumVCpus: 2, + minimumMemory: 7680, +} + // Validate executes platform-specific validation. func Validate(client API, ic *types.InstallConfig) error { allErrs := field.ErrorList{} allErrs = append(allErrs, validateProject(client, ic, field.NewPath("platform").Child("gcp"))...) allErrs = append(allErrs, validateNetworks(client, ic, field.NewPath("platform").Child("gcp"))...) + allErrs = append(allErrs, validateInstanceTypes(client, ic)...) return allErrs.ToAggregate() } +// ValidateInstanceType ensures the instance type has sufficient Vcpu and Memory. +func ValidateInstanceType(client API, fieldPath *field.Path, project, zone, instanceType string, req resourceRequirements) field.ErrorList { + allErrs := field.ErrorList{} + + typeMeta, err := client.GetMachineType(context.TODO(), project, zone, instanceType) + if err != nil { + if _, ok := err.(*googleapi.Error); ok { + return append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, err.Error())) + } + return append(allErrs, field.InternalError(nil, err)) + } + + if typeMeta.GuestCpus < req.minimumVCpus { + errMsg := fmt.Sprintf("instance type does not meet minimum resource requirements of %d vCPUs", req.minimumVCpus) + allErrs = append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, errMsg)) + } + if typeMeta.MemoryMb < req.minimumMemory { + errMsg := fmt.Sprintf("instance type does not meet minimum resource requirements of %d MB Memory", req.minimumMemory) + allErrs = append(allErrs, field.Invalid(fieldPath.Child("type"), instanceType, errMsg)) + } + + return allErrs +} + +// validateInstanceTypes checks that the user-provided instance types are valid. +func validateInstanceTypes(client API, ic *types.InstallConfig) field.ErrorList { + allErrs := field.ErrorList{} + + // Get list of zones in region + zones, err := client.GetZones(context.TODO(), ic.GCP.ProjectID, fmt.Sprintf("region eq .*%s", ic.GCP.Region)) + if err != nil { + return append(allErrs, field.InternalError(nil, err)) + } + + // Default requirements need to be sufficient to support Control Plane instances. + defaultInstanceReq := controlPlaneReq + + if ic.ControlPlane != nil && ic.ControlPlane.Platform.GCP != nil && ic.ControlPlane.Platform.GCP.InstanceType != "" { + // Default requirements can be relaxed when the controlPlane type is set explicitly. + defaultInstanceReq = computeReq + + allErrs = append(allErrs, ValidateInstanceType(client, field.NewPath("controlPlane", "platform", "gcp"), ic.GCP.ProjectID, zones[0].Name, + ic.ControlPlane.Platform.GCP.InstanceType, controlPlaneReq)...) + } + + if ic.Platform.GCP.DefaultMachinePlatform != nil && ic.Platform.GCP.DefaultMachinePlatform.InstanceType != "" { + allErrs = append(allErrs, ValidateInstanceType(client, field.NewPath("platform", "gcp", "defaultMachinePlatform"), ic.GCP.ProjectID, zones[0].Name, + ic.Platform.GCP.DefaultMachinePlatform.InstanceType, defaultInstanceReq)...) + } + + for idx, compute := range ic.Compute { + fieldPath := field.NewPath("compute").Index(idx) + if compute.Platform.GCP != nil && compute.Platform.GCP.InstanceType != "" { + allErrs = append(allErrs, ValidateInstanceType(client, fieldPath.Child("platform", "gcp"), ic.GCP.ProjectID, zones[0].Name, + compute.Platform.GCP.InstanceType, computeReq)...) + } + } + + return allErrs +} + // ValidatePreExitingPublicDNS ensure no pre-existing DNS record exists in the public // DNS zone for cluster's Kubernetes API. func ValidatePreExitingPublicDNS(client API, ic *types.InstallConfig) error { diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/client.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/client.go index 46286355114..37cac010be6 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/client.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/client.go @@ -15,6 +15,7 @@ func getConnection(ovirtConfig Config) (*ovirtsdk.Connection, error) { Username(ovirtConfig.Username). Password(ovirtConfig.Password). CAFile(ovirtConfig.CAFile). + CACert([]byte(ovirtConfig.CABundle)). Insecure(ovirtConfig.Insecure). Build() if err != nil { diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/cluster.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/cluster.go index 1a88ac17cc5..e8918d8d2bb 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/cluster.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/cluster.go @@ -38,7 +38,7 @@ func askCluster(c *ovirtsdk4.Connection, p *ovirt.Platform) (string, error) { clusterNames = append(clusterNames, cluster.MustName()) } } - err = survey.AskOne(&survey.Select{ + if err := survey.AskOne(&survey.Select{ Message: "Cluster", Help: "The Cluster where the VMs will be created.", Options: clusterNames, @@ -57,6 +57,8 @@ func askCluster(c *ovirtsdk4.Connection, p *ovirt.Platform) (string, error) { } p.ClusterID = cl.MustId() return nil - }) - return clusterName, err + }); err != nil { + return clusterName, errors.Wrap(err, "failed UserInput") + } + return clusterName, nil } diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/config.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/config.go index 829c350f08d..276f914dbe1 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/config.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/config.go @@ -6,6 +6,8 @@ import ( "os" "path/filepath" + ovirtsdk "github.com/ovirt/go-ovirt" + "github.com/pkg/errors" "gopkg.in/yaml.v2" ) @@ -85,3 +87,17 @@ func (c *Config) Save() error { } return ioutil.WriteFile(path, out, 0600) } + +// getValidatedConnection will create a connection and validate it before returning. +func (c *Config) getValidatedConnection() (*ovirtsdk.Connection, error) { + connection, err := getConnection(*c) + if err != nil { + return nil, errors.Wrap(err, "failed to build configuration for ovirt connection validation") + } + + if err := connection.Test(); err != nil { + _ = connection.Close() + return nil, err + } + return connection, nil +} diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/credentials.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/credentials.go index 707055f252e..c95ecc8ceb5 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/credentials.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/credentials.go @@ -366,9 +366,19 @@ func engineSetup() (Config, error) { } if engineConfig.Insecure { - logrus.Warning( - "cannot detect Engine CA cert imported in the system. ", - "Communication with the Engine will be insecure.") + logrus.Error( + "****************************************************************************\n", + "* Could not configure secure communication to the oVirt engine. *\n", + "* As of 4.7 insecure mode for oVirt is no longer supported in the *\n", + "* installer. Please see the help article titled \"Installing OpenShift on *\n", + "* RHV/oVirt in insecure mode\" for details how to configure insecure mode *\n", + "* manually. *\n", + "****************************************************************************", + ) + return engineConfig, + errors.New( + "cannot detect engine ca cert imported in the system", + ) } return askCredentials(engineConfig) } diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/network.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/network.go index 06e049ff90c..491fed111c6 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/network.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/network.go @@ -5,6 +5,7 @@ import ( "sort" ovirtsdk4 "github.com/ovirt/go-ovirt" + "github.com/pkg/errors" "gopkg.in/AlecAivazis/survey.v1" "github.com/openshift/installer/pkg/types/ovirt" @@ -28,7 +29,7 @@ func askNetwork(c *ovirtsdk4.Connection, p *ovirt.Platform) error { networkByNames[network.MustName()] = network networkNames = append(networkNames, network.MustName()) } - err = survey.AskOne(&survey.Select{ + if err := survey.AskOne(&survey.Select{ Message: "Network", Help: "The Engine network of the deployed VMs. 'ovirtmgmt' is the default network. It is recommended to use a dedicated network for each OpenShift cluster.", Options: networkNames, @@ -47,8 +48,10 @@ func askNetwork(c *ovirtsdk4.Connection, p *ovirt.Platform) error { } p.NetworkName = network.MustName() return nil - }) - return err + }); err != nil { + return errors.Wrap(err, "failed UserInput") + } + return nil } func askVNICProfileID(c *ovirtsdk4.Connection, p *ovirt.Platform) error { @@ -71,7 +74,7 @@ func askVNICProfileID(c *ovirtsdk4.Connection, p *ovirt.Platform) error { } // we have multiple vnic profile for the selected network - err = survey.AskOne(&survey.Select{ + if err := survey.AskOne(&survey.Select{ Message: "VNIC Profile", Help: "The Engine VNIC profile of the VMs.", Options: profileNames, @@ -90,6 +93,8 @@ func askVNICProfileID(c *ovirtsdk4.Connection, p *ovirt.Platform) error { } p.VNICProfileID = profile.MustId() return nil - }) - return err + }); err != nil { + return errors.Wrap(err, "failed UserInput") + } + return nil } diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/ovirt.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/ovirt.go index 313dc360742..47ba7ee8631 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/ovirt.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/ovirt.go @@ -2,40 +2,47 @@ package ovirt import ( ovirtsdk4 "github.com/ovirt/go-ovirt" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" "gopkg.in/AlecAivazis/survey.v1" "github.com/openshift/installer/pkg/types/ovirt" ) +const platformValidationMaxTries = 3 + // Platform collects ovirt-specific configuration. func Platform() (*ovirt.Platform, error) { p := ovirt.Platform{} + var c *ovirtsdk4.Connection + ovirtConfig, err := NewConfig() - if err != nil { - ovirtConfig, err = engineSetup() + for tries := 0; tries < platformValidationMaxTries; tries++ { if err != nil { - return nil, err + ovirtConfig, err = engineSetup() + if err != nil { + logrus.Error(errors.Wrap(err, "oVirt configuration failed")) + } } - } - - c, err := ovirtsdk4.NewConnectionBuilder(). - URL(ovirtConfig.URL). - Username(ovirtConfig.Username). - Password(ovirtConfig.Password). - CAFile(ovirtConfig.CAFile). - Insecure(ovirtConfig.Insecure). - Build() + if err == nil { + c, err = ovirtConfig.getValidatedConnection() + if err != nil { + logrus.Error(errors.Wrap(err, "failed to validate oVirt configuration")) + } else { + break + } + } + } if err != nil { - return nil, err + // Last error is not nil, we don't have a valid config. + return nil, errors.Wrap(err, "maximum retries for configuration exhausted") } defer c.Close() - err = c.Test() - if err != nil { + if err = ovirtConfig.Save(); err != nil { return nil, err } - ovirtConfig.Save() clusterName, err := askCluster(c, &p) if err != nil { @@ -68,7 +75,7 @@ func Platform() (*ovirt.Platform, error) { }, }, &p.APIVIP) if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed UserInput") } err = survey.Ask([]*survey.Question{ @@ -82,7 +89,7 @@ func Platform() (*ovirt.Platform, error) { }, }, &p.IngressVIP) if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed UserInput") } return &p, nil diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/storage.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/storage.go index 28a41594a7c..faec96ad4e2 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/storage.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/storage.go @@ -5,6 +5,7 @@ import ( "sort" ovirtsdk4 "github.com/ovirt/go-ovirt" + "github.com/pkg/errors" "gopkg.in/AlecAivazis/survey.v1" "github.com/openshift/installer/pkg/types/ovirt" @@ -28,7 +29,7 @@ func askStorage(c *ovirtsdk4.Connection, p *ovirt.Platform, clusterName string) domainsForCluster[domain.MustName()] = domain domainNames = append(domainNames, domain.MustName()) } - err = survey.AskOne(&survey.Select{ + if err := survey.AskOne(&survey.Select{ Message: "Storage domain", Help: "The storage domain will be used to create the disks of all the cluster nodes.", Options: domainNames, @@ -47,6 +48,8 @@ func askStorage(c *ovirtsdk4.Connection, p *ovirt.Platform, clusterName string) } p.StorageDomainID = domain.MustId() return nil - }) - return err + }); err != nil { + return errors.Wrap(err, "failed UserInput") + } + return nil } diff --git a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/validation.go b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/validation.go index 2b97a8c2a02..504d64ce03d 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/validation.go +++ b/vendor/github.com/openshift/installer/pkg/asset/installconfig/ovirt/validation.go @@ -86,6 +86,7 @@ func authenticated(c *Config) survey.Validator { Username(c.Username). Password(fmt.Sprint(val)). CAFile(c.CAFile). + CACert([]byte(c.CABundle)). Insecure(c.Insecure). Build() diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machines.go index 30185030a08..8d3b2b30102 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machines.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machines.go @@ -4,7 +4,7 @@ package aws import ( "fmt" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machinesets.go index aac1ce9dbbf..6c62ea50e21 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machinesets.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/aws/machinesets.go @@ -4,7 +4,7 @@ package aws import ( "fmt" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -74,7 +74,7 @@ func MachineSets(clusterID string, region string, subnets map[string]string, poo }, }, Template: machineapi.MachineTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: machineapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machines.go index e57225456bc..aa77a61a664 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machines.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machines.go @@ -9,9 +9,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/azure" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" azureprovider "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1" ) @@ -116,7 +116,7 @@ func provider(platform *azure.Platform, mpool *azure.MachinePool, osImage string OSDisk: azureprovider.OSDisk{ OSType: "Linux", DiskSizeGB: mpool.OSDisk.DiskSizeGB, - ManagedDisk: azureprovider.ManagedDisk{ + ManagedDisk: azureprovider.ManagedDiskParameters{ StorageAccountType: mpool.OSDisk.DiskType, }, }, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machinesets.go index 7b7d71c8b21..7a43af5fdc1 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machinesets.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/azure/machinesets.go @@ -7,9 +7,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - clusterapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/azure" + clusterapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" ) // MachineSets returns a list of machinesets for a machinepool. @@ -68,7 +68,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach }, }, Template: clusterapi.MachineTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: clusterapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machines.go index c82f80f7db2..20f90246fb7 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machines.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machines.go @@ -5,7 +5,7 @@ import ( "fmt" gcpprovider "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -77,6 +77,20 @@ func provider(clusterID string, platform *gcp.Platform, mpool *gcp.MachinePool, return nil, err } + var encryptionKey *gcpprovider.GCPEncryptionKeyReference + + if mpool.OSDisk.EncryptionKey != nil { + encryptionKey = &gcpprovider.GCPEncryptionKeyReference{ + KMSKey: &gcpprovider.GCPKMSKeyReference{ + Name: mpool.OSDisk.EncryptionKey.KMSKey.Name, + KeyRing: mpool.OSDisk.EncryptionKey.KMSKey.KeyRing, + ProjectID: mpool.OSDisk.EncryptionKey.KMSKey.ProjectID, + Location: mpool.OSDisk.EncryptionKey.KMSKey.Location, + }, + KMSKeyServiceAccount: mpool.OSDisk.EncryptionKey.KMSKeyServiceAccount, + } + } + return &gcpprovider.GCPMachineProviderSpec{ TypeMeta: metav1.TypeMeta{ APIVersion: "gcpprovider.openshift.io/v1beta1", @@ -85,11 +99,12 @@ func provider(clusterID string, platform *gcp.Platform, mpool *gcp.MachinePool, UserDataSecret: &corev1.LocalObjectReference{Name: userDataSecret}, CredentialsSecret: &corev1.LocalObjectReference{Name: "gcp-cloud-credentials"}, Disks: []*gcpprovider.GCPDisk{{ - AutoDelete: true, - Boot: true, - SizeGb: mpool.OSDisk.DiskSizeGB, - Type: mpool.OSDisk.DiskType, - Image: osImage, + AutoDelete: true, + Boot: true, + SizeGb: mpool.OSDisk.DiskSizeGB, + Type: mpool.OSDisk.DiskType, + Image: osImage, + EncryptionKey: encryptionKey, }}, NetworkInterfaces: []*gcpprovider.GCPNetworkInterface{{ Network: network, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machinesets.go index 6314e9eb31b..1ebb10eeb4f 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machinesets.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/gcp/machinesets.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -64,7 +64,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach }, }, Template: machineapi.MachineTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: machineapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machines.go index 7831f562491..0678db41cad 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machines.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machines.go @@ -7,7 +7,7 @@ import ( "github.com/gophercloud/gophercloud" netext "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions" "github.com/gophercloud/utils/openstack/clientconfig" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -15,6 +15,7 @@ import ( "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/openstack" + openstackdefaults "github.com/openshift/installer/pkg/types/openstack/defaults" ) const ( @@ -40,7 +41,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine mpool := pool.Platform.OpenStack platform := config.Platform.OpenStack - trunkSupport, err := checkNetworkExtensionAvailability(platform.Cloud, "trunk", nil) + trunkSupport, err := checkNetworkExtensionAvailability(platform.Cloud, "trunk") if err != nil { return nil, err } @@ -150,6 +151,7 @@ func generateProvider(clusterID string, platform *openstack.Platform, mpool *ope CloudsSecret: &corev1.SecretReference{Name: cloudsSecret, Namespace: cloudsSecretNamespace}, UserDataSecret: &corev1.SecretReference{Name: userDataSecret}, Networks: networks, + PrimarySubnet: platform.MachinesSubnet, AvailabilityZone: az, SecurityGroups: securityGroups, Trunk: trunkSupport, @@ -174,13 +176,8 @@ func generateProvider(clusterID string, platform *openstack.Platform, mpool *ope return &spec, nil } -func checkNetworkExtensionAvailability(cloud, alias string, opts *clientconfig.ClientOpts) (bool, error) { - if opts == nil { - opts = &clientconfig.ClientOpts{} - } - opts.Cloud = cloud - - conn, err := clientconfig.NewServiceClient("network", opts) +func checkNetworkExtensionAvailability(cloud, alias string) (bool, error) { + conn, err := clientconfig.NewServiceClient("network", openstackdefaults.DefaultClientOpts(cloud)) if err != nil { return false, err } diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machinesets.go index 7c629d86764..5ed9dc8dd5e 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machinesets.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/openstack/machinesets.go @@ -4,8 +4,7 @@ package openstack import ( "fmt" - "github.com/gophercloud/utils/openstack/clientconfig" - clusterapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + clusterapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -14,7 +13,7 @@ import ( ) // MachineSets returns a list of machinesets for a machinepool. -func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string, clientOpts *clientconfig.ClientOpts) ([]*clusterapi.MachineSet, error) { +func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string) ([]*clusterapi.MachineSet, error) { if configPlatform := config.Platform.Name(); configPlatform != openstack.Name { return nil, fmt.Errorf("non-OpenStack configuration: %q", configPlatform) } @@ -23,7 +22,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach } platform := config.Platform.OpenStack mpool := pool.Platform.OpenStack - trunkSupport, err := checkNetworkExtensionAvailability(platform.Cloud, "trunk", clientOpts) + trunkSupport, err := checkNetworkExtensionAvailability(platform.Cloud, "trunk") if err != nil { return nil, err } @@ -72,7 +71,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach }, }, Template: clusterapi.MachineTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: clusterapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go index b768f32f02d..a370f7702fa 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go @@ -4,7 +4,7 @@ package ovirt import ( "fmt" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go index df5f6513afd..d8c13f203b4 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go @@ -4,7 +4,7 @@ package ovirt import ( "fmt" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" @@ -55,7 +55,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach }, }, Template: machineapi.MachineTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: machineapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machines.go index 140d9779053..399eb781d3e 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machines.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machines.go @@ -4,7 +4,7 @@ package vsphere import ( "fmt" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" vsphereapis "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machinesets.go index 2ab2b2c93df..0b2772aa61e 100644 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machinesets.go +++ b/vendor/github.com/openshift/installer/pkg/asset/machines/vsphere/machinesets.go @@ -4,7 +4,7 @@ package vsphere import ( "fmt" - machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -57,7 +57,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach }, }, Template: machineapi.MachineTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ + ObjectMeta: machineapi.ObjectMeta{ Labels: map[string]string{ "machine.openshift.io/cluster-api-machineset": name, "machine.openshift.io/cluster-api-cluster": clusterID, diff --git a/vendor/github.com/openshift/installer/pkg/destroy/aws/aws.go b/vendor/github.com/openshift/installer/pkg/destroy/aws/aws.go index 369d270091e..11a3bc765b3 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/aws/aws.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/aws/aws.go @@ -1096,11 +1096,6 @@ func deleteEC2SecurityGroup(ctx context.Context, client *ec2.EC2, id string, log } func deleteEC2SecurityGroupObject(ctx context.Context, client *ec2.EC2, group *ec2.SecurityGroup, logger logrus.FieldLogger) error { - if group.GroupName != nil && *group.GroupName == "default" { - logger.Debug("Skipping default security group") - return nil - } - if len(group.IpPermissions) > 0 { _, err := client.RevokeSecurityGroupIngressWithContext(ctx, &ec2.RevokeSecurityGroupIngressInput{ GroupId: group.GroupId, @@ -1123,6 +1118,11 @@ func deleteEC2SecurityGroupObject(ctx context.Context, client *ec2.EC2, group *e logger.Debug("Revoked egress permissions") } + if group.GroupName != nil && *group.GroupName == "default" { + logger.Debug("Skipping default security group") + return nil + } + _, err := client.DeleteSecurityGroupWithContext(ctx, &ec2.DeleteSecurityGroupInput{ GroupId: group.GroupId, }) @@ -1896,6 +1896,9 @@ func deleteRoute53(ctx context.Context, session *session.Session, arn arn.ARN, l Id: aws.String(id), }) if err != nil { + if err.(awserr.Error).Code() == "NoSuchHostedZone" { + return nil + } return err } diff --git a/vendor/github.com/openshift/installer/pkg/destroy/gcp/gcp.go b/vendor/github.com/openshift/installer/pkg/destroy/gcp/gcp.go index b422ce73850..d9cd454e609 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/gcp/gcp.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/gcp/gcp.go @@ -130,7 +130,6 @@ func (o *ClusterUninstaller) destroyCluster() (bool, error) { {name: "Instances", execute: o.destroyInstances}, {name: "Disks", execute: o.destroyDisks}, {name: "Service accounts", execute: o.destroyServiceAccounts}, - {name: "Policy bindings", execute: o.destroyIAMPolicyBindings}, {name: "Images", execute: o.destroyImages}, {name: "DNS", execute: o.destroyDNS}, {name: "Buckets", execute: o.destroyBuckets}, diff --git a/vendor/github.com/openshift/installer/pkg/destroy/gcp/policybinding.go b/vendor/github.com/openshift/installer/pkg/destroy/gcp/policybinding.go index bf335be5e18..02a5865ffd3 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/gcp/policybinding.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/gcp/policybinding.go @@ -34,7 +34,7 @@ func (o *ClusterUninstaller) setProjectIAMPolicy(policy *resourcemanager.Policy) return nil } -func clearIAMPolicyBindings(policy *resourcemanager.Policy, emails sets.String, logger logrus.FieldLogger) bool { +func (o *ClusterUninstaller) clearIAMPolicyBindings(policy *resourcemanager.Policy, emails sets.String, logger logrus.FieldLogger) bool { removedBindings := false for _, binding := range policy.Bindings { members := []string{} @@ -52,36 +52,6 @@ func clearIAMPolicyBindings(policy *resourcemanager.Policy, emails sets.String, return removedBindings } -// destroyIAMPolicyBindings removes any role bindings from the project policy to -// service accounts that start with the cluster's infra ID. -func (o *ClusterUninstaller) destroyIAMPolicyBindings() error { - policy, err := o.getProjectIAMPolicy() - if err != nil { - return err - } - - sas := o.getPendingItems("serviceaccount_binding") - emails := sets.NewString() - for _, item := range sas { - emails.Insert(item.url) - } - o.Logger.Debugf("candidate members to be removed: %s", emails.List()) - if !clearIAMPolicyBindings(policy, emails, o.Logger) { - pendingPolicy := o.getPendingItems("iampolicy") - if len(pendingPolicy) > 0 { - o.Logger.Infof("Deleted IAM project role bindings") - o.deletePendingItems("iampolicy", pendingPolicy) - } - return nil - } - o.insertPendingItems("iampolicy", []cloudResource{{key: "policy", name: "policy", typeName: "iampolicy"}}) - err = o.setProjectIAMPolicy(policy) - if err != nil { - return err - } - return errors.Errorf("%d items pending", 1) -} - // policyMemberToEmail takes member of IAM policy binding and converts it to service account email. // https://cloud.google.com/iam/docs/reference/rest/v1/Policy#Binding // see members[] diff --git a/vendor/github.com/openshift/installer/pkg/destroy/gcp/serviceaccount.go b/vendor/github.com/openshift/installer/pkg/destroy/gcp/serviceaccount.go index e1aa80d8950..c472b97f45d 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/gcp/serviceaccount.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/gcp/serviceaccount.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/util/sets" iam "google.golang.org/api/iam/v1" ) @@ -69,9 +70,29 @@ func (o *ClusterUninstaller) destroyServiceAccounts() error { if err != nil { return err } - o.insertPendingItems("serviceaccount_binding", found) // store service accounts to remove project IAM binding - items := o.insertPendingItems("serviceaccount", found) + if len(items) == 0 { + return nil + } + + // Remove service accounts from project policy + policy, err := o.getProjectIAMPolicy() + if err != nil { + return err + } + emails := sets.NewString() + for _, item := range items { + emails.Insert(item.url) + } + if o.clearIAMPolicyBindings(policy, emails, o.Logger) { + err = o.setProjectIAMPolicy(policy) + if err != nil { + o.errorTracker.suppressWarning("iampolicy", err, o.Logger) + return errors.Errorf("%d items pending", len(items)) + } + o.Logger.Infof("Deleted IAM project role bindings") + } + for _, item := range items { err := o.deleteServiceAccount(item) if err != nil { diff --git a/vendor/github.com/openshift/installer/pkg/destroy/openstack/glance.go b/vendor/github.com/openshift/installer/pkg/destroy/openstack/glance.go index fe510d9364f..594bb3b8570 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/openstack/glance.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/openstack/glance.go @@ -8,6 +8,8 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" + openstackdefaults "github.com/openshift/installer/pkg/types/openstack/defaults" + "k8s.io/apimachinery/pkg/util/wait" ) @@ -29,11 +31,7 @@ func DeleteGlanceImage(name string, cloud string) error { } func deleteGlanceImage(name string, cloud string) (bool, error) { - opts := clientconfig.ClientOpts{ - Cloud: cloud, - } - - conn, err := clientconfig.NewServiceClient("image", &opts) + conn, err := clientconfig.NewServiceClient("image", openstackdefaults.DefaultClientOpts(cloud)) if err != nil { logrus.Warningf("There was an error during the image removal: %v", err) return false, nil diff --git a/vendor/github.com/openshift/installer/pkg/destroy/openstack/openstack.go b/vendor/github.com/openshift/installer/pkg/destroy/openstack/openstack.go index c5e36197e97..f47b8c3f9e4 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/openstack/openstack.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/openstack/openstack.go @@ -1,12 +1,12 @@ package openstack import ( - "os" "strings" "time" "github.com/openshift/installer/pkg/destroy/providers" "github.com/openshift/installer/pkg/types" + openstackdefaults "github.com/openshift/installer/pkg/types/openstack/defaults" "github.com/gophercloud/gophercloud" "github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes" @@ -101,14 +101,7 @@ func (o *ClusterUninstaller) Run() error { } returnChannel := make(chan string) - opts := &clientconfig.ClientOpts{ - Cloud: o.Cloud, - } - - // We should unset OS_CLOUD env variable here, because the real cloud name was - // defined on the previous step. OS_CLOUD has more priority, so the value from - // "opts" variable will be ignored if OS_CLOUD contains something. - os.Unsetenv("OS_CLOUD") + opts := openstackdefaults.DefaultClientOpts(o.Cloud) // launch goroutines for name, function := range deleteFuncs { diff --git a/vendor/github.com/openshift/installer/pkg/destroy/vsphere/vsphere.go b/vendor/github.com/openshift/installer/pkg/destroy/vsphere/vsphere.go index 4e2e0737754..5bb2588e6f9 100644 --- a/vendor/github.com/openshift/installer/pkg/destroy/vsphere/vsphere.go +++ b/vendor/github.com/openshift/installer/pkg/destroy/vsphere/vsphere.go @@ -153,7 +153,7 @@ func (o *ClusterUninstaller) Run() error { var folderList []types.ManagedObjectReference var virtualMachineList []types.ManagedObjectReference - o.Logger.Debug("find attached objects on tag") + o.Logger.Debug("Find attached objects on tag") tagAttachedObjects, err := getAttachedObjectsOnTag(context.TODO(), o.RestClient, o.InfraID) if err != nil { return err @@ -179,48 +179,54 @@ func (o *ClusterUninstaller) Run() error { return errors.Errorf("Expected 1 Folder per tag but got %d", len(folderList)) } - o.Logger.Debug("find VirtualMachine objects") - virtualMachineMoList, err := getVirtualMachineManagedObjects(context.TODO(), o.Client, virtualMachineList) - if err != nil { - return err - } - o.Logger.Debug("delete VirtualMachines") - err = deleteVirtualMachines(context.TODO(), o.Client, virtualMachineMoList, o.Logger) - if err != nil { - return err - } - - // In this case, folder was user-provided - // and should not be deleted so we are done. - if len(folderList) == 0 { - return nil + if len(virtualMachineList) > 0 { + o.Logger.Debug("Find VirtualMachine objects") + virtualMachineMoList, err := getVirtualMachineManagedObjects(context.TODO(), o.Client, virtualMachineList) + if err != nil { + return err + } + o.Logger.Debug("Delete VirtualMachines") + err = deleteVirtualMachines(context.TODO(), o.Client, virtualMachineMoList, o.Logger) + if err != nil { + return err + } + } else { + o.Logger.Debug("No VirtualMachines found") } - o.Logger.Debug("find Folder objects") - folderMoList, err := getFolderManagedObjects(context.TODO(), o.Client, folderList) - if err != nil { - o.Logger.Errorln(err) - return err - } + if len(folderList) > 0 { + o.Logger.Debug("Find Folder objects") + folderMoList, err := getFolderManagedObjects(context.TODO(), o.Client, folderList) + if err != nil { + o.Logger.Errorln(err) + return err + } - o.Logger.Debug("delete Folder") - err = deleteFolder(context.TODO(), o.Client, folderMoList, o.Logger) - if err != nil { - o.Logger.Errorln(err) - return err + o.Logger.Debug("Delete Folder") + err = deleteFolder(context.TODO(), o.Client, folderMoList, o.Logger) + if err != nil { + o.Logger.Errorln(err) + return err + } + } else { + o.Logger.Debug("No managed Folder found") } - o.Logger.Debug("delete tag") + o.Logger.Debug("Delete tag") + tagLogger := o.Logger.WithField("Tag", o.InfraID) if err = deleteTag(context.TODO(), o.RestClient, o.InfraID); err != nil { - o.Logger.Errorln(err) + tagLogger.Errorln(err) return err } + tagLogger.Info("Destroyed") - o.Logger.Debug("delete tag category") + o.Logger.Debug("Delete tag category") + tcLogger := o.Logger.WithField("TagCategory", "openshift-"+o.InfraID) if err = deleteTagCategory(context.TODO(), o.RestClient, "openshift-"+o.InfraID); err != nil { - o.Logger.Errorln(err) + tcLogger.Errorln(err) return err } + tcLogger.Info("Destroyed") return nil } diff --git a/vendor/github.com/openshift/installer/pkg/types/aws/platform.go b/vendor/github.com/openshift/installer/pkg/types/aws/platform.go index 1d2b1c6a3a5..b29aaaddbb9 100644 --- a/vendor/github.com/openshift/installer/pkg/types/aws/platform.go +++ b/vendor/github.com/openshift/installer/pkg/types/aws/platform.go @@ -1,5 +1,12 @@ package aws +import "k8s.io/apimachinery/pkg/util/sets" + +var ( + // C2SRegions are the C2S AWS regions. + C2SRegions = sets.NewString("us-iso-east-1") +) + // Platform stores all the global configuration that all machinesets // use. type Platform struct { diff --git a/vendor/github.com/openshift/installer/pkg/types/baremetal/platform.go b/vendor/github.com/openshift/installer/pkg/types/baremetal/platform.go index 0c9f77dc599..3f2557dad69 100644 --- a/vendor/github.com/openshift/installer/pkg/types/baremetal/platform.go +++ b/vendor/github.com/openshift/installer/pkg/types/baremetal/platform.go @@ -69,7 +69,13 @@ type Platform struct { // where the baremetal-operator pod runs provisioning services, // and an http server to cache some downloaded content e.g RHCOS/IPA images // +optional - ClusterProvisioningIP string `json:"provisioningHostIP,omitempty"` + ClusterProvisioningIP string `json:"clusterProvisioningIP,omitempty"` + + // DeprecatedProvisioningHostIP is the deprecated version of clusterProvisioningIP. When the + // baremetal platform was initially added to the installer, the JSON field for ClusterProvisioningIP + // was incorrectly set to "provisioningHostIP." This field is here to allow backwards-compatibility. + // +optional + DeprecatedProvisioningHostIP string `json:"provisioningHostIP,omitempty"` // BootstrapProvisioningIP is the IP used on the bootstrap VM to // bring up provisioning services that are used to create the @@ -83,6 +89,13 @@ type Platform struct { // +optional ExternalBridge string `json:"externalBridge,omitempty"` + // ExternalMACAddress is used to allow setting a static unicast MAC + // address for the bootstrap host on the external network. Consider + // using the QEMU vendor prefix `52:54:00`. If left blank, libvirt will + // generate one for you. + // +optional + ExternalMACAddress string `json:"externalMACAddress,omitempty"` + // ProvisioningNetwork is used to indicate if we will have a provisioning network, and how it will be managed. // +kubebuilder:default=Managed // +optional @@ -93,6 +106,13 @@ type Platform struct { // +optional ProvisioningBridge string `json:"provisioningBridge,omitempty"` + // ProvisioningMACAddress is used to allow setting a static unicast MAC + // address for the bootstrap host on the provisioning network. Consider + // using the QEMU vendor prefix `52:54:00`. If left blank, libvirt will + // generate one for you. + // +optional + ProvisioningMACAddress string `json:"provisioningMACAddress,omitempty"` + // ProvisioningNetworkInterface is the name of the network interface on a control plane // baremetal host that is connected to the provisioning network. ProvisioningNetworkInterface string `json:"provisioningNetworkInterface"` diff --git a/vendor/github.com/openshift/installer/pkg/types/clustermetadata.go b/vendor/github.com/openshift/installer/pkg/types/clustermetadata.go index 31084ffcdeb..9f2dcbaea79 100644 --- a/vendor/github.com/openshift/installer/pkg/types/clustermetadata.go +++ b/vendor/github.com/openshift/installer/pkg/types/clustermetadata.go @@ -5,6 +5,7 @@ import ( "github.com/openshift/installer/pkg/types/azure" "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" + "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/openstack" "github.com/openshift/installer/pkg/types/ovirt" @@ -33,6 +34,7 @@ type ClusterPlatformMetadata struct { BareMetal *baremetal.Metadata `json:"baremetal,omitempty"` Ovirt *ovirt.Metadata `json:"ovirt,omitempty"` VSphere *vsphere.Metadata `json:"vsphere,omitempty"` + Kubevirt *kubevirt.Metadata `json:"kubevirt,omitempty"` } // Platform returns a string representation of the platform @@ -66,5 +68,8 @@ func (cpm *ClusterPlatformMetadata) Platform() string { if cpm.VSphere != nil { return vsphere.Name } + if cpm.Kubevirt != nil { + return kubevirt.Name + } return "" } diff --git a/vendor/github.com/openshift/installer/pkg/types/installconfig.go b/vendor/github.com/openshift/installer/pkg/types/installconfig.go index ceec4f9e189..e3dadb4c30c 100644 --- a/vendor/github.com/openshift/installer/pkg/types/installconfig.go +++ b/vendor/github.com/openshift/installer/pkg/types/installconfig.go @@ -9,6 +9,7 @@ import ( "github.com/openshift/installer/pkg/types/azure" "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" + "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -41,6 +42,7 @@ var ( // to the user in the interactive wizard. HiddenPlatformNames = []string{ baremetal.Name, + kubevirt.Name, none.Name, } ) @@ -184,6 +186,10 @@ type Platform struct { // Ovirt is the configuration used when installing on oVirt. // +optional Ovirt *ovirt.Platform `json:"ovirt,omitempty"` + + // Kubevirt is the configuration used when installing on kubevirt. + // +optional + Kubevirt *kubevirt.Platform `json:"kubevirt,omitempty"` } // Name returns a string representation of the platform (e.g. "aws" if @@ -211,6 +217,8 @@ func (p *Platform) Name() string { return vsphere.Name case p.Ovirt != nil: return ovirt.Name + case p.Kubevirt != nil: + return kubevirt.Name default: return "" } @@ -247,7 +255,7 @@ type Networking struct { // +optional ServiceNetwork []ipnet.IPNet `json:"serviceNetwork,omitempty"` - // Deprected types, scheduled to be removed + // Deprecated types, scheduled to be removed // Deprecated name for MachineCIDRs. If set, MachineCIDRs must // be empty or the first index must match. @@ -258,7 +266,7 @@ type Networking struct { // +optional DeprecatedType string `json:"type,omitempty"` - // Depcreated name for ServiceNetwork + // Deprecated name for ServiceNetwork // +optional DeprecatedServiceCIDR *ipnet.IPNet `json:"serviceCIDR,omitempty"` diff --git a/vendor/github.com/openshift/installer/pkg/types/kubevirt/OWNERS b/vendor/github.com/openshift/installer/pkg/types/kubevirt/OWNERS new file mode 100644 index 00000000000..c81b62d00a3 --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/kubevirt/OWNERS @@ -0,0 +1,7 @@ +# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md +# This file just uses aliases defined in OWNERS_ALIASES. + +approvers: + - kubevirt-approvers +reviewers: + - kubevirt-reviewers diff --git a/vendor/github.com/openshift/installer/pkg/types/kubevirt/doc.go b/vendor/github.com/openshift/installer/pkg/types/kubevirt/doc.go new file mode 100644 index 00000000000..3cf5f936878 --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/kubevirt/doc.go @@ -0,0 +1,6 @@ +// Package kubevirt contains kubevirt-specific structures for +// installer configuration and management. +package kubevirt + +// Name is the name for the kubevirt platform. +const Name string = "kubevirt" diff --git a/vendor/github.com/openshift/installer/pkg/types/kubevirt/machinepool.go b/vendor/github.com/openshift/installer/pkg/types/kubevirt/machinepool.go new file mode 100644 index 00000000000..ad3544f61cf --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/kubevirt/machinepool.go @@ -0,0 +1,38 @@ +package kubevirt + +// MachinePool stores the configuration for a machine pool installed +// on kubevirt. +type MachinePool struct { + // CPU is the amount of CPUs used. + // +optional + CPU uint32 `json:"cpu,omitempty"` + + // Memory is the size of a VM's memory. + // Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + // +optional + Memory string `json:"memory,omitempty"` + + // StorageSize is the size of VM's boot volume. + // Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + // +optional + StorageSize string `json:"storageSize,omitempty"` +} + +// Set sets the values from `required` to `p`. +func (p *MachinePool) Set(required *MachinePool) { + if required == nil || p == nil { + return + } + + if required.CPU != 0 { + p.CPU = required.CPU + } + + if required.Memory != "" { + p.Memory = required.Memory + } + + if required.StorageSize != "" { + p.StorageSize = required.StorageSize + } +} diff --git a/vendor/github.com/openshift/installer/pkg/types/kubevirt/metadata.go b/vendor/github.com/openshift/installer/pkg/types/kubevirt/metadata.go new file mode 100644 index 00000000000..c4952cf8ead --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/kubevirt/metadata.go @@ -0,0 +1,7 @@ +package kubevirt + +// Metadata contains kubevirt metadata (e.g. for uninstalling the cluster). +type Metadata struct { + Namespace string `json:"namespace"` + Labels map[string]string `json:"labels"` +} diff --git a/vendor/github.com/openshift/installer/pkg/types/kubevirt/platform.go b/vendor/github.com/openshift/installer/pkg/types/kubevirt/platform.go new file mode 100644 index 00000000000..75dcf57641c --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/kubevirt/platform.go @@ -0,0 +1,34 @@ +package kubevirt + +// Platform stores all the global configuration used by the kubevirt platform installation. +type Platform struct { + // Namespace is the namespace in the infra cluster, which the control plane (master vms) + // and the compute (worker vms) are installed in. + Namespace string `json:"namespace"` + + // StorageClass is the Storage Class used in the infra cluster. + // +optional + StorageClass string `json:"storageClass,omitempty"` + + // NetworkName is the target network of all the network interfaces of the nodes. + NetworkName string `json:"networkName"` + + // APIVIP is the virtual IP address for the api endpoint. + // +kubebuilder:validation:Format=ip + APIVIP string `json:"apiVIP"` + + // IngressIP is an external IP which routes to the default ingress controller. + // +kubebuilder:validation:Format=ip + IngressVIP string `json:"ingressVIP"` + + // PersistentVolumeAccessMode is the access mode should be use with the persistent volumes. + // +kubebuilder:default="ReadWriteMany" + // +optional + PersistentVolumeAccessMode string `json:"persistentVolumeAccessMode,omitempty"` + + // DefaultMachinePlatform is the default configuration used when + // installing on Kubevirt for machine pools which do not define their own + // platform configuration. + // +optional + DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"` +} diff --git a/vendor/github.com/openshift/installer/pkg/types/machinepools.go b/vendor/github.com/openshift/installer/pkg/types/machinepools.go index d385327516d..30d162f5e38 100644 --- a/vendor/github.com/openshift/installer/pkg/types/machinepools.go +++ b/vendor/github.com/openshift/installer/pkg/types/machinepools.go @@ -5,6 +5,7 @@ import ( "github.com/openshift/installer/pkg/types/azure" "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" + "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/openstack" "github.com/openshift/installer/pkg/types/ovirt" @@ -90,6 +91,9 @@ type MachinePoolPlatform struct { // Ovirt is the configuration used when installing on oVirt. Ovirt *ovirt.MachinePool `json:"ovirt,omitempty"` + + // Kubevirt is the configuration used when installing on Kubevirt. + Kubevirt *kubevirt.MachinePool `json:"kubevirt,omitempty"` } // Name returns a string representation of the platform (e.g. "aws" if @@ -115,6 +119,8 @@ func (p *MachinePoolPlatform) Name() string { return vsphere.Name case p.Ovirt != nil: return ovirt.Name + case p.Kubevirt != nil: + return kubevirt.Name default: return "" } diff --git a/vendor/github.com/openshift/installer/pkg/types/openstack/defaults/clientopts.go b/vendor/github.com/openshift/installer/pkg/types/openstack/defaults/clientopts.go new file mode 100644 index 00000000000..fb64632755b --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/openstack/defaults/clientopts.go @@ -0,0 +1,16 @@ +package defaults + +import ( + "github.com/gophercloud/utils/openstack/clientconfig" +) + +// DefaultClientOpts generates default client opts based on cloud name +func DefaultClientOpts(cloudName string) *clientconfig.ClientOpts { + opts := new(clientconfig.ClientOpts) + opts.Cloud = cloudName + // We explicitly disable reading auth data from env variables by setting an invalid EnvPrefix. + // By doing this, we make sure that the data from clouds.yaml is enough to authenticate. + // For more information: https://github.com/gophercloud/utils/blob/8677e053dcf1f05d0fa0a616094aace04690eb94/openstack/clientconfig/requests.go#L508 + opts.EnvPrefix = "NO_ENV_VARIABLES_" + return opts +} diff --git a/vendor/github.com/openshift/installer/pkg/types/openstack/defaults/platform.go b/vendor/github.com/openshift/installer/pkg/types/openstack/defaults/platform.go new file mode 100644 index 00000000000..5d2727984ba --- /dev/null +++ b/vendor/github.com/openshift/installer/pkg/types/openstack/defaults/platform.go @@ -0,0 +1,43 @@ +package defaults + +import ( + "os" + + "github.com/apparentlymart/go-cidr/cidr" + + "github.com/openshift/installer/pkg/types" + "github.com/openshift/installer/pkg/types/openstack" +) + +const ( + // DefaultCloudName is the default name of the cloud in clouds.yaml file. + DefaultCloudName = "openstack" +) + +// SetPlatformDefaults sets the defaults for the platform. +func SetPlatformDefaults(p *openstack.Platform, n *types.Networking) { + if p.Cloud == "" { + p.Cloud = os.Getenv("OS_CLOUD") + if p.Cloud == "" { + p.Cloud = DefaultCloudName + } + } + // APIVIP returns the internal virtual IP address (VIP) put in front + // of the Kubernetes API server for use by components inside the + // cluster. The DNS static pods running on the nodes resolve the + // api-int record to APIVIP. + if p.APIVIP == "" { + vip, _ := cidr.Host(&n.MachineNetwork[0].CIDR.IPNet, 5) + p.APIVIP = vip.String() + } + + // IngressVIP returns the internal virtual IP address (VIP) put in + // front of the OpenShift router pods. This provides the internal + // accessibility to the internal pods running on the worker nodes, + // e.g. `console`. The DNS static pods running on the nodes resolve + // the wildcard apps record to IngressVIP. + if p.IngressVIP == "" { + vip, _ := cidr.Host(&n.MachineNetwork[0].CIDR.IPNet, 7) + p.IngressVIP = vip.String() + } +} diff --git a/vendor/github.com/openshift/installer/pkg/types/openstack/platform.go b/vendor/github.com/openshift/installer/pkg/types/openstack/platform.go index 80094d17455..e3098eb762b 100644 --- a/vendor/github.com/openshift/installer/pkg/types/openstack/platform.go +++ b/vendor/github.com/openshift/installer/pkg/types/openstack/platform.go @@ -21,8 +21,10 @@ type Platform struct { // +optional ExternalNetwork string `json:"externalNetwork,omitempty"` - // FlavorName is the name of the compute flavor to use for instances in this cluster. - FlavorName string `json:"computeFlavor"` + // DeprecatedFlavorName is the name of the flavor to use for instances in this cluster. + // Deprecated: use FlavorName in DefaultMachinePlatform to define default flavor. + // +optional + DeprecatedFlavorName string `json:"computeFlavor,omitempty"` // LbFloatingIP is the IP address of an available floating IP in your OpenStack cluster // to associate with the OpenShift load balancer. @@ -62,6 +64,11 @@ type Platform struct { // +optional ClusterOSImage string `json:"clusterOSImage,omitempty"` + // ClusterOSImageProperties is a list of properties to be added to the metadata of the uploaded Glance ClusterOSImage. + // Default: the default is to not set any properties. + // +optional + ClusterOSImageProperties map[string]string `json:"clusterOSImageProperties,omitempty"` + // APIVIP is the static IP on the nodes subnet that the api port for openshift will be assigned // Default: will be set to the 5 on the first entry in the machineNetwork CIDR // +optional diff --git a/vendor/github.com/openshift/installer/pkg/validate/validate.go b/vendor/github.com/openshift/installer/pkg/validate/validate.go index b67c6456cf5..acc1a9234f5 100644 --- a/vendor/github.com/openshift/installer/pkg/validate/validate.go +++ b/vendor/github.com/openshift/installer/pkg/validate/validate.go @@ -115,13 +115,23 @@ func ClusterName1035(v string) error { return ClusterName(v) } +// ClusterNameMaxLength validates if the string provided length is +// greater than maxlen argument. +func ClusterNameMaxLength(v string, maxlen int) error { + if len(v) > maxlen { + return errors.New(validation.MaxLenError(maxlen)) + } + return nil +} + // ClusterName checks if the given string is a valid name for a cluster and returns an error if not. // The max length of the DNS label is `DNS1123LabelMaxLength + 9` because the public DNS zones have records // `api.clustername`, `*.apps.clustername`, and *.apps is rendered as the nine-character \052.apps in DNS records. func ClusterName(v string) error { - maxlen := validation.DNS1123LabelMaxLength - 9 - if len(v) > maxlen { - return errors.New(validation.MaxLenError(maxlen)) + const maxlen = validation.DNS1123LabelMaxLength - 9 + err := ClusterNameMaxLength(v, maxlen) + if err != nil { + return err } return validateSubdomain(v) } @@ -184,10 +194,43 @@ func IP(ip string) error { return nil } -// MAC validates that a value is a valid mac address +// MAC validates that a value is a valid unicast EUI-48 MAC address func MAC(addr string) error { - _, err := net.ParseMAC(addr) - return err + hwAddr, err := net.ParseMAC(addr) + if err != nil { + return err + } + + // net.ParseMAC checks for any valid mac, including 20-octet infiniband + // MAC's. Let's make sure we have an EUI-48 MAC, consisting of 6 octets + if len(hwAddr) != 6 { + return fmt.Errorf("invalid MAC address") + } + + // We also need to check that the MAC is a valid unicast address. A multicast + // address is an address where the least significant bit of the most significant + // byte is 1. + // + // Example 1: Multicast MAC + // ------------------------ + // 7D:CE:E3:29:35:6F + // ^--> most significant byte + // + // 0x7D is 0b11111101 + // ^--> this is a multicast MAC + // + // Example 2: Unicast MAC + // ---------------------- + // 7A:CE:E3:29:35:6F + // ^--> most significant byte + // + // 0x7A is 0b11111010 + // ^--> this is a unicast MAC + if hwAddr[0]&1 == 1 { + return fmt.Errorf("expected unicast mac address, found multicast") + } + + return nil } // UUID validates that a uuid is non-empty and a valid uuid. diff --git a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/core.go b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/core.go index ac2b477585b..daa27c7b509 100644 --- a/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/core.go +++ b/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/core.go @@ -58,11 +58,19 @@ func ReadServiceV1OrDie(objBytes []byte) *corev1.Service { } func ReadPodV1OrDie(objBytes []byte) *corev1.Pod { - requiredObj, err := runtime.Decode(coreCodecs.UniversalDecoder(corev1.SchemeGroupVersion), objBytes) + requiredObj, err := ReadPodV1(objBytes) if err != nil { panic(err) } - return requiredObj.(*corev1.Pod) + return requiredObj +} + +func ReadPodV1(objBytes []byte) (*corev1.Pod, error) { + requiredObj, err := runtime.Decode(coreCodecs.UniversalDecoder(corev1.SchemeGroupVersion), objBytes) + if err != nil { + return nil, err + } + return requiredObj.(*corev1.Pod), nil } func WritePodV1OrDie(obj *corev1.Pod) string { diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/register.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/register.go index b986c43b329..1b710aafa26 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/register.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/register.go @@ -1,3 +1,8 @@ +// Generate deepcopy for apis +//go:generate go run ../../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../../hack/boilerplate.go.txt,year=2019 +// Ensure generated code is goimports compliant +//go:generate goimports -w ./v1beta1/zz_generated.deepcopy.go + package machine const GroupName = "machine.openshift.io" diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go new file mode 100644 index 00000000000..9afc4e6e01e --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machine_webhook.go @@ -0,0 +1,1101 @@ +package v1beta1 + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "strings" + + osconfigv1 "github.com/openshift/api/config/v1" + osclientset "github.com/openshift/client-go/config/clientset/versioned" + gcp "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" + "github.com/openshift/machine-api-operator/pkg/apis/machine" + vsphere "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" + admissionregistrationv1 "k8s.io/api/admissionregistration/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/klog/v2" + "k8s.io/utils/pointer" + aws "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" + azure "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" + yaml "sigs.k8s.io/yaml" +) + +var ( + // Azure Defaults + defaultAzureVnet = func(clusterID string) string { + return fmt.Sprintf("%s-vnet", clusterID) + } + defaultAzureSubnet = func(clusterID string) string { + return fmt.Sprintf("%s-worker-subnet", clusterID) + } + defaultAzureNetworkResourceGroup = func(clusterID string) string { + return fmt.Sprintf("%s-rg", clusterID) + } + defaultAzureImageResourceID = func(clusterID string) string { + return fmt.Sprintf("/resourceGroups/%s/providers/Microsoft.Compute/images/%s", clusterID+"-rg", clusterID) + } + defaultAzureManagedIdentiy = func(clusterID string) string { + return fmt.Sprintf("%s-identity", clusterID) + } + defaultAzureResourceGroup = func(clusterID string) string { + return fmt.Sprintf("%s-rg", clusterID) + } + + // GCP Defaults + defaultGCPNetwork = func(clusterID string) string { + return fmt.Sprintf("%s-network", clusterID) + } + defaultGCPSubnetwork = func(clusterID string) string { + return fmt.Sprintf("%s-worker-subnet", clusterID) + } + defaultGCPTags = func(clusterID string) []string { + return []string{fmt.Sprintf("%s-worker", clusterID)} + } +) + +const ( + DefaultMachineMutatingHookPath = "/mutate-machine-openshift-io-v1beta1-machine" + DefaultMachineValidatingHookPath = "/validate-machine-openshift-io-v1beta1-machine" + DefaultMachineSetMutatingHookPath = "/mutate-machine-openshift-io-v1beta1-machineset" + DefaultMachineSetValidatingHookPath = "/validate-machine-openshift-io-v1beta1-machineset" + + defaultWebhookConfigurationName = "machine-api" + defaultWebhookServiceName = "machine-api-operator-webhook" + defaultWebhookServiceNamespace = "openshift-machine-api" + defaultWebhookServicePort = 443 + + defaultUserDataSecret = "worker-user-data" + defaultSecretNamespace = "openshift-machine-api" + + // AWS Defaults + defaultAWSCredentialsSecret = "aws-cloud-credentials" + defaultAWSInstanceType = "m4.large" + + // Azure Defaults + defaultAzureVMSize = "Standard_D4s_V3" + defaultAzureCredentialsSecret = "azure-cloud-credentials" + defaultAzureOSDiskOSType = "Linux" + defaultAzureOSDiskStorageType = "Premium_LRS" + azureMaxDiskSizeGB = 32768 + + // GCP Defaults + defaultGCPMachineType = "n1-standard-4" + defaultGCPCredentialsSecret = "gcp-cloud-credentials" + defaultGCPDiskSizeGb = 128 + defaultGCPDiskType = "pd-standard" + // https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.6/46.82.202007212240-0/x86_64/meta.json + // https://github.com/openshift/installer/pull/3808 + // https://github.com/openshift/installer/blob/d75bf7ad98124b901ae7e22b5595e0392ed6ea3c/data/data/rhcos.json + defaultGCPDiskImage = "projects/rhcos-cloud/global/images/rhcos-46-82-202007212240-0-gcp-x86-64" + + // vSphere Defaults + defaultVSphereCredentialsSecret = "vsphere-cloud-credentials" + // Minimum vSphere values taken from vSphere reconciler + minVSphereCPU = 2 + minVSphereMemoryMiB = 2048 + // https://docs.openshift.com/container-platform/4.1/installing/installing_vsphere/installing-vsphere.html#minimum-resource-requirements_installing-vsphere + minVSphereDiskGiB = 120 +) + +var ( + // webhookFailurePolicy is ignore so we don't want to block machine lifecycle on the webhook operational aspects. + // This would be particularly problematic for chicken egg issues when bootstrapping a cluster. + webhookFailurePolicy = admissionregistrationv1.Ignore + webhookSideEffects = admissionregistrationv1.SideEffectClassNone +) + +func getInfra() (*osconfigv1.Infrastructure, error) { + cfg, err := ctrl.GetConfig() + if err != nil { + return nil, err + } + client, err := osclientset.NewForConfig(cfg) + if err != nil { + return nil, err + } + infra, err := client.ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{}) + if err != nil { + return nil, err + } + return infra, nil +} + +func getDNS() (*osconfigv1.DNS, error) { + cfg, err := ctrl.GetConfig() + if err != nil { + return nil, err + } + client, err := osclientset.NewForConfig(cfg) + if err != nil { + return nil, err + } + dns, err := client.ConfigV1().DNSes().Get(context.Background(), "cluster", metav1.GetOptions{}) + if err != nil { + return nil, err + } + + return dns, nil +} + +type machineAdmissionFn func(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) + +type admissionConfig struct { + clusterID string + dnsDisconnected bool +} + +type admissionHandler struct { + *admissionConfig + webhookOperations machineAdmissionFn + decoder *admission.Decoder +} + +// InjectDecoder injects the decoder. +func (a *admissionHandler) InjectDecoder(d *admission.Decoder) error { + a.decoder = d + return nil +} + +// machineValidatorHandler validates Machine API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineValidatorHandler struct { + *admissionHandler +} + +// machineDefaulterHandler defaults Machine API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineDefaulterHandler struct { + *admissionHandler +} + +// NewValidator returns a new machineValidatorHandler. +func NewMachineValidator() (*machineValidatorHandler, error) { + infra, err := getInfra() + if err != nil { + return nil, err + } + + dns, err := getDNS() + if err != nil { + return nil, err + } + + return createMachineValidator(infra, dns), nil +} + +func createMachineValidator(infra *osconfigv1.Infrastructure, dns *osconfigv1.DNS) *machineValidatorHandler { + admissionConfig := &admissionConfig{ + dnsDisconnected: dns.Spec.PublicZone == nil, + clusterID: infra.Status.InfrastructureName, + } + return &machineValidatorHandler{ + admissionHandler: &admissionHandler{ + admissionConfig: admissionConfig, + webhookOperations: getMachineValidatorOperation(infra.Status.PlatformStatus.Type), + }, + } +} + +func getMachineValidatorOperation(platform osconfigv1.PlatformType) machineAdmissionFn { + switch platform { + case osconfigv1.AWSPlatformType: + return validateAWS + case osconfigv1.AzurePlatformType: + return validateAzure + case osconfigv1.GCPPlatformType: + return validateGCP + case osconfigv1.VSpherePlatformType: + return validateVSphere + default: + // just no-op + return func(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + return true, []string{}, nil + } + } +} + +// NewDefaulter returns a new machineDefaulterHandler. +func NewMachineDefaulter() (*machineDefaulterHandler, error) { + infra, err := getInfra() + if err != nil { + return nil, err + } + + return createMachineDefaulter(infra.Status.PlatformStatus, infra.Status.InfrastructureName), nil +} + +func createMachineDefaulter(platformStatus *osconfigv1.PlatformStatus, clusterID string) *machineDefaulterHandler { + return &machineDefaulterHandler{ + admissionHandler: &admissionHandler{ + admissionConfig: &admissionConfig{clusterID: clusterID}, + webhookOperations: getMachineDefaulterOperation(platformStatus), + }, + } +} + +func getMachineDefaulterOperation(platformStatus *osconfigv1.PlatformStatus) machineAdmissionFn { + switch platformStatus.Type { + case osconfigv1.AWSPlatformType: + region := "" + if platformStatus.AWS != nil { + region = platformStatus.AWS.Region + } + return awsDefaulter{region: region}.defaultAWS + case osconfigv1.AzurePlatformType: + return defaultAzure + case osconfigv1.GCPPlatformType: + return defaultGCP + case osconfigv1.VSpherePlatformType: + return defaultVSphere + default: + // just no-op + return func(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + return true, []string{}, nil + } + } +} + +// NewValidatingWebhookConfiguration creates a validation webhook configuration with configured Machine and MachineSet webhooks +func NewValidatingWebhookConfiguration() *admissionregistrationv1.ValidatingWebhookConfiguration { + validatingWebhookConfiguration := &admissionregistrationv1.ValidatingWebhookConfiguration{ + ObjectMeta: metav1.ObjectMeta{ + Name: defaultWebhookConfigurationName, + Annotations: map[string]string{ + "service.beta.openshift.io/inject-cabundle": "true", + }, + }, + Webhooks: []admissionregistrationv1.ValidatingWebhook{ + MachineValidatingWebhook(), + MachineSetValidatingWebhook(), + }, + } + + // Setting group version is required for testEnv to create unstructured objects, as the new structure sets it on empty strings + // Usual way to populate those values, is to create the resource in the cluster first, which we can't yet do. + validatingWebhookConfiguration.SetGroupVersionKind(admissionregistrationv1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration")) + return validatingWebhookConfiguration +} + +// MachineValidatingWebhook returns validating webhooks for machine to populate the configuration +func MachineValidatingWebhook() admissionregistrationv1.ValidatingWebhook { + serviceReference := admissionregistrationv1.ServiceReference{ + Namespace: defaultWebhookServiceNamespace, + Name: defaultWebhookServiceName, + Path: pointer.StringPtr(DefaultMachineValidatingHookPath), + Port: pointer.Int32Ptr(defaultWebhookServicePort), + } + return admissionregistrationv1.ValidatingWebhook{ + AdmissionReviewVersions: []string{"v1beta1"}, + Name: "validation.machine.machine.openshift.io", + FailurePolicy: &webhookFailurePolicy, + SideEffects: &webhookSideEffects, + ClientConfig: admissionregistrationv1.WebhookClientConfig{ + Service: &serviceReference, + }, + Rules: []admissionregistrationv1.RuleWithOperations{ + { + Rule: admissionregistrationv1.Rule{ + APIGroups: []string{machine.GroupName}, + APIVersions: []string{SchemeGroupVersion.Version}, + Resources: []string{"machines"}, + }, + Operations: []admissionregistrationv1.OperationType{ + admissionregistrationv1.Create, + admissionregistrationv1.Update, + }, + }, + }, + } +} + +// MachineSetValidatingWebhook returns validating webhooks for machineSet to populate the configuration +func MachineSetValidatingWebhook() admissionregistrationv1.ValidatingWebhook { + machinesetServiceReference := admissionregistrationv1.ServiceReference{ + Namespace: defaultWebhookServiceNamespace, + Name: defaultWebhookServiceName, + Path: pointer.StringPtr(DefaultMachineSetValidatingHookPath), + Port: pointer.Int32Ptr(defaultWebhookServicePort), + } + return admissionregistrationv1.ValidatingWebhook{ + AdmissionReviewVersions: []string{"v1beta1"}, + Name: "validation.machineset.machine.openshift.io", + FailurePolicy: &webhookFailurePolicy, + SideEffects: &webhookSideEffects, + ClientConfig: admissionregistrationv1.WebhookClientConfig{ + Service: &machinesetServiceReference, + }, + Rules: []admissionregistrationv1.RuleWithOperations{ + { + Rule: admissionregistrationv1.Rule{ + APIGroups: []string{machine.GroupName}, + APIVersions: []string{SchemeGroupVersion.Version}, + Resources: []string{"machinesets"}, + }, + Operations: []admissionregistrationv1.OperationType{ + admissionregistrationv1.Create, + admissionregistrationv1.Update, + }, + }, + }, + } +} + +// NewMutatingWebhookConfiguration creates a mutating webhook configuration with configured Machine and MachineSet webhooks +func NewMutatingWebhookConfiguration() *admissionregistrationv1.MutatingWebhookConfiguration { + mutatingWebhookConfiguration := &admissionregistrationv1.MutatingWebhookConfiguration{ + ObjectMeta: metav1.ObjectMeta{ + Name: defaultWebhookConfigurationName, + Annotations: map[string]string{ + "service.beta.openshift.io/inject-cabundle": "true", + }, + }, + Webhooks: []admissionregistrationv1.MutatingWebhook{ + MachineMutatingWebhook(), + MachineSetMutatingWebhook(), + }, + } + + // Setting group version is required for testEnv to create unstructured objects, as the new structure sets it on empty strings + // Usual way to populate those values, is to create the resource in the cluster first, which we can't yet do. + mutatingWebhookConfiguration.SetGroupVersionKind(admissionregistrationv1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration")) + return mutatingWebhookConfiguration +} + +// MachineMutatingWebhook returns mutating webhooks for machine to apply in configuration +func MachineMutatingWebhook() admissionregistrationv1.MutatingWebhook { + machineServiceReference := admissionregistrationv1.ServiceReference{ + Namespace: defaultWebhookServiceNamespace, + Name: defaultWebhookServiceName, + Path: pointer.StringPtr(DefaultMachineMutatingHookPath), + Port: pointer.Int32Ptr(defaultWebhookServicePort), + } + return admissionregistrationv1.MutatingWebhook{ + AdmissionReviewVersions: []string{"v1beta1"}, + Name: "default.machine.machine.openshift.io", + FailurePolicy: &webhookFailurePolicy, + SideEffects: &webhookSideEffects, + ClientConfig: admissionregistrationv1.WebhookClientConfig{ + Service: &machineServiceReference, + }, + Rules: []admissionregistrationv1.RuleWithOperations{ + { + Rule: admissionregistrationv1.Rule{ + APIGroups: []string{machine.GroupName}, + APIVersions: []string{SchemeGroupVersion.Version}, + Resources: []string{"machines"}, + }, + Operations: []admissionregistrationv1.OperationType{ + admissionregistrationv1.Create, + }, + }, + }, + } +} + +// MachineSetMutatingWebhook returns mutating webhook for machineSet to apply in configuration +func MachineSetMutatingWebhook() admissionregistrationv1.MutatingWebhook { + machineSetServiceReference := admissionregistrationv1.ServiceReference{ + Namespace: defaultWebhookServiceNamespace, + Name: defaultWebhookServiceName, + Path: pointer.StringPtr(DefaultMachineSetMutatingHookPath), + Port: pointer.Int32Ptr(defaultWebhookServicePort), + } + return admissionregistrationv1.MutatingWebhook{ + AdmissionReviewVersions: []string{"v1beta1"}, + Name: "default.machineset.machine.openshift.io", + FailurePolicy: &webhookFailurePolicy, + SideEffects: &webhookSideEffects, + ClientConfig: admissionregistrationv1.WebhookClientConfig{ + Service: &machineSetServiceReference, + }, + Rules: []admissionregistrationv1.RuleWithOperations{ + { + Rule: admissionregistrationv1.Rule{ + APIGroups: []string{machine.GroupName}, + APIVersions: []string{SchemeGroupVersion.Version}, + Resources: []string{"machinesets"}, + }, + Operations: []admissionregistrationv1.OperationType{ + admissionregistrationv1.Create, + }, + }, + }, + } +} + +func responseWithWarnings(response admission.Response, warnings []string) admission.Response { + response.AdmissionResponse.Warnings = warnings + return response +} + +// Handle handles HTTP requests for admission webhook servers. +func (h *machineValidatorHandler) Handle(ctx context.Context, req admission.Request) admission.Response { + m := &Machine{} + + if err := h.decoder.Decode(req, m); err != nil { + return admission.Errored(http.StatusBadRequest, err) + } + + klog.V(3).Infof("Validate webhook called for Machine: %s", m.GetName()) + + ok, warnings, errs := h.webhookOperations(m, h.admissionConfig) + if !ok { + return responseWithWarnings(admission.Denied(errs.Error()), warnings) + } + + return responseWithWarnings(admission.Allowed("Machine valid"), warnings) +} + +// Handle handles HTTP requests for admission webhook servers. +func (h *machineDefaulterHandler) Handle(ctx context.Context, req admission.Request) admission.Response { + m := &Machine{} + + if err := h.decoder.Decode(req, m); err != nil { + return admission.Errored(http.StatusBadRequest, err) + } + + klog.V(3).Infof("Mutate webhook called for Machine: %s", m.GetName()) + + // Only enforce the clusterID if it's not set. + // Otherwise a discrepancy on the value would leave the machine orphan + // and would trigger a new machine creation by the machineSet. + // https://bugzilla.redhat.com/show_bug.cgi?id=1857175 + if m.Labels == nil { + m.Labels = make(map[string]string) + } + if _, ok := m.Labels[MachineClusterIDLabel]; !ok { + m.Labels[MachineClusterIDLabel] = h.clusterID + } + + ok, warnings, errs := h.webhookOperations(m, h.admissionConfig) + if !ok { + return responseWithWarnings(admission.Denied(errs.Error()), warnings) + } + + marshaledMachine, err := json.Marshal(m) + if err != nil { + return responseWithWarnings(admission.Errored(http.StatusInternalServerError, err), warnings) + } + return responseWithWarnings(admission.PatchResponseFromRaw(req.Object.Raw, marshaledMachine), warnings) +} + +type awsDefaulter struct { + region string +} + +func (a awsDefaulter) defaultAWS(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting AWS providerSpec") + + var errs []error + var warnings []string + providerSpec := new(aws.AWSMachineProviderConfig) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.InstanceType == "" { + providerSpec.InstanceType = defaultAWSInstanceType + } + + if providerSpec.Placement.Region == "" { + providerSpec.Placement.Region = a.region + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultUserDataSecret} + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.LocalObjectReference{Name: defaultAWSCredentialsSecret} + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, warnings, nil +} + +func unmarshalInto(m *Machine, providerSpec interface{}) error { + if m.Spec.ProviderSpec.Value == nil { + return field.Required(field.NewPath("providerSpec", "value"), "a value must be provided") + } + + if err := yaml.Unmarshal(m.Spec.ProviderSpec.Value.Raw, &providerSpec); err != nil { + return field.Invalid(field.NewPath("providerSpec", "value"), providerSpec, err.Error()) + } + return nil +} + +func validateAWS(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Validating AWS providerSpec") + + var errs []error + var warnings []string + providerSpec := new(aws.AWSMachineProviderConfig) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.AMI.ARN == nil && providerSpec.AMI.Filters == nil && providerSpec.AMI.ID == nil { + errs = append( + errs, + field.Required( + field.NewPath("providerSpec", "ami"), + "expected either providerSpec.ami.arn or providerSpec.ami.filters or providerSpec.ami.id to be populated", + ), + ) + } + + if providerSpec.Placement.Region == "" { + errs = append( + errs, + field.Required( + field.NewPath("providerSpec", "placement", "region"), + "expected providerSpec.placement.region to be populated", + ), + ) + } + + if providerSpec.InstanceType == "" { + errs = append( + errs, + field.Required( + field.NewPath("providerSpec", "instanceType"), + "expected providerSpec.instanceType to be populated", + ), + ) + } + + if providerSpec.UserDataSecret == nil { + errs = append( + errs, + field.Required( + field.NewPath("providerSpec", "userDataSecret"), + "expected providerSpec.userDataSecret to be populated", + ), + ) + } + + if providerSpec.CredentialsSecret == nil { + errs = append( + errs, + field.Required( + field.NewPath("providerSpec", "credentialsSecret"), + "expected providerSpec.credentialsSecret to be populated", + ), + ) + } + + if providerSpec.Subnet.ARN == nil && providerSpec.Subnet.ID == nil && providerSpec.Subnet.Filters == nil { + warnings = append( + warnings, + "providerSpec.subnet: No subnet has been provided. Instances may be created in an unexpected subnet and may not join the cluster.", + ) + } + // TODO(alberto): Validate providerSpec.BlockDevices. + // https://github.com/openshift/cluster-api-provider-aws/pull/299#discussion_r433920532 + + switch providerSpec.Tenancy { + case "", aws.DefaultTenancy, aws.DedicatedTenancy, aws.HostTenancy: + // Do nothing, valid values + default: + errs = append( + errs, + field.Invalid( + field.NewPath("providerSpec", "tenancy"), + providerSpec.Tenancy, + fmt.Sprintf("Invalid providerSpec.tenancy, the only allowed options are: %s, %s, %s", aws.DefaultTenancy, aws.DedicatedTenancy, aws.HostTenancy), + ), + ) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + + return true, warnings, nil +} + +func defaultAzure(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting Azure providerSpec") + + var errs []error + var warnings []string + providerSpec := new(azure.AzureMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.VMSize == "" { + providerSpec.VMSize = defaultAzureVMSize + } + + // Vnet and Subnet need to be provided together by the user + if providerSpec.Vnet == "" && providerSpec.Subnet == "" { + providerSpec.Vnet = defaultAzureVnet(config.clusterID) + providerSpec.Subnet = defaultAzureSubnet(config.clusterID) + } + + if providerSpec.Image == (azure.Image{}) { + providerSpec.Image.ResourceID = defaultAzureImageResourceID(config.clusterID) + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.SecretReference{Name: defaultUserDataSecret} + } else if providerSpec.UserDataSecret.Name == "" { + providerSpec.UserDataSecret.Name = defaultUserDataSecret + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.SecretReference{Name: defaultAzureCredentialsSecret, Namespace: defaultSecretNamespace} + } else { + if providerSpec.CredentialsSecret.Namespace == "" { + providerSpec.CredentialsSecret.Namespace = defaultSecretNamespace + } + if providerSpec.CredentialsSecret.Name == "" { + providerSpec.CredentialsSecret.Name = defaultAzureCredentialsSecret + } + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, warnings, nil +} + +func validateAzure(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Validating Azure providerSpec") + + var errs []error + var warnings []string + providerSpec := new(azure.AzureMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.VMSize == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "vmSize"), "vmSize should be set to one of the supported Azure VM sizes")) + } + + if providerSpec.PublicIP && config.dnsDisconnected { + errs = append(errs, field.Forbidden(field.NewPath("providerSpec", "publicIP"), "publicIP is not allowed in Azure disconnected installation")) + } + // Vnet requires Subnet + if providerSpec.Vnet != "" && providerSpec.Subnet == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "subnet"), "must provide a subnet when a virtual network is specified")) + } + + // Subnet requires Vnet + if providerSpec.Subnet != "" && providerSpec.Vnet == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "vnet"), "must provide a virtual network when supplying subnets")) + } + + errs = append(errs, validateAzureImage(providerSpec.Image)...) + + if providerSpec.UserDataSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "userDataSecret must be provided")) + } else if providerSpec.UserDataSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided")) + } + + if providerSpec.CredentialsSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret"), "credentialsSecret must be provided")) + } else { + if providerSpec.CredentialsSecret.Namespace == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "namespace"), "namespace must be provided")) + } + if providerSpec.CredentialsSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "name"), "name must be provided")) + } + } + + if providerSpec.OSDisk.DiskSizeGB <= 0 || providerSpec.OSDisk.DiskSizeGB >= azureMaxDiskSizeGB { + errs = append(errs, field.Invalid(field.NewPath("providerSpec", "osDisk", "diskSizeGB"), providerSpec.OSDisk.DiskSizeGB, "diskSizeGB must be greater than zero and less than 32768")) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + return true, warnings, nil +} + +func validateAzureImage(image azure.Image) []error { + errors := []error{} + if image == (azure.Image{}) { + return append(errors, field.Required(field.NewPath("providerSpec", "image"), "an image reference must be provided")) + } + + if image.ResourceID != "" { + if image != (azure.Image{ResourceID: image.ResourceID}) { + return append(errors, field.Required(field.NewPath("providerSpec", "image", "resourceID"), "resourceID is already specified, other fields such as [Offer, Publisher, SKU, Version] should not be set")) + } + return errors + } + + // Resource ID not provided, so Offer, Publisher, SKU and Version are required + if image.Offer == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "Offer"), "Offer must be provided")) + } + if image.Publisher == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "Publisher"), "Publisher must be provided")) + } + if image.SKU == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "SKU"), "SKU must be provided")) + } + if image.Version == "" { + errors = append(errors, field.Required(field.NewPath("providerSpec", "image", "Version"), "Version must be provided")) + } + + return errors +} + +func defaultGCP(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting GCP providerSpec") + + var errs []error + var warnings []string + providerSpec := new(gcp.GCPMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.MachineType == "" { + providerSpec.MachineType = defaultGCPMachineType + } + + if len(providerSpec.NetworkInterfaces) == 0 { + providerSpec.NetworkInterfaces = append(providerSpec.NetworkInterfaces, &gcp.GCPNetworkInterface{ + Network: defaultGCPNetwork(config.clusterID), + Subnetwork: defaultGCPSubnetwork(config.clusterID), + }) + } + + providerSpec.Disks = defaultGCPDisks(providerSpec.Disks, config.clusterID) + + if len(providerSpec.Tags) == 0 { + providerSpec.Tags = defaultGCPTags(config.clusterID) + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultUserDataSecret} + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.LocalObjectReference{Name: defaultGCPCredentialsSecret} + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, warnings, nil +} + +func defaultGCPDisks(disks []*gcp.GCPDisk, clusterID string) []*gcp.GCPDisk { + if len(disks) == 0 { + return []*gcp.GCPDisk{ + { + AutoDelete: true, + Boot: true, + SizeGb: defaultGCPDiskSizeGb, + Type: defaultGCPDiskType, + Image: defaultGCPDiskImage, + }, + } + } + + for _, disk := range disks { + if disk.Type == "" { + disk.Type = defaultGCPDiskType + } + + if disk.Image == "" { + disk.Image = defaultGCPDiskImage + } + } + + return disks +} + +func validateGCP(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Validating GCP providerSpec") + + var errs []error + var warnings []string + providerSpec := new(gcp.GCPMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.Region == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "region"), "region is required")) + } + + if !strings.HasPrefix(providerSpec.Zone, providerSpec.Region) { + errs = append(errs, field.Invalid(field.NewPath("providerSpec", "zone"), providerSpec.Zone, fmt.Sprintf("zone not in configured region (%s)", providerSpec.Region))) + } + + if providerSpec.MachineType == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "machineType"), "machineType should be set to one of the supported GCP machine types")) + } + + errs = append(errs, validateGCPNetworkInterfaces(providerSpec.NetworkInterfaces, field.NewPath("providerSpec", "networkInterfaces"))...) + errs = append(errs, validateGCPDisks(providerSpec.Disks, field.NewPath("providerSpec", "disks"))...) + + if len(providerSpec.ServiceAccounts) == 0 { + warnings = append(warnings, "providerSpec.serviceAccounts: no service account provided: nodes may be unable to join the cluster") + } else { + errs = append(errs, validateGCPServiceAccounts(providerSpec.ServiceAccounts, field.NewPath("providerSpec", "serviceAccounts"))...) + } + + if providerSpec.UserDataSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "userDataSecret must be provided")) + } else { + if providerSpec.UserDataSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided")) + } + } + + if providerSpec.CredentialsSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret"), "credentialsSecret must be provided")) + } else { + if providerSpec.CredentialsSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "name"), "name must be provided")) + } + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + return true, warnings, nil +} + +func validateGCPNetworkInterfaces(networkInterfaces []*gcp.GCPNetworkInterface, parentPath *field.Path) []error { + if len(networkInterfaces) == 0 { + return []error{field.Required(parentPath, "at least 1 network interface is required")} + } + + var errs []error + for i, ni := range networkInterfaces { + fldPath := parentPath.Index(i) + + if ni.Network == "" { + errs = append(errs, field.Required(fldPath.Child("network"), "network is required")) + } + + if ni.Subnetwork == "" { + errs = append(errs, field.Required(fldPath.Child("subnetwork"), "subnetwork is required")) + } + } + + return errs +} + +func validateGCPDisks(disks []*gcp.GCPDisk, parentPath *field.Path) []error { + if len(disks) == 0 { + return []error{field.Required(parentPath, "at least 1 disk is required")} + } + + var errs []error + for i, disk := range disks { + fldPath := parentPath.Index(i) + + if disk.SizeGb != 0 { + if disk.SizeGb < 16 { + errs = append(errs, field.Invalid(fldPath.Child("sizeGb"), disk.SizeGb, "must be at least 16GB in size")) + } else if disk.SizeGb > 65536 { + errs = append(errs, field.Invalid(fldPath.Child("sizeGb"), disk.SizeGb, "exceeding maximum GCP disk size limit, must be below 65536")) + } + } + + if disk.Type != "" { + diskTypes := sets.NewString("pd-standard", "pd-ssd") + if !diskTypes.Has(disk.Type) { + errs = append(errs, field.NotSupported(fldPath.Child("type"), disk.Type, diskTypes.List())) + } + } + } + + return errs +} + +func validateGCPServiceAccounts(serviceAccounts []gcp.GCPServiceAccount, parentPath *field.Path) []error { + if len(serviceAccounts) != 1 { + return []error{field.Invalid(parentPath, fmt.Sprintf("%d service accounts supplied", len(serviceAccounts)), "exactly 1 service account must be supplied")} + } + + var errs []error + for i, serviceAccount := range serviceAccounts { + fldPath := parentPath.Index(i) + + if serviceAccount.Email == "" { + errs = append(errs, field.Required(fldPath.Child("email"), "email is required")) + } + + if len(serviceAccount.Scopes) == 0 { + errs = append(errs, field.Required(fldPath.Child("scopes"), "at least 1 scope is required")) + } + } + return errs +} + +func defaultVSphere(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Defaulting vSphere providerSpec") + + var errs []error + var warnings []string + providerSpec := new(vsphere.VSphereMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.UserDataSecret == nil { + providerSpec.UserDataSecret = &corev1.LocalObjectReference{Name: defaultUserDataSecret} + } + + if providerSpec.CredentialsSecret == nil { + providerSpec.CredentialsSecret = &corev1.LocalObjectReference{Name: defaultVSphereCredentialsSecret} + } + + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + + m.Spec.ProviderSpec.Value = &runtime.RawExtension{Raw: rawBytes} + return true, warnings, nil +} + +func validateVSphere(m *Machine, config *admissionConfig) (bool, []string, utilerrors.Aggregate) { + klog.V(3).Infof("Validating vSphere providerSpec") + + var errs []error + var warnings []string + providerSpec := new(vsphere.VSphereMachineProviderSpec) + if err := unmarshalInto(m, providerSpec); err != nil { + errs = append(errs, err) + return false, warnings, utilerrors.NewAggregate(errs) + } + + if providerSpec.Template == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "template"), "template must be provided")) + } + + workspaceWarnings, workspaceErrors := validateVSphereWorkspace(providerSpec.Workspace, field.NewPath("providerSpec", "workspace")) + warnings = append(warnings, workspaceWarnings...) + errs = append(errs, workspaceErrors...) + + errs = append(errs, validateVSphereNetwork(providerSpec.Network, field.NewPath("providerSpec", "network"))...) + + if providerSpec.NumCPUs < minVSphereCPU { + warnings = append(warnings, fmt.Sprintf("providerSpec.numCPUs: %d is less than the minimum value (%d): the minimum value will be used instead", providerSpec.NumCPUs, minVSphereCPU)) + } + if providerSpec.MemoryMiB < minVSphereMemoryMiB { + warnings = append(warnings, fmt.Sprintf("providerSpec.memoryMiB: %d is less than the recommended minimum value (%d): nodes may not boot correctly", providerSpec.MemoryMiB, minVSphereMemoryMiB)) + } + if providerSpec.DiskGiB < minVSphereDiskGiB { + warnings = append(warnings, fmt.Sprintf("providerSpec.diskGiB: %d is less than the recommended minimum (%d): nodes may fail to start if disk size is too low", providerSpec.DiskGiB, minVSphereDiskGiB)) + } + + if providerSpec.UserDataSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret"), "userDataSecret must be provided")) + } else { + if providerSpec.UserDataSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "userDataSecret", "name"), "name must be provided")) + } + } + + if providerSpec.CredentialsSecret == nil { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret"), "credentialsSecret must be provided")) + } else { + if providerSpec.CredentialsSecret.Name == "" { + errs = append(errs, field.Required(field.NewPath("providerSpec", "credentialsSecret", "name"), "name must be provided")) + } + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + return true, warnings, nil +} + +func validateVSphereWorkspace(workspace *vsphere.Workspace, parentPath *field.Path) ([]string, []error) { + if workspace == nil { + return []string{}, []error{field.Required(parentPath, "workspace must be provided")} + } + + var errs []error + var warnings []string + if workspace.Server == "" { + errs = append(errs, field.Required(parentPath.Child("server"), "server must be provided")) + } + if workspace.Datacenter == "" { + warnings = append(warnings, fmt.Sprintf("%s: datacenter is unset: if more than one datacenter is present, VMs cannot be created", parentPath.Child("datacenter"))) + } + if workspace.Folder != "" { + expectedPrefix := fmt.Sprintf("/%s/vm/", workspace.Datacenter) + if !strings.HasPrefix(workspace.Folder, expectedPrefix) { + errMsg := fmt.Sprintf("folder must be absolute path: expected prefix %q", expectedPrefix) + errs = append(errs, field.Invalid(parentPath.Child("folder"), workspace.Folder, errMsg)) + } + } + + return warnings, errs +} + +func validateVSphereNetwork(network vsphere.NetworkSpec, parentPath *field.Path) []error { + if len(network.Devices) == 0 { + return []error{field.Required(parentPath.Child("devices"), "at least 1 network device must be provided")} + } + + var errs []error + for i, spec := range network.Devices { + fldPath := parentPath.Child("devices").Index(i) + if spec.NetworkName == "" { + errs = append(errs, field.Required(fldPath.Child("networkName"), "networkName must be provided")) + } + } + + return errs +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machinehealthcheck_types.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machinehealthcheck_types.go index 21ff73e42c3..f06c85a78c3 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machinehealthcheck_types.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machinehealthcheck_types.go @@ -54,20 +54,24 @@ type MachineHealthCheckSpec struct { // Any farther remediation is only allowed if at most "MaxUnhealthy" machines selected by // "selector" are not healthy. - // +optional + // Expects either a postive integer value or a percentage value. + // Percentage values must be positive whole numbers and are capped at 100%. + // Both 0 and 0% are valid and will block all remediation. + // +kubebuilder:default:="100%" + // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" + // +kubebuilder:validation:Type:=string MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` - // It would be preferable for nodeStartupTimeout to be a metav1.Duration, but - // there's no good way to validate the format here. Invalid input would cause - // problems with marshaling, so it's better to just make it a string and - // handle the conversion in the controller. - // - // Intentional blank line to keep this out of the OpenAPI description... - // Machines older than this duration without a node will be considered to have // failed and will be remediated. + // Expects an unsigned duration string of decimal numbers each with optional + // fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m". + // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". // +optional - NodeStartupTimeout string `json:"nodeStartupTimeout,omitempty"` + // +kubebuilder:default:="10m" + // +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$" + // +kubebuilder:validation:Type:=string + NodeStartupTimeout metav1.Duration `json:"nodeStartupTimeout,omitempty"` } // UnhealthyCondition represents a Node condition type and value with a timeout @@ -82,15 +86,12 @@ type UnhealthyCondition struct { // +kubebuilder:validation:MinLength=1 Status corev1.ConditionStatus `json:"status"` - // It would be preferable for timeout to be a metav1.Duration, but there's - // no good way to validate the format here. Invalid input would cause - // problems with marshaling, so it's better to just make it a string and - // handle the conversion in the controller. - // - // Intentional blank line to keep this out of the OpenAPI description... - - // +kubebuilder:validation:MinLength=1 - Timeout string `json:"timeout"` + // Expects an unsigned duration string of decimal numbers each with optional + // fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m". + // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + // +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$" + // +kubebuilder:validation:Type:=string + Timeout metav1.Duration `json:"timeout"` } // MachineHealthCheckStatus defines the observed state of MachineHealthCheck diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_types.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_types.go index e0991ea79a0..f2c3c7e184a 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_types.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_types.go @@ -55,7 +55,7 @@ type MachineSetSpec struct { // Replicas is the number of desired replicas. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. - // +optional + // +kubebuilder:default=1 Replicas *int32 `json:"replicas,omitempty"` // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. @@ -110,12 +110,12 @@ const ( // MachineTemplateSpec describes the data needed to create a Machine from a template type MachineTemplateSpec struct { // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional ObjectMeta `json:"metadata,omitempty"` // Specification of the desired behavior of the machine. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +optional Spec MachineSpec `json:"spec,omitempty"` } diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_webhook.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_webhook.go new file mode 100644 index 00000000000..fba62af71a2 --- /dev/null +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/machineset_webhook.go @@ -0,0 +1,133 @@ +package v1beta1 + +import ( + "context" + "encoding/json" + "net/http" + + osconfigv1 "github.com/openshift/api/config/v1" + utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// machineSetValidatorHandler validates MachineSet API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineSetValidatorHandler struct { + *admissionHandler +} + +// machineSetDefaulterHandler defaults MachineSet API resources. +// implements type Handler interface. +// https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/webhook/admission#Handler +type machineSetDefaulterHandler struct { + *admissionHandler +} + +// NewMachineSetValidator returns a new machineSetValidatorHandler. +func NewMachineSetValidator() (*machineSetValidatorHandler, error) { + infra, err := getInfra() + if err != nil { + return nil, err + } + + return createMachineSetValidator(infra.Status.PlatformStatus.Type, infra.Status.InfrastructureName), nil +} + +func createMachineSetValidator(platform osconfigv1.PlatformType, clusterID string) *machineSetValidatorHandler { + return &machineSetValidatorHandler{ + admissionHandler: &admissionHandler{ + admissionConfig: &admissionConfig{clusterID: clusterID}, + webhookOperations: getMachineValidatorOperation(platform), + }, + } +} + +// NewMachineSetDefaulter returns a new machineSetDefaulterHandler. +func NewMachineSetDefaulter() (*machineSetDefaulterHandler, error) { + infra, err := getInfra() + if err != nil { + return nil, err + } + + return createMachineSetDefaulter(infra.Status.PlatformStatus, infra.Status.InfrastructureName), nil +} + +func createMachineSetDefaulter(platformStatus *osconfigv1.PlatformStatus, clusterID string) *machineSetDefaulterHandler { + return &machineSetDefaulterHandler{ + admissionHandler: &admissionHandler{ + admissionConfig: &admissionConfig{clusterID: clusterID}, + webhookOperations: getMachineDefaulterOperation(platformStatus), + }, + } +} + +// Handle handles HTTP requests for admission webhook servers. +func (h *machineSetValidatorHandler) Handle(ctx context.Context, req admission.Request) admission.Response { + ms := &MachineSet{} + + if err := h.decoder.Decode(req, ms); err != nil { + return admission.Errored(http.StatusBadRequest, err) + } + + klog.V(3).Infof("Validate webhook called for MachineSet: %s", ms.GetName()) + + ok, warnings, errs := h.validateMachineSet(ms) + if !ok { + return responseWithWarnings(admission.Denied(errs.Error()), warnings) + } + + return responseWithWarnings(admission.Allowed("MachineSet valid"), warnings) +} + +// Handle handles HTTP requests for admission webhook servers. +func (h *machineSetDefaulterHandler) Handle(ctx context.Context, req admission.Request) admission.Response { + ms := &MachineSet{} + + if err := h.decoder.Decode(req, ms); err != nil { + return admission.Errored(http.StatusBadRequest, err) + } + + klog.V(3).Infof("Mutate webhook called for MachineSet: %s", ms.GetName()) + + ok, warnings, errs := h.defaultMachineSet(ms) + if !ok { + return responseWithWarnings(admission.Denied(errs.Error()), warnings) + } + + marshaledMachineSet, err := json.Marshal(ms) + if err != nil { + return responseWithWarnings(admission.Errored(http.StatusInternalServerError, err), warnings) + } + return responseWithWarnings(admission.PatchResponseFromRaw(req.Object.Raw, marshaledMachineSet), warnings) +} + +func (h *machineSetValidatorHandler) validateMachineSet(ms *MachineSet) (bool, []string, utilerrors.Aggregate) { + var errs []error + + // Create a Machine from the MachineSet and validate the Machine template + m := &Machine{Spec: ms.Spec.Template.Spec} + ok, warnings, err := h.webhookOperations(m, h.admissionConfig) + if !ok { + errs = append(errs, err.Errors()...) + } + + if len(errs) > 0 { + return false, warnings, utilerrors.NewAggregate(errs) + } + return true, warnings, nil +} + +func (h *machineSetDefaulterHandler) defaultMachineSet(ms *MachineSet) (bool, []string, utilerrors.Aggregate) { + // Create a Machine from the MachineSet and default the Machine template + m := &Machine{Spec: ms.Spec.Template.Spec} + ok, warnings, err := h.webhookOperations(m, h.admissionConfig) + if !ok { + return false, warnings, utilerrors.NewAggregate(err.Errors()) + } + + // Restore the defaulted template + ms.Spec.Template.Spec = m.Spec + return true, warnings, nil +} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go index f13a4dbb27c..7a79e549b3e 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go @@ -16,15 +16,16 @@ * Copyright 2019 Red Hat, Inc. * */ -// Code generated by deepcopy-gen. DO NOT EDIT. + +// Code generated by controller-gen. DO NOT EDIT. package v1beta1 import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - intstr "k8s.io/apimachinery/pkg/util/intstr" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/intstr" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -49,7 +50,6 @@ func (in *LastOperation) DeepCopyInto(out *LastOperation) { *out = new(string) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LastOperation. @@ -69,7 +69,6 @@ func (in *Machine) DeepCopyInto(out *Machine) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. @@ -97,7 +96,6 @@ func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheck. @@ -130,7 +128,6 @@ func (in *MachineHealthCheckList) DeepCopyInto(out *MachineHealthCheckList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckList. @@ -165,7 +162,7 @@ func (in *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { *out = new(intstr.IntOrString) **out = **in } - return + out.NodeStartupTimeout = in.NodeStartupTimeout } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec. @@ -191,7 +188,6 @@ func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus) *out = new(int) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckStatus. @@ -216,7 +212,6 @@ func (in *MachineList) DeepCopyInto(out *MachineList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. @@ -244,7 +239,6 @@ func (in *MachineSet) DeepCopyInto(out *MachineSet) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. @@ -277,7 +271,6 @@ func (in *MachineSetList) DeepCopyInto(out *MachineSetList) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. @@ -308,7 +301,6 @@ func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { } in.Selector.DeepCopyInto(&out.Selector) in.Template.DeepCopyInto(&out.Template) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. @@ -334,7 +326,6 @@ func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { *out = new(string) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. @@ -353,7 +344,7 @@ func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) if in.Taints != nil { in, out := &in.Taints, &out.Taints - *out = make([]v1.Taint, len(*in)) + *out = make([]corev1.Taint, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -364,7 +355,6 @@ func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { *out = new(string) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. @@ -382,7 +372,7 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { *out = *in if in.NodeRef != nil { in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) + *out = new(corev1.ObjectReference) **out = **in } if in.LastUpdated != nil { @@ -406,7 +396,7 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { } if in.Addresses != nil { in, out := &in.Addresses, &out.Addresses - *out = make([]v1.NodeAddress, len(*in)) + *out = make([]corev1.NodeAddress, len(*in)) copy(*out, *in) } if in.LastOperation != nil { @@ -419,7 +409,6 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { *out = new(string) **out = **in } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. @@ -437,7 +426,6 @@ func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { *out = *in in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. @@ -469,12 +457,11 @@ func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { } if in.OwnerReferences != nil { in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]metav1.OwnerReference, len(*in)) + *out = make([]v1.OwnerReference, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. @@ -495,7 +482,6 @@ func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { *out = new(runtime.RawExtension) (*in).DeepCopyInto(*out) } - return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec. @@ -511,7 +497,7 @@ func (in *ProviderSpec) DeepCopy() *ProviderSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition) { *out = *in - return + out.Timeout = in.Timeout } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition. diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go index 609a8391cb6..3b340c70b7b 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go @@ -1,5 +1,7 @@ // Generate deepcopy for apis //go:generate go run ../../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../../hack/boilerplate.go.txt,year=2019 +// Ensure generated code is goimports compliant +//go:generate goimports -w ./v1beta1/zz_generated.deepcopy.go // Package apis contains Kubernetes API groups. package apis diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go index 04fb4543fc3..741becbf38c 100644 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go +++ b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1/register.go @@ -12,7 +12,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/klog" + "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/scheme" "sigs.k8s.io/yaml" ) diff --git a/vendor/github.com/ovirt/go-ovirt/CHANGES.adoc b/vendor/github.com/ovirt/go-ovirt/CHANGES.adoc index 98fc27f8368..469fcdd9ea2 100644 --- a/vendor/github.com/ovirt/go-ovirt/CHANGES.adoc +++ b/vendor/github.com/ovirt/go-ovirt/CHANGES.adoc @@ -2,6 +2,49 @@ This document describes the relevant changes between releases of the SDK. +== 4.4.3 / Jan 11 2021 + +Update to model 4.4.22 and metamodel 1.3.4 + +Bug Fixes: + +* Align connection test code with other SDKs + https://github.com/oVirt/ovirt-engine-sdk-go/pull/217[GitHub-217] + +== 4.4.2 / Oct 13 2020 + +Update to model 4.4.19 and metamodel 1.3.3 + +New features: + +* Add add_cluster.go and add new examples + https://github.com/oVirt/ovirt-engine-sdk-go/pull/196[GitHub-196] + +* Tries the connection token aquired in `Test()` method + https://github.com/oVirt/ovirt-engine-sdk-go/pull/197[GitHub-197] + +* Add CACert attribute to connection + https://github.com/oVirt/ovirt-engine-sdk-go/pull/203[GitHub-203] + +* Add new example set_vm_comment.go for sdk + https://github.com/oVirt/ovirt-engine-sdk-go/pull/212[Github-212] + + +Bug fixes: + +* Fix error handling in case token request errors + https://github.com/oVirt/ovirt-engine-sdk-go/pull/204[GitHub-204] + +* Networks parsing problem + https://bugzilla.redhat.com/1841556[1841556]. + +* Fix show_summary and add check_OCP_support + https://github.com/oVirt/ovirt-engine-sdk-go/pull/211[Github-211] + +* Check if follow link response is not nil + https://github.com/oVirt/ovirt-engine-sdk-go/pull/215[Github-215] + + == 4.4.1 / Jan 31 2020 Bug fixes: diff --git a/vendor/github.com/ovirt/go-ovirt/connection.go b/vendor/github.com/ovirt/go-ovirt/connection.go index 0698322b89e..7c121219522 100644 --- a/vendor/github.com/ovirt/go-ovirt/connection.go +++ b/vendor/github.com/ovirt/go-ovirt/connection.go @@ -67,39 +67,13 @@ func (c *Connection) URL() string { return c.url.String() } -// Test tests the connectivity with the server using the credentials provided in connection. -// If connectivity works correctly and the credentials are valid, it returns a nil error, -// or it will return an error containing the reason as the message. -// If the authentication fails because the oauth token is no longer valid it will -// try to re-authenticate, to renew the token. +// Test tests the connectivity with the server using the system service. func (c *Connection) Test() error { - statusCode, err := c.testToken() - if err != nil || statusCode == http.StatusUnauthorized { - // failed, then clear state. - c.ssoToken = "" - } - _, err = c.authenticate() - return err -} - -// testToken tries a minimal request, using the existing token. Returns the status -// code and an error. -func (c *Connection) testToken() (int, error) { - // a simple http OPTIONS request is the lightest method to test auth. - options, err := http.NewRequest(http.MethodOptions, c.url.String(), nil) - // add auth token to the request - options.Header.Add("Authorization", fmt.Sprintf("Bearer %s", c.ssoToken)) - if err != nil { - // shouldn't fail to construct a request, but report anyway. - return 0, err - } - res, err := c.client.Do(options) - if err != nil { - return 0, err + _, err := c.SystemService().Get().Send() + if err != nil { + return fmt.Errorf("Failed to validate the connection, '%s'", err) } - defer res.Body.Close() - - return res.StatusCode, err + return nil } func (c *Connection) getHref(object Href) (string, bool) { @@ -151,6 +125,10 @@ func (c *Connection) FollowLink(object Href) (interface{}, error) { requestCaller = serviceValue.MethodByName("Get").Call([]reflect.Value{})[0] } callerResponse := requestCaller.MethodByName("Send").Call([]reflect.Value{})[0] + if callerResponse.IsNil() { + return nil, errors.New("Could not get response") + } + // Get the method index, which is not the Must version methodIndex := 0 callerResponseType := callerResponse.Type() diff --git a/vendor/github.com/ovirt/go-ovirt/readers.go b/vendor/github.com/ovirt/go-ovirt/readers.go index 7e7b9f01c84..be699a5550f 100644 --- a/vendor/github.com/ovirt/go-ovirt/readers.go +++ b/vendor/github.com/ovirt/go-ovirt/readers.go @@ -21,136 +21,8 @@ import ( "strconv" ) -func XMLVmSummaryReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmSummary, error) { - builder := NewVmSummaryBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "vm_summary" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "active": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Active(v) - case "migrating": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Migrating(v) - case "total": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Total(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLVmSummaryReadMany(reader *XMLReader, start *xml.StartElement) (*VmSummarySlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result VmSummarySlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "vm_summary": - one, err := XMLVmSummaryReadOne(reader, &t, "vm_summary") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLNetworkFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkFilter, error) { - builder := NewNetworkFilterBuilder() +func XMLAffinityGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AffinityGroup, error) { + builder := NewAffinityGroupBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -162,7 +34,7 @@ func XMLNetworkFilterReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "network_filter" + expectedTag = "affinity_group" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -192,6 +64,12 @@ func XMLNetworkFilterReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -204,18 +82,66 @@ func XMLNetworkFilterReadOne(reader *XMLReader, start *xml.StartElement, expecte return nil, err } builder.Description(v) + case "enforcing": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Enforcing(v) + case "host_labels": + v, err := XMLAffinityLabelReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.HostLabels(v) + case "hosts": + v, err := XMLHostReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Hosts(v) + case "hosts_rule": + v, err := XMLAffinityRuleReadOne(reader, &t, "hosts_rule") + if err != nil { + return nil, err + } + builder.HostsRule(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + case "positive": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Version(v) + builder.Positive(v) + case "priority": + v, err := reader.ReadFloat64(&t) + if err != nil { + return nil, err + } + builder.Priority(v) + case "vm_labels": + v, err := XMLAffinityLabelReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.VmLabels(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) + case "vms_rule": + v, err := XMLAffinityRuleReadOne(reader, &t, "vms_rule") + if err != nil { + return nil, err + } + builder.VmsRule(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -246,12 +172,32 @@ func XMLNetworkFilterReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { + case "hostlabels": + if one.hostLabels == nil { + one.hostLabels = new(AffinityLabelSlice) + } + one.hostLabels.href = link.href + case "hosts": + if one.hosts == nil { + one.hosts = new(HostSlice) + } + one.hosts.href = link.href + case "vmlabels": + if one.vmLabels == nil { + one.vmLabels = new(AffinityLabelSlice) + } + one.vmLabels.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLNetworkFilterReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkFilterSlice, error) { +func XMLAffinityGroupReadMany(reader *XMLReader, start *xml.StartElement) (*AffinityGroupSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -262,7 +208,7 @@ func XMLNetworkFilterReadMany(reader *XMLReader, start *xml.StartElement) (*Netw } start = st } - var result NetworkFilterSlice + var result AffinityGroupSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -276,8 +222,8 @@ func XMLNetworkFilterReadMany(reader *XMLReader, start *xml.StartElement) (*Netw switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "network_filter": - one, err := XMLNetworkFilterReadOne(reader, &t, "network_filter") + case "affinity_group": + one, err := XMLAffinityGroupReadOne(reader, &t, "affinity_group") if err != nil { return nil, err } @@ -294,8 +240,8 @@ func XMLNetworkFilterReadMany(reader *XMLReader, start *xml.StartElement) (*Netw return &result, nil } -func XMLQuotaClusterLimitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*QuotaClusterLimit, error) { - builder := NewQuotaClusterLimitBuilder() +func XMLAffinityLabelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AffinityLabel, error) { + builder := NewAffinityLabelBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -307,7 +253,7 @@ func XMLQuotaClusterLimitReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "quota_cluster_limit" + expectedTag = "affinity_label" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -337,12 +283,6 @@ func XMLQuotaClusterLimitReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -355,42 +295,36 @@ func XMLQuotaClusterLimitReadOne(reader *XMLReader, start *xml.StartElement, exp return nil, err } builder.Description(v) - case "memory_limit": - v, err := reader.ReadFloat64(&t) + case "has_implicit_affinity_group": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.MemoryLimit(v) - case "memory_usage": - v, err := reader.ReadFloat64(&t) + builder.HasImplicitAffinityGroup(v) + case "hosts": + v, err := XMLHostReadMany(reader, &t) if err != nil { return nil, err } - builder.MemoryUsage(v) + builder.Hosts(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "vcpu_limit": - v, err := reader.ReadInt64(&t) + case "read_only": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.VcpuLimit(v) - case "vcpu_usage": - v, err := reader.ReadInt64(&t) + builder.ReadOnly(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) if err != nil { return nil, err } - builder.VcpuUsage(v) + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -421,12 +355,22 @@ func XMLQuotaClusterLimitReadOne(reader *XMLReader, start *xml.StartElement, exp } for _, link := range links { switch *link.rel { + case "hosts": + if one.hosts == nil { + one.hosts = new(HostSlice) + } + one.hosts.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLQuotaClusterLimitReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaClusterLimitSlice, error) { +func XMLAffinityLabelReadMany(reader *XMLReader, start *xml.StartElement) (*AffinityLabelSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -437,7 +381,7 @@ func XMLQuotaClusterLimitReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result QuotaClusterLimitSlice + var result AffinityLabelSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -451,8 +395,8 @@ func XMLQuotaClusterLimitReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "quota_cluster_limit": - one, err := XMLQuotaClusterLimitReadOne(reader, &t, "quota_cluster_limit") + case "affinity_label": + one, err := XMLAffinityLabelReadOne(reader, &t, "affinity_label") if err != nil { return nil, err } @@ -469,8 +413,8 @@ func XMLQuotaClusterLimitReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLBiosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Bios, error) { - builder := NewBiosBuilder() +func XMLAffinityRuleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AffinityRule, error) { + builder := NewAffinityRuleBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -482,7 +426,7 @@ func XMLBiosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "bios" + expectedTag = "affinity_rule" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -501,19 +445,24 @@ func XMLBiosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "boot_menu": - v, err := XMLBootMenuReadOne(reader, &t, "boot_menu") + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.BootMenu(v) - case "type": - vp, err := XMLBiosTypeReadOne(reader, &t) - v := *vp + builder.Enabled(v) + case "enforcing": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Type(v) + builder.Enforcing(v) + case "positive": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Positive(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -549,7 +498,7 @@ func XMLBiosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return one, nil } -func XMLBiosReadMany(reader *XMLReader, start *xml.StartElement) (*BiosSlice, error) { +func XMLAffinityRuleReadMany(reader *XMLReader, start *xml.StartElement) (*AffinityRuleSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -560,7 +509,7 @@ func XMLBiosReadMany(reader *XMLReader, start *xml.StartElement) (*BiosSlice, er } start = st } - var result BiosSlice + var result AffinityRuleSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -574,8 +523,8 @@ func XMLBiosReadMany(reader *XMLReader, start *xml.StartElement) (*BiosSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bios": - one, err := XMLBiosReadOne(reader, &t, "bios") + case "affinity_rule": + one, err := XMLAffinityRuleReadOne(reader, &t, "affinity_rule") if err != nil { return nil, err } @@ -592,8 +541,8 @@ func XMLBiosReadMany(reader *XMLReader, start *xml.StartElement) (*BiosSlice, er return &result, nil } -func XMLQuotaReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Quota, error) { - builder := NewQuotaBuilder() +func XMLAgentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Agent, error) { + builder := NewAgentBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -605,7 +554,7 @@ func XMLQuotaReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "quota" + expectedTag = "agent" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -635,90 +584,84 @@ func XMLQuotaReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster_hard_limit_pct": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ClusterHardLimitPct(v) - case "cluster_soft_limit_pct": - v, err := reader.ReadInt64(&t) + case "address": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ClusterSoftLimitPct(v) + builder.Address(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") + case "concurrent": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.DataCenter(v) + builder.Concurrent(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "disks": - v, err := XMLDiskReadMany(reader, &t) + case "encrypt_options": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Disks(v) - case "name": - v, err := reader.ReadString(&t) + builder.EncryptOptions(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Name(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) + builder.Host(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Permissions(v) - case "quota_cluster_limits": - v, err := XMLQuotaClusterLimitReadMany(reader, &t) + builder.Name(v) + case "options": + v, err := XMLOptionReadMany(reader, &t) if err != nil { return nil, err } - builder.QuotaClusterLimits(v) - case "quota_storage_limits": - v, err := XMLQuotaStorageLimitReadMany(reader, &t) + builder.Options(v) + case "order": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.QuotaStorageLimits(v) - case "storage_hard_limit_pct": - v, err := reader.ReadInt64(&t) + builder.Order(v) + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.StorageHardLimitPct(v) - case "storage_soft_limit_pct": + builder.Password(v) + case "port": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.StorageSoftLimitPct(v) - case "users": - v, err := XMLUserReadMany(reader, &t) + builder.Port(v) + case "type": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Users(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.Type(v) + case "username": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Vms(v) + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -749,27 +692,12 @@ func XMLQuotaReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str } for _, link := range links { switch *link.rel { - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "quotaclusterlimits": - if one.quotaClusterLimits == nil { - one.quotaClusterLimits = new(QuotaClusterLimitSlice) - } - one.quotaClusterLimits.href = link.href - case "quotastoragelimits": - if one.quotaStorageLimits == nil { - one.quotaStorageLimits = new(QuotaStorageLimitSlice) - } - one.quotaStorageLimits.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLQuotaReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaSlice, error) { +func XMLAgentReadMany(reader *XMLReader, start *xml.StartElement) (*AgentSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -780,7 +708,7 @@ func XMLQuotaReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaSlice, } start = st } - var result QuotaSlice + var result AgentSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -794,8 +722,8 @@ func XMLQuotaReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "quota": - one, err := XMLQuotaReadOne(reader, &t, "quota") + case "agent": + one, err := XMLAgentReadOne(reader, &t, "agent") if err != nil { return nil, err } @@ -812,8 +740,8 @@ func XMLQuotaReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaSlice, return &result, nil } -func XMLMigrationOptionsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MigrationOptions, error) { - builder := NewMigrationOptionsBuilder() +func XMLAgentConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AgentConfiguration, error) { + builder := NewAgentConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -825,7 +753,7 @@ func XMLMigrationOptionsReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "migration" + expectedTag = "agent_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -844,39 +772,43 @@ func XMLMigrationOptionsReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "auto_converge": - vp, err := XMLInheritableBooleanReadOne(reader, &t) + case "address": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Address(v) + case "broker_type": + vp, err := XMLMessageBrokerTypeReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.AutoConverge(v) - case "bandwidth": - v, err := XMLMigrationBandwidthReadOne(reader, &t, "bandwidth") + builder.BrokerType(v) + case "network_mappings": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Bandwidth(v) - case "compressed": - vp, err := XMLInheritableBooleanReadOne(reader, &t) - v := *vp + builder.NetworkMappings(v) + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Compressed(v) - case "encrypted": - vp, err := XMLInheritableBooleanReadOne(reader, &t) - v := *vp + builder.Password(v) + case "port": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Encrypted(v) - case "policy": - v, err := XMLMigrationPolicyReadOne(reader, &t, "policy") + builder.Port(v) + case "username": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Policy(v) + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -912,7 +844,7 @@ func XMLMigrationOptionsReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLMigrationOptionsReadMany(reader *XMLReader, start *xml.StartElement) (*MigrationOptionsSlice, error) { +func XMLAgentConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*AgentConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -923,7 +855,7 @@ func XMLMigrationOptionsReadMany(reader *XMLReader, start *xml.StartElement) (*M } start = st } - var result MigrationOptionsSlice + var result AgentConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -937,8 +869,8 @@ func XMLMigrationOptionsReadMany(reader *XMLReader, start *xml.StartElement) (*M switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "migration": - one, err := XMLMigrationOptionsReadOne(reader, &t, "migration") + case "agent_configuration": + one, err := XMLAgentConfigurationReadOne(reader, &t, "agent_configuration") if err != nil { return nil, err } @@ -955,8 +887,8 @@ func XMLMigrationOptionsReadMany(reader *XMLReader, start *xml.StartElement) (*M return &result, nil } -func XMLRangeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Range, error) { - builder := NewRangeBuilder() +func XMLApiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Api, error) { + builder := NewApiBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -968,7 +900,7 @@ func XMLRangeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "range" + expectedTag = "api" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -987,18 +919,42 @@ func XMLRangeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := reader.ReadString(&t) + case "authenticated_user": + v, err := XMLUserReadOne(reader, &t, "authenticated_user") if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := reader.ReadString(&t) + builder.AuthenticatedUser(v) + case "effective_user": + v, err := XMLUserReadOne(reader, &t, "effective_user") if err != nil { return nil, err } - builder.To(v) + builder.EffectiveUser(v) + case "product_info": + v, err := XMLProductInfoReadOne(reader, &t, "product_info") + if err != nil { + return nil, err + } + builder.ProductInfo(v) + case "special_objects": + v, err := XMLSpecialObjectsReadOne(reader, &t, "special_objects") + if err != nil { + return nil, err + } + builder.SpecialObjects(v) + case "summary": + v, err := XMLApiSummaryReadOne(reader, &t, "summary") + if err != nil { + return nil, err + } + builder.Summary(v) + case "time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.Time(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -1034,7 +990,7 @@ func XMLRangeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str return one, nil } -func XMLRangeReadMany(reader *XMLReader, start *xml.StartElement) (*RangeSlice, error) { +func XMLApiReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1045,7 +1001,7 @@ func XMLRangeReadMany(reader *XMLReader, start *xml.StartElement) (*RangeSlice, } start = st } - var result RangeSlice + var result ApiSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -1059,8 +1015,8 @@ func XMLRangeReadMany(reader *XMLReader, start *xml.StartElement) (*RangeSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "range": - one, err := XMLRangeReadOne(reader, &t, "range") + case "api": + one, err := XMLApiReadOne(reader, &t, "api") if err != nil { return nil, err } @@ -1077,8 +1033,8 @@ func XMLRangeReadMany(reader *XMLReader, start *xml.StartElement) (*RangeSlice, return &result, nil } -func XMLVirtualNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VirtualNumaNode, error) { - builder := NewVirtualNumaNodeBuilder() +func XMLApiSummaryReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ApiSummary, error) { + builder := NewApiSummaryBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1090,22 +1046,11 @@ func XMLVirtualNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "vm_numa_node" + expectedTag = "api_summary" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -1120,72 +1065,30 @@ func XMLVirtualNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") - if err != nil { - return nil, err - } - builder.Cpu(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "index": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Index(v) - case "memory": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Memory(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "node_distance": - v, err := reader.ReadString(&t) + case "hosts": + v, err := XMLApiSummaryItemReadOne(reader, &t, "hosts") if err != nil { return nil, err } - builder.NodeDistance(v) - case "numa_node_pins": - v, err := XMLNumaNodePinReadMany(reader, &t) + builder.Hosts(v) + case "storage_domains": + v, err := XMLApiSummaryItemReadOne(reader, &t, "storage_domains") if err != nil { return nil, err } - builder.NumaNodePins(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) + builder.StorageDomains(v) + case "users": + v, err := XMLApiSummaryItemReadOne(reader, &t, "users") if err != nil { return nil, err } - builder.Statistics(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.Users(v) + case "vms": + v, err := XMLApiSummaryItemReadOne(reader, &t, "vms") if err != nil { return nil, err } - builder.Vm(v) + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -1216,17 +1119,12 @@ func XMLVirtualNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expec } for _, link := range links { switch *link.rel { - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLVirtualNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*VirtualNumaNodeSlice, error) { +func XMLApiSummaryReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSummarySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1237,7 +1135,7 @@ func XMLVirtualNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*Vi } start = st } - var result VirtualNumaNodeSlice + var result ApiSummarySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -1251,8 +1149,8 @@ func XMLVirtualNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*Vi switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vm_numa_node": - one, err := XMLVirtualNumaNodeReadOne(reader, &t, "vm_numa_node") + case "api_summary": + one, err := XMLApiSummaryReadOne(reader, &t, "api_summary") if err != nil { return nil, err } @@ -1269,8 +1167,8 @@ func XMLVirtualNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*Vi return &result, nil } -func XMLUserReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*User, error) { - builder := NewUserBuilder() +func XMLApiSummaryItemReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ApiSummaryItem, error) { + builder := NewApiSummaryItemBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1282,22 +1180,11 @@ func XMLUserReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "user" + expectedTag = "api_summary_item" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -1312,120 +1199,18 @@ func XMLUserReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "department": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Department(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "domain": - v, err := XMLDomainReadOne(reader, &t, "domain") - if err != nil { - return nil, err - } - builder.Domain(v) - case "domain_entry_id": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.DomainEntryId(v) - case "email": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Email(v) - case "groups": - v, err := XMLGroupReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Groups(v) - case "last_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.LastName(v) - case "logged_in": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.LoggedIn(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "namespace": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Namespace(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "principal": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Principal(v) - case "roles": - v, err := XMLRoleReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Roles(v) - case "ssh_public_keys": - v, err := XMLSshPublicKeyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.SshPublicKeys(v) - case "tags": - v, err := XMLTagReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Tags(v) - case "user_name": - v, err := reader.ReadString(&t) + case "active": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.UserName(v) - case "user_options": - v, err := XMLPropertyReadMany(reader, &t) + builder.Active(v) + case "total": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.UserOptions(v) + builder.Total(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -1456,37 +1241,12 @@ func XMLUserReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { - case "groups": - if one.groups == nil { - one.groups = new(GroupSlice) - } - one.groups.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "roles": - if one.roles == nil { - one.roles = new(RoleSlice) - } - one.roles.href = link.href - case "sshpublickeys": - if one.sshPublicKeys == nil { - one.sshPublicKeys = new(SshPublicKeySlice) - } - one.sshPublicKeys.href = link.href - case "tags": - if one.tags == nil { - one.tags = new(TagSlice) - } - one.tags.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLUserReadMany(reader *XMLReader, start *xml.StartElement) (*UserSlice, error) { +func XMLApiSummaryItemReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSummaryItemSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1497,7 +1257,7 @@ func XMLUserReadMany(reader *XMLReader, start *xml.StartElement) (*UserSlice, er } start = st } - var result UserSlice + var result ApiSummaryItemSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -1511,8 +1271,8 @@ func XMLUserReadMany(reader *XMLReader, start *xml.StartElement) (*UserSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "user": - one, err := XMLUserReadOne(reader, &t, "user") + case "api_summary_item": + one, err := XMLApiSummaryItemReadOne(reader, &t, "api_summary_item") if err != nil { return nil, err } @@ -1529,8 +1289,8 @@ func XMLUserReadMany(reader *XMLReader, start *xml.StartElement) (*UserSlice, er return &result, nil } -func XMLSshReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ssh, error) { - builder := NewSshBuilder() +func XMLApplicationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Application, error) { + builder := NewApplicationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1542,7 +1302,7 @@ func XMLSshReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "ssh" + expectedTag = "application" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -1572,13 +1332,6 @@ func XMLSshReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authentication_method": - vp, err := XMLSshAuthenticationMethodReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.AuthenticationMethod(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -1591,30 +1344,18 @@ func XMLSshReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return nil, err } builder.Description(v) - case "fingerprint": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Fingerprint(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } - builder.User(v) + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -1650,7 +1391,7 @@ func XMLSshReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLSshReadMany(reader *XMLReader, start *xml.StartElement) (*SshSlice, error) { +func XMLApplicationReadMany(reader *XMLReader, start *xml.StartElement) (*ApplicationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1661,7 +1402,7 @@ func XMLSshReadMany(reader *XMLReader, start *xml.StartElement) (*SshSlice, erro } start = st } - var result SshSlice + var result ApplicationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -1675,8 +1416,8 @@ func XMLSshReadMany(reader *XMLReader, start *xml.StartElement) (*SshSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ssh": - one, err := XMLSshReadOne(reader, &t, "ssh") + case "application": + one, err := XMLApplicationReadOne(reader, &t, "application") if err != nil { return nil, err } @@ -1693,8 +1434,8 @@ func XMLSshReadMany(reader *XMLReader, start *xml.StartElement) (*SshSlice, erro return &result, nil } -func XMLRoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Role, error) { - builder := NewRoleBuilder() +func XMLAuthorizedKeyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AuthorizedKey, error) { + builder := NewAuthorizedKeyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1706,7 +1447,7 @@ func XMLRoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "role" + expectedTag = "authorized_key" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -1736,12 +1477,6 @@ func XMLRoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "administrative": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Administrative(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -1754,24 +1489,18 @@ func XMLRoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return nil, err } builder.Description(v) - case "mutable": - v, err := reader.ReadBool(&t) + case "key": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Mutable(v) + builder.Key(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "permits": - v, err := XMLPermitReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permits(v) case "user": v, err := XMLUserReadOne(reader, &t, "user") if err != nil { @@ -1808,17 +1537,12 @@ func XMLRoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { - case "permits": - if one.permits == nil { - one.permits = new(PermitSlice) - } - one.permits.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLRoleReadMany(reader *XMLReader, start *xml.StartElement) (*RoleSlice, error) { +func XMLAuthorizedKeyReadMany(reader *XMLReader, start *xml.StartElement) (*AuthorizedKeySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1829,7 +1553,7 @@ func XMLRoleReadMany(reader *XMLReader, start *xml.StartElement) (*RoleSlice, er } start = st } - var result RoleSlice + var result AuthorizedKeySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -1843,8 +1567,8 @@ func XMLRoleReadMany(reader *XMLReader, start *xml.StartElement) (*RoleSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "role": - one, err := XMLRoleReadOne(reader, &t, "role") + case "authorized_key": + one, err := XMLAuthorizedKeyReadOne(reader, &t, "authorized_key") if err != nil { return nil, err } @@ -1861,8 +1585,8 @@ func XMLRoleReadMany(reader *XMLReader, start *xml.StartElement) (*RoleSlice, er return &result, nil } -func XMLProductReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Product, error) { - builder := NewProductBuilder() +func XMLBackupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Backup, error) { + builder := NewBackupBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1874,7 +1598,7 @@ func XMLProductReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "product" + expectedTag = "backup" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -1910,18 +1634,61 @@ func XMLProductReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return nil, err } builder.Comment(v) + case "creation_date": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.CreationDate(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) + case "disks": + v, err := XMLDiskReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Disks(v) + case "from_checkpoint_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.FromCheckpointId(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "phase": + vp, err := XMLBackupPhaseReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Phase(v) + case "to_checkpoint_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ToCheckpointId(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -1952,12 +1719,17 @@ func XMLProductReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s } for _, link := range links { switch *link.rel { + case "disks": + if one.disks == nil { + one.disks = new(DiskSlice) + } + one.disks.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLProductReadMany(reader *XMLReader, start *xml.StartElement) (*ProductSlice, error) { +func XMLBackupReadMany(reader *XMLReader, start *xml.StartElement) (*BackupSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -1968,7 +1740,7 @@ func XMLProductReadMany(reader *XMLReader, start *xml.StartElement) (*ProductSli } start = st } - var result ProductSlice + var result BackupSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -1982,8 +1754,8 @@ func XMLProductReadMany(reader *XMLReader, start *xml.StartElement) (*ProductSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "product": - one, err := XMLProductReadOne(reader, &t, "product") + case "backup": + one, err := XMLBackupReadOne(reader, &t, "backup") if err != nil { return nil, err } @@ -2000,8 +1772,8 @@ func XMLProductReadMany(reader *XMLReader, start *xml.StartElement) (*ProductSli return &result, nil } -func XMLOpenStackVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackVolumeType, error) { - builder := NewOpenStackVolumeTypeBuilder() +func XMLBalanceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Balance, error) { + builder := NewBalanceBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2013,7 +1785,7 @@ func XMLOpenStackVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement, e start = st } if expectedTag == "" { - expectedTag = "open_stack_volume_type" + expectedTag = "balance" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -2061,18 +1833,18 @@ func XMLOpenStackVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement, e return nil, err } builder.Name(v) - case "openstack_volume_provider": - v, err := XMLOpenStackVolumeProviderReadOne(reader, &t, "openstack_volume_provider") + case "scheduling_policy": + v, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") if err != nil { return nil, err } - builder.OpenstackVolumeProvider(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) + builder.SchedulingPolicy(v) + case "scheduling_policy_unit": + v, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") if err != nil { return nil, err } - builder.Properties(v) + builder.SchedulingPolicyUnit(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -2108,7 +1880,7 @@ func XMLOpenStackVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement, e return one, nil } -func XMLOpenStackVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackVolumeTypeSlice, error) { +func XMLBalanceReadMany(reader *XMLReader, start *xml.StartElement) (*BalanceSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2119,7 +1891,7 @@ func XMLOpenStackVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result OpenStackVolumeTypeSlice + var result BalanceSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -2133,8 +1905,8 @@ func XMLOpenStackVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "open_stack_volume_type": - one, err := XMLOpenStackVolumeTypeReadOne(reader, &t, "open_stack_volume_type") + case "balance": + one, err := XMLBalanceReadOne(reader, &t, "balance") if err != nil { return nil, err } @@ -2151,8 +1923,8 @@ func XMLOpenStackVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLBootMenuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*BootMenu, error) { - builder := NewBootMenuBuilder() +func XMLBiosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Bios, error) { + builder := NewBiosBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2164,7 +1936,7 @@ func XMLBootMenuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "boot_menu" + expectedTag = "bios" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -2183,12 +1955,19 @@ func XMLBootMenuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "boot_menu": + v, err := XMLBootMenuReadOne(reader, &t, "boot_menu") if err != nil { return nil, err } - builder.Enabled(v) + builder.BootMenu(v) + case "type": + vp, err := XMLBiosTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -2224,7 +2003,7 @@ func XMLBootMenuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLBootMenuReadMany(reader *XMLReader, start *xml.StartElement) (*BootMenuSlice, error) { +func XMLBiosReadMany(reader *XMLReader, start *xml.StartElement) (*BiosSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2235,7 +2014,7 @@ func XMLBootMenuReadMany(reader *XMLReader, start *xml.StartElement) (*BootMenuS } start = st } - var result BootMenuSlice + var result BiosSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -2249,8 +2028,8 @@ func XMLBootMenuReadMany(reader *XMLReader, start *xml.StartElement) (*BootMenuS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "boot_menu": - one, err := XMLBootMenuReadOne(reader, &t, "boot_menu") + case "bios": + one, err := XMLBiosReadOne(reader, &t, "bios") if err != nil { return nil, err } @@ -2267,8 +2046,8 @@ func XMLBootMenuReadMany(reader *XMLReader, start *xml.StartElement) (*BootMenuS return &result, nil } -func XMLVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Version, error) { - builder := NewVersionBuilder() +func XMLBlockStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*BlockStatistic, error) { + builder := NewBlockStatisticBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2280,22 +2059,11 @@ func XMLVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "version" + expectedTag = "block_statistic" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -2310,54 +2078,12 @@ func XMLVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "build": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Build_(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "full_version": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.FullVersion(v) - case "major": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Major(v) - case "minor": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Minor(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "revision": - v, err := reader.ReadInt64(&t) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.Revision(v) + builder.Statistics(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -2393,7 +2119,7 @@ func XMLVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLVersionReadMany(reader *XMLReader, start *xml.StartElement) (*VersionSlice, error) { +func XMLBlockStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*BlockStatisticSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2404,7 +2130,7 @@ func XMLVersionReadMany(reader *XMLReader, start *xml.StartElement) (*VersionSli } start = st } - var result VersionSlice + var result BlockStatisticSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -2418,8 +2144,8 @@ func XMLVersionReadMany(reader *XMLReader, start *xml.StartElement) (*VersionSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "version": - one, err := XMLVersionReadOne(reader, &t, "version") + case "block_statistic": + one, err := XMLBlockStatisticReadOne(reader, &t, "block_statistic") if err != nil { return nil, err } @@ -2436,8 +2162,8 @@ func XMLVersionReadMany(reader *XMLReader, start *xml.StartElement) (*VersionSli return &result, nil } -func XMLWatchdogReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Watchdog, error) { - builder := NewWatchdogBuilder() +func XMLBondingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Bonding, error) { + builder := NewBondingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2449,22 +2175,11 @@ func XMLWatchdogReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "watchdog" + expectedTag = "bonding" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -2479,62 +2194,30 @@ func XMLWatchdogReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "action": - vp, err := XMLWatchdogActionReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Action(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "model": - vp, err := XMLWatchdogModelReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Model(v) - case "name": - v, err := reader.ReadString(&t) + case "active_slave": + v, err := XMLHostNicReadOne(reader, &t, "active_slave") if err != nil { return nil, err } - builder.Name(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") + builder.ActiveSlave(v) + case "ad_partner_mac": + v, err := XMLMacReadOne(reader, &t, "ad_partner_mac") if err != nil { return nil, err } - builder.Template(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.AdPartnerMac(v) + case "options": + v, err := XMLOptionReadMany(reader, &t) if err != nil { return nil, err } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.Options(v) + case "slaves": + v, err := XMLHostNicReadMany(reader, &t) if err != nil { return nil, err } - builder.Vms(v) + builder.Slaves(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -2565,17 +2248,12 @@ func XMLWatchdogReadOne(reader *XMLReader, start *xml.StartElement, expectedTag } for _, link := range links { switch *link.rel { - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) - } - one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLWatchdogReadMany(reader *XMLReader, start *xml.StartElement) (*WatchdogSlice, error) { +func XMLBondingReadMany(reader *XMLReader, start *xml.StartElement) (*BondingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2586,7 +2264,7 @@ func XMLWatchdogReadMany(reader *XMLReader, start *xml.StartElement) (*WatchdogS } start = st } - var result WatchdogSlice + var result BondingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -2600,8 +2278,8 @@ func XMLWatchdogReadMany(reader *XMLReader, start *xml.StartElement) (*WatchdogS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "watchdog": - one, err := XMLWatchdogReadOne(reader, &t, "watchdog") + case "bonding": + one, err := XMLBondingReadOne(reader, &t, "bonding") if err != nil { return nil, err } @@ -2618,8 +2296,8 @@ func XMLWatchdogReadMany(reader *XMLReader, start *xml.StartElement) (*WatchdogS return &result, nil } -func XMLStorageDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageDomain, error) { - builder := NewStorageDomainBuilder() +func XMLBookmarkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Bookmark, error) { + builder := NewBookmarkBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2631,7 +2309,7 @@ func XMLStorageDomainReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "storage_domain" + expectedTag = "bookmark" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -2661,208 +2339,30 @@ func XMLStorageDomainReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "available": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Available(v) - case "backup": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Backup(v) - case "block_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.BlockSize(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "committed": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Committed(v) - case "critical_space_action_blocker": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.CriticalSpaceActionBlocker(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") - if err != nil { - return nil, err - } - builder.DataCenter(v) - case "data_centers": - v, err := XMLDataCenterReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.DataCenters(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "discard_after_delete": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.DiscardAfterDelete(v) - case "disk_profiles": - v, err := XMLDiskProfileReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.DiskProfiles(v) - case "disk_snapshots": - v, err := XMLDiskSnapshotReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.DiskSnapshots(v) - case "disks": - v, err := XMLDiskReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Disks(v) - case "external_status": - vp, err := XMLExternalStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.ExternalStatus(v) - case "files": - v, err := XMLFileReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Files(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "images": - v, err := XMLImageReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Images(v) - case "import": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Import(v) - case "master": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Master(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "status": - vp, err := XMLStorageDomainStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "storage": - v, err := XMLHostStorageReadOne(reader, &t, "storage") - if err != nil { - return nil, err - } - builder.Storage(v) - case "storage_connections": - v, err := XMLStorageConnectionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.StorageConnections(v) - case "storage_format": - vp, err := XMLStorageFormatReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.StorageFormat(v) - case "supports_discard": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.SupportsDiscard(v) - case "supports_discard_zeroes_data": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.SupportsDiscardZeroesData(v) - case "templates": - v, err := XMLTemplateReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Templates(v) - case "type": - vp, err := XMLStorageDomainTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Type(v) - case "used": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Used(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Vms(v) - case "warning_low_space_indicator": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.WarningLowSpaceIndicator(v) - case "wipe_after_delete": - v, err := reader.ReadBool(&t) + case "value": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.WipeAfterDelete(v) + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -2893,62 +2393,12 @@ func XMLStorageDomainReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { - case "datacenters": - if one.dataCenters == nil { - one.dataCenters = new(DataCenterSlice) - } - one.dataCenters.href = link.href - case "diskprofiles": - if one.diskProfiles == nil { - one.diskProfiles = new(DiskProfileSlice) - } - one.diskProfiles.href = link.href - case "disksnapshots": - if one.diskSnapshots == nil { - one.diskSnapshots = new(DiskSnapshotSlice) - } - one.diskSnapshots.href = link.href - case "disks": - if one.disks == nil { - one.disks = new(DiskSlice) - } - one.disks.href = link.href - case "files": - if one.files == nil { - one.files = new(FileSlice) - } - one.files.href = link.href - case "images": - if one.images == nil { - one.images = new(ImageSlice) - } - one.images.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "storageconnections": - if one.storageConnections == nil { - one.storageConnections = new(StorageConnectionSlice) - } - one.storageConnections.href = link.href - case "templates": - if one.templates == nil { - one.templates = new(TemplateSlice) - } - one.templates.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) - } - one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLStorageDomainReadMany(reader *XMLReader, start *xml.StartElement) (*StorageDomainSlice, error) { +func XMLBookmarkReadMany(reader *XMLReader, start *xml.StartElement) (*BookmarkSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -2959,7 +2409,7 @@ func XMLStorageDomainReadMany(reader *XMLReader, start *xml.StartElement) (*Stor } start = st } - var result StorageDomainSlice + var result BookmarkSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -2973,8 +2423,8 @@ func XMLStorageDomainReadMany(reader *XMLReader, start *xml.StartElement) (*Stor switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "storage_domain": - one, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + case "bookmark": + one, err := XMLBookmarkReadOne(reader, &t, "bookmark") if err != nil { return nil, err } @@ -2991,8 +2441,8 @@ func XMLStorageDomainReadMany(reader *XMLReader, start *xml.StartElement) (*Stor return &result, nil } -func XMLKatelloErratumReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*KatelloErratum, error) { - builder := NewKatelloErratumBuilder() +func XMLBootReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Boot, error) { + builder := NewBootBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3004,22 +2454,11 @@ func XMLKatelloErratumReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "katello_erratum" + expectedTag = "boot" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -3034,92 +2473,26 @@ func XMLKatelloErratumReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + case "devices": + v, err := XMLBootDeviceReadMany(reader, &t) if err != nil { return nil, err } - builder.Host(v) - case "issued": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err + builder.Devices(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.Issued(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "packages": - v, err := XMLPackageReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Packages(v) - case "severity": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Severity(v) - case "solution": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Solution(v) - case "summary": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Summary(v) - case "title": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Title(v) - case "type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Type(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } // just has attributes, so must skip manually reader.Skip() @@ -3141,7 +2514,7 @@ func XMLKatelloErratumReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLKatelloErratumReadMany(reader *XMLReader, start *xml.StartElement) (*KatelloErratumSlice, error) { +func XMLBootReadMany(reader *XMLReader, start *xml.StartElement) (*BootSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3152,7 +2525,7 @@ func XMLKatelloErratumReadMany(reader *XMLReader, start *xml.StartElement) (*Kat } start = st } - var result KatelloErratumSlice + var result BootSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3166,8 +2539,8 @@ func XMLKatelloErratumReadMany(reader *XMLReader, start *xml.StartElement) (*Kat switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "katello_erratum": - one, err := XMLKatelloErratumReadOne(reader, &t, "katello_erratum") + case "boot": + one, err := XMLBootReadOne(reader, &t, "boot") if err != nil { return nil, err } @@ -3184,8 +2557,8 @@ func XMLKatelloErratumReadMany(reader *XMLReader, start *xml.StartElement) (*Kat return &result, nil } -func XMLMemoryOverCommitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MemoryOverCommit, error) { - builder := NewMemoryOverCommitBuilder() +func XMLBootMenuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*BootMenu, error) { + builder := NewBootMenuBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3197,7 +2570,7 @@ func XMLMemoryOverCommitReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "memory_over_commit" + expectedTag = "boot_menu" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -3216,12 +2589,12 @@ func XMLMemoryOverCommitReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "percent": - v, err := reader.ReadInt64(&t) + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Percent(v) + builder.Enabled(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -3257,7 +2630,7 @@ func XMLMemoryOverCommitReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLMemoryOverCommitReadMany(reader *XMLReader, start *xml.StartElement) (*MemoryOverCommitSlice, error) { +func XMLBootMenuReadMany(reader *XMLReader, start *xml.StartElement) (*BootMenuSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3268,7 +2641,7 @@ func XMLMemoryOverCommitReadMany(reader *XMLReader, start *xml.StartElement) (*M } start = st } - var result MemoryOverCommitSlice + var result BootMenuSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3282,8 +2655,8 @@ func XMLMemoryOverCommitReadMany(reader *XMLReader, start *xml.StartElement) (*M switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "memory_over_commit": - one, err := XMLMemoryOverCommitReadOne(reader, &t, "memory_over_commit") + case "boot_menu": + one, err := XMLBootMenuReadOne(reader, &t, "boot_menu") if err != nil { return nil, err } @@ -3300,8 +2673,8 @@ func XMLMemoryOverCommitReadMany(reader *XMLReader, start *xml.StartElement) (*M return &result, nil } -func XMLMDevTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MDevType, error) { - builder := NewMDevTypeBuilder() +func XMLBrickProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*BrickProfileDetail, error) { + builder := NewBrickProfileDetailBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3313,7 +2686,7 @@ func XMLMDevTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "m_dev_type" + expectedTag = "brick_profile_detail" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -3332,24 +2705,18 @@ func XMLMDevTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "available_instances": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.AvailableInstances(v) - case "description": - v, err := reader.ReadString(&t) + case "brick": + v, err := XMLGlusterBrickReadOne(reader, &t, "brick") if err != nil { return nil, err } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) + builder.Brick(v) + case "profile_details": + v, err := XMLProfileDetailReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) + builder.ProfileDetails(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -3385,7 +2752,7 @@ func XMLMDevTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLMDevTypeReadMany(reader *XMLReader, start *xml.StartElement) (*MDevTypeSlice, error) { +func XMLBrickProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*BrickProfileDetailSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3396,7 +2763,7 @@ func XMLMDevTypeReadMany(reader *XMLReader, start *xml.StartElement) (*MDevTypeS } start = st } - var result MDevTypeSlice + var result BrickProfileDetailSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3410,8 +2777,8 @@ func XMLMDevTypeReadMany(reader *XMLReader, start *xml.StartElement) (*MDevTypeS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "m_dev_type": - one, err := XMLMDevTypeReadOne(reader, &t, "m_dev_type") + case "brick_profile_detail": + one, err := XMLBrickProfileDetailReadOne(reader, &t, "brick_profile_detail") if err != nil { return nil, err } @@ -3428,8 +2795,8 @@ func XMLMDevTypeReadMany(reader *XMLReader, start *xml.StartElement) (*MDevTypeS return &result, nil } -func XMLTemplateVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*TemplateVersion, error) { - builder := NewTemplateVersionBuilder() +func XMLCdromReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Cdrom, error) { + builder := NewCdromBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3441,11 +2808,22 @@ func XMLTemplateVersionReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "template_version" + expectedTag = "cdrom" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -3460,24 +2838,54 @@ func XMLTemplateVersionReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "base_template": - v, err := XMLTemplateReadOne(reader, &t, "base_template") + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.BaseTemplate(v) - case "version_name": + builder.Comment(v) + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.VersionName(v) - case "version_number": - v, err := reader.ReadInt64(&t) + builder.Description(v) + case "file": + v, err := XMLFileReadOne(reader, &t, "file") if err != nil { return nil, err } - builder.VersionNumber(v) + builder.File(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -3508,12 +2916,17 @@ func XMLTemplateVersionReadOne(reader *XMLReader, start *xml.StartElement, expec } for _, link := range links { switch *link.rel { + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLTemplateVersionReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateVersionSlice, error) { +func XMLCdromReadMany(reader *XMLReader, start *xml.StartElement) (*CdromSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3524,7 +2937,7 @@ func XMLTemplateVersionReadMany(reader *XMLReader, start *xml.StartElement) (*Te } start = st } - var result TemplateVersionSlice + var result CdromSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3538,8 +2951,8 @@ func XMLTemplateVersionReadMany(reader *XMLReader, start *xml.StartElement) (*Te switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "template_version": - one, err := XMLTemplateVersionReadOne(reader, &t, "template_version") + case "cdrom": + one, err := XMLCdromReadOne(reader, &t, "cdrom") if err != nil { return nil, err } @@ -3556,8 +2969,8 @@ func XMLTemplateVersionReadMany(reader *XMLReader, start *xml.StartElement) (*Te return &result, nil } -func XMLStorageConnectionExtensionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageConnectionExtension, error) { - builder := NewStorageConnectionExtensionBuilder() +func XMLCertificateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Certificate, error) { + builder := NewCertificateBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3569,7 +2982,7 @@ func XMLStorageConnectionExtensionReadOne(reader *XMLReader, start *xml.StartEle start = st } if expectedTag == "" { - expectedTag = "storage_connection_extension" + expectedTag = "certificate" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -3605,42 +3018,36 @@ func XMLStorageConnectionExtensionReadOne(reader *XMLReader, start *xml.StartEle return nil, err } builder.Comment(v) - case "description": + case "content": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + builder.Content(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Host(v) + builder.Description(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "target": + case "organization": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Target(v) - case "username": + builder.Organization(v) + case "subject": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Username(v) + builder.Subject(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -3676,7 +3083,7 @@ func XMLStorageConnectionExtensionReadOne(reader *XMLReader, start *xml.StartEle return one, nil } -func XMLStorageConnectionExtensionReadMany(reader *XMLReader, start *xml.StartElement) (*StorageConnectionExtensionSlice, error) { +func XMLCertificateReadMany(reader *XMLReader, start *xml.StartElement) (*CertificateSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3687,7 +3094,7 @@ func XMLStorageConnectionExtensionReadMany(reader *XMLReader, start *xml.StartEl } start = st } - var result StorageConnectionExtensionSlice + var result CertificateSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3701,8 +3108,8 @@ func XMLStorageConnectionExtensionReadMany(reader *XMLReader, start *xml.StartEl switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "storage_connection_extension": - one, err := XMLStorageConnectionExtensionReadOne(reader, &t, "storage_connection_extension") + case "certificate": + one, err := XMLCertificateReadOne(reader, &t, "certificate") if err != nil { return nil, err } @@ -3719,8 +3126,8 @@ func XMLStorageConnectionExtensionReadMany(reader *XMLReader, start *xml.StartEl return &result, nil } -func XMLCoreReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Core, error) { - builder := NewCoreBuilder() +func XMLCheckpointReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Checkpoint, error) { + builder := NewCheckpointBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3732,11 +3139,22 @@ func XMLCoreReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "core" + expectedTag = "checkpoint" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -3751,18 +3169,48 @@ func XMLCoreReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "index": - v, err := reader.ReadInt64(&t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Index(v) - case "socket": - v, err := reader.ReadInt64(&t) + builder.Comment(v) + case "creation_date": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.Socket(v) + builder.CreationDate(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "disks": + v, err := XMLDiskReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Disks(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "parent_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ParentId(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -3793,12 +3241,17 @@ func XMLCoreReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { + case "disks": + if one.disks == nil { + one.disks = new(DiskSlice) + } + one.disks.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLCoreReadMany(reader *XMLReader, start *xml.StartElement) (*CoreSlice, error) { +func XMLCheckpointReadMany(reader *XMLReader, start *xml.StartElement) (*CheckpointSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3809,7 +3262,7 @@ func XMLCoreReadMany(reader *XMLReader, start *xml.StartElement) (*CoreSlice, er } start = st } - var result CoreSlice + var result CheckpointSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3823,8 +3276,8 @@ func XMLCoreReadMany(reader *XMLReader, start *xml.StartElement) (*CoreSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "core": - one, err := XMLCoreReadOne(reader, &t, "core") + case "checkpoint": + one, err := XMLCheckpointReadOne(reader, &t, "checkpoint") if err != nil { return nil, err } @@ -3841,8 +3294,8 @@ func XMLCoreReadMany(reader *XMLReader, start *xml.StartElement) (*CoreSlice, er return &result, nil } -func XMLVcpuPinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VcpuPin, error) { - builder := NewVcpuPinBuilder() +func XMLCloudInitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CloudInit, error) { + builder := NewCloudInitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3854,7 +3307,7 @@ func XMLVcpuPinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "vcpu_pin" + expectedTag = "cloud_init" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -3873,18 +3326,48 @@ func XMLVcpuPinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cpu_set": + case "authorized_keys": + v, err := XMLAuthorizedKeyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.AuthorizedKeys(v) + case "files": + v, err := XMLFileReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Files(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "network_configuration": + v, err := XMLNetworkConfigurationReadOne(reader, &t, "network_configuration") + if err != nil { + return nil, err + } + builder.NetworkConfiguration(v) + case "regenerate_ssh_keys": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.RegenerateSshKeys(v) + case "timezone": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.CpuSet(v) - case "vcpu": - v, err := reader.ReadInt64(&t) + builder.Timezone(v) + case "users": + v, err := XMLUserReadMany(reader, &t) if err != nil { return nil, err } - builder.Vcpu(v) + builder.Users(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -3920,7 +3403,7 @@ func XMLVcpuPinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLVcpuPinReadMany(reader *XMLReader, start *xml.StartElement) (*VcpuPinSlice, error) { +func XMLCloudInitReadMany(reader *XMLReader, start *xml.StartElement) (*CloudInitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3931,7 +3414,7 @@ func XMLVcpuPinReadMany(reader *XMLReader, start *xml.StartElement) (*VcpuPinSli } start = st } - var result VcpuPinSlice + var result CloudInitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -3945,8 +3428,8 @@ func XMLVcpuPinReadMany(reader *XMLReader, start *xml.StartElement) (*VcpuPinSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vcpu_pin": - one, err := XMLVcpuPinReadOne(reader, &t, "vcpu_pin") + case "cloud_init": + one, err := XMLCloudInitReadOne(reader, &t, "cloud_init") if err != nil { return nil, err } @@ -3963,8 +3446,8 @@ func XMLVcpuPinReadMany(reader *XMLReader, start *xml.StartElement) (*VcpuPinSli return &result, nil } -func XMLTemplateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Template, error) { - builder := NewTemplateBuilder() +func XMLClusterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Cluster, error) { + builder := NewClusterBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -3976,7 +3459,7 @@ func XMLTemplateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "template" + expectedTag = "cluster" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -4006,339 +3489,274 @@ func XMLTemplateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bios": - v, err := XMLBiosReadOne(reader, &t, "bios") + case "affinity_groups": + v, err := XMLAffinityGroupReadMany(reader, &t) if err != nil { return nil, err } - builder.Bios(v) - case "cdroms": - v, err := XMLCdromReadMany(reader, &t) + builder.AffinityGroups(v) + case "ballooning_enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Cdroms(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + builder.BallooningEnabled(v) + case "bios_type": + vp, err := XMLBiosTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Cluster(v) + builder.BiosType(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "console": - v, err := XMLConsoleReadOne(reader, &t, "console") - if err != nil { - return nil, err - } - builder.Console(v) case "cpu": v, err := XMLCpuReadOne(reader, &t, "cpu") if err != nil { return nil, err } builder.Cpu(v) - case "cpu_profile": - v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") + case "cpu_profiles": + v, err := XMLCpuProfileReadMany(reader, &t) if err != nil { return nil, err } - builder.CpuProfile(v) - case "cpu_shares": - v, err := reader.ReadInt64(&t) + builder.CpuProfiles(v) + case "custom_scheduling_policy_properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.CpuShares(v) - case "creation_time": - v, err := reader.ReadTime(&t) + builder.CustomSchedulingPolicyProperties(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") if err != nil { return nil, err } - builder.CreationTime(v) - case "custom_compatibility_version": - v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") + builder.DataCenter(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.CustomCompatibilityVersion(v) - case "custom_cpu_model": - v, err := reader.ReadString(&t) + builder.Description(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") if err != nil { return nil, err } - builder.CustomCpuModel(v) - case "custom_emulated_machine": - v, err := reader.ReadString(&t) + builder.Display(v) + case "enabled_features": + v, err := XMLClusterFeatureReadMany(reader, &t) if err != nil { return nil, err } - builder.CustomEmulatedMachine(v) - case "custom_properties": - v, err := XMLCustomPropertyReadMany(reader, &t) + builder.EnabledFeatures(v) + case "error_handling": + v, err := XMLErrorHandlingReadOne(reader, &t, "error_handling") if err != nil { return nil, err } - builder.CustomProperties(v) - case "delete_protected": - v, err := reader.ReadBool(&t) + builder.ErrorHandling(v) + case "external_network_providers": + v, err := XMLExternalProviderReadMany(reader, &t) if err != nil { return nil, err } - builder.DeleteProtected(v) - case "description": - v, err := reader.ReadString(&t) + builder.ExternalNetworkProviders(v) + case "fencing_policy": + v, err := XMLFencingPolicyReadOne(reader, &t, "fencing_policy") if err != nil { return nil, err } - builder.Description(v) - case "disk_attachments": - v, err := XMLDiskAttachmentReadMany(reader, &t) + builder.FencingPolicy(v) + case "firewall_type": + vp, err := XMLFirewallTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.DiskAttachments(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") + builder.FirewallType(v) + case "gluster_hooks": + v, err := XMLGlusterHookReadMany(reader, &t) if err != nil { return nil, err } - builder.Display(v) - case "domain": - v, err := XMLDomainReadOne(reader, &t, "domain") + builder.GlusterHooks(v) + case "gluster_service": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Domain(v) - case "graphics_consoles": - v, err := XMLGraphicsConsoleReadMany(reader, &t) + builder.GlusterService(v) + case "gluster_tuned_profile": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.GraphicsConsoles(v) - case "high_availability": - v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + builder.GlusterTunedProfile(v) + case "gluster_volumes": + v, err := XMLGlusterVolumeReadMany(reader, &t) if err != nil { return nil, err } - builder.HighAvailability(v) - case "initialization": - v, err := XMLInitializationReadOne(reader, &t, "initialization") + builder.GlusterVolumes(v) + case "ha_reservation": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Initialization(v) - case "io": - v, err := XMLIoReadOne(reader, &t, "io") + builder.HaReservation(v) + case "ksm": + v, err := XMLKsmReadOne(reader, &t, "ksm") if err != nil { return nil, err } - builder.Io(v) - case "large_icon": - v, err := XMLIconReadOne(reader, &t, "large_icon") + builder.Ksm(v) + case "log_max_memory_used_threshold": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.LargeIcon(v) - case "lease": - v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") + builder.LogMaxMemoryUsedThreshold(v) + case "log_max_memory_used_threshold_type": + vp, err := XMLLogMaxMemoryUsedThresholdTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Lease(v) - case "memory": - v, err := reader.ReadInt64(&t) + builder.LogMaxMemoryUsedThresholdType(v) + case "mac_pool": + v, err := XMLMacPoolReadOne(reader, &t, "mac_pool") if err != nil { return nil, err } - builder.Memory(v) - case "memory_policy": - v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + builder.MacPool(v) + case "maintenance_reason_required": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.MemoryPolicy(v) - case "migration": - v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") + builder.MaintenanceReasonRequired(v) + case "management_network": + v, err := XMLNetworkReadOne(reader, &t, "management_network") if err != nil { return nil, err } - builder.Migration(v) - case "migration_downtime": - v, err := reader.ReadInt64(&t) + builder.ManagementNetwork(v) + case "memory_policy": + v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") if err != nil { return nil, err } - builder.MigrationDowntime(v) - case "multi_queues_enabled": - v, err := reader.ReadBool(&t) + builder.MemoryPolicy(v) + case "migration": + v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") if err != nil { return nil, err } - builder.MultiQueuesEnabled(v) + builder.Migration(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "nics": - v, err := XMLNicReadMany(reader, &t) + case "network_filters": + v, err := XMLNetworkFilterReadMany(reader, &t) if err != nil { return nil, err } - builder.Nics(v) - case "origin": - v, err := reader.ReadString(&t) + builder.NetworkFilters(v) + case "networks": + v, err := XMLNetworkReadMany(reader, &t) if err != nil { return nil, err } - builder.Origin(v) - case "os": - v, err := XMLOperatingSystemReadOne(reader, &t, "os") + builder.Networks(v) + case "optional_reason": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Os(v) + builder.OptionalReason(v) case "permissions": v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } builder.Permissions(v) - case "placement_policy": - v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") - if err != nil { - return nil, err - } - builder.PlacementPolicy(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") + case "required_rng_sources": + v, err := XMLRngSourceReadMany(reader, &t) if err != nil { return nil, err } - builder.Quota(v) - case "rng_device": - v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + builder.RequiredRngSources(v) + case "scheduling_policy": + v, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") if err != nil { return nil, err } - builder.RngDevice(v) + builder.SchedulingPolicy(v) case "serial_number": v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") if err != nil { return nil, err } builder.SerialNumber(v) - case "small_icon": - v, err := XMLIconReadOne(reader, &t, "small_icon") - if err != nil { - return nil, err - } - builder.SmallIcon(v) - case "soundcard_enabled": - v, err := reader.ReadBool(&t) + case "supported_versions": + v, err := XMLVersionReadMany(reader, &t) if err != nil { return nil, err } - builder.SoundcardEnabled(v) - case "sso": - v, err := XMLSsoReadOne(reader, &t, "sso") + builder.SupportedVersions(v) + case "switch_type": + vp, err := XMLSwitchTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Sso(v) - case "start_paused": + builder.SwitchType(v) + case "threads_as_cores": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.StartPaused(v) - case "stateless": + builder.ThreadsAsCores(v) + case "trusted_service": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Stateless(v) - case "status": - vp, err := XMLTemplateStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") - if err != nil { - return nil, err - } - builder.StorageDomain(v) - case "storage_error_resume_behaviour": - vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.StorageErrorResumeBehaviour(v) - case "tags": - v, err := XMLTagReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Tags(v) - case "time_zone": - v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") - if err != nil { - return nil, err - } - builder.TimeZone(v) + builder.TrustedService(v) case "tunnel_migration": v, err := reader.ReadBool(&t) if err != nil { return nil, err } builder.TunnelMigration(v) - case "type": - vp, err := XMLVmTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Type(v) - case "usb": - v, err := XMLUsbReadOne(reader, &t, "usb") - if err != nil { - return nil, err - } - builder.Usb(v) case "version": - v, err := XMLTemplateVersionReadOne(reader, &t, "version") + v, err := XMLVersionReadOne(reader, &t, "version") if err != nil { return nil, err } builder.Version(v) - case "virtio_scsi": - v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") - if err != nil { - return nil, err - } - builder.VirtioScsi(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + case "virt_service": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Vm(v) - case "watchdogs": - v, err := XMLWatchdogReadMany(reader, &t) + builder.VirtService(v) + case "vnc_encryption": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Watchdogs(v) + builder.VncEncryption(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -4369,47 +3787,57 @@ func XMLTemplateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag } for _, link := range links { switch *link.rel { - case "cdroms": - if one.cdroms == nil { - one.cdroms = new(CdromSlice) + case "affinitygroups": + if one.affinityGroups == nil { + one.affinityGroups = new(AffinityGroupSlice) } - one.cdroms.href = link.href - case "diskattachments": - if one.diskAttachments == nil { - one.diskAttachments = new(DiskAttachmentSlice) + one.affinityGroups.href = link.href + case "cpuprofiles": + if one.cpuProfiles == nil { + one.cpuProfiles = new(CpuProfileSlice) } - one.diskAttachments.href = link.href - case "graphicsconsoles": - if one.graphicsConsoles == nil { - one.graphicsConsoles = new(GraphicsConsoleSlice) + one.cpuProfiles.href = link.href + case "enabledfeatures": + if one.enabledFeatures == nil { + one.enabledFeatures = new(ClusterFeatureSlice) } - one.graphicsConsoles.href = link.href - case "nics": - if one.nics == nil { - one.nics = new(NicSlice) + one.enabledFeatures.href = link.href + case "externalnetworkproviders": + if one.externalNetworkProviders == nil { + one.externalNetworkProviders = new(ExternalProviderSlice) } - one.nics.href = link.href + one.externalNetworkProviders.href = link.href + case "glusterhooks": + if one.glusterHooks == nil { + one.glusterHooks = new(GlusterHookSlice) + } + one.glusterHooks.href = link.href + case "glustervolumes": + if one.glusterVolumes == nil { + one.glusterVolumes = new(GlusterVolumeSlice) + } + one.glusterVolumes.href = link.href + case "networkfilters": + if one.networkFilters == nil { + one.networkFilters = new(NetworkFilterSlice) + } + one.networkFilters.href = link.href + case "networks": + if one.networks == nil { + one.networks = new(NetworkSlice) + } + one.networks.href = link.href case "permissions": if one.permissions == nil { one.permissions = new(PermissionSlice) } one.permissions.href = link.href - case "tags": - if one.tags == nil { - one.tags = new(TagSlice) - } - one.tags.href = link.href - case "watchdogs": - if one.watchdogs == nil { - one.watchdogs = new(WatchdogSlice) - } - one.watchdogs.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLTemplateReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateSlice, error) { +func XMLClusterReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4420,7 +3848,7 @@ func XMLTemplateReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateS } start = st } - var result TemplateSlice + var result ClusterSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -4434,8 +3862,8 @@ func XMLTemplateReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "template": - one, err := XMLTemplateReadOne(reader, &t, "template") + case "cluster": + one, err := XMLClusterReadOne(reader, &t, "cluster") if err != nil { return nil, err } @@ -4452,8 +3880,8 @@ func XMLTemplateReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateS return &result, nil } -func XMLNfsProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NfsProfileDetail, error) { - builder := NewNfsProfileDetailBuilder() +func XMLClusterFeatureReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ClusterFeature, error) { + builder := NewClusterFeatureBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4465,11 +3893,22 @@ func XMLNfsProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "nfs_profile_detail" + expectedTag = "cluster_feature" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -4484,18 +3923,30 @@ func XMLNfsProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "nfs_server_ip": + case "cluster_level": + v, err := XMLClusterLevelReadOne(reader, &t, "cluster_level") + if err != nil { + return nil, err + } + builder.ClusterLevel(v) + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.NfsServerIp(v) - case "profile_details": - v, err := XMLProfileDetailReadMany(reader, &t) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ProfileDetails(v) + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -4531,7 +3982,7 @@ func XMLNfsProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLNfsProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*NfsProfileDetailSlice, error) { +func XMLClusterFeatureReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterFeatureSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4542,7 +3993,7 @@ func XMLNfsProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*N } start = st } - var result NfsProfileDetailSlice + var result ClusterFeatureSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -4556,8 +4007,8 @@ func XMLNfsProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*N switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "nfs_profile_detail": - one, err := XMLNfsProfileDetailReadOne(reader, &t, "nfs_profile_detail") + case "cluster_feature": + one, err := XMLClusterFeatureReadOne(reader, &t, "cluster_feature") if err != nil { return nil, err } @@ -4574,8 +4025,8 @@ func XMLNfsProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*N return &result, nil } -func XMLBrickProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*BrickProfileDetail, error) { - builder := NewBrickProfileDetailBuilder() +func XMLClusterLevelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ClusterLevel, error) { + builder := NewClusterLevelBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4587,11 +4038,22 @@ func XMLBrickProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, ex start = st } if expectedTag == "" { - expectedTag = "brick_profile_detail" + expectedTag = "cluster_level" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -4606,25 +4068,49 @@ func XMLBrickProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, ex switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "brick": - v, err := XMLGlusterBrickReadOne(reader, &t, "brick") + case "cluster_features": + v, err := XMLClusterFeatureReadMany(reader, &t) if err != nil { return nil, err } - builder.Brick(v) - case "profile_details": - v, err := XMLProfileDetailReadMany(reader, &t) + builder.ClusterFeatures(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ProfileDetails(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": + builder.Comment(v) + case "cpu_types": + v, err := XMLCpuTypeReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.CpuTypes(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "permits": + v, err := XMLPermitReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permits(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": href = value case "rel": rel = value @@ -4648,12 +4134,17 @@ func XMLBrickProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, ex } for _, link := range links { switch *link.rel { + case "clusterfeatures": + if one.clusterFeatures == nil { + one.clusterFeatures = new(ClusterFeatureSlice) + } + one.clusterFeatures.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLBrickProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*BrickProfileDetailSlice, error) { +func XMLClusterLevelReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterLevelSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4664,7 +4155,7 @@ func XMLBrickProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var result BrickProfileDetailSlice + var result ClusterLevelSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -4678,8 +4169,8 @@ func XMLBrickProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) ( switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "brick_profile_detail": - one, err := XMLBrickProfileDetailReadOne(reader, &t, "brick_profile_detail") + case "cluster_level": + one, err := XMLClusterLevelReadOne(reader, &t, "cluster_level") if err != nil { return nil, err } @@ -4696,8 +4187,8 @@ func XMLBrickProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) ( return &result, nil } -func XMLFloppyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Floppy, error) { - builder := NewFloppyBuilder() +func XMLConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Configuration, error) { + builder := NewConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4709,22 +4200,11 @@ func XMLFloppyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "floppy" + expectedTag = "configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -4739,54 +4219,19 @@ func XMLFloppyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "file": - v, err := XMLFileReadOne(reader, &t, "file") - if err != nil { - return nil, err - } - builder.File(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "name": + case "data": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.Data(v) + case "type": + vp, err := XMLConfigurationTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Vms(v) + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -4817,17 +4262,12 @@ func XMLFloppyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) - } - one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLFloppyReadMany(reader *XMLReader, start *xml.StartElement) (*FloppySlice, error) { +func XMLConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*ConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4838,7 +4278,7 @@ func XMLFloppyReadMany(reader *XMLReader, start *xml.StartElement) (*FloppySlice } start = st } - var result FloppySlice + var result ConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -4852,8 +4292,8 @@ func XMLFloppyReadMany(reader *XMLReader, start *xml.StartElement) (*FloppySlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "floppy": - one, err := XMLFloppyReadOne(reader, &t, "floppy") + case "configuration": + one, err := XMLConfigurationReadOne(reader, &t, "configuration") if err != nil { return nil, err } @@ -4870,8 +4310,8 @@ func XMLFloppyReadMany(reader *XMLReader, start *xml.StartElement) (*FloppySlice return &result, nil } -func XMLMacPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MacPool, error) { - builder := NewMacPoolBuilder() +func XMLConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Console, error) { + builder := NewConsoleBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4883,22 +4323,11 @@ func XMLMacPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "mac_pool" + expectedTag = "console" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -4913,42 +4342,12 @@ func XMLMacPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "allow_duplicates": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.AllowDuplicates(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "default_pool": + case "enabled": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.DefaultPool(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "ranges": - v, err := XMLRangeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Ranges(v) + builder.Enabled(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -4984,7 +4383,7 @@ func XMLMacPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLMacPoolReadMany(reader *XMLReader, start *xml.StartElement) (*MacPoolSlice, error) { +func XMLConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*ConsoleSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -4995,7 +4394,7 @@ func XMLMacPoolReadMany(reader *XMLReader, start *xml.StartElement) (*MacPoolSli } start = st } - var result MacPoolSlice + var result ConsoleSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5009,8 +4408,8 @@ func XMLMacPoolReadMany(reader *XMLReader, start *xml.StartElement) (*MacPoolSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "mac_pool": - one, err := XMLMacPoolReadOne(reader, &t, "mac_pool") + case "console": + one, err := XMLConsoleReadOne(reader, &t, "console") if err != nil { return nil, err } @@ -5027,8 +4426,8 @@ func XMLMacPoolReadMany(reader *XMLReader, start *xml.StartElement) (*MacPoolSli return &result, nil } -func XMLVmPlacementPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmPlacementPolicy, error) { - builder := NewVmPlacementPolicyBuilder() +func XMLCoreReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Core, error) { + builder := NewCoreBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5040,7 +4439,7 @@ func XMLVmPlacementPolicyReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "vm_placement_policy" + expectedTag = "core" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -5059,19 +4458,18 @@ func XMLVmPlacementPolicyReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity": - vp, err := XMLVmAffinityReadOne(reader, &t) - v := *vp + case "index": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Affinity(v) - case "hosts": - v, err := XMLHostReadMany(reader, &t) + builder.Index(v) + case "socket": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Hosts(v) + builder.Socket(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -5102,17 +4500,12 @@ func XMLVmPlacementPolicyReadOne(reader *XMLReader, start *xml.StartElement, exp } for _, link := range links { switch *link.rel { - case "hosts": - if one.hosts == nil { - one.hosts = new(HostSlice) - } - one.hosts.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLVmPlacementPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*VmPlacementPolicySlice, error) { +func XMLCoreReadMany(reader *XMLReader, start *xml.StartElement) (*CoreSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5123,7 +4516,7 @@ func XMLVmPlacementPolicyReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result VmPlacementPolicySlice + var result CoreSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5137,8 +4530,8 @@ func XMLVmPlacementPolicyReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vm_placement_policy": - one, err := XMLVmPlacementPolicyReadOne(reader, &t, "vm_placement_policy") + case "core": + one, err := XMLCoreReadOne(reader, &t, "core") if err != nil { return nil, err } @@ -5155,8 +4548,8 @@ func XMLVmPlacementPolicyReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLProductInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ProductInfo, error) { - builder := NewProductInfoBuilder() +func XMLCpuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Cpu, error) { + builder := NewCpuBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5168,7 +4561,7 @@ func XMLProductInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "product_info" + expectedTag = "cpu" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -5187,24 +4580,62 @@ func XMLProductInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "architecture": + vp, err := XMLArchitectureReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Architecture(v) + case "cores": + v, err := XMLCoreReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Cores(v) + case "cpu_tune": + v, err := XMLCpuTuneReadOne(reader, &t, "cpu_tune") + if err != nil { + return nil, err + } + builder.CpuTune(v) + case "level": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Level(v) + case "mode": + vp, err := XMLCpuModeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Mode(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "vendor": - v, err := reader.ReadString(&t) + case "speed": + v, err := reader.ReadFloat64(&t) if err != nil { return nil, err } - builder.Vendor(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + builder.Speed(v) + case "topology": + v, err := XMLCpuTopologyReadOne(reader, &t, "topology") if err != nil { return nil, err } - builder.Version(v) + builder.Topology(v) + case "type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -5240,7 +4671,7 @@ func XMLProductInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLProductInfoReadMany(reader *XMLReader, start *xml.StartElement) (*ProductInfoSlice, error) { +func XMLCpuReadMany(reader *XMLReader, start *xml.StartElement) (*CpuSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5251,7 +4682,7 @@ func XMLProductInfoReadMany(reader *XMLReader, start *xml.StartElement) (*Produc } start = st } - var result ProductInfoSlice + var result CpuSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5265,8 +4696,8 @@ func XMLProductInfoReadMany(reader *XMLReader, start *xml.StartElement) (*Produc switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "product_info": - one, err := XMLProductInfoReadOne(reader, &t, "product_info") + case "cpu": + one, err := XMLCpuReadOne(reader, &t, "cpu") if err != nil { return nil, err } @@ -5283,8 +4714,8 @@ func XMLProductInfoReadMany(reader *XMLReader, start *xml.StartElement) (*Produc return &result, nil } -func XMLCpuTuneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuTune, error) { - builder := NewCpuTuneBuilder() +func XMLCpuProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuProfile, error) { + builder := NewCpuProfileBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5296,11 +4727,22 @@ func XMLCpuTuneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "cpu_tune" + expectedTag = "cpu_profile" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -5315,12 +4757,42 @@ func XMLCpuTuneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vcpu_pins": - v, err := XMLVcpuPinReadMany(reader, &t) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") if err != nil { return nil, err } - builder.VcpuPins(v) + builder.Cluster(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "qos": + v, err := XMLQosReadOne(reader, &t, "qos") + if err != nil { + return nil, err + } + builder.Qos(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -5351,12 +4823,17 @@ func XMLCpuTuneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s } for _, link := range links { switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLCpuTuneReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTuneSlice, error) { +func XMLCpuProfileReadMany(reader *XMLReader, start *xml.StartElement) (*CpuProfileSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5367,7 +4844,7 @@ func XMLCpuTuneReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTuneSli } start = st } - var result CpuTuneSlice + var result CpuProfileSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5381,8 +4858,8 @@ func XMLCpuTuneReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTuneSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cpu_tune": - one, err := XMLCpuTuneReadOne(reader, &t, "cpu_tune") + case "cpu_profile": + one, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") if err != nil { return nil, err } @@ -5399,8 +4876,8 @@ func XMLCpuTuneReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTuneSli return &result, nil } -func XMLAffinityRuleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AffinityRule, error) { - builder := NewAffinityRuleBuilder() +func XMLCpuTopologyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuTopology, error) { + builder := NewCpuTopologyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5412,7 +4889,7 @@ func XMLAffinityRuleReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "affinity_rule" + expectedTag = "cpu_topology" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -5431,24 +4908,24 @@ func XMLAffinityRuleReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "cores": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Enabled(v) - case "enforcing": - v, err := reader.ReadBool(&t) + builder.Cores(v) + case "sockets": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Enforcing(v) - case "positive": - v, err := reader.ReadBool(&t) + builder.Sockets(v) + case "threads": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Positive(v) + builder.Threads(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -5484,7 +4961,7 @@ func XMLAffinityRuleReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLAffinityRuleReadMany(reader *XMLReader, start *xml.StartElement) (*AffinityRuleSlice, error) { +func XMLCpuTopologyReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTopologySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5495,7 +4972,7 @@ func XMLAffinityRuleReadMany(reader *XMLReader, start *xml.StartElement) (*Affin } start = st } - var result AffinityRuleSlice + var result CpuTopologySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5509,8 +4986,8 @@ func XMLAffinityRuleReadMany(reader *XMLReader, start *xml.StartElement) (*Affin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity_rule": - one, err := XMLAffinityRuleReadOne(reader, &t, "affinity_rule") + case "cpu_topology": + one, err := XMLCpuTopologyReadOne(reader, &t, "cpu_topology") if err != nil { return nil, err } @@ -5527,8 +5004,8 @@ func XMLAffinityRuleReadMany(reader *XMLReader, start *xml.StartElement) (*Affin return &result, nil } -func XMLHostNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostNic, error) { - builder := NewHostNicBuilder() +func XMLCpuTuneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuTune, error) { + builder := NewCpuTuneBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5540,22 +5017,11 @@ func XMLHostNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "host_nic" + expectedTag = "cpu_tune" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -5570,171 +5036,12 @@ func XMLHostNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ad_aggregator_id": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.AdAggregatorId(v) - case "base_interface": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.BaseInterface(v) - case "bonding": - v, err := XMLBondingReadOne(reader, &t, "bonding") - if err != nil { - return nil, err - } - builder.Bonding(v) - case "boot_protocol": - vp, err := XMLBootProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.BootProtocol(v) - case "bridged": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Bridged(v) - case "check_connectivity": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.CheckConnectivity(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "custom_configuration": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.CustomConfiguration(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "ip": - v, err := XMLIpReadOne(reader, &t, "ip") - if err != nil { - return nil, err - } - builder.Ip(v) - case "ipv6": - v, err := XMLIpReadOne(reader, &t, "ipv6") - if err != nil { - return nil, err - } - builder.Ipv6(v) - case "ipv6_boot_protocol": - vp, err := XMLBootProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Ipv6BootProtocol(v) - case "mac": - v, err := XMLMacReadOne(reader, &t, "mac") - if err != nil { - return nil, err - } - builder.Mac(v) - case "mtu": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Mtu(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "network": - v, err := XMLNetworkReadOne(reader, &t, "network") - if err != nil { - return nil, err - } - builder.Network(v) - case "network_labels": - v, err := XMLNetworkLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NetworkLabels(v) - case "override_configuration": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.OverrideConfiguration(v) - case "physical_function": - v, err := XMLHostNicReadOne(reader, &t, "physical_function") - if err != nil { - return nil, err - } - builder.PhysicalFunction(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Properties(v) - case "qos": - v, err := XMLQosReadOne(reader, &t, "qos") - if err != nil { - return nil, err - } - builder.Qos(v) - case "speed": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Speed(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "status": - vp, err := XMLNicStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "virtual_functions_configuration": - v, err := XMLHostNicVirtualFunctionsConfigurationReadOne(reader, &t, "virtual_functions_configuration") - if err != nil { - return nil, err - } - builder.VirtualFunctionsConfiguration(v) - case "vlan": - v, err := XMLVlanReadOne(reader, &t, "vlan") + case "vcpu_pins": + v, err := XMLVcpuPinReadMany(reader, &t) if err != nil { return nil, err } - builder.Vlan(v) + builder.VcpuPins(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -5765,22 +5072,12 @@ func XMLHostNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s } for _, link := range links { switch *link.rel { - case "networklabels": - if one.networkLabels == nil { - one.networkLabels = new(NetworkLabelSlice) - } - one.networkLabels.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLHostNicReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicSlice, error) { +func XMLCpuTuneReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTuneSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5791,7 +5088,7 @@ func XMLHostNicReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicSli } start = st } - var result HostNicSlice + var result CpuTuneSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5805,8 +5102,8 @@ func XMLHostNicReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host_nic": - one, err := XMLHostNicReadOne(reader, &t, "host_nic") + case "cpu_tune": + one, err := XMLCpuTuneReadOne(reader, &t, "cpu_tune") if err != nil { return nil, err } @@ -5823,8 +5120,8 @@ func XMLHostNicReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicSli return &result, nil } -func XMLCustomPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CustomProperty, error) { - builder := NewCustomPropertyBuilder() +func XMLCpuTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuType, error) { + builder := NewCpuTypeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5836,7 +5133,7 @@ func XMLCustomPropertyReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "custom_property" + expectedTag = "cpu_type" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -5855,24 +5152,25 @@ func XMLCustomPropertyReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "name": - v, err := reader.ReadString(&t) + case "architecture": + vp, err := XMLArchitectureReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Name(v) - case "regexp": - v, err := reader.ReadString(&t) + builder.Architecture(v) + case "level": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Regexp(v) - case "value": + builder.Level(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Value(v) + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -5908,7 +5206,7 @@ func XMLCustomPropertyReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLCustomPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*CustomPropertySlice, error) { +func XMLCpuTypeReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTypeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5919,7 +5217,7 @@ func XMLCustomPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*Cus } start = st } - var result CustomPropertySlice + var result CpuTypeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -5933,8 +5231,8 @@ func XMLCustomPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*Cus switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "custom_property": - one, err := XMLCustomPropertyReadOne(reader, &t, "custom_property") + case "cpu_type": + one, err := XMLCpuTypeReadOne(reader, &t, "cpu_type") if err != nil { return nil, err } @@ -5951,8 +5249,8 @@ func XMLCustomPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*Cus return &result, nil } -func XMLPortMirroringReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*PortMirroring, error) { - builder := NewPortMirroringBuilder() +func XMLCustomPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CustomProperty, error) { + builder := NewCustomPropertyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5964,13 +5262,67 @@ func XMLPortMirroringReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "port_mirroring" + expectedTag = "custom_property" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } var links []Link - reader.Skip() + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "regexp": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Regexp(v) + case "value": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Value(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } + } + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) + } + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } one, err := builder.Build() if err != nil { return nil, err @@ -5982,7 +5334,7 @@ func XMLPortMirroringReadOne(reader *XMLReader, start *xml.StartElement, expecte return one, nil } -func XMLPortMirroringReadMany(reader *XMLReader, start *xml.StartElement) (*PortMirroringSlice, error) { +func XMLCustomPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*CustomPropertySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -5993,7 +5345,7 @@ func XMLPortMirroringReadMany(reader *XMLReader, start *xml.StartElement) (*Port } start = st } - var result PortMirroringSlice + var result CustomPropertySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6007,8 +5359,8 @@ func XMLPortMirroringReadMany(reader *XMLReader, start *xml.StartElement) (*Port switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "port_mirroring": - one, err := XMLPortMirroringReadOne(reader, &t, "port_mirroring") + case "custom_property": + one, err := XMLCustomPropertyReadOne(reader, &t, "custom_property") if err != nil { return nil, err } @@ -6025,8 +5377,8 @@ func XMLPortMirroringReadMany(reader *XMLReader, start *xml.StartElement) (*Port return &result, nil } -func XMLBookmarkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Bookmark, error) { - builder := NewBookmarkBuilder() +func XMLDataCenterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DataCenter, error) { + builder := NewDataCenterBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6038,7 +5390,7 @@ func XMLBookmarkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "bookmark" + expectedTag = "data_center" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -6068,6 +5420,12 @@ func XMLBookmarkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "clusters": + v, err := XMLClusterReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Clusters(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -6080,18 +5438,93 @@ func XMLBookmarkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Description(v) + case "iscsi_bonds": + v, err := XMLIscsiBondReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.IscsiBonds(v) + case "local": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Local(v) + case "mac_pool": + v, err := XMLMacPoolReadOne(reader, &t, "mac_pool") + if err != nil { + return nil, err + } + builder.MacPool(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "value": - v, err := reader.ReadString(&t) + case "networks": + v, err := XMLNetworkReadMany(reader, &t) if err != nil { return nil, err } - builder.Value(v) + builder.Networks(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "qoss": + v, err := XMLQosReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Qoss(v) + case "quota_mode": + vp, err := XMLQuotaModeTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.QuotaMode(v) + case "quotas": + v, err := XMLQuotaReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Quotas(v) + case "status": + vp, err := XMLDataCenterStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "storage_domains": + v, err := XMLStorageDomainReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.StorageDomains(v) + case "storage_format": + vp, err := XMLStorageFormatReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.StorageFormat(v) + case "supported_versions": + v, err := XMLVersionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.SupportedVersions(v) + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") + if err != nil { + return nil, err + } + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -6122,23 +5555,58 @@ func XMLBookmarkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag } for _, link := range links { switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLBookmarkReadMany(reader *XMLReader, start *xml.StartElement) (*BookmarkSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } + case "clusters": + if one.clusters == nil { + one.clusters = new(ClusterSlice) + } + one.clusters.href = link.href + case "iscsibonds": + if one.iscsiBonds == nil { + one.iscsiBonds = new(IscsiBondSlice) + } + one.iscsiBonds.href = link.href + case "networks": + if one.networks == nil { + one.networks = new(NetworkSlice) + } + one.networks.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "qoss": + if one.qoss == nil { + one.qoss = new(QosSlice) + } + one.qoss.href = link.href + case "quotas": + if one.quotas == nil { + one.quotas = new(QuotaSlice) + } + one.quotas.href = link.href + case "storagedomains": + if one.storageDomains == nil { + one.storageDomains = new(StorageDomainSlice) + } + one.storageDomains.href = link.href + } // end of switch + } // end of for-links + return one, nil +} + +func XMLDataCenterReadMany(reader *XMLReader, start *xml.StartElement) (*DataCenterSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } return nil, err } start = st } - var result BookmarkSlice + var result DataCenterSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6152,8 +5620,8 @@ func XMLBookmarkReadMany(reader *XMLReader, start *xml.StartElement) (*BookmarkS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bookmark": - one, err := XMLBookmarkReadOne(reader, &t, "bookmark") + case "data_center": + one, err := XMLDataCenterReadOne(reader, &t, "data_center") if err != nil { return nil, err } @@ -6170,8 +5638,8 @@ func XMLBookmarkReadMany(reader *XMLReader, start *xml.StartElement) (*BookmarkS return &result, nil } -func XMLRegistrationAffinityGroupMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationAffinityGroupMapping, error) { - builder := NewRegistrationAffinityGroupMappingBuilder() +func XMLDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Device, error) { + builder := NewDeviceBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6183,11 +5651,22 @@ func XMLRegistrationAffinityGroupMappingReadOne(reader *XMLReader, start *xml.St start = st } if expectedTag == "" { - expectedTag = "registration_affinity_group_mapping" + expectedTag = "device" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -6202,18 +5681,48 @@ func XMLRegistrationAffinityGroupMappingReadOne(reader *XMLReader, start *xml.St switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLAffinityGroupReadOne(reader, &t, "from") + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLAffinityGroupReadOne(reader, &t, "to") + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.To(v) + builder.Description(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -6244,12 +5753,17 @@ func XMLRegistrationAffinityGroupMappingReadOne(reader *XMLReader, start *xml.St } for _, link := range links { switch *link.rel { + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLRegistrationAffinityGroupMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationAffinityGroupMappingSlice, error) { +func XMLDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*DeviceSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6260,7 +5774,7 @@ func XMLRegistrationAffinityGroupMappingReadMany(reader *XMLReader, start *xml.S } start = st } - var result RegistrationAffinityGroupMappingSlice + var result DeviceSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6274,8 +5788,8 @@ func XMLRegistrationAffinityGroupMappingReadMany(reader *XMLReader, start *xml.S switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_affinity_group_mapping": - one, err := XMLRegistrationAffinityGroupMappingReadOne(reader, &t, "registration_affinity_group_mapping") + case "device": + one, err := XMLDeviceReadOne(reader, &t, "device") if err != nil { return nil, err } @@ -6292,8 +5806,8 @@ func XMLRegistrationAffinityGroupMappingReadMany(reader *XMLReader, start *xml.S return &result, nil } -func XMLProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ProfileDetail, error) { - builder := NewProfileDetailBuilder() +func XMLDiskReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Disk, error) { + builder := NewDiskBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6305,11 +5819,22 @@ func XMLProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "profile_detail" + expectedTag = "disk" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -6324,36 +5849,267 @@ func XMLProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "block_statistics": - v, err := XMLBlockStatisticReadMany(reader, &t) + case "active": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.BlockStatistics(v) - case "duration": + builder.Active(v) + case "actual_size": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Duration(v) - case "fop_statistics": - v, err := XMLFopStatisticReadMany(reader, &t) + builder.ActualSize(v) + case "alias": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.FopStatistics(v) - case "profile_type": + builder.Alias(v) + case "backup": + vp, err := XMLDiskBackupReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Backup(v) + case "backup_mode": + vp, err := XMLDiskBackupModeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.BackupMode(v) + case "bootable": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Bootable(v) + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ProfileType(v) + builder.Comment(v) + case "content_type": + vp, err := XMLDiskContentTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.ContentType(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "disk_profile": + v, err := XMLDiskProfileReadOne(reader, &t, "disk_profile") + if err != nil { + return nil, err + } + builder.DiskProfile(v) + case "disk_snapshots": + v, err := XMLDiskSnapshotReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DiskSnapshots(v) + case "external_disk": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ExternalDisk(v) + case "format": + vp, err := XMLDiskFormatReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Format(v) + case "image_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ImageId(v) + case "initial_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.InitialSize(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "interface": + vp, err := XMLDiskInterfaceReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Interface(v) + case "logical_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.LogicalName(v) + case "lun_storage": + v, err := XMLHostStorageReadOne(reader, &t, "lun_storage") + if err != nil { + return nil, err + } + builder.LunStorage(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "openstack_volume_type": + v, err := XMLOpenStackVolumeTypeReadOne(reader, &t, "openstack_volume_type") + if err != nil { + return nil, err + } + builder.OpenstackVolumeType(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "propagate_errors": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.PropagateErrors(v) + case "provisioned_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.ProvisionedSize(v) + case "qcow_version": + vp, err := XMLQcowVersionReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.QcowVersion(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err + } + builder.Quota(v) + case "read_only": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.ReadOnly(v) + case "sgio": + vp, err := XMLScsiGenericIOReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Sgio(v) + case "shareable": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Shareable(v) + case "snapshot": + v, err := XMLSnapshotReadOne(reader, &t, "snapshot") + if err != nil { + return nil, err + } + builder.Snapshot(v) + case "sparse": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Sparse(v) case "statistics": v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } builder.Statistics(v) + case "status": + vp, err := XMLDiskStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "storage_domains": + v, err := XMLStorageDomainReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.StorageDomains(v) + case "storage_type": + vp, err := XMLDiskStorageTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.StorageType(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "total_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.TotalSize(v) + case "uses_scsi_reservation": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.UsesScsiReservation(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) + case "wipe_after_delete": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.WipeAfterDelete(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -6384,12 +6140,37 @@ func XMLProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { + case "disksnapshots": + if one.diskSnapshots == nil { + one.diskSnapshots = new(DiskSnapshotSlice) + } + one.diskSnapshots.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + case "storagedomains": + if one.storageDomains == nil { + one.storageDomains = new(StorageDomainSlice) + } + one.storageDomains.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*ProfileDetailSlice, error) { +func XMLDiskReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6400,7 +6181,7 @@ func XMLProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*Prof } start = st } - var result ProfileDetailSlice + var result DiskSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6414,8 +6195,8 @@ func XMLProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*Prof switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "profile_detail": - one, err := XMLProfileDetailReadOne(reader, &t, "profile_detail") + case "disk": + one, err := XMLDiskReadOne(reader, &t, "disk") if err != nil { return nil, err } @@ -6432,8 +6213,8 @@ func XMLProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*Prof return &result, nil } -func XMLTimeZoneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*TimeZone, error) { - builder := NewTimeZoneBuilder() +func XMLDiskAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DiskAttachment, error) { + builder := NewDiskAttachmentBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6445,11 +6226,22 @@ func XMLTimeZoneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "time_zone" + expectedTag = "disk_attachment" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -6464,18 +6256,85 @@ func XMLTimeZoneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "active": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Active(v) + case "bootable": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Bootable(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "disk": + v, err := XMLDiskReadOne(reader, &t, "disk") + if err != nil { + return nil, err + } + builder.Disk(v) + case "interface": + vp, err := XMLDiskInterfaceReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Interface(v) + case "logical_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.LogicalName(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "utc_offset": - v, err := reader.ReadString(&t) + case "pass_discard": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.UtcOffset(v) + builder.PassDiscard(v) + case "read_only": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.ReadOnly(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "uses_scsi_reservation": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.UsesScsiReservation(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -6511,7 +6370,7 @@ func XMLTimeZoneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLTimeZoneReadMany(reader *XMLReader, start *xml.StartElement) (*TimeZoneSlice, error) { +func XMLDiskAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*DiskAttachmentSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6522,7 +6381,7 @@ func XMLTimeZoneReadMany(reader *XMLReader, start *xml.StartElement) (*TimeZoneS } start = st } - var result TimeZoneSlice + var result DiskAttachmentSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6536,8 +6395,8 @@ func XMLTimeZoneReadMany(reader *XMLReader, start *xml.StartElement) (*TimeZoneS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "time_zone": - one, err := XMLTimeZoneReadOne(reader, &t, "time_zone") + case "disk_attachment": + one, err := XMLDiskAttachmentReadOne(reader, &t, "disk_attachment") if err != nil { return nil, err } @@ -6554,8 +6413,8 @@ func XMLTimeZoneReadMany(reader *XMLReader, start *xml.StartElement) (*TimeZoneS return &result, nil } -func XMLEventReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Event, error) { - builder := NewEventBuilder() +func XMLDiskProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DiskProfile, error) { + builder := NewDiskProfileBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6567,7 +6426,7 @@ func XMLEventReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "event" + expectedTag = "disk_profile" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -6597,127 +6456,42 @@ func XMLEventReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) - case "code": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Code(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "correlation_id": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CorrelationId(v) - case "custom_data": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomData(v) - case "custom_id": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.CustomId(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") - if err != nil { - return nil, err - } - builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "flood_rate": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.FloodRate(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "index": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Index(v) - case "log_on_host": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.LogOnHost(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "origin": - v, err := reader.ReadString(&t) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } - builder.Origin(v) - case "severity": - vp, err := XMLLogSeverityReadOne(reader, &t) - v := *vp + builder.Permissions(v) + case "qos": + v, err := XMLQosReadOne(reader, &t, "qos") if err != nil { return nil, err } - builder.Severity(v) + builder.Qos(v) case "storage_domain": v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } builder.StorageDomain(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.Time(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") - if err != nil { - return nil, err - } - builder.User(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -6748,12 +6522,17 @@ func XMLEventReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str } for _, link := range links { switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLEventReadMany(reader *XMLReader, start *xml.StartElement) (*EventSlice, error) { +func XMLDiskProfileReadMany(reader *XMLReader, start *xml.StartElement) (*DiskProfileSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6764,7 +6543,7 @@ func XMLEventReadMany(reader *XMLReader, start *xml.StartElement) (*EventSlice, } start = st } - var result EventSlice + var result DiskProfileSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6778,8 +6557,8 @@ func XMLEventReadMany(reader *XMLReader, start *xml.StartElement) (*EventSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "event": - one, err := XMLEventReadOne(reader, &t, "event") + case "disk_profile": + one, err := XMLDiskProfileReadOne(reader, &t, "disk_profile") if err != nil { return nil, err } @@ -6796,8 +6575,8 @@ func XMLEventReadMany(reader *XMLReader, start *xml.StartElement) (*EventSlice, return &result, nil } -func XMLFileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*File, error) { - builder := NewFileBuilder() +func XMLDiskSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DiskSnapshot, error) { + builder := NewDiskSnapshotBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6809,7 +6588,7 @@ func XMLFileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "file" + expectedTag = "disk_snapshot" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -6839,42 +6618,279 @@ func XMLFileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "active": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Active(v) + case "actual_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.ActualSize(v) + case "alias": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Alias(v) + case "backup": + vp, err := XMLDiskBackupReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Backup(v) + case "backup_mode": + vp, err := XMLDiskBackupModeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.BackupMode(v) + case "bootable": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Bootable(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "content": - v, err := reader.ReadString(&t) + case "content_type": + vp, err := XMLDiskContentTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Content(v) + builder.ContentType(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) + case "disk": + v, err := XMLDiskReadOne(reader, &t, "disk") + if err != nil { + return nil, err + } + builder.Disk(v) + case "disk_profile": + v, err := XMLDiskProfileReadOne(reader, &t, "disk_profile") + if err != nil { + return nil, err + } + builder.DiskProfile(v) + case "disk_snapshots": + v, err := XMLDiskSnapshotReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DiskSnapshots(v) + case "external_disk": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ExternalDisk(v) + case "format": + vp, err := XMLDiskFormatReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Format(v) + case "image_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ImageId(v) + case "initial_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.InitialSize(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "interface": + vp, err := XMLDiskInterfaceReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Interface(v) + case "logical_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.LogicalName(v) + case "lun_storage": + v, err := XMLHostStorageReadOne(reader, &t, "lun_storage") + if err != nil { + return nil, err + } + builder.LunStorage(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "openstack_volume_type": + v, err := XMLOpenStackVolumeTypeReadOne(reader, &t, "openstack_volume_type") + if err != nil { + return nil, err + } + builder.OpenstackVolumeType(v) + case "parent": + v, err := XMLDiskSnapshotReadOne(reader, &t, "parent") + if err != nil { + return nil, err + } + builder.Parent(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "propagate_errors": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.PropagateErrors(v) + case "provisioned_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.ProvisionedSize(v) + case "qcow_version": + vp, err := XMLQcowVersionReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.QcowVersion(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err + } + builder.Quota(v) + case "read_only": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.ReadOnly(v) + case "sgio": + vp, err := XMLScsiGenericIOReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Sgio(v) + case "shareable": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Shareable(v) + case "snapshot": + v, err := XMLSnapshotReadOne(reader, &t, "snapshot") + if err != nil { + return nil, err + } + builder.Snapshot(v) + case "sparse": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Sparse(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Statistics(v) + case "status": + vp, err := XMLDiskStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) case "storage_domain": v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } builder.StorageDomain(v) - case "type": - v, err := reader.ReadString(&t) + case "storage_domains": + v, err := XMLStorageDomainReadMany(reader, &t) if err != nil { return nil, err } - builder.Type(v) + builder.StorageDomains(v) + case "storage_type": + vp, err := XMLDiskStorageTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.StorageType(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "total_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.TotalSize(v) + case "uses_scsi_reservation": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.UsesScsiReservation(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) + case "wipe_after_delete": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.WipeAfterDelete(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -6905,12 +6921,37 @@ func XMLFileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { + case "disksnapshots": + if one.diskSnapshots == nil { + one.diskSnapshots = new(DiskSnapshotSlice) + } + one.diskSnapshots.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + case "storagedomains": + if one.storageDomains == nil { + one.storageDomains = new(StorageDomainSlice) + } + one.storageDomains.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLFileReadMany(reader *XMLReader, start *xml.StartElement) (*FileSlice, error) { +func XMLDiskSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSnapshotSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6921,7 +6962,7 @@ func XMLFileReadMany(reader *XMLReader, start *xml.StartElement) (*FileSlice, er } start = st } - var result FileSlice + var result DiskSnapshotSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -6935,8 +6976,8 @@ func XMLFileReadMany(reader *XMLReader, start *xml.StartElement) (*FileSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "file": - one, err := XMLFileReadOne(reader, &t, "file") + case "disk_snapshot": + one, err := XMLDiskSnapshotReadOne(reader, &t, "disk_snapshot") if err != nil { return nil, err } @@ -6953,8 +6994,8 @@ func XMLFileReadMany(reader *XMLReader, start *xml.StartElement) (*FileSlice, er return &result, nil } -func XMLLogicalUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*LogicalUnit, error) { - builder := NewLogicalUnitBuilder() +func XMLDisplayReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Display, error) { + builder := NewDisplayBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -6966,22 +7007,11 @@ func XMLLogicalUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "logical_unit" + expectedTag = "display" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -7002,109 +7032,207 @@ func XMLLogicalUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedT return nil, err } builder.Address(v) - case "discard_max_size": - v, err := reader.ReadInt64(&t) + case "allow_override": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.DiscardMaxSize(v) - case "discard_zeroes_data": + builder.AllowOverride(v) + case "certificate": + v, err := XMLCertificateReadOne(reader, &t, "certificate") + if err != nil { + return nil, err + } + builder.Certificate(v) + case "copy_paste_enabled": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.DiscardZeroesData(v) - case "disk_id": + builder.CopyPasteEnabled(v) + case "disconnect_action": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.DiskId(v) - case "lun_mapping": - v, err := reader.ReadInt64(&t) + builder.DisconnectAction(v) + case "file_transfer_enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.LunMapping(v) - case "password": + builder.FileTransferEnabled(v) + case "keyboard_layout": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Password(v) - case "paths": + builder.KeyboardLayout(v) + case "monitors": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Paths(v) + builder.Monitors(v) case "port": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } builder.Port(v) - case "portal": + case "proxy": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Portal(v) - case "product_id": - v, err := reader.ReadString(&t) + builder.Proxy(v) + case "secure_port": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.ProductId(v) - case "serial": - v, err := reader.ReadString(&t) + builder.SecurePort(v) + case "single_qxl_pci": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Serial(v) - case "size": - v, err := reader.ReadInt64(&t) + builder.SingleQxlPci(v) + case "smartcard_enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Size(v) - case "status": - vp, err := XMLLunStatusReadOne(reader, &t) + builder.SmartcardEnabled(v) + case "type": + vp, err := XMLDisplayTypeReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.Status(v) - case "storage_domain_id": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.StorageDomainId(v) - case "target": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err + builder.Type(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.Target(v) - case "username": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.Username(v) - case "vendor_id": - v, err := reader.ReadString(&t) + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLDisplayReadMany(reader *XMLReader, start *xml.StartElement) (*DisplaySlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result DisplaySlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "display": + one, err := XMLDisplayReadOne(reader, &t, "display") if err != nil { return nil, err } - builder.VendorId(v) - case "volume_group_id": - v, err := reader.ReadString(&t) + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLDnsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Dns, error) { + builder := NewDnsBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "dns" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "search_domains": + v, err := XMLHostReadMany(reader, &t) if err != nil { return nil, err } - builder.VolumeGroupId(v) + builder.SearchDomains(v) + case "servers": + v, err := XMLHostReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Servers(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -7140,7 +7268,7 @@ func XMLLogicalUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLLogicalUnitReadMany(reader *XMLReader, start *xml.StartElement) (*LogicalUnitSlice, error) { +func XMLDnsReadMany(reader *XMLReader, start *xml.StartElement) (*DnsSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7151,7 +7279,7 @@ func XMLLogicalUnitReadMany(reader *XMLReader, start *xml.StartElement) (*Logica } start = st } - var result LogicalUnitSlice + var result DnsSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -7165,8 +7293,8 @@ func XMLLogicalUnitReadMany(reader *XMLReader, start *xml.StartElement) (*Logica switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "logical_unit": - one, err := XMLLogicalUnitReadOne(reader, &t, "logical_unit") + case "dns": + one, err := XMLDnsReadOne(reader, &t, "dns") if err != nil { return nil, err } @@ -7183,8 +7311,8 @@ func XMLLogicalUnitReadMany(reader *XMLReader, start *xml.StartElement) (*Logica return &result, nil } -func XMLApplicationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Application, error) { - builder := NewApplicationBuilder() +func XMLDnsResolverConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DnsResolverConfiguration, error) { + builder := NewDnsResolverConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7196,22 +7324,11 @@ func XMLApplicationReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "application" + expectedTag = "dns_resolver_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -7226,30 +7343,12 @@ func XMLApplicationReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + case "name_servers": + v, err := reader.ReadStrings(&t) if err != nil { return nil, err } - builder.Vm(v) + builder.NameServers(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -7285,7 +7384,7 @@ func XMLApplicationReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLApplicationReadMany(reader *XMLReader, start *xml.StartElement) (*ApplicationSlice, error) { +func XMLDnsResolverConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*DnsResolverConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7296,7 +7395,7 @@ func XMLApplicationReadMany(reader *XMLReader, start *xml.StartElement) (*Applic } start = st } - var result ApplicationSlice + var result DnsResolverConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -7310,8 +7409,8 @@ func XMLApplicationReadMany(reader *XMLReader, start *xml.StartElement) (*Applic switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "application": - one, err := XMLApplicationReadOne(reader, &t, "application") + case "dns_resolver_configuration": + one, err := XMLDnsResolverConfigurationReadOne(reader, &t, "dns_resolver_configuration") if err != nil { return nil, err } @@ -7328,8 +7427,8 @@ func XMLApplicationReadMany(reader *XMLReader, start *xml.StartElement) (*Applic return &result, nil } -func XMLImageTransferReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ImageTransfer, error) { - builder := NewImageTransferBuilder() +func XMLDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Domain, error) { + builder := NewDomainBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7341,7 +7440,7 @@ func XMLImageTransferReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "image_transfer" + expectedTag = "domain" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -7371,18 +7470,6 @@ func XMLImageTransferReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Active(v) - case "backup": - v, err := XMLBackupReadOne(reader, &t, "backup") - if err != nil { - return nil, err - } - builder.Backup(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -7395,87 +7482,30 @@ func XMLImageTransferReadOne(reader *XMLReader, start *xml.StartElement, expecte return nil, err } builder.Description(v) - case "direction": - vp, err := XMLImageTransferDirectionReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Direction(v) - case "disk": - v, err := XMLDiskReadOne(reader, &t, "disk") - if err != nil { - return nil, err - } - builder.Disk(v) - case "format": - vp, err := XMLDiskFormatReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Format(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "image": - v, err := XMLImageReadOne(reader, &t, "image") - if err != nil { - return nil, err - } - builder.Image(v) - case "inactivity_timeout": - v, err := reader.ReadInt64(&t) + case "groups": + v, err := XMLGroupReadMany(reader, &t) if err != nil { return nil, err } - builder.InactivityTimeout(v) + builder.Groups(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "phase": - vp, err := XMLImageTransferPhaseReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Phase(v) - case "proxy_url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ProxyUrl(v) - case "signed_ticket": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.SignedTicket(v) - case "snapshot": - v, err := XMLDiskSnapshotReadOne(reader, &t, "snapshot") - if err != nil { - return nil, err - } - builder.Snapshot(v) - case "transfer_url": - v, err := reader.ReadString(&t) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } - builder.TransferUrl(v) - case "transferred": - v, err := reader.ReadInt64(&t) + builder.User(v) + case "users": + v, err := XMLUserReadMany(reader, &t) if err != nil { return nil, err } - builder.Transferred(v) + builder.Users(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -7506,12 +7536,22 @@ func XMLImageTransferReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { + case "groups": + if one.groups == nil { + one.groups = new(GroupSlice) + } + one.groups.href = link.href + case "users": + if one.users == nil { + one.users = new(UserSlice) + } + one.users.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLImageTransferReadMany(reader *XMLReader, start *xml.StartElement) (*ImageTransferSlice, error) { +func XMLDomainReadMany(reader *XMLReader, start *xml.StartElement) (*DomainSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7522,7 +7562,7 @@ func XMLImageTransferReadMany(reader *XMLReader, start *xml.StartElement) (*Imag } start = st } - var result ImageTransferSlice + var result DomainSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -7536,8 +7576,8 @@ func XMLImageTransferReadMany(reader *XMLReader, start *xml.StartElement) (*Imag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "image_transfer": - one, err := XMLImageTransferReadOne(reader, &t, "image_transfer") + case "domain": + one, err := XMLDomainReadOne(reader, &t, "domain") if err != nil { return nil, err } @@ -7554,8 +7594,8 @@ func XMLImageTransferReadMany(reader *XMLReader, start *xml.StartElement) (*Imag return &result, nil } -func XMLIpReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ip, error) { - builder := NewIpBuilder() +func XMLEntityProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*EntityProfileDetail, error) { + builder := NewEntityProfileDetailBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7567,7 +7607,7 @@ func XMLIpReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string start = st } if expectedTag == "" { - expectedTag = "ip" + expectedTag = "entity_profile_detail" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -7586,31 +7626,12 @@ func XMLIpReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "gateway": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Gateway(v) - case "netmask": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Netmask(v) - case "version": - vp, err := XMLIpVersionReadOne(reader, &t) - v := *vp + case "profile_details": + v, err := XMLProfileDetailReadMany(reader, &t) if err != nil { return nil, err } - builder.Version(v) + builder.ProfileDetails(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -7646,7 +7667,7 @@ func XMLIpReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string return one, nil } -func XMLIpReadMany(reader *XMLReader, start *xml.StartElement) (*IpSlice, error) { +func XMLEntityProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*EntityProfileDetailSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7657,7 +7678,7 @@ func XMLIpReadMany(reader *XMLReader, start *xml.StartElement) (*IpSlice, error) } start = st } - var result IpSlice + var result EntityProfileDetailSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -7671,8 +7692,8 @@ func XMLIpReadMany(reader *XMLReader, start *xml.StartElement) (*IpSlice, error) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ip": - one, err := XMLIpReadOne(reader, &t, "ip") + case "entity_profile_detail": + one, err := XMLEntityProfileDetailReadOne(reader, &t, "entity_profile_detail") if err != nil { return nil, err } @@ -7689,8 +7710,8 @@ func XMLIpReadMany(reader *XMLReader, start *xml.StartElement) (*IpSlice, error) return &result, nil } -func XMLVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VnicProfileMapping, error) { - builder := NewVnicProfileMappingBuilder() +func XMLErrorHandlingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ErrorHandling, error) { + builder := NewErrorHandlingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7702,7 +7723,7 @@ func XMLVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, ex start = st } if expectedTag == "" { - expectedTag = "vnic_profile_mapping" + expectedTag = "error_handling" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -7721,24 +7742,13 @@ func XMLVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, ex switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "source_network_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.SourceNetworkName(v) - case "source_network_profile_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.SourceNetworkProfileName(v) - case "target_vnic_profile": - v, err := XMLVnicProfileReadOne(reader, &t, "target_vnic_profile") + case "on_error": + vp, err := XMLMigrateOnErrorReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.TargetVnicProfile(v) + builder.OnError(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -7774,7 +7784,7 @@ func XMLVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, ex return one, nil } -func XMLVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) (*VnicProfileMappingSlice, error) { +func XMLErrorHandlingReadMany(reader *XMLReader, start *xml.StartElement) (*ErrorHandlingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7785,7 +7795,7 @@ func XMLVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var result VnicProfileMappingSlice + var result ErrorHandlingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -7799,8 +7809,8 @@ func XMLVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) ( switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vnic_profile_mapping": - one, err := XMLVnicProfileMappingReadOne(reader, &t, "vnic_profile_mapping") + case "error_handling": + one, err := XMLErrorHandlingReadOne(reader, &t, "error_handling") if err != nil { return nil, err } @@ -7817,8 +7827,8 @@ func XMLVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) ( return &result, nil } -func XMLSystemOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SystemOption, error) { - builder := NewSystemOptionBuilder() +func XMLEventReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Event, error) { + builder := NewEventBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7830,7 +7840,7 @@ func XMLSystemOptionReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "system_option" + expectedTag = "event" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -7860,30 +7870,127 @@ func XMLSystemOptionReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) + case "code": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Code(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) + case "correlation_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CorrelationId(v) + case "custom_data": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomData(v) + case "custom_id": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.CustomId(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") + if err != nil { + return nil, err + } + builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) + case "flood_rate": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.FloodRate(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "index": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Index(v) + case "log_on_host": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.LogOnHost(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "values": - v, err := XMLSystemOptionValueReadMany(reader, &t) + case "origin": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Values(v) + builder.Origin(v) + case "severity": + vp, err := XMLLogSeverityReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Severity(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.Time(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") + if err != nil { + return nil, err + } + builder.User(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -7919,7 +8026,7 @@ func XMLSystemOptionReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLSystemOptionReadMany(reader *XMLReader, start *xml.StartElement) (*SystemOptionSlice, error) { +func XMLEventReadMany(reader *XMLReader, start *xml.StartElement) (*EventSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7930,7 +8037,7 @@ func XMLSystemOptionReadMany(reader *XMLReader, start *xml.StartElement) (*Syste } start = st } - var result SystemOptionSlice + var result EventSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -7944,8 +8051,8 @@ func XMLSystemOptionReadMany(reader *XMLReader, start *xml.StartElement) (*Syste switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "system_option": - one, err := XMLSystemOptionReadOne(reader, &t, "system_option") + case "event": + one, err := XMLEventReadOne(reader, &t, "event") if err != nil { return nil, err } @@ -7962,8 +8069,8 @@ func XMLSystemOptionReadMany(reader *XMLReader, start *xml.StartElement) (*Syste return &result, nil } -func XMLGlusterBrickReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterBrick, error) { - builder := NewGlusterBrickBuilder() +func XMLEventSubscriptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*EventSubscription, error) { + builder := NewEventSubscriptionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -7975,7 +8082,7 @@ func XMLGlusterBrickReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "brick" + expectedTag = "event_subscription" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -8005,12 +8112,12 @@ func XMLGlusterBrickReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "brick_dir": + case "address": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.BrickDir(v) + builder.Address(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -8023,103 +8130,32 @@ func XMLGlusterBrickReadOne(reader *XMLReader, start *xml.StartElement, expected return nil, err } builder.Description(v) - case "device": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Device(v) - case "fs_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.FsName(v) - case "gluster_clients": - v, err := XMLGlusterClientReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.GlusterClients(v) - case "gluster_volume": - v, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") - if err != nil { - return nil, err - } - builder.GlusterVolume(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "memory_pools": - v, err := XMLGlusterMemoryPoolReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.MemoryPools(v) - case "mnt_options": - v, err := reader.ReadString(&t) + case "event": + vp, err := XMLNotifiableEventReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.MntOptions(v) + builder.Event(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "pid": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Pid(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "server_id": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ServerId(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "status": - vp, err := XMLGlusterBrickStatusReadOne(reader, &t) + case "notification_method": + vp, err := XMLNotificationMethodReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.Status(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.NotificationMethod(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } - builder.Vms(v) + builder.User(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -8150,22 +8186,12 @@ func XMLGlusterBrickReadOne(reader *XMLReader, start *xml.StartElement, expected } for _, link := range links { switch *link.rel { - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) - } - one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLGlusterBrickReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterBrickSlice, error) { +func XMLEventSubscriptionReadMany(reader *XMLReader, start *xml.StartElement) (*EventSubscriptionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8176,7 +8202,7 @@ func XMLGlusterBrickReadMany(reader *XMLReader, start *xml.StartElement) (*Glust } start = st } - var result GlusterBrickSlice + var result EventSubscriptionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -8190,8 +8216,8 @@ func XMLGlusterBrickReadMany(reader *XMLReader, start *xml.StartElement) (*Glust switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "brick": - one, err := XMLGlusterBrickReadOne(reader, &t, "brick") + case "event_subscription": + one, err := XMLEventSubscriptionReadOne(reader, &t, "event_subscription") if err != nil { return nil, err } @@ -8208,8 +8234,8 @@ func XMLGlusterBrickReadMany(reader *XMLReader, start *xml.StartElement) (*Glust return &result, nil } -func XMLOpenStackProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackProvider, error) { - builder := NewOpenStackProviderBuilder() +func XMLExternalComputeResourceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalComputeResource, error) { + builder := NewExternalComputeResourceBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8221,7 +8247,7 @@ func XMLOpenStackProviderReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "open_stack_provider" + expectedTag = "external_compute_resource" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -8251,12 +8277,6 @@ func XMLOpenStackProviderReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authentication_url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.AuthenticationUrl(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -8269,48 +8289,36 @@ func XMLOpenStackProviderReadOne(reader *XMLReader, start *xml.StartElement, exp return nil, err } builder.Description(v) - case "name": - v, err := reader.ReadString(&t) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") if err != nil { return nil, err } - builder.Name(v) - case "password": + builder.ExternalHostProvider(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Password(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Properties(v) - case "requires_authentication": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RequiresAuthentication(v) - case "tenant_name": + builder.Name(v) + case "provider": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.TenantName(v) + builder.Provider(v) case "url": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Url(v) - case "username": + case "user": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Username(v) + builder.User(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -8346,7 +8354,7 @@ func XMLOpenStackProviderReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLOpenStackProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackProviderSlice, error) { +func XMLExternalComputeResourceReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalComputeResourceSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8357,7 +8365,7 @@ func XMLOpenStackProviderReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result OpenStackProviderSlice + var result ExternalComputeResourceSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -8371,8 +8379,8 @@ func XMLOpenStackProviderReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "open_stack_provider": - one, err := XMLOpenStackProviderReadOne(reader, &t, "open_stack_provider") + case "external_compute_resource": + one, err := XMLExternalComputeResourceReadOne(reader, &t, "external_compute_resource") if err != nil { return nil, err } @@ -8389,8 +8397,8 @@ func XMLOpenStackProviderReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLRegistrationClusterMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationClusterMapping, error) { - builder := NewRegistrationClusterMappingBuilder() +func XMLExternalDiscoveredHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalDiscoveredHost, error) { + builder := NewExternalDiscoveredHostBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8402,11 +8410,22 @@ func XMLRegistrationClusterMappingReadOne(reader *XMLReader, start *xml.StartEle start = st } if expectedTag == "" { - expectedTag = "registration_cluster_mapping" + expectedTag = "external_discovered_host" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -8421,18 +8440,54 @@ func XMLRegistrationClusterMappingReadOne(reader *XMLReader, start *xml.StartEle switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLClusterReadOne(reader, &t, "from") + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLClusterReadOne(reader, &t, "to") + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.To(v) + builder.Description(v) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + if err != nil { + return nil, err + } + builder.ExternalHostProvider(v) + case "ip": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Ip(v) + case "last_report": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.LastReport(v) + case "mac": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Mac(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "subnet_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.SubnetName(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -8468,7 +8523,7 @@ func XMLRegistrationClusterMappingReadOne(reader *XMLReader, start *xml.StartEle return one, nil } -func XMLRegistrationClusterMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationClusterMappingSlice, error) { +func XMLExternalDiscoveredHostReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalDiscoveredHostSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8479,7 +8534,7 @@ func XMLRegistrationClusterMappingReadMany(reader *XMLReader, start *xml.StartEl } start = st } - var result RegistrationClusterMappingSlice + var result ExternalDiscoveredHostSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -8493,8 +8548,8 @@ func XMLRegistrationClusterMappingReadMany(reader *XMLReader, start *xml.StartEl switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_cluster_mapping": - one, err := XMLRegistrationClusterMappingReadOne(reader, &t, "registration_cluster_mapping") + case "external_discovered_host": + one, err := XMLExternalDiscoveredHostReadOne(reader, &t, "external_discovered_host") if err != nil { return nil, err } @@ -8511,8 +8566,8 @@ func XMLRegistrationClusterMappingReadMany(reader *XMLReader, start *xml.StartEl return &result, nil } -func XMLSystemOptionValueReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SystemOptionValue, error) { - builder := NewSystemOptionValueBuilder() +func XMLExternalHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalHost, error) { + builder := NewExternalHostBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8524,11 +8579,22 @@ func XMLSystemOptionValueReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "system_option_value" + expectedTag = "external_host" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -8543,18 +8609,36 @@ func XMLSystemOptionValueReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "value": + case "address": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Value(v) - case "version": + builder.Address(v) + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Version(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + if err != nil { + return nil, err + } + builder.ExternalHostProvider(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -8590,7 +8674,7 @@ func XMLSystemOptionValueReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLSystemOptionValueReadMany(reader *XMLReader, start *xml.StartElement) (*SystemOptionValueSlice, error) { +func XMLExternalHostReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalHostSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8601,7 +8685,7 @@ func XMLSystemOptionValueReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result SystemOptionValueSlice + var result ExternalHostSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -8615,8 +8699,8 @@ func XMLSystemOptionValueReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "system_option_value": - one, err := XMLSystemOptionValueReadOne(reader, &t, "system_option_value") + case "external_host": + one, err := XMLExternalHostReadOne(reader, &t, "external_host") if err != nil { return nil, err } @@ -8633,8 +8717,8 @@ func XMLSystemOptionValueReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLBondingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Bonding, error) { - builder := NewBondingBuilder() +func XMLExternalHostGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalHostGroup, error) { + builder := NewExternalHostGroupBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8646,11 +8730,22 @@ func XMLBondingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "bonding" + expectedTag = "external_host_group" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -8665,30 +8760,54 @@ func XMLBondingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active_slave": - v, err := XMLHostNicReadOne(reader, &t, "active_slave") + case "architecture_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ActiveSlave(v) - case "ad_partner_mac": - v, err := XMLMacReadOne(reader, &t, "ad_partner_mac") + builder.ArchitectureName(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.AdPartnerMac(v) - case "options": - v, err := XMLOptionReadMany(reader, &t) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Options(v) - case "slaves": - v, err := XMLHostNicReadMany(reader, &t) + builder.Description(v) + case "domain_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Slaves(v) + builder.DomainName(v) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + if err != nil { + return nil, err + } + builder.ExternalHostProvider(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "operating_system_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.OperatingSystemName(v) + case "subnet_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.SubnetName(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -8724,7 +8843,7 @@ func XMLBondingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLBondingReadMany(reader *XMLReader, start *xml.StartElement) (*BondingSlice, error) { +func XMLExternalHostGroupReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalHostGroupSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8735,7 +8854,7 @@ func XMLBondingReadMany(reader *XMLReader, start *xml.StartElement) (*BondingSli } start = st } - var result BondingSlice + var result ExternalHostGroupSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -8749,8 +8868,8 @@ func XMLBondingReadMany(reader *XMLReader, start *xml.StartElement) (*BondingSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bonding": - one, err := XMLBondingReadOne(reader, &t, "bonding") + case "external_host_group": + one, err := XMLExternalHostGroupReadOne(reader, &t, "external_host_group") if err != nil { return nil, err } @@ -8767,8 +8886,8 @@ func XMLBondingReadMany(reader *XMLReader, start *xml.StartElement) (*BondingSli return &result, nil } -func XMLSeLinuxReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SeLinux, error) { - builder := NewSeLinuxBuilder() +func XMLExternalHostProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalHostProvider, error) { + builder := NewExternalHostProviderBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8780,11 +8899,22 @@ func XMLSeLinuxReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "se_linux" + expectedTag = "external_host_provider" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -8799,25 +8929,102 @@ func XMLSeLinuxReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "mode": - vp, err := XMLSeLinuxModeReadOne(reader, &t) - v := *vp + case "authentication_url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Mode(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } + builder.AuthenticationUrl(v) + case "certificates": + v, err := XMLCertificateReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Certificates(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "compute_resources": + v, err := XMLExternalComputeResourceReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.ComputeResources(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "discovered_hosts": + v, err := XMLExternalDiscoveredHostReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DiscoveredHosts(v) + case "host_groups": + v, err := XMLExternalHostGroupReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.HostGroups(v) + case "hosts": + v, err := XMLHostReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Hosts(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "password": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Password(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Properties(v) + case "requires_authentication": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.RequiresAuthentication(v) + case "url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Url(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } + } if rel != "" && href != "" { links = append(links, Link{&href, &rel}) } @@ -8836,12 +9043,37 @@ func XMLSeLinuxReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s } for _, link := range links { switch *link.rel { + case "certificates": + if one.certificates == nil { + one.certificates = new(CertificateSlice) + } + one.certificates.href = link.href + case "computeresources": + if one.computeResources == nil { + one.computeResources = new(ExternalComputeResourceSlice) + } + one.computeResources.href = link.href + case "discoveredhosts": + if one.discoveredHosts == nil { + one.discoveredHosts = new(ExternalDiscoveredHostSlice) + } + one.discoveredHosts.href = link.href + case "hostgroups": + if one.hostGroups == nil { + one.hostGroups = new(ExternalHostGroupSlice) + } + one.hostGroups.href = link.href + case "hosts": + if one.hosts == nil { + one.hosts = new(HostSlice) + } + one.hosts.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLSeLinuxReadMany(reader *XMLReader, start *xml.StartElement) (*SeLinuxSlice, error) { +func XMLExternalHostProviderReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalHostProviderSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8852,7 +9084,7 @@ func XMLSeLinuxReadMany(reader *XMLReader, start *xml.StartElement) (*SeLinuxSli } start = st } - var result SeLinuxSlice + var result ExternalHostProviderSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -8866,8 +9098,8 @@ func XMLSeLinuxReadMany(reader *XMLReader, start *xml.StartElement) (*SeLinuxSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "se_linux": - one, err := XMLSeLinuxReadOne(reader, &t, "se_linux") + case "external_host_provider": + one, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") if err != nil { return nil, err } @@ -8884,8 +9116,8 @@ func XMLSeLinuxReadMany(reader *XMLReader, start *xml.StartElement) (*SeLinuxSli return &result, nil } -func XMLApiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Api, error) { - builder := NewApiBuilder() +func XMLExternalNetworkProviderConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalNetworkProviderConfiguration, error) { + builder := NewExternalNetworkProviderConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8897,11 +9129,22 @@ func XMLApiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "api" + expectedTag = "external_network_provider_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -8916,42 +9159,36 @@ func XMLApiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authenticated_user": - v, err := XMLUserReadOne(reader, &t, "authenticated_user") - if err != nil { - return nil, err - } - builder.AuthenticatedUser(v) - case "effective_user": - v, err := XMLUserReadOne(reader, &t, "effective_user") + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.EffectiveUser(v) - case "product_info": - v, err := XMLProductInfoReadOne(reader, &t, "product_info") + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ProductInfo(v) - case "special_objects": - v, err := XMLSpecialObjectsReadOne(reader, &t, "special_objects") + builder.Description(v) + case "external_network_provider": + v, err := XMLExternalProviderReadOne(reader, &t, "external_network_provider") if err != nil { return nil, err } - builder.SpecialObjects(v) - case "summary": - v, err := XMLApiSummaryReadOne(reader, &t, "summary") + builder.ExternalNetworkProvider(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Summary(v) - case "time": - v, err := reader.ReadTime(&t) + builder.Host(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Time(v) + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -8987,7 +9224,7 @@ func XMLApiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLApiReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSlice, error) { +func XMLExternalNetworkProviderConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalNetworkProviderConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -8998,7 +9235,7 @@ func XMLApiReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSlice, erro } start = st } - var result ApiSlice + var result ExternalNetworkProviderConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -9012,8 +9249,8 @@ func XMLApiReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "api": - one, err := XMLApiReadOne(reader, &t, "api") + case "external_network_provider_configuration": + one, err := XMLExternalNetworkProviderConfigurationReadOne(reader, &t, "external_network_provider_configuration") if err != nil { return nil, err } @@ -9030,8 +9267,8 @@ func XMLApiReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSlice, erro return &result, nil } -func XMLMemoryPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MemoryPolicy, error) { - builder := NewMemoryPolicyBuilder() +func XMLExternalProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalProvider, error) { + builder := NewExternalProviderBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -9043,11 +9280,22 @@ func XMLMemoryPolicyReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "memory_policy" + expectedTag = "external_provider" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -9062,36 +9310,60 @@ func XMLMemoryPolicyReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ballooning": - v, err := reader.ReadBool(&t) + case "authentication_url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Ballooning(v) - case "guaranteed": - v, err := reader.ReadInt64(&t) + builder.AuthenticationUrl(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Guaranteed(v) - case "max": - v, err := reader.ReadInt64(&t) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Max(v) - case "over_commit": - v, err := XMLMemoryOverCommitReadOne(reader, &t, "over_commit") + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.OverCommit(v) - case "transparent_hugepages": - v, err := XMLTransparentHugePagesReadOne(reader, &t, "transparent_hugepages") + builder.Name(v) + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.TransparentHugePages(v) + builder.Password(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Properties(v) + case "requires_authentication": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.RequiresAuthentication(v) + case "url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Url(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -9127,7 +9399,7 @@ func XMLMemoryPolicyReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLMemoryPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*MemoryPolicySlice, error) { +func XMLExternalProviderReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalProviderSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -9138,7 +9410,7 @@ func XMLMemoryPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Memor } start = st } - var result MemoryPolicySlice + var result ExternalProviderSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -9152,8 +9424,8 @@ func XMLMemoryPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Memor switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "memory_policy": - one, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + case "external_provider": + one, err := XMLExternalProviderReadOne(reader, &t, "external_provider") if err != nil { return nil, err } @@ -9170,8 +9442,8 @@ func XMLMemoryPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Memor return &result, nil } -func XMLOpenStackNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackNetwork, error) { - builder := NewOpenStackNetworkBuilder() +func XMLExternalVmImportReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalVmImport, error) { + builder := NewExternalVmImportBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -9183,22 +9455,11 @@ func XMLOpenStackNetworkReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "openstack_network" + expectedTag = "external_vm_import" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -9213,30 +9474,85 @@ func XMLOpenStackNetworkReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") if err != nil { return nil, err } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + builder.Cluster(v) + case "cpu_profile": + v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") if err != nil { return nil, err } - builder.Description(v) + builder.CpuProfile(v) + case "drivers_iso": + v, err := XMLFileReadOne(reader, &t, "drivers_iso") + if err != nil { + return nil, err + } + builder.DriversIso(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "openstack_network_provider": - v, err := XMLOpenStackNetworkProviderReadOne(reader, &t, "openstack_network_provider") + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.OpenstackNetworkProvider(v) + builder.Password(v) + case "provider": + vp, err := XMLExternalVmProviderTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Provider(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err + } + builder.Quota(v) + case "sparse": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Sparse(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Url(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -9272,7 +9588,7 @@ func XMLOpenStackNetworkReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLOpenStackNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackNetworkSlice, error) { +func XMLExternalVmImportReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalVmImportSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -9283,7 +9599,7 @@ func XMLOpenStackNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*O } start = st } - var result OpenStackNetworkSlice + var result ExternalVmImportSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -9297,8 +9613,8 @@ func XMLOpenStackNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*O switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_network": - one, err := XMLOpenStackNetworkReadOne(reader, &t, "openstack_network") + case "external_vm_import": + one, err := XMLExternalVmImportReadOne(reader, &t, "external_vm_import") if err != nil { return nil, err } @@ -9315,8 +9631,8 @@ func XMLOpenStackNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*O return &result, nil } -func XMLVmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Vm, error) { - builder := NewVmBuilder() +func XMLFencingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*FencingPolicy, error) { + builder := NewFencingPolicyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -9328,22 +9644,11 @@ func XMLVmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string start = st } if expectedTag == "" { - expectedTag = "vm" + expectedTag = "fencing_policy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -9358,823 +9663,103 @@ func XMLVmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity_labels": - v, err := XMLAffinityLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AffinityLabels(v) - case "applications": - v, err := XMLApplicationReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Applications(v) - case "bios": - v, err := XMLBiosReadOne(reader, &t, "bios") - if err != nil { - return nil, err - } - builder.Bios(v) - case "cdroms": - v, err := XMLCdromReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Cdroms(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Cluster(v) - case "comment": - v, err := reader.ReadString(&t) + builder.Enabled(v) + case "skip_if_connectivity_broken": + v, err := XMLSkipIfConnectivityBrokenReadOne(reader, &t, "skip_if_connectivity_broken") if err != nil { return nil, err } - builder.Comment(v) - case "console": - v, err := XMLConsoleReadOne(reader, &t, "console") + builder.SkipIfConnectivityBroken(v) + case "skip_if_gluster_bricks_up": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Console(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") + builder.SkipIfGlusterBricksUp(v) + case "skip_if_gluster_quorum_not_met": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Cpu(v) - case "cpu_profile": - v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") + builder.SkipIfGlusterQuorumNotMet(v) + case "skip_if_sd_active": + v, err := XMLSkipIfSdActiveReadOne(reader, &t, "skip_if_sd_active") if err != nil { return nil, err } - builder.CpuProfile(v) - case "cpu_shares": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err + builder.SkipIfSdActive(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.CpuShares(v) - case "creation_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.CreationTime(v) - case "custom_compatibility_version": - v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLFencingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*FencingPolicySlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result FencingPolicySlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "fencing_policy": + one, err := XMLFencingPolicyReadOne(reader, &t, "fencing_policy") if err != nil { return nil, err } - builder.CustomCompatibilityVersion(v) - case "custom_cpu_model": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomCpuModel(v) - case "custom_emulated_machine": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomEmulatedMachine(v) - case "custom_properties": - v, err := XMLCustomPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.CustomProperties(v) - case "delete_protected": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.DeleteProtected(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "disk_attachments": - v, err := XMLDiskAttachmentReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.DiskAttachments(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") - if err != nil { - return nil, err - } - builder.Display(v) - case "domain": - v, err := XMLDomainReadOne(reader, &t, "domain") - if err != nil { - return nil, err - } - builder.Domain(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") - if err != nil { - return nil, err - } - builder.ExternalHostProvider(v) - case "floppies": - v, err := XMLFloppyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Floppies(v) - case "fqdn": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Fqdn(v) - case "graphics_consoles": - v, err := XMLGraphicsConsoleReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.GraphicsConsoles(v) - case "guest_operating_system": - v, err := XMLGuestOperatingSystemReadOne(reader, &t, "guest_operating_system") - if err != nil { - return nil, err - } - builder.GuestOperatingSystem(v) - case "guest_time_zone": - v, err := XMLTimeZoneReadOne(reader, &t, "guest_time_zone") - if err != nil { - return nil, err - } - builder.GuestTimeZone(v) - case "has_illegal_images": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.HasIllegalImages(v) - case "high_availability": - v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") - if err != nil { - return nil, err - } - builder.HighAvailability(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "host_devices": - v, err := XMLHostDeviceReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.HostDevices(v) - case "initialization": - v, err := XMLInitializationReadOne(reader, &t, "initialization") - if err != nil { - return nil, err - } - builder.Initialization(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "io": - v, err := XMLIoReadOne(reader, &t, "io") - if err != nil { - return nil, err - } - builder.Io(v) - case "katello_errata": - v, err := XMLKatelloErratumReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.KatelloErrata(v) - case "large_icon": - v, err := XMLIconReadOne(reader, &t, "large_icon") - if err != nil { - return nil, err - } - builder.LargeIcon(v) - case "lease": - v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") - if err != nil { - return nil, err - } - builder.Lease(v) - case "memory": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Memory(v) - case "memory_policy": - v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") - if err != nil { - return nil, err - } - builder.MemoryPolicy(v) - case "migration": - v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") - if err != nil { - return nil, err - } - builder.Migration(v) - case "migration_downtime": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MigrationDowntime(v) - case "multi_queues_enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.MultiQueuesEnabled(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "next_run_configuration_exists": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.NextRunConfigurationExists(v) - case "nics": - v, err := XMLNicReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Nics(v) - case "host_numa_nodes": - v, err := XMLNumaNodeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NumaNodes(v) - case "numa_tune_mode": - vp, err := XMLNumaTuneModeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.NumaTuneMode(v) - case "origin": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Origin(v) - case "original_template": - v, err := XMLTemplateReadOne(reader, &t, "original_template") - if err != nil { - return nil, err - } - builder.OriginalTemplate(v) - case "os": - v, err := XMLOperatingSystemReadOne(reader, &t, "os") - if err != nil { - return nil, err - } - builder.Os(v) - case "payloads": - v, err := XMLPayloadReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Payloads(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "placement_policy": - v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") - if err != nil { - return nil, err - } - builder.PlacementPolicy(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "reported_devices": - v, err := XMLReportedDeviceReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.ReportedDevices(v) - case "rng_device": - v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") - if err != nil { - return nil, err - } - builder.RngDevice(v) - case "run_once": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RunOnce(v) - case "serial_number": - v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") - if err != nil { - return nil, err - } - builder.SerialNumber(v) - case "sessions": - v, err := XMLSessionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Sessions(v) - case "small_icon": - v, err := XMLIconReadOne(reader, &t, "small_icon") - if err != nil { - return nil, err - } - builder.SmallIcon(v) - case "snapshots": - v, err := XMLSnapshotReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Snapshots(v) - case "soundcard_enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.SoundcardEnabled(v) - case "sso": - v, err := XMLSsoReadOne(reader, &t, "sso") - if err != nil { - return nil, err - } - builder.Sso(v) - case "start_paused": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.StartPaused(v) - case "start_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.StartTime(v) - case "stateless": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Stateless(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "status": - vp, err := XMLVmStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "status_detail": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.StatusDetail(v) - case "stop_reason": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.StopReason(v) - case "stop_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.StopTime(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") - if err != nil { - return nil, err - } - builder.StorageDomain(v) - case "storage_error_resume_behaviour": - vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.StorageErrorResumeBehaviour(v) - case "tags": - v, err := XMLTagReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Tags(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "time_zone": - v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") - if err != nil { - return nil, err - } - builder.TimeZone(v) - case "tunnel_migration": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.TunnelMigration(v) - case "type": - vp, err := XMLVmTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Type(v) - case "usb": - v, err := XMLUsbReadOne(reader, &t, "usb") - if err != nil { - return nil, err - } - builder.Usb(v) - case "use_latest_template_version": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.UseLatestTemplateVersion(v) - case "virtio_scsi": - v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") - if err != nil { - return nil, err - } - builder.VirtioScsi(v) - case "vm_pool": - v, err := XMLVmPoolReadOne(reader, &t, "vm_pool") - if err != nil { - return nil, err - } - builder.VmPool(v) - case "watchdogs": - v, err := XMLWatchdogReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Watchdogs(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - case "affinitylabels": - if one.affinityLabels == nil { - one.affinityLabels = new(AffinityLabelSlice) - } - one.affinityLabels.href = link.href - case "applications": - if one.applications == nil { - one.applications = new(ApplicationSlice) - } - one.applications.href = link.href - case "cdroms": - if one.cdroms == nil { - one.cdroms = new(CdromSlice) - } - one.cdroms.href = link.href - case "diskattachments": - if one.diskAttachments == nil { - one.diskAttachments = new(DiskAttachmentSlice) - } - one.diskAttachments.href = link.href - case "floppies": - if one.floppies == nil { - one.floppies = new(FloppySlice) - } - one.floppies.href = link.href - case "graphicsconsoles": - if one.graphicsConsoles == nil { - one.graphicsConsoles = new(GraphicsConsoleSlice) - } - one.graphicsConsoles.href = link.href - case "hostdevices": - if one.hostDevices == nil { - one.hostDevices = new(HostDeviceSlice) - } - one.hostDevices.href = link.href - case "katelloerrata": - if one.katelloErrata == nil { - one.katelloErrata = new(KatelloErratumSlice) - } - one.katelloErrata.href = link.href - case "nics": - if one.nics == nil { - one.nics = new(NicSlice) - } - one.nics.href = link.href - case "numanodes": - if one.numaNodes == nil { - one.numaNodes = new(NumaNodeSlice) - } - one.numaNodes.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "reporteddevices": - if one.reportedDevices == nil { - one.reportedDevices = new(ReportedDeviceSlice) - } - one.reportedDevices.href = link.href - case "sessions": - if one.sessions == nil { - one.sessions = new(SessionSlice) - } - one.sessions.href = link.href - case "snapshots": - if one.snapshots == nil { - one.snapshots = new(SnapshotSlice) - } - one.snapshots.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href - case "tags": - if one.tags == nil { - one.tags = new(TagSlice) - } - one.tags.href = link.href - case "watchdogs": - if one.watchdogs == nil { - one.watchdogs = new(WatchdogSlice) - } - one.watchdogs.href = link.href - } // end of switch - } // end of for-links - return one, nil -} - -func XMLVmReadMany(reader *XMLReader, start *xml.StartElement) (*VmSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result VmSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "vm": - one, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLExternalHostGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalHostGroup, error) { - builder := NewExternalHostGroupBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "external_host_group" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "architecture_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ArchitectureName(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "domain_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.DomainName(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") - if err != nil { - return nil, err - } - builder.ExternalHostProvider(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "operating_system_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.OperatingSystemName(v) - case "subnet_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.SubnetName(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLExternalHostGroupReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalHostGroupSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result ExternalHostGroupSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "external_host_group": - one, err := XMLExternalHostGroupReadOne(reader, &t, "external_host_group") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) + if one != nil { + result.slice = append(result.slice, one) } default: reader.Skip() @@ -10186,8 +9771,8 @@ func XMLExternalHostGroupReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLExternalComputeResourceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalComputeResource, error) { - builder := NewExternalComputeResourceBuilder() +func XMLFileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*File, error) { + builder := NewFileBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -10199,7 +9784,7 @@ func XMLExternalComputeResourceReadOne(reader *XMLReader, start *xml.StartElemen start = st } if expectedTag == "" { - expectedTag = "external_compute_resource" + expectedTag = "file" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -10235,42 +9820,36 @@ func XMLExternalComputeResourceReadOne(reader *XMLReader, start *xml.StartElemen return nil, err } builder.Comment(v) - case "description": + case "content": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + builder.Content(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ExternalHostProvider(v) + builder.Description(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "provider": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Provider(v) - case "url": - v, err := reader.ReadString(&t) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } - builder.Url(v) - case "user": + builder.StorageDomain(v) + case "type": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.User(v) + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -10306,7 +9885,7 @@ func XMLExternalComputeResourceReadOne(reader *XMLReader, start *xml.StartElemen return one, nil } -func XMLExternalComputeResourceReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalComputeResourceSlice, error) { +func XMLFileReadMany(reader *XMLReader, start *xml.StartElement) (*FileSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -10317,7 +9896,7 @@ func XMLExternalComputeResourceReadMany(reader *XMLReader, start *xml.StartEleme } start = st } - var result ExternalComputeResourceSlice + var result FileSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -10331,8 +9910,8 @@ func XMLExternalComputeResourceReadMany(reader *XMLReader, start *xml.StartEleme switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "external_compute_resource": - one, err := XMLExternalComputeResourceReadOne(reader, &t, "external_compute_resource") + case "file": + one, err := XMLFileReadOne(reader, &t, "file") if err != nil { return nil, err } @@ -10349,8 +9928,8 @@ func XMLExternalComputeResourceReadMany(reader *XMLReader, start *xml.StartEleme return &result, nil } -func XMLOpenStackVolumeProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackVolumeProvider, error) { - builder := NewOpenStackVolumeProviderBuilder() +func XMLFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Filter, error) { + builder := NewFilterBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -10362,7 +9941,7 @@ func XMLOpenStackVolumeProviderReadOne(reader *XMLReader, start *xml.StartElemen start = st } if expectedTag == "" { - expectedTag = "openstack_volume_provider" + expectedTag = "filter" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -10392,36 +9971,12 @@ func XMLOpenStackVolumeProviderReadOne(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authentication_keys": - v, err := XMLOpenstackVolumeAuthenticationKeyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AuthenticationKeys(v) - case "authentication_url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.AuthenticationUrl(v) - case "certificates": - v, err := XMLCertificateReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Certificates(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") - if err != nil { - return nil, err - } - builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { @@ -10434,48 +9989,18 @@ func XMLOpenStackVolumeProviderReadOne(reader *XMLReader, start *xml.StartElemen return nil, err } builder.Name(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Properties(v) - case "requires_authentication": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RequiresAuthentication(v) - case "tenant_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.TenantName(v) - case "url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Url(v) - case "username": - v, err := reader.ReadString(&t) + case "position": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Username(v) - case "volume_types": - v, err := XMLOpenStackVolumeTypeReadMany(reader, &t) + builder.Position(v) + case "scheduling_policy_unit": + v, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") if err != nil { return nil, err } - builder.VolumeTypes(v) + builder.SchedulingPolicyUnit(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -10506,27 +10031,12 @@ func XMLOpenStackVolumeProviderReadOne(reader *XMLReader, start *xml.StartElemen } for _, link := range links { switch *link.rel { - case "authenticationkeys": - if one.authenticationKeys == nil { - one.authenticationKeys = new(OpenstackVolumeAuthenticationKeySlice) - } - one.authenticationKeys.href = link.href - case "certificates": - if one.certificates == nil { - one.certificates = new(CertificateSlice) - } - one.certificates.href = link.href - case "volumetypes": - if one.volumeTypes == nil { - one.volumeTypes = new(OpenStackVolumeTypeSlice) - } - one.volumeTypes.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLOpenStackVolumeProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackVolumeProviderSlice, error) { +func XMLFilterReadMany(reader *XMLReader, start *xml.StartElement) (*FilterSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -10537,7 +10047,7 @@ func XMLOpenStackVolumeProviderReadMany(reader *XMLReader, start *xml.StartEleme } start = st } - var result OpenStackVolumeProviderSlice + var result FilterSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -10551,8 +10061,8 @@ func XMLOpenStackVolumeProviderReadMany(reader *XMLReader, start *xml.StartEleme switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_volume_provider": - one, err := XMLOpenStackVolumeProviderReadOne(reader, &t, "openstack_volume_provider") + case "filter": + one, err := XMLFilterReadOne(reader, &t, "filter") if err != nil { return nil, err } @@ -10569,8 +10079,8 @@ func XMLOpenStackVolumeProviderReadMany(reader *XMLReader, start *xml.StartEleme return &result, nil } -func XMLStepReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Step, error) { - builder := NewStepBuilder() +func XMLFloppyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Floppy, error) { + builder := NewFloppyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -10582,7 +10092,7 @@ func XMLStepReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "step" + expectedTag = "floppy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -10624,87 +10134,42 @@ func XMLStepReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return nil, err } builder.Description(v) - case "end_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.EndTime(v) - case "execution_host": - v, err := XMLHostReadOne(reader, &t, "execution_host") - if err != nil { - return nil, err - } - builder.ExecutionHost(v) - case "external": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.External(v) - case "external_type": - vp, err := XMLExternalSystemTypeReadOne(reader, &t) - v := *vp + case "file": + v, err := XMLFileReadOne(reader, &t, "file") if err != nil { return nil, err } - builder.ExternalType(v) - case "job": - v, err := XMLJobReadOne(reader, &t, "job") + builder.File(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") if err != nil { return nil, err } - builder.Job(v) + builder.InstanceType(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "number": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Number(v) - case "parent_step": - v, err := XMLStepReadOne(reader, &t, "parent_step") - if err != nil { - return nil, err - } - builder.ParentStep(v) - case "progress": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Progress(v) - case "start_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.StartTime(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } - builder.Statistics(v) - case "status": - vp, err := XMLStepStatusReadOne(reader, &t) - v := *vp + builder.Template(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } - builder.Status(v) - case "type": - vp, err := XMLStepEnumReadOne(reader, &t) - v := *vp + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) if err != nil { return nil, err } - builder.Type(v) + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -10735,61 +10200,17 @@ func XMLStepReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) } - one.statistics.href = link.href + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLStepReadMany(reader *XMLReader, start *xml.StartElement) (*StepSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result StepSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "step": - one, err := XMLStepReadOne(reader, &t, "step") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLOpenStackNetworkProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackNetworkProvider, error) { - builder := NewOpenStackNetworkProviderBuilder() +func XMLFloppyReadMany(reader *XMLReader, start *xml.StartElement) (*FloppySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -10798,179 +10219,84 @@ func XMLOpenStackNetworkProviderReadOne(reader *XMLReader, start *xml.StartEleme } return nil, err } - start = st - } - if expectedTag == "" { - expectedTag = "openstack_network_provider" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "agent_configuration": - v, err := XMLAgentConfigurationReadOne(reader, &t, "agent_configuration") - if err != nil { - return nil, err - } - builder.AgentConfiguration(v) - case "authentication_url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.AuthenticationUrl(v) - case "auto_sync": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.AutoSync(v) - case "certificates": - v, err := XMLCertificateReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Certificates(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "external_plugin_type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ExternalPluginType(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "networks": - v, err := XMLOpenStackNetworkReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Networks(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "plugin_type": - vp, err := XMLNetworkPluginTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.PluginType(v) - case "project_domain_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ProjectDomainName(v) - case "project_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ProjectName(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Properties(v) - case "read_only": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.ReadOnly(v) - case "requires_authentication": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RequiresAuthentication(v) - case "subnets": - v, err := XMLOpenStackSubnetReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Subnets(v) - case "tenant_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.TenantName(v) - case "type": - vp, err := XMLOpenStackNetworkProviderTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Type(v) - case "unmanaged": - v, err := reader.ReadBool(&t) + start = st + } + var result FloppySlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "floppy": + one, err := XMLFloppyReadOne(reader, &t, "floppy") if err != nil { return nil, err } - builder.Unmanaged(v) - case "url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err + if one != nil { + result.slice = append(result.slice, one) } - builder.Url(v) - case "user_domain_name": + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLFopStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*FopStatistic, error) { + builder := NewFopStatisticBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "fop_statistic" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.UserDomainName(v) - case "username": - v, err := reader.ReadString(&t) + builder.Name(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.Username(v) + builder.Statistics(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11001,27 +10327,12 @@ func XMLOpenStackNetworkProviderReadOne(reader *XMLReader, start *xml.StartEleme } for _, link := range links { switch *link.rel { - case "certificates": - if one.certificates == nil { - one.certificates = new(CertificateSlice) - } - one.certificates.href = link.href - case "networks": - if one.networks == nil { - one.networks = new(OpenStackNetworkSlice) - } - one.networks.href = link.href - case "subnets": - if one.subnets == nil { - one.subnets = new(OpenStackSubnetSlice) - } - one.subnets.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLOpenStackNetworkProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackNetworkProviderSlice, error) { +func XMLFopStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*FopStatisticSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11032,7 +10343,7 @@ func XMLOpenStackNetworkProviderReadMany(reader *XMLReader, start *xml.StartElem } start = st } - var result OpenStackNetworkProviderSlice + var result FopStatisticSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11046,8 +10357,8 @@ func XMLOpenStackNetworkProviderReadMany(reader *XMLReader, start *xml.StartElem switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_network_provider": - one, err := XMLOpenStackNetworkProviderReadOne(reader, &t, "openstack_network_provider") + case "fop_statistic": + one, err := XMLFopStatisticReadOne(reader, &t, "fop_statistic") if err != nil { return nil, err } @@ -11064,8 +10375,8 @@ func XMLOpenStackNetworkProviderReadMany(reader *XMLReader, start *xml.StartElem return &result, nil } -func XMLHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Hook, error) { - builder := NewHookBuilder() +func XMLGlusterBrickReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterBrick, error) { + builder := NewGlusterBrickBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11077,7 +10388,7 @@ func XMLHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "hook" + expectedTag = "brick" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -11107,6 +10418,12 @@ func XMLHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "brick_dir": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.BrickDir(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -11119,30 +10436,103 @@ func XMLHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return nil, err } builder.Description(v) - case "event_name": + case "device": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.EventName(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + builder.Device(v) + case "fs_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Host(v) - case "md5": + builder.FsName(v) + case "gluster_clients": + v, err := XMLGlusterClientReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.GlusterClients(v) + case "gluster_volume": + v, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") + if err != nil { + return nil, err + } + builder.GlusterVolume(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "memory_pools": + v, err := XMLGlusterMemoryPoolReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.MemoryPools(v) + case "mnt_options": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Md5(v) + builder.MntOptions(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "pid": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Pid(v) + case "port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Port(v) + case "server_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ServerId(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Statistics(v) + case "status": + vp, err := XMLGlusterBrickStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11173,12 +10563,22 @@ func XMLHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLHookReadMany(reader *XMLReader, start *xml.StartElement) (*HookSlice, error) { +func XMLGlusterBrickReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterBrickSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11189,7 +10589,7 @@ func XMLHookReadMany(reader *XMLReader, start *xml.StartElement) (*HookSlice, er } start = st } - var result HookSlice + var result GlusterBrickSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11203,8 +10603,8 @@ func XMLHookReadMany(reader *XMLReader, start *xml.StartElement) (*HookSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "hook": - one, err := XMLHookReadOne(reader, &t, "hook") + case "brick": + one, err := XMLGlusterBrickReadOne(reader, &t, "brick") if err != nil { return nil, err } @@ -11221,8 +10621,8 @@ func XMLHookReadMany(reader *XMLReader, start *xml.StartElement) (*HookSlice, er return &result, nil } -func XMLConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Configuration, error) { - builder := NewConfigurationBuilder() +func XMLGlusterBrickAdvancedDetailsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterBrickAdvancedDetails, error) { + builder := NewGlusterBrickAdvancedDetailsBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11234,11 +10634,22 @@ func XMLConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "configuration" + expectedTag = "gluster_brick_advanced_details" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -11253,19 +10664,90 @@ func XMLConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "data": + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Data(v) - case "type": - vp, err := XMLConfigurationTypeReadOne(reader, &t) - v := *vp + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Type(v) + builder.Description(v) + case "device": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Device(v) + case "fs_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.FsName(v) + case "gluster_clients": + v, err := XMLGlusterClientReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.GlusterClients(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "memory_pools": + v, err := XMLGlusterMemoryPoolReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.MemoryPools(v) + case "mnt_options": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.MntOptions(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "pid": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Pid(v) + case "port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Port(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11296,12 +10778,17 @@ func XMLConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*ConfigurationSlice, error) { +func XMLGlusterBrickAdvancedDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterBrickAdvancedDetailsSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11312,7 +10799,7 @@ func XMLConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*Conf } start = st } - var result ConfigurationSlice + var result GlusterBrickAdvancedDetailsSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11326,8 +10813,8 @@ func XMLConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*Conf switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "configuration": - one, err := XMLConfigurationReadOne(reader, &t, "configuration") + case "gluster_brick_advanced_details": + one, err := XMLGlusterBrickAdvancedDetailsReadOne(reader, &t, "gluster_brick_advanced_details") if err != nil { return nil, err } @@ -11344,8 +10831,8 @@ func XMLConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*Conf return &result, nil } -func XMLOperatingSystemInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OperatingSystemInfo, error) { - builder := NewOperatingSystemInfoBuilder() +func XMLGlusterBrickMemoryInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterBrickMemoryInfo, error) { + builder := NewGlusterBrickMemoryInfoBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11357,22 +10844,11 @@ func XMLOperatingSystemInfoReadOne(reader *XMLReader, start *xml.StartElement, e start = st } if expectedTag == "" { - expectedTag = "operating_system" + expectedTag = "brick_memoryinfo" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -11387,43 +10863,12 @@ func XMLOperatingSystemInfoReadOne(reader *XMLReader, start *xml.StartElement, e switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "architecture": - vp, err := XMLArchitectureReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Architecture(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "large_icon": - v, err := XMLIconReadOne(reader, &t, "large_icon") - if err != nil { - return nil, err - } - builder.LargeIcon(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "small_icon": - v, err := XMLIconReadOne(reader, &t, "small_icon") + case "memory_pools": + v, err := XMLGlusterMemoryPoolReadMany(reader, &t) if err != nil { return nil, err } - builder.SmallIcon(v) + builder.MemoryPools(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11459,7 +10904,7 @@ func XMLOperatingSystemInfoReadOne(reader *XMLReader, start *xml.StartElement, e return one, nil } -func XMLOperatingSystemInfoReadMany(reader *XMLReader, start *xml.StartElement) (*OperatingSystemInfoSlice, error) { +func XMLGlusterBrickMemoryInfoReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterBrickMemoryInfoSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11470,7 +10915,7 @@ func XMLOperatingSystemInfoReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result OperatingSystemInfoSlice + var result GlusterBrickMemoryInfoSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11484,8 +10929,8 @@ func XMLOperatingSystemInfoReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "operating_system": - one, err := XMLOperatingSystemInfoReadOne(reader, &t, "operating_system") + case "brick_memoryinfo": + one, err := XMLGlusterBrickMemoryInfoReadOne(reader, &t, "brick_memoryinfo") if err != nil { return nil, err } @@ -11502,8 +10947,8 @@ func XMLOperatingSystemInfoReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLRegistrationLunMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationLunMapping, error) { - builder := NewRegistrationLunMappingBuilder() +func XMLGlusterClientReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterClient, error) { + builder := NewGlusterClientBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11515,7 +10960,7 @@ func XMLRegistrationLunMappingReadOne(reader *XMLReader, start *xml.StartElement start = st } if expectedTag == "" { - expectedTag = "registration_lun_mapping" + expectedTag = "gluster_client" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -11534,18 +10979,30 @@ func XMLRegistrationLunMappingReadOne(reader *XMLReader, start *xml.StartElement switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLDiskReadOne(reader, &t, "from") + case "bytes_read": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLDiskReadOne(reader, &t, "to") + builder.BytesRead(v) + case "bytes_written": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.To(v) + builder.BytesWritten(v) + case "client_port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.ClientPort(v) + case "host_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.HostName(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11581,7 +11038,7 @@ func XMLRegistrationLunMappingReadOne(reader *XMLReader, start *xml.StartElement return one, nil } -func XMLRegistrationLunMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationLunMappingSlice, error) { +func XMLGlusterClientReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterClientSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11592,7 +11049,7 @@ func XMLRegistrationLunMappingReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var result RegistrationLunMappingSlice + var result GlusterClientSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11606,8 +11063,8 @@ func XMLRegistrationLunMappingReadMany(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_lun_mapping": - one, err := XMLRegistrationLunMappingReadOne(reader, &t, "registration_lun_mapping") + case "gluster_client": + one, err := XMLGlusterClientReadOne(reader, &t, "gluster_client") if err != nil { return nil, err } @@ -11624,8 +11081,8 @@ func XMLRegistrationLunMappingReadMany(reader *XMLReader, start *xml.StartElemen return &result, nil } -func XMLDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Device, error) { - builder := NewDeviceBuilder() +func XMLGlusterHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterHook, error) { + builder := NewGlusterHookBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11637,7 +11094,7 @@ func XMLDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "device" + expectedTag = "gluster_hook" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -11667,48 +11124,87 @@ func XMLDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "checksum": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Checksum(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) + case "conflict_status": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.ConflictStatus(v) + case "conflicts": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Conflicts(v) + case "content": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Content(v) + case "content_type": + vp, err := XMLHookContentTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.ContentType(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + case "gluster_command": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.InstanceType(v) + builder.GlusterCommand(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") + case "server_hooks": + v, err := XMLGlusterServerHookReadMany(reader, &t) if err != nil { return nil, err } - builder.Template(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.ServerHooks(v) + case "stage": + vp, err := XMLHookStageReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.Stage(v) + case "status": + vp, err := XMLGlusterHookStatusReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Vms(v) + builder.Status(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11739,17 +11235,17 @@ func XMLDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) + case "serverhooks": + if one.serverHooks == nil { + one.serverHooks = new(GlusterServerHookSlice) } - one.vms.href = link.href + one.serverHooks.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*DeviceSlice, error) { +func XMLGlusterHookReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterHookSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11760,7 +11256,7 @@ func XMLDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*DeviceSlice } start = st } - var result DeviceSlice + var result GlusterHookSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11774,8 +11270,8 @@ func XMLDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*DeviceSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "device": - one, err := XMLDeviceReadOne(reader, &t, "device") + case "gluster_hook": + one, err := XMLGlusterHookReadOne(reader, &t, "gluster_hook") if err != nil { return nil, err } @@ -11792,8 +11288,8 @@ func XMLDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*DeviceSlice return &result, nil } -func XMLNumaNodePinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NumaNodePin, error) { - builder := NewNumaNodePinBuilder() +func XMLGlusterMemoryPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterMemoryPool, error) { + builder := NewGlusterMemoryPoolBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11805,11 +11301,22 @@ func XMLNumaNodePinReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "numa_node_pin" + expectedTag = "memory_pool" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -11824,24 +11331,72 @@ func XMLNumaNodePinReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host_numa_node": - v, err := XMLNumaNodeReadOne(reader, &t, "host_numa_node") + case "alloc_count": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.HostNumaNode(v) - case "index": + builder.AllocCount(v) + case "cold_count": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Index(v) - case "pinned": - v, err := reader.ReadBool(&t) + builder.ColdCount(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Pinned(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "hot_count": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.HotCount(v) + case "max_alloc": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxAlloc(v) + case "max_stdalloc": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxStdalloc(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "padded_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.PaddedSize(v) + case "pool_misses": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.PoolMisses(v) + case "type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -11877,7 +11432,7 @@ func XMLNumaNodePinReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLNumaNodePinReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodePinSlice, error) { +func XMLGlusterMemoryPoolReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterMemoryPoolSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11888,7 +11443,7 @@ func XMLNumaNodePinReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNo } start = st } - var result NumaNodePinSlice + var result GlusterMemoryPoolSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -11902,8 +11457,8 @@ func XMLNumaNodePinReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNo switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "numa_node_pin": - one, err := XMLNumaNodePinReadOne(reader, &t, "numa_node_pin") + case "memory_pool": + one, err := XMLGlusterMemoryPoolReadOne(reader, &t, "memory_pool") if err != nil { return nil, err } @@ -11920,8 +11475,8 @@ func XMLNumaNodePinReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNo return &result, nil } -func XMLReportedDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ReportedDevice, error) { - builder := NewReportedDeviceBuilder() +func XMLGlusterServerHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterServerHook, error) { + builder := NewGlusterServerHookBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -11933,7 +11488,7 @@ func XMLReportedDeviceReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "reported_device" + expectedTag = "server_hook" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -11963,49 +11518,50 @@ func XMLReportedDeviceReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "checksum": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Checksum(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + case "content_type": + vp, err := XMLHookContentTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Description(v) - case "ips": - v, err := XMLIpReadMany(reader, &t) + builder.ContentType(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Ips(v) - case "mac": - v, err := XMLMacReadOne(reader, &t, "mac") + builder.Description(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Mac(v) + builder.Host(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "type": - vp, err := XMLReportedDeviceTypeReadOne(reader, &t) + case "status": + vp, err := XMLGlusterHookStatusReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.Type(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) + builder.Status(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12041,7 +11597,7 @@ func XMLReportedDeviceReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLReportedDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*ReportedDeviceSlice, error) { +func XMLGlusterServerHookReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterServerHookSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12052,7 +11608,7 @@ func XMLReportedDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*Rep } start = st } - var result ReportedDeviceSlice + var result GlusterServerHookSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12066,8 +11622,8 @@ func XMLReportedDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*Rep switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "reported_device": - one, err := XMLReportedDeviceReadOne(reader, &t, "reported_device") + case "server_hook": + one, err := XMLGlusterServerHookReadOne(reader, &t, "server_hook") if err != nil { return nil, err } @@ -12084,8 +11640,8 @@ func XMLReportedDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*Rep return &result, nil } -func XMLHostDevicePassthroughReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostDevicePassthrough, error) { - builder := NewHostDevicePassthroughBuilder() +func XMLGlusterVolumeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterVolume, error) { + builder := NewGlusterVolumeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12097,11 +11653,22 @@ func XMLHostDevicePassthroughReadOne(reader *XMLReader, start *xml.StartElement, start = st } if expectedTag == "" { - expectedTag = "host_device_passthrough" + expectedTag = "gluster_volume" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -12116,12 +11683,92 @@ func XMLHostDevicePassthroughReadOne(reader *XMLReader, start *xml.StartElement, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "bricks": + v, err := XMLGlusterBrickReadMany(reader, &t) if err != nil { return nil, err } - builder.Enabled(v) + builder.Bricks(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "disperse_count": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.DisperseCount(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "options": + v, err := XMLOptionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Options(v) + case "redundancy_count": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.RedundancyCount(v) + case "replica_count": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.ReplicaCount(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Statistics(v) + case "status": + vp, err := XMLGlusterVolumeStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "stripe_count": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.StripeCount(v) + case "transport_types": + v, err := XMLTransportTypeReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.TransportTypes(v) + case "volume_type": + vp, err := XMLGlusterVolumeTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.VolumeType(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12152,12 +11799,22 @@ func XMLHostDevicePassthroughReadOne(reader *XMLReader, start *xml.StartElement, } for _, link := range links { switch *link.rel { + case "bricks": + if one.bricks == nil { + one.bricks = new(GlusterBrickSlice) + } + one.bricks.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLHostDevicePassthroughReadMany(reader *XMLReader, start *xml.StartElement) (*HostDevicePassthroughSlice, error) { +func XMLGlusterVolumeReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12168,7 +11825,7 @@ func XMLHostDevicePassthroughReadMany(reader *XMLReader, start *xml.StartElement } start = st } - var result HostDevicePassthroughSlice + var result GlusterVolumeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12182,8 +11839,8 @@ func XMLHostDevicePassthroughReadMany(reader *XMLReader, start *xml.StartElement switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host_device_passthrough": - one, err := XMLHostDevicePassthroughReadOne(reader, &t, "host_device_passthrough") + case "gluster_volume": + one, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") if err != nil { return nil, err } @@ -12200,8 +11857,8 @@ func XMLHostDevicePassthroughReadMany(reader *XMLReader, start *xml.StartElement return &result, nil } -func XMLAgentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Agent, error) { - builder := NewAgentBuilder() +func XMLGlusterVolumeProfileDetailsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterVolumeProfileDetails, error) { + builder := NewGlusterVolumeProfileDetailsBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12213,7 +11870,7 @@ func XMLAgentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "agent" + expectedTag = "gluster_volume_profile_details" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -12243,84 +11900,36 @@ func XMLAgentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) + case "brick_profile_details": + v, err := XMLBrickProfileDetailReadMany(reader, &t) if err != nil { return nil, err } - builder.Address(v) + builder.BrickProfileDetails(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "concurrent": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Concurrent(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "encrypt_options": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.EncryptOptions(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "options": - v, err := XMLOptionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Options(v) - case "order": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Order(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Type(v) - case "username": - v, err := reader.ReadString(&t) + case "nfs_profile_details": + v, err := XMLNfsProfileDetailReadMany(reader, &t) if err != nil { return nil, err } - builder.Username(v) + builder.NfsProfileDetails(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12356,7 +11965,7 @@ func XMLAgentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str return one, nil } -func XMLAgentReadMany(reader *XMLReader, start *xml.StartElement) (*AgentSlice, error) { +func XMLGlusterVolumeProfileDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeProfileDetailsSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12367,7 +11976,7 @@ func XMLAgentReadMany(reader *XMLReader, start *xml.StartElement) (*AgentSlice, } start = st } - var result AgentSlice + var result GlusterVolumeProfileDetailsSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12381,8 +11990,8 @@ func XMLAgentReadMany(reader *XMLReader, start *xml.StartElement) (*AgentSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "agent": - one, err := XMLAgentReadOne(reader, &t, "agent") + case "gluster_volume_profile_details": + one, err := XMLGlusterVolumeProfileDetailsReadOne(reader, &t, "gluster_volume_profile_details") if err != nil { return nil, err } @@ -12399,8 +12008,8 @@ func XMLAgentReadMany(reader *XMLReader, start *xml.StartElement) (*AgentSlice, return &result, nil } -func XMLSerialNumberReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SerialNumber, error) { - builder := NewSerialNumberBuilder() +func XMLGraphicsConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GraphicsConsole, error) { + builder := NewGraphicsConsoleBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12412,11 +12021,22 @@ func XMLSerialNumberReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "serial_number" + expectedTag = "graphics_console" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -12431,19 +12051,67 @@ func XMLSerialNumberReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "policy": - vp, err := XMLSerialNumberPolicyReadOne(reader, &t) - v := *vp + case "address": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Policy(v) - case "value": + builder.Address(v) + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Value(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Port(v) + case "protocol": + vp, err := XMLGraphicsTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Protocol(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "tls_port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.TlsPort(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12479,7 +12147,7 @@ func XMLSerialNumberReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLSerialNumberReadMany(reader *XMLReader, start *xml.StartElement) (*SerialNumberSlice, error) { +func XMLGraphicsConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*GraphicsConsoleSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12490,7 +12158,7 @@ func XMLSerialNumberReadMany(reader *XMLReader, start *xml.StartElement) (*Seria } start = st } - var result SerialNumberSlice + var result GraphicsConsoleSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12504,8 +12172,8 @@ func XMLSerialNumberReadMany(reader *XMLReader, start *xml.StartElement) (*Seria switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "serial_number": - one, err := XMLSerialNumberReadOne(reader, &t, "serial_number") + case "graphics_console": + one, err := XMLGraphicsConsoleReadOne(reader, &t, "graphics_console") if err != nil { return nil, err } @@ -12522,8 +12190,8 @@ func XMLSerialNumberReadMany(reader *XMLReader, start *xml.StartElement) (*Seria return &result, nil } -func XMLUsbReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Usb, error) { - builder := NewUsbBuilder() +func XMLGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Group, error) { + builder := NewGroupBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12535,11 +12203,22 @@ func XMLUsbReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "usb" + expectedTag = "group" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -12554,19 +12233,60 @@ func XMLUsbReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Enabled(v) - case "type": - vp, err := XMLUsbTypeReadOne(reader, &t) - v := *vp + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Type(v) + builder.Description(v) + case "domain": + v, err := XMLDomainReadOne(reader, &t, "domain") + if err != nil { + return nil, err + } + builder.Domain(v) + case "domain_entry_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.DomainEntryId(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "namespace": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Namespace(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "roles": + v, err := XMLRoleReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Roles(v) + case "tags": + v, err := XMLTagReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Tags(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12597,12 +12317,27 @@ func XMLUsbReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin } for _, link := range links { switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "roles": + if one.roles == nil { + one.roles = new(RoleSlice) + } + one.roles.href = link.href + case "tags": + if one.tags == nil { + one.tags = new(TagSlice) + } + one.tags.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLUsbReadMany(reader *XMLReader, start *xml.StartElement) (*UsbSlice, error) { +func XMLGroupReadMany(reader *XMLReader, start *xml.StartElement) (*GroupSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12613,7 +12348,7 @@ func XMLUsbReadMany(reader *XMLReader, start *xml.StartElement) (*UsbSlice, erro } start = st } - var result UsbSlice + var result GroupSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12627,8 +12362,8 @@ func XMLUsbReadMany(reader *XMLReader, start *xml.StartElement) (*UsbSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "usb": - one, err := XMLUsbReadOne(reader, &t, "usb") + case "group": + one, err := XMLGroupReadOne(reader, &t, "group") if err != nil { return nil, err } @@ -12645,8 +12380,8 @@ func XMLUsbReadMany(reader *XMLReader, start *xml.StartElement) (*UsbSlice, erro return &result, nil } -func XMLRegistrationDomainMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationDomainMapping, error) { - builder := NewRegistrationDomainMappingBuilder() +func XMLGuestOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GuestOperatingSystem, error) { + builder := NewGuestOperatingSystemBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12658,7 +12393,7 @@ func XMLRegistrationDomainMappingReadOne(reader *XMLReader, start *xml.StartElem start = st } if expectedTag == "" { - expectedTag = "registration_domain_mapping" + expectedTag = "guest_operating_system" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -12677,18 +12412,42 @@ func XMLRegistrationDomainMappingReadOne(reader *XMLReader, start *xml.StartElem switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLDomainReadOne(reader, &t, "from") + case "architecture": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLDomainReadOne(reader, &t, "to") + builder.Architecture(v) + case "codename": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.To(v) + builder.Codename(v) + case "distribution": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Distribution(v) + case "family": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Family(v) + case "kernel": + v, err := XMLKernelReadOne(reader, &t, "kernel") + if err != nil { + return nil, err + } + builder.Kernel(v) + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") + if err != nil { + return nil, err + } + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12724,7 +12483,7 @@ func XMLRegistrationDomainMappingReadOne(reader *XMLReader, start *xml.StartElem return one, nil } -func XMLRegistrationDomainMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationDomainMappingSlice, error) { +func XMLGuestOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*GuestOperatingSystemSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12735,7 +12494,7 @@ func XMLRegistrationDomainMappingReadMany(reader *XMLReader, start *xml.StartEle } start = st } - var result RegistrationDomainMappingSlice + var result GuestOperatingSystemSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12749,8 +12508,8 @@ func XMLRegistrationDomainMappingReadMany(reader *XMLReader, start *xml.StartEle switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_domain_mapping": - one, err := XMLRegistrationDomainMappingReadOne(reader, &t, "registration_domain_mapping") + case "guest_operating_system": + one, err := XMLGuestOperatingSystemReadOne(reader, &t, "guest_operating_system") if err != nil { return nil, err } @@ -12767,8 +12526,8 @@ func XMLRegistrationDomainMappingReadMany(reader *XMLReader, start *xml.StartEle return &result, nil } -func XMLGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Group, error) { - builder := NewGroupBuilder() +func XMLHardwareInformationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HardwareInformation, error) { + builder := NewHardwareInformationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12780,22 +12539,11 @@ func XMLGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "group" + expectedTag = "hardware_information" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -12810,60 +12558,48 @@ func XMLGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": + case "family": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "domain": - v, err := XMLDomainReadOne(reader, &t, "domain") - if err != nil { - return nil, err - } - builder.Domain(v) - case "domain_entry_id": + builder.Family(v) + case "manufacturer": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.DomainEntryId(v) - case "name": + builder.Manufacturer(v) + case "product_name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "namespace": + builder.ProductName(v) + case "serial_number": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Namespace(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) + builder.SerialNumber(v) + case "supported_rng_sources": + v, err := XMLRngSourceReadMany(reader, &t) if err != nil { return nil, err } - builder.Permissions(v) - case "roles": - v, err := XMLRoleReadMany(reader, &t) + builder.SupportedRngSources(v) + case "uuid": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Roles(v) - case "tags": - v, err := XMLTagReadMany(reader, &t) + builder.Uuid(v) + case "version": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Tags(v) + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -12894,27 +12630,12 @@ func XMLGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str } for _, link := range links { switch *link.rel { - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "roles": - if one.roles == nil { - one.roles = new(RoleSlice) - } - one.roles.href = link.href - case "tags": - if one.tags == nil { - one.tags = new(TagSlice) - } - one.tags.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLGroupReadMany(reader *XMLReader, start *xml.StartElement) (*GroupSlice, error) { +func XMLHardwareInformationReadMany(reader *XMLReader, start *xml.StartElement) (*HardwareInformationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12925,7 +12646,7 @@ func XMLGroupReadMany(reader *XMLReader, start *xml.StartElement) (*GroupSlice, } start = st } - var result GroupSlice + var result HardwareInformationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -12939,8 +12660,8 @@ func XMLGroupReadMany(reader *XMLReader, start *xml.StartElement) (*GroupSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "group": - one, err := XMLGroupReadOne(reader, &t, "group") + case "hardware_information": + one, err := XMLHardwareInformationReadOne(reader, &t, "hardware_information") if err != nil { return nil, err } @@ -12957,8 +12678,8 @@ func XMLGroupReadMany(reader *XMLReader, start *xml.StartElement) (*GroupSlice, return &result, nil } -func XMLRateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Rate, error) { - builder := NewRateBuilder() +func XMLHighAvailabilityReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HighAvailability, error) { + builder := NewHighAvailabilityBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -12970,7 +12691,7 @@ func XMLRateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "rate" + expectedTag = "high_availability" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -12989,18 +12710,18 @@ func XMLRateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bytes": - v, err := reader.ReadInt64(&t) + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Bytes(v) - case "period": + builder.Enabled(v) + case "priority": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Period(v) + builder.Priority(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13036,7 +12757,7 @@ func XMLRateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return one, nil } -func XMLRateReadMany(reader *XMLReader, start *xml.StartElement) (*RateSlice, error) { +func XMLHighAvailabilityReadMany(reader *XMLReader, start *xml.StartElement) (*HighAvailabilitySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13047,7 +12768,7 @@ func XMLRateReadMany(reader *XMLReader, start *xml.StartElement) (*RateSlice, er } start = st } - var result RateSlice + var result HighAvailabilitySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13061,8 +12782,8 @@ func XMLRateReadMany(reader *XMLReader, start *xml.StartElement) (*RateSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "rate": - one, err := XMLRateReadOne(reader, &t, "rate") + case "high_availability": + one, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") if err != nil { return nil, err } @@ -13079,8 +12800,8 @@ func XMLRateReadMany(reader *XMLReader, start *xml.StartElement) (*RateSlice, er return &result, nil } -func XMLAffinityLabelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AffinityLabel, error) { - builder := NewAffinityLabelBuilder() +func XMLHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Hook, error) { + builder := NewHookBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13092,7 +12813,7 @@ func XMLAffinityLabelReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "affinity_label" + expectedTag = "hook" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -13134,36 +12855,30 @@ func XMLAffinityLabelReadOne(reader *XMLReader, start *xml.StartElement, expecte return nil, err } builder.Description(v) - case "has_implicit_affinity_group": - v, err := reader.ReadBool(&t) + case "event_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.HasImplicitAffinityGroup(v) - case "hosts": - v, err := XMLHostReadMany(reader, &t) + builder.EventName(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Hosts(v) - case "name": + builder.Host(v) + case "md5": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "read_only": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.ReadOnly(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.Md5(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Vms(v) + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13194,22 +12909,12 @@ func XMLAffinityLabelReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { - case "hosts": - if one.hosts == nil { - one.hosts = new(HostSlice) - } - one.hosts.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) - } - one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLAffinityLabelReadMany(reader *XMLReader, start *xml.StartElement) (*AffinityLabelSlice, error) { +func XMLHookReadMany(reader *XMLReader, start *xml.StartElement) (*HookSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13220,7 +12925,7 @@ func XMLAffinityLabelReadMany(reader *XMLReader, start *xml.StartElement) (*Affi } start = st } - var result AffinityLabelSlice + var result HookSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13234,8 +12939,8 @@ func XMLAffinityLabelReadMany(reader *XMLReader, start *xml.StartElement) (*Affi switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity_label": - one, err := XMLAffinityLabelReadOne(reader, &t, "affinity_label") + case "hook": + one, err := XMLHookReadOne(reader, &t, "hook") if err != nil { return nil, err } @@ -13252,8 +12957,8 @@ func XMLAffinityLabelReadMany(reader *XMLReader, start *xml.StartElement) (*Affi return &result, nil } -func XMLHostNicVirtualFunctionsConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostNicVirtualFunctionsConfiguration, error) { - builder := NewHostNicVirtualFunctionsConfigurationBuilder() +func XMLHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Host, error) { + builder := NewHostBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13265,11 +12970,22 @@ func XMLHostNicVirtualFunctionsConfigurationReadOne(reader *XMLReader, start *xm start = st } if expectedTag == "" { - expectedTag = "host_nic_virtual_functions_configuration" + expectedTag = "host" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -13284,24 +13000,343 @@ func XMLHostNicVirtualFunctionsConfigurationReadOne(reader *XMLReader, start *xm switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "all_networks_allowed": + case "address": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Address(v) + case "affinity_labels": + v, err := XMLAffinityLabelReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.AffinityLabels(v) + case "agents": + v, err := XMLAgentReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Agents(v) + case "auto_numa_status": + vp, err := XMLAutoNumaStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.AutoNumaStatus(v) + case "certificate": + v, err := XMLCertificateReadOne(reader, &t, "certificate") + if err != nil { + return nil, err + } + builder.Certificate(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") + if err != nil { + return nil, err + } + builder.Cpu(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "device_passthrough": + v, err := XMLHostDevicePassthroughReadOne(reader, &t, "device_passthrough") + if err != nil { + return nil, err + } + builder.DevicePassthrough(v) + case "devices": + v, err := XMLHostDeviceReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Devices(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") + if err != nil { + return nil, err + } + builder.Display(v) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + if err != nil { + return nil, err + } + builder.ExternalHostProvider(v) + case "external_network_provider_configurations": + v, err := XMLExternalNetworkProviderConfigurationReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.ExternalNetworkProviderConfigurations(v) + case "external_status": + vp, err := XMLExternalStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.ExternalStatus(v) + case "hardware_information": + v, err := XMLHardwareInformationReadOne(reader, &t, "hardware_information") + if err != nil { + return nil, err + } + builder.HardwareInformation(v) + case "hooks": + v, err := XMLHookReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Hooks(v) + case "hosted_engine": + v, err := XMLHostedEngineReadOne(reader, &t, "hosted_engine") + if err != nil { + return nil, err + } + builder.HostedEngine(v) + case "iscsi": + v, err := XMLIscsiDetailsReadOne(reader, &t, "iscsi") + if err != nil { + return nil, err + } + builder.Iscsi(v) + case "katello_errata": + v, err := XMLKatelloErratumReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.KatelloErrata(v) + case "kdump_status": + vp, err := XMLKdumpStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.KdumpStatus(v) + case "ksm": + v, err := XMLKsmReadOne(reader, &t, "ksm") + if err != nil { + return nil, err + } + builder.Ksm(v) + case "libvirt_version": + v, err := XMLVersionReadOne(reader, &t, "libvirt_version") + if err != nil { + return nil, err + } + builder.LibvirtVersion(v) + case "max_scheduling_memory": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxSchedulingMemory(v) + case "memory": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Memory(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "network_attachments": + v, err := XMLNetworkAttachmentReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.NetworkAttachments(v) + case "network_operation_in_progress": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.NetworkOperationInProgress(v) + case "nics": + v, err := XMLHostNicReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Nics(v) + case "host_numa_nodes": + v, err := XMLNumaNodeReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.NumaNodes(v) + case "numa_supported": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.NumaSupported(v) + case "os": + v, err := XMLOperatingSystemReadOne(reader, &t, "os") + if err != nil { + return nil, err + } + builder.Os(v) + case "override_iptables": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.OverrideIptables(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Port(v) + case "power_management": + v, err := XMLPowerManagementReadOne(reader, &t, "power_management") + if err != nil { + return nil, err + } + builder.PowerManagement(v) + case "protocol": + vp, err := XMLHostProtocolReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Protocol(v) + case "reinstallation_required": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.ReinstallationRequired(v) + case "root_password": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.RootPassword(v) + case "se_linux": + v, err := XMLSeLinuxReadOne(reader, &t, "se_linux") + if err != nil { + return nil, err + } + builder.SeLinux(v) + case "spm": + v, err := XMLSpmReadOne(reader, &t, "spm") + if err != nil { + return nil, err + } + builder.Spm(v) + case "ssh": + v, err := XMLSshReadOne(reader, &t, "ssh") + if err != nil { + return nil, err + } + builder.Ssh(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Statistics(v) + case "status": + vp, err := XMLHostStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "status_detail": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.StatusDetail(v) + case "storage_connection_extensions": + v, err := XMLStorageConnectionExtensionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.StorageConnectionExtensions(v) + case "storages": + v, err := XMLHostStorageReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Storages(v) + case "summary": + v, err := XMLVmSummaryReadOne(reader, &t, "summary") + if err != nil { + return nil, err + } + builder.Summary(v) + case "tags": + v, err := XMLTagReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Tags(v) + case "transparent_hugepages": + v, err := XMLTransparentHugePagesReadOne(reader, &t, "transparent_hugepages") + if err != nil { + return nil, err + } + builder.TransparentHugePages(v) + case "type": + vp, err := XMLHostTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "unmanaged_networks": + v, err := XMLUnmanagedNetworkReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.UnmanagedNetworks(v) + case "update_available": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.AllNetworksAllowed(v) - case "max_number_of_virtual_functions": - v, err := reader.ReadInt64(&t) + builder.UpdateAvailable(v) + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") if err != nil { return nil, err } - builder.MaxNumberOfVirtualFunctions(v) - case "number_of_virtual_functions": - v, err := reader.ReadInt64(&t) + builder.Version(v) + case "vgpu_placement": + vp, err := XMLVgpuPlacementReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.NumberOfVirtualFunctions(v) + builder.VgpuPlacement(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13332,12 +13367,87 @@ func XMLHostNicVirtualFunctionsConfigurationReadOne(reader *XMLReader, start *xm } for _, link := range links { switch *link.rel { + case "affinitylabels": + if one.affinityLabels == nil { + one.affinityLabels = new(AffinityLabelSlice) + } + one.affinityLabels.href = link.href + case "agents": + if one.agents == nil { + one.agents = new(AgentSlice) + } + one.agents.href = link.href + case "devices": + if one.devices == nil { + one.devices = new(HostDeviceSlice) + } + one.devices.href = link.href + case "externalnetworkproviderconfigurations": + if one.externalNetworkProviderConfigurations == nil { + one.externalNetworkProviderConfigurations = new(ExternalNetworkProviderConfigurationSlice) + } + one.externalNetworkProviderConfigurations.href = link.href + case "hooks": + if one.hooks == nil { + one.hooks = new(HookSlice) + } + one.hooks.href = link.href + case "katelloerrata": + if one.katelloErrata == nil { + one.katelloErrata = new(KatelloErratumSlice) + } + one.katelloErrata.href = link.href + case "networkattachments": + if one.networkAttachments == nil { + one.networkAttachments = new(NetworkAttachmentSlice) + } + one.networkAttachments.href = link.href + case "nics": + if one.nics == nil { + one.nics = new(HostNicSlice) + } + one.nics.href = link.href + case "numanodes": + if one.numaNodes == nil { + one.numaNodes = new(NumaNodeSlice) + } + one.numaNodes.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + case "storageconnectionextensions": + if one.storageConnectionExtensions == nil { + one.storageConnectionExtensions = new(StorageConnectionExtensionSlice) + } + one.storageConnectionExtensions.href = link.href + case "storages": + if one.storages == nil { + one.storages = new(HostStorageSlice) + } + one.storages.href = link.href + case "tags": + if one.tags == nil { + one.tags = new(TagSlice) + } + one.tags.href = link.href + case "unmanagednetworks": + if one.unmanagedNetworks == nil { + one.unmanagedNetworks = new(UnmanagedNetworkSlice) + } + one.unmanagedNetworks.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLHostNicVirtualFunctionsConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicVirtualFunctionsConfigurationSlice, error) { +func XMLHostReadMany(reader *XMLReader, start *xml.StartElement) (*HostSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13348,7 +13458,7 @@ func XMLHostNicVirtualFunctionsConfigurationReadMany(reader *XMLReader, start *x } start = st } - var result HostNicVirtualFunctionsConfigurationSlice + var result HostSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13362,8 +13472,8 @@ func XMLHostNicVirtualFunctionsConfigurationReadMany(reader *XMLReader, start *x switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host_nic_virtual_functions_configuration": - one, err := XMLHostNicVirtualFunctionsConfigurationReadOne(reader, &t, "host_nic_virtual_functions_configuration") + case "host": + one, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } @@ -13380,8 +13490,8 @@ func XMLHostNicVirtualFunctionsConfigurationReadMany(reader *XMLReader, start *x return &result, nil } -func XMLOpenStackImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackImage, error) { - builder := NewOpenStackImageBuilder() +func XMLHostDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostDevice, error) { + builder := NewHostDeviceBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13393,7 +13503,7 @@ func XMLOpenStackImageReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "openstack_image" + expectedTag = "host_device" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -13423,6 +13533,12 @@ func XMLOpenStackImageReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "capability": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Capability(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -13435,18 +13551,78 @@ func XMLOpenStackImageReadOne(reader *XMLReader, start *xml.StartElement, expect return nil, err } builder.Description(v) + case "driver": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Driver(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "iommu_group": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.IommuGroup(v) + case "m_dev_types": + v, err := XMLMDevTypeReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.MDevTypes(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "openstack_image_provider": - v, err := XMLOpenStackImageProviderReadOne(reader, &t, "openstack_image_provider") + case "parent_device": + v, err := XMLHostDeviceReadOne(reader, &t, "parent_device") if err != nil { return nil, err } - builder.OpenstackImageProvider(v) + builder.ParentDevice(v) + case "physical_function": + v, err := XMLHostDeviceReadOne(reader, &t, "physical_function") + if err != nil { + return nil, err + } + builder.PhysicalFunction(v) + case "placeholder": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Placeholder(v) + case "product": + v, err := XMLProductReadOne(reader, &t, "product") + if err != nil { + return nil, err + } + builder.Product(v) + case "vendor": + v, err := XMLVendorReadOne(reader, &t, "vendor") + if err != nil { + return nil, err + } + builder.Vendor(v) + case "virtual_functions": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.VirtualFunctions(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13482,7 +13658,7 @@ func XMLOpenStackImageReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLOpenStackImageReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackImageSlice, error) { +func XMLHostDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*HostDeviceSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13493,7 +13669,7 @@ func XMLOpenStackImageReadMany(reader *XMLReader, start *xml.StartElement) (*Ope } start = st } - var result OpenStackImageSlice + var result HostDeviceSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13507,8 +13683,8 @@ func XMLOpenStackImageReadMany(reader *XMLReader, start *xml.StartElement) (*Ope switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_image": - one, err := XMLOpenStackImageReadOne(reader, &t, "openstack_image") + case "host_device": + one, err := XMLHostDeviceReadOne(reader, &t, "host_device") if err != nil { return nil, err } @@ -13525,8 +13701,8 @@ func XMLOpenStackImageReadMany(reader *XMLReader, start *xml.StartElement) (*Ope return &result, nil } -func XMLKernelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Kernel, error) { - builder := NewKernelBuilder() +func XMLHostDevicePassthroughReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostDevicePassthrough, error) { + builder := NewHostDevicePassthroughBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13538,7 +13714,7 @@ func XMLKernelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "kernel" + expectedTag = "host_device_passthrough" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -13557,12 +13733,12 @@ func XMLKernelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Version(v) + builder.Enabled(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13598,7 +13774,7 @@ func XMLKernelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLKernelReadMany(reader *XMLReader, start *xml.StartElement) (*KernelSlice, error) { +func XMLHostDevicePassthroughReadMany(reader *XMLReader, start *xml.StartElement) (*HostDevicePassthroughSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13609,7 +13785,7 @@ func XMLKernelReadMany(reader *XMLReader, start *xml.StartElement) (*KernelSlice } start = st } - var result KernelSlice + var result HostDevicePassthroughSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13623,8 +13799,8 @@ func XMLKernelReadMany(reader *XMLReader, start *xml.StartElement) (*KernelSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "kernel": - one, err := XMLKernelReadOne(reader, &t, "kernel") + case "host_device_passthrough": + one, err := XMLHostDevicePassthroughReadOne(reader, &t, "host_device_passthrough") if err != nil { return nil, err } @@ -13641,8 +13817,8 @@ func XMLKernelReadMany(reader *XMLReader, start *xml.StartElement) (*KernelSlice return &result, nil } -func XMLExternalHostProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalHostProvider, error) { - builder := NewExternalHostProviderBuilder() +func XMLHostNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostNic, error) { + builder := NewHostNicBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13654,7 +13830,7 @@ func XMLExternalHostProviderReadOne(reader *XMLReader, start *xml.StartElement, start = st } if expectedTag == "" { - expectedTag = "external_host_provider" + expectedTag = "host_nic" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -13684,90 +13860,171 @@ func XMLExternalHostProviderReadOne(reader *XMLReader, start *xml.StartElement, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authentication_url": + case "ad_aggregator_id": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.AdAggregatorId(v) + case "base_interface": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.AuthenticationUrl(v) - case "certificates": - v, err := XMLCertificateReadMany(reader, &t) + builder.BaseInterface(v) + case "bonding": + v, err := XMLBondingReadOne(reader, &t, "bonding") if err != nil { return nil, err } - builder.Certificates(v) + builder.Bonding(v) + case "boot_protocol": + vp, err := XMLBootProtocolReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.BootProtocol(v) + case "bridged": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Bridged(v) + case "check_connectivity": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.CheckConnectivity(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "compute_resources": - v, err := XMLExternalComputeResourceReadMany(reader, &t) + case "custom_configuration": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.ComputeResources(v) + builder.CustomConfiguration(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "discovered_hosts": - v, err := XMLExternalDiscoveredHostReadMany(reader, &t) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.DiscoveredHosts(v) - case "host_groups": - v, err := XMLExternalHostGroupReadMany(reader, &t) + builder.Host(v) + case "ip": + v, err := XMLIpReadOne(reader, &t, "ip") if err != nil { return nil, err } - builder.HostGroups(v) - case "hosts": - v, err := XMLHostReadMany(reader, &t) + builder.Ip(v) + case "ipv6": + v, err := XMLIpReadOne(reader, &t, "ipv6") if err != nil { return nil, err } - builder.Hosts(v) + builder.Ipv6(v) + case "ipv6_boot_protocol": + vp, err := XMLBootProtocolReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Ipv6BootProtocol(v) + case "mac": + v, err := XMLMacReadOne(reader, &t, "mac") + if err != nil { + return nil, err + } + builder.Mac(v) + case "mtu": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Mtu(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "password": - v, err := reader.ReadString(&t) + case "network": + v, err := XMLNetworkReadOne(reader, &t, "network") if err != nil { return nil, err } - builder.Password(v) + builder.Network(v) + case "network_labels": + v, err := XMLNetworkLabelReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.NetworkLabels(v) + case "override_configuration": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.OverrideConfiguration(v) + case "physical_function": + v, err := XMLHostNicReadOne(reader, &t, "physical_function") + if err != nil { + return nil, err + } + builder.PhysicalFunction(v) case "properties": v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } builder.Properties(v) - case "requires_authentication": - v, err := reader.ReadBool(&t) + case "qos": + v, err := XMLQosReadOne(reader, &t, "qos") if err != nil { return nil, err } - builder.RequiresAuthentication(v) - case "url": - v, err := reader.ReadString(&t) + builder.Qos(v) + case "speed": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Url(v) - case "username": - v, err := reader.ReadString(&t) + builder.Speed(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.Username(v) + builder.Statistics(v) + case "status": + vp, err := XMLNicStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "virtual_functions_configuration": + v, err := XMLHostNicVirtualFunctionsConfigurationReadOne(reader, &t, "virtual_functions_configuration") + if err != nil { + return nil, err + } + builder.VirtualFunctionsConfiguration(v) + case "vlan": + v, err := XMLVlanReadOne(reader, &t, "vlan") + if err != nil { + return nil, err + } + builder.Vlan(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13798,37 +14055,22 @@ func XMLExternalHostProviderReadOne(reader *XMLReader, start *xml.StartElement, } for _, link := range links { switch *link.rel { - case "certificates": - if one.certificates == nil { - one.certificates = new(CertificateSlice) - } - one.certificates.href = link.href - case "computeresources": - if one.computeResources == nil { - one.computeResources = new(ExternalComputeResourceSlice) - } - one.computeResources.href = link.href - case "discoveredhosts": - if one.discoveredHosts == nil { - one.discoveredHosts = new(ExternalDiscoveredHostSlice) - } - one.discoveredHosts.href = link.href - case "hostgroups": - if one.hostGroups == nil { - one.hostGroups = new(ExternalHostGroupSlice) + case "networklabels": + if one.networkLabels == nil { + one.networkLabels = new(NetworkLabelSlice) } - one.hostGroups.href = link.href - case "hosts": - if one.hosts == nil { - one.hosts = new(HostSlice) + one.networkLabels.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) } - one.hosts.href = link.href + one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLExternalHostProviderReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalHostProviderSlice, error) { +func XMLHostNicReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13839,7 +14081,7 @@ func XMLExternalHostProviderReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result ExternalHostProviderSlice + var result HostNicSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13853,8 +14095,8 @@ func XMLExternalHostProviderReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "external_host_provider": - one, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + case "host_nic": + one, err := XMLHostNicReadOne(reader, &t, "host_nic") if err != nil { return nil, err } @@ -13871,8 +14113,8 @@ func XMLExternalHostProviderReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLSsoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Sso, error) { - builder := NewSsoBuilder() +func XMLHostNicVirtualFunctionsConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostNicVirtualFunctionsConfiguration, error) { + builder := NewHostNicVirtualFunctionsConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13884,7 +14126,7 @@ func XMLSsoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "sso" + expectedTag = "host_nic_virtual_functions_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -13903,12 +14145,24 @@ func XMLSsoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "methods": - v, err := XMLMethodReadMany(reader, &t) + case "all_networks_allowed": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Methods(v) + builder.AllNetworksAllowed(v) + case "max_number_of_virtual_functions": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxNumberOfVirtualFunctions(v) + case "number_of_virtual_functions": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.NumberOfVirtualFunctions(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -13944,7 +14198,7 @@ func XMLSsoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLSsoReadMany(reader *XMLReader, start *xml.StartElement) (*SsoSlice, error) { +func XMLHostNicVirtualFunctionsConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*HostNicVirtualFunctionsConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -13955,7 +14209,7 @@ func XMLSsoReadMany(reader *XMLReader, start *xml.StartElement) (*SsoSlice, erro } start = st } - var result SsoSlice + var result HostNicVirtualFunctionsConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -13969,8 +14223,8 @@ func XMLSsoReadMany(reader *XMLReader, start *xml.StartElement) (*SsoSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "sso": - one, err := XMLSsoReadOne(reader, &t, "sso") + case "host_nic_virtual_functions_configuration": + one, err := XMLHostNicVirtualFunctionsConfigurationReadOne(reader, &t, "host_nic_virtual_functions_configuration") if err != nil { return nil, err } @@ -13987,8 +14241,8 @@ func XMLSsoReadMany(reader *XMLReader, start *xml.StartElement) (*SsoSlice, erro return &result, nil } -func XMLIscsiDetailsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*IscsiDetails, error) { - builder := NewIscsiDetailsBuilder() +func XMLHostStorageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostStorage, error) { + builder := NewHostStorageBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14000,11 +14254,22 @@ func XMLIscsiDetailsReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "iscsi_details" + expectedTag = "host_storage" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -14024,103 +14289,135 @@ func XMLIscsiDetailsReadOne(reader *XMLReader, start *xml.StartElement, expected if err != nil { return nil, err } - builder.Address(v) - case "disk_id": + builder.Address(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "driver_options": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DriverOptions(v) + case "driver_sensitive_options": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DriverSensitiveOptions(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "logical_units": + v, err := XMLLogicalUnitReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.LogicalUnits(v) + case "mount_options": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.DiskId(v) - case "initiator": + builder.MountOptions(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Initiator(v) - case "lun_mapping": + builder.Name(v) + case "nfs_retrans": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.LunMapping(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "paths": + builder.NfsRetrans(v) + case "nfs_timeo": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Paths(v) - case "port": - v, err := reader.ReadInt64(&t) + builder.NfsTimeo(v) + case "nfs_version": + vp, err := XMLNfsVersionReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Port(v) - case "portal": - v, err := reader.ReadString(&t) + builder.NfsVersion(v) + case "override_luns": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Portal(v) - case "product_id": + builder.OverrideLuns(v) + case "password": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ProductId(v) - case "serial": + builder.Password(v) + case "path": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Serial(v) - case "size": + builder.Path(v) + case "port": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Size(v) - case "status": + builder.Port(v) + case "portal": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Status(v) - case "storage_domain_id": + builder.Portal(v) + case "target": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.StorageDomainId(v) - case "target": - v, err := reader.ReadString(&t) + builder.Target(v) + case "type": + vp, err := XMLStorageTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Target(v) + builder.Type(v) case "username": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Username(v) - case "vendor_id": + case "vfs_type": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.VendorId(v) - case "volume_group_id": - v, err := reader.ReadString(&t) + builder.VfsType(v) + case "volume_group": + v, err := XMLVolumeGroupReadOne(reader, &t, "volume_group") if err != nil { return nil, err } - builder.VolumeGroupId(v) + builder.VolumeGroup(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -14156,7 +14453,7 @@ func XMLIscsiDetailsReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLIscsiDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiDetailsSlice, error) { +func XMLHostStorageReadMany(reader *XMLReader, start *xml.StartElement) (*HostStorageSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14167,7 +14464,7 @@ func XMLIscsiDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*Iscsi } start = st } - var result IscsiDetailsSlice + var result HostStorageSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -14181,8 +14478,8 @@ func XMLIscsiDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*Iscsi switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "iscsi_details": - one, err := XMLIscsiDetailsReadOne(reader, &t, "iscsi_details") + case "host_storage": + one, err := XMLHostStorageReadOne(reader, &t, "host_storage") if err != nil { return nil, err } @@ -14199,8 +14496,8 @@ func XMLIscsiDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*Iscsi return &result, nil } -func XMLDnsResolverConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DnsResolverConfiguration, error) { - builder := NewDnsResolverConfigurationBuilder() +func XMLHostedEngineReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostedEngine, error) { + builder := NewHostedEngineBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14212,7 +14509,7 @@ func XMLDnsResolverConfigurationReadOne(reader *XMLReader, start *xml.StartEleme start = st } if expectedTag == "" { - expectedTag = "dns_resolver_configuration" + expectedTag = "hosted_engine" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -14231,12 +14528,36 @@ func XMLDnsResolverConfigurationReadOne(reader *XMLReader, start *xml.StartEleme switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "name_servers": - v, err := reader.ReadStrings(&t) + case "active": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.NameServers(v) + builder.Active(v) + case "configured": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Configured(v) + case "global_maintenance": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.GlobalMaintenance(v) + case "local_maintenance": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.LocalMaintenance(v) + case "score": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Score(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -14272,7 +14593,7 @@ func XMLDnsResolverConfigurationReadOne(reader *XMLReader, start *xml.StartEleme return one, nil } -func XMLDnsResolverConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*DnsResolverConfigurationSlice, error) { +func XMLHostedEngineReadMany(reader *XMLReader, start *xml.StartElement) (*HostedEngineSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14283,7 +14604,7 @@ func XMLDnsResolverConfigurationReadMany(reader *XMLReader, start *xml.StartElem } start = st } - var result DnsResolverConfigurationSlice + var result HostedEngineSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -14297,8 +14618,8 @@ func XMLDnsResolverConfigurationReadMany(reader *XMLReader, start *xml.StartElem switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "dns_resolver_configuration": - one, err := XMLDnsResolverConfigurationReadOne(reader, &t, "dns_resolver_configuration") + case "hosted_engine": + one, err := XMLHostedEngineReadOne(reader, &t, "hosted_engine") if err != nil { return nil, err } @@ -14315,8 +14636,8 @@ func XMLDnsResolverConfigurationReadMany(reader *XMLReader, start *xml.StartElem return &result, nil } -func XMLMethodReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Method, error) { - builder := NewMethodBuilder() +func XMLIconReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Icon, error) { + builder := NewIconBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14328,7 +14649,7 @@ func XMLMethodReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "method" + expectedTag = "icon" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -14339,13 +14660,79 @@ func XMLMethodReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st value := attr.Value switch name { case "id": - builder.Id(SsoMethod(value)) + builder.Id(value) case "href": builder.Href(value) } } var links []Link - reader.Skip() + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "data": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Data(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "media_type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.MediaType(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } + } + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) + } + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } one, err := builder.Build() if err != nil { return nil, err @@ -14357,7 +14744,7 @@ func XMLMethodReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLMethodReadMany(reader *XMLReader, start *xml.StartElement) (*MethodSlice, error) { +func XMLIconReadMany(reader *XMLReader, start *xml.StartElement) (*IconSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14368,7 +14755,7 @@ func XMLMethodReadMany(reader *XMLReader, start *xml.StartElement) (*MethodSlice } start = st } - var result MethodSlice + var result IconSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -14382,8 +14769,8 @@ func XMLMethodReadMany(reader *XMLReader, start *xml.StartElement) (*MethodSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "method": - one, err := XMLMethodReadOne(reader, &t, "method") + case "icon": + one, err := XMLIconReadOne(reader, &t, "icon") if err != nil { return nil, err } @@ -14400,8 +14787,8 @@ func XMLMethodReadMany(reader *XMLReader, start *xml.StartElement) (*MethodSlice return &result, nil } -func XMLDataCenterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DataCenter, error) { - builder := NewDataCenterBuilder() +func XMLIdentifiedReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Identified, error) { + builder := NewIdentifiedBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14413,7 +14800,7 @@ func XMLDataCenterReadOne(reader *XMLReader, start *xml.StartElement, expectedTa start = st } if expectedTag == "" { - expectedTag = "data_center" + expectedTag = "identified" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -14443,12 +14830,6 @@ func XMLDataCenterReadOne(reader *XMLReader, start *xml.StartElement, expectedTa switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "clusters": - v, err := XMLClusterReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Clusters(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -14461,93 +14842,12 @@ func XMLDataCenterReadOne(reader *XMLReader, start *xml.StartElement, expectedTa return nil, err } builder.Description(v) - case "iscsi_bonds": - v, err := XMLIscsiBondReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.IscsiBonds(v) - case "local": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Local(v) - case "mac_pool": - v, err := XMLMacPoolReadOne(reader, &t, "mac_pool") - if err != nil { - return nil, err - } - builder.MacPool(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "networks": - v, err := XMLNetworkReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Networks(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "qoss": - v, err := XMLQosReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Qoss(v) - case "quota_mode": - vp, err := XMLQuotaModeTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.QuotaMode(v) - case "quotas": - v, err := XMLQuotaReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Quotas(v) - case "status": - vp, err := XMLDataCenterStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "storage_domains": - v, err := XMLStorageDomainReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.StorageDomains(v) - case "storage_format": - vp, err := XMLStorageFormatReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.StorageFormat(v) - case "supported_versions": - v, err := XMLVersionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.SupportedVersions(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") - if err != nil { - return nil, err - } - builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -14578,47 +14878,12 @@ func XMLDataCenterReadOne(reader *XMLReader, start *xml.StartElement, expectedTa } for _, link := range links { switch *link.rel { - case "clusters": - if one.clusters == nil { - one.clusters = new(ClusterSlice) - } - one.clusters.href = link.href - case "iscsibonds": - if one.iscsiBonds == nil { - one.iscsiBonds = new(IscsiBondSlice) - } - one.iscsiBonds.href = link.href - case "networks": - if one.networks == nil { - one.networks = new(NetworkSlice) - } - one.networks.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "qoss": - if one.qoss == nil { - one.qoss = new(QosSlice) - } - one.qoss.href = link.href - case "quotas": - if one.quotas == nil { - one.quotas = new(QuotaSlice) - } - one.quotas.href = link.href - case "storagedomains": - if one.storageDomains == nil { - one.storageDomains = new(StorageDomainSlice) - } - one.storageDomains.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLDataCenterReadMany(reader *XMLReader, start *xml.StartElement) (*DataCenterSlice, error) { +func XMLIdentifiedReadMany(reader *XMLReader, start *xml.StartElement) (*IdentifiedSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14629,7 +14894,7 @@ func XMLDataCenterReadMany(reader *XMLReader, start *xml.StartElement) (*DataCen } start = st } - var result DataCenterSlice + var result IdentifiedSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -14643,8 +14908,8 @@ func XMLDataCenterReadMany(reader *XMLReader, start *xml.StartElement) (*DataCen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "data_center": - one, err := XMLDataCenterReadOne(reader, &t, "data_center") + case "identified": + one, err := XMLIdentifiedReadOne(reader, &t, "identified") if err != nil { return nil, err } @@ -14661,8 +14926,8 @@ func XMLDataCenterReadMany(reader *XMLReader, start *xml.StartElement) (*DataCen return &result, nil } -func XMLRegistrationRoleMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationRoleMapping, error) { - builder := NewRegistrationRoleMappingBuilder() +func XMLImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Image, error) { + builder := NewImageBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14674,11 +14939,22 @@ func XMLRegistrationRoleMappingReadOne(reader *XMLReader, start *xml.StartElemen start = st } if expectedTag == "" { - expectedTag = "registration_role_mapping" + expectedTag = "image" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -14693,18 +14969,43 @@ func XMLRegistrationRoleMappingReadOne(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLRoleReadOne(reader, &t, "from") + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLRoleReadOne(reader, &t, "to") + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.To(v) + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Size(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "type": + vp, err := XMLImageFileTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -14740,7 +15041,7 @@ func XMLRegistrationRoleMappingReadOne(reader *XMLReader, start *xml.StartElemen return one, nil } -func XMLRegistrationRoleMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationRoleMappingSlice, error) { +func XMLImageReadMany(reader *XMLReader, start *xml.StartElement) (*ImageSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14751,7 +15052,7 @@ func XMLRegistrationRoleMappingReadMany(reader *XMLReader, start *xml.StartEleme } start = st } - var result RegistrationRoleMappingSlice + var result ImageSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -14765,8 +15066,8 @@ func XMLRegistrationRoleMappingReadMany(reader *XMLReader, start *xml.StartEleme switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_role_mapping": - one, err := XMLRegistrationRoleMappingReadOne(reader, &t, "registration_role_mapping") + case "image": + one, err := XMLImageReadOne(reader, &t, "image") if err != nil { return nil, err } @@ -14783,8 +15084,8 @@ func XMLRegistrationRoleMappingReadMany(reader *XMLReader, start *xml.StartEleme return &result, nil } -func XMLFopStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*FopStatistic, error) { - builder := NewFopStatisticBuilder() +func XMLImageTransferReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ImageTransfer, error) { + builder := NewImageTransferBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14796,11 +15097,22 @@ func XMLFopStatisticReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "fop_statistic" + expectedTag = "image_transfer" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -14815,18 +15127,111 @@ func XMLFopStatisticReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "active": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Active(v) + case "backup": + v, err := XMLBackupReadOne(reader, &t, "backup") + if err != nil { + return nil, err + } + builder.Backup(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "direction": + vp, err := XMLImageTransferDirectionReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Direction(v) + case "disk": + v, err := XMLDiskReadOne(reader, &t, "disk") + if err != nil { + return nil, err + } + builder.Disk(v) + case "format": + vp, err := XMLDiskFormatReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Format(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "image": + v, err := XMLImageReadOne(reader, &t, "image") + if err != nil { + return nil, err + } + builder.Image(v) + case "inactivity_timeout": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.InactivityTimeout(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) + builder.Name(v) + case "phase": + vp, err := XMLImageTransferPhaseReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Phase(v) + case "proxy_url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ProxyUrl(v) + case "shallow": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Shallow(v) + case "snapshot": + v, err := XMLDiskSnapshotReadOne(reader, &t, "snapshot") + if err != nil { + return nil, err + } + builder.Snapshot(v) + case "transfer_url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.TransferUrl(v) + case "transferred": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Statistics(v) + builder.Transferred(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -14862,7 +15267,7 @@ func XMLFopStatisticReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLFopStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*FopStatisticSlice, error) { +func XMLImageTransferReadMany(reader *XMLReader, start *xml.StartElement) (*ImageTransferSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14873,7 +15278,7 @@ func XMLFopStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*FopSt } start = st } - var result FopStatisticSlice + var result ImageTransferSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -14887,8 +15292,8 @@ func XMLFopStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*FopSt switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "fop_statistic": - one, err := XMLFopStatisticReadOne(reader, &t, "fop_statistic") + case "image_transfer": + one, err := XMLImageTransferReadOne(reader, &t, "image_transfer") if err != nil { return nil, err } @@ -14905,8 +15310,8 @@ func XMLFopStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*FopSt return &result, nil } -func XMLIdentifiedReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Identified, error) { - builder := NewIdentifiedBuilder() +func XMLInitializationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Initialization, error) { + builder := NewInitializationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -14918,22 +15323,11 @@ func XMLIdentifiedReadOne(reader *XMLReader, start *xml.StartElement, expectedTa start = st } if expectedTag == "" { - expectedTag = "identified" + expectedTag = "initialization" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -14948,24 +15342,139 @@ func XMLIdentifiedReadOne(reader *XMLReader, start *xml.StartElement, expectedTa switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": + case "active_directory_ou": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "description": + builder.ActiveDirectoryOu(v) + case "authorized_ssh_keys": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "name": + builder.AuthorizedSshKeys(v) + case "cloud_init": + v, err := XMLCloudInitReadOne(reader, &t, "cloud_init") + if err != nil { + return nil, err + } + builder.CloudInit(v) + case "cloud_init_network_protocol": + vp, err := XMLCloudInitNetworkProtocolReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.CloudInitNetworkProtocol(v) + case "configuration": + v, err := XMLConfigurationReadOne(reader, &t, "configuration") + if err != nil { + return nil, err + } + builder.Configuration(v) + case "custom_script": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) + builder.CustomScript(v) + case "dns_search": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.DnsSearch(v) + case "dns_servers": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.DnsServers(v) + case "domain": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Domain(v) + case "host_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.HostName(v) + case "input_locale": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.InputLocale(v) + case "nic_configurations": + v, err := XMLNicConfigurationReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.NicConfigurations(v) + case "org_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.OrgName(v) + case "regenerate_ids": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.RegenerateIds(v) + case "regenerate_ssh_keys": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.RegenerateSshKeys(v) + case "root_password": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.RootPassword(v) + case "system_locale": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.SystemLocale(v) + case "timezone": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Timezone(v) + case "ui_language": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.UiLanguage(v) + case "user_locale": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.UserLocale(v) + case "user_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.UserName(v) + case "windows_license_key": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.WindowsLicenseKey(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -15001,7 +15510,7 @@ func XMLIdentifiedReadOne(reader *XMLReader, start *xml.StartElement, expectedTa return one, nil } -func XMLIdentifiedReadMany(reader *XMLReader, start *xml.StartElement) (*IdentifiedSlice, error) { +func XMLInitializationReadMany(reader *XMLReader, start *xml.StartElement) (*InitializationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15012,7 +15521,7 @@ func XMLIdentifiedReadMany(reader *XMLReader, start *xml.StartElement) (*Identif } start = st } - var result IdentifiedSlice + var result InitializationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -15026,8 +15535,8 @@ func XMLIdentifiedReadMany(reader *XMLReader, start *xml.StartElement) (*Identif switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "identified": - one, err := XMLIdentifiedReadOne(reader, &t, "identified") + case "initialization": + one, err := XMLInitializationReadOne(reader, &t, "initialization") if err != nil { return nil, err } @@ -15044,8 +15553,8 @@ func XMLIdentifiedReadMany(reader *XMLReader, start *xml.StartElement) (*Identif return &result, nil } -func XMLEntityProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*EntityProfileDetail, error) { - builder := NewEntityProfileDetailBuilder() +func XMLInstanceTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*InstanceType, error) { + builder := NewInstanceTypeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15057,11 +15566,22 @@ func XMLEntityProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, e start = st } if expectedTag == "" { - expectedTag = "entity_profile_detail" + expectedTag = "instance_type" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -15076,12 +15596,339 @@ func XMLEntityProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, e switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "profile_details": - v, err := XMLProfileDetailReadMany(reader, &t) + case "bios": + v, err := XMLBiosReadOne(reader, &t, "bios") + if err != nil { + return nil, err + } + builder.Bios(v) + case "cdroms": + v, err := XMLCdromReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Cdroms(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "console": + v, err := XMLConsoleReadOne(reader, &t, "console") + if err != nil { + return nil, err + } + builder.Console(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") + if err != nil { + return nil, err + } + builder.Cpu(v) + case "cpu_profile": + v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") + if err != nil { + return nil, err + } + builder.CpuProfile(v) + case "cpu_shares": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.CpuShares(v) + case "creation_time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.CreationTime(v) + case "custom_compatibility_version": + v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") + if err != nil { + return nil, err + } + builder.CustomCompatibilityVersion(v) + case "custom_cpu_model": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomCpuModel(v) + case "custom_emulated_machine": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomEmulatedMachine(v) + case "custom_properties": + v, err := XMLCustomPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.CustomProperties(v) + case "delete_protected": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.DeleteProtected(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "disk_attachments": + v, err := XMLDiskAttachmentReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DiskAttachments(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") + if err != nil { + return nil, err + } + builder.Display(v) + case "domain": + v, err := XMLDomainReadOne(reader, &t, "domain") + if err != nil { + return nil, err + } + builder.Domain(v) + case "graphics_consoles": + v, err := XMLGraphicsConsoleReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.GraphicsConsoles(v) + case "high_availability": + v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + if err != nil { + return nil, err + } + builder.HighAvailability(v) + case "initialization": + v, err := XMLInitializationReadOne(reader, &t, "initialization") + if err != nil { + return nil, err + } + builder.Initialization(v) + case "io": + v, err := XMLIoReadOne(reader, &t, "io") + if err != nil { + return nil, err + } + builder.Io(v) + case "large_icon": + v, err := XMLIconReadOne(reader, &t, "large_icon") + if err != nil { + return nil, err + } + builder.LargeIcon(v) + case "lease": + v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") + if err != nil { + return nil, err + } + builder.Lease(v) + case "memory": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Memory(v) + case "memory_policy": + v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + if err != nil { + return nil, err + } + builder.MemoryPolicy(v) + case "migration": + v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") + if err != nil { + return nil, err + } + builder.Migration(v) + case "migration_downtime": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MigrationDowntime(v) + case "multi_queues_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.MultiQueuesEnabled(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "nics": + v, err := XMLNicReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Nics(v) + case "origin": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Origin(v) + case "os": + v, err := XMLOperatingSystemReadOne(reader, &t, "os") + if err != nil { + return nil, err + } + builder.Os(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "placement_policy": + v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") + if err != nil { + return nil, err + } + builder.PlacementPolicy(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err + } + builder.Quota(v) + case "rng_device": + v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + if err != nil { + return nil, err + } + builder.RngDevice(v) + case "serial_number": + v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") + if err != nil { + return nil, err + } + builder.SerialNumber(v) + case "small_icon": + v, err := XMLIconReadOne(reader, &t, "small_icon") + if err != nil { + return nil, err + } + builder.SmallIcon(v) + case "soundcard_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.SoundcardEnabled(v) + case "sso": + v, err := XMLSsoReadOne(reader, &t, "sso") + if err != nil { + return nil, err + } + builder.Sso(v) + case "start_paused": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.StartPaused(v) + case "stateless": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Stateless(v) + case "status": + vp, err := XMLTemplateStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "storage_error_resume_behaviour": + vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.StorageErrorResumeBehaviour(v) + case "tags": + v, err := XMLTagReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Tags(v) + case "time_zone": + v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") + if err != nil { + return nil, err + } + builder.TimeZone(v) + case "tunnel_migration": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.TunnelMigration(v) + case "type": + vp, err := XMLVmTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "usb": + v, err := XMLUsbReadOne(reader, &t, "usb") + if err != nil { + return nil, err + } + builder.Usb(v) + case "version": + v, err := XMLTemplateVersionReadOne(reader, &t, "version") + if err != nil { + return nil, err + } + builder.Version(v) + case "virtio_scsi": + v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") + if err != nil { + return nil, err + } + builder.VirtioScsi(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } - builder.ProfileDetails(v) + builder.Vm(v) + case "watchdogs": + v, err := XMLWatchdogReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Watchdogs(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -15112,12 +15959,47 @@ func XMLEntityProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, e } for _, link := range links { switch *link.rel { + case "cdroms": + if one.cdroms == nil { + one.cdroms = new(CdromSlice) + } + one.cdroms.href = link.href + case "diskattachments": + if one.diskAttachments == nil { + one.diskAttachments = new(DiskAttachmentSlice) + } + one.diskAttachments.href = link.href + case "graphicsconsoles": + if one.graphicsConsoles == nil { + one.graphicsConsoles = new(GraphicsConsoleSlice) + } + one.graphicsConsoles.href = link.href + case "nics": + if one.nics == nil { + one.nics = new(NicSlice) + } + one.nics.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "tags": + if one.tags == nil { + one.tags = new(TagSlice) + } + one.tags.href = link.href + case "watchdogs": + if one.watchdogs == nil { + one.watchdogs = new(WatchdogSlice) + } + one.watchdogs.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLEntityProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*EntityProfileDetailSlice, error) { +func XMLInstanceTypeReadMany(reader *XMLReader, start *xml.StartElement) (*InstanceTypeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15128,7 +16010,7 @@ func XMLEntityProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result EntityProfileDetailSlice + var result InstanceTypeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -15142,8 +16024,8 @@ func XMLEntityProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "entity_profile_detail": - one, err := XMLEntityProfileDetailReadOne(reader, &t, "entity_profile_detail") + case "instance_type": + one, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") if err != nil { return nil, err } @@ -15160,8 +16042,8 @@ func XMLEntityProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLWeightReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Weight, error) { - builder := NewWeightBuilder() +func XMLIoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Io, error) { + builder := NewIoBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15173,22 +16055,11 @@ func XMLWeightReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "weight" + expectedTag = "io" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -15203,42 +16074,12 @@ func XMLWeightReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "factor": + case "threads": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Factor(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "scheduling_policy": - v, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") - if err != nil { - return nil, err - } - builder.SchedulingPolicy(v) - case "scheduling_policy_unit": - v, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") - if err != nil { - return nil, err - } - builder.SchedulingPolicyUnit(v) + builder.Threads(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -15274,7 +16115,7 @@ func XMLWeightReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLWeightReadMany(reader *XMLReader, start *xml.StartElement) (*WeightSlice, error) { +func XMLIoReadMany(reader *XMLReader, start *xml.StartElement) (*IoSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15285,7 +16126,7 @@ func XMLWeightReadMany(reader *XMLReader, start *xml.StartElement) (*WeightSlice } start = st } - var result WeightSlice + var result IoSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -15299,8 +16140,8 @@ func XMLWeightReadMany(reader *XMLReader, start *xml.StartElement) (*WeightSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "weight": - one, err := XMLWeightReadOne(reader, &t, "weight") + case "io": + one, err := XMLIoReadOne(reader, &t, "io") if err != nil { return nil, err } @@ -15317,8 +16158,8 @@ func XMLWeightReadMany(reader *XMLReader, start *xml.StartElement) (*WeightSlice return &result, nil } -func XMLGlusterVolumeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterVolume, error) { - builder := NewGlusterVolumeBuilder() +func XMLIpReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ip, error) { + builder := NewIpBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15330,22 +16171,11 @@ func XMLGlusterVolumeReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "gluster_volume" + expectedTag = "ip" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -15360,92 +16190,31 @@ func XMLGlusterVolumeReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bricks": - v, err := XMLGlusterBrickReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Bricks(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) - case "comment": + case "address": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "description": + builder.Address(v) + case "gateway": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "disperse_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.DisperseCount(v) - case "name": + builder.Gateway(v) + case "netmask": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "options": - v, err := XMLOptionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Options(v) - case "redundancy_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.RedundancyCount(v) - case "replica_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ReplicaCount(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "status": - vp, err := XMLGlusterVolumeStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "stripe_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.StripeCount(v) - case "transport_types": - v, err := XMLTransportTypeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.TransportTypes(v) - case "volume_type": - vp, err := XMLGlusterVolumeTypeReadOne(reader, &t) + builder.Netmask(v) + case "version": + vp, err := XMLIpVersionReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.VolumeType(v) + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -15476,22 +16245,12 @@ func XMLGlusterVolumeReadOne(reader *XMLReader, start *xml.StartElement, expecte } for _, link := range links { switch *link.rel { - case "bricks": - if one.bricks == nil { - one.bricks = new(GlusterBrickSlice) - } - one.bricks.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLGlusterVolumeReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeSlice, error) { +func XMLIpReadMany(reader *XMLReader, start *xml.StartElement) (*IpSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15502,7 +16261,7 @@ func XMLGlusterVolumeReadMany(reader *XMLReader, start *xml.StartElement) (*Glus } start = st } - var result GlusterVolumeSlice + var result IpSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -15516,8 +16275,8 @@ func XMLGlusterVolumeReadMany(reader *XMLReader, start *xml.StartElement) (*Glus switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "gluster_volume": - one, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") + case "ip": + one, err := XMLIpReadOne(reader, &t, "ip") if err != nil { return nil, err } @@ -15534,8 +16293,8 @@ func XMLGlusterVolumeReadMany(reader *XMLReader, start *xml.StartElement) (*Glus return &result, nil } -func XMLStorageConnectionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageConnection, error) { - builder := NewStorageConnectionBuilder() +func XMLIpAddressAssignmentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*IpAddressAssignment, error) { + builder := NewIpAddressAssignmentBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15547,22 +16306,11 @@ func XMLStorageConnectionReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "storage_connection" + expectedTag = "ip_address_assignment" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -15577,116 +16325,19 @@ func XMLStorageConnectionReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "gluster_volume": - v, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") - if err != nil { - return nil, err - } - builder.GlusterVolume(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "mount_options": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.MountOptions(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "nfs_retrans": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.NfsRetrans(v) - case "nfs_timeo": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.NfsTimeo(v) - case "nfs_version": - vp, err := XMLNfsVersionReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.NfsVersion(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "path": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Path(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "portal": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Portal(v) - case "target": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Target(v) - case "type": - vp, err := XMLStorageTypeReadOne(reader, &t) + case "assignment_method": + vp, err := XMLBootProtocolReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.Type(v) - case "username": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Username(v) - case "vfs_type": - v, err := reader.ReadString(&t) + builder.AssignmentMethod(v) + case "ip": + v, err := XMLIpReadOne(reader, &t, "ip") if err != nil { return nil, err } - builder.VfsType(v) + builder.Ip(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -15722,7 +16373,7 @@ func XMLStorageConnectionReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLStorageConnectionReadMany(reader *XMLReader, start *xml.StartElement) (*StorageConnectionSlice, error) { +func XMLIpAddressAssignmentReadMany(reader *XMLReader, start *xml.StartElement) (*IpAddressAssignmentSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15733,7 +16384,7 @@ func XMLStorageConnectionReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result StorageConnectionSlice + var result IpAddressAssignmentSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -15747,8 +16398,8 @@ func XMLStorageConnectionReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "storage_connection": - one, err := XMLStorageConnectionReadOne(reader, &t, "storage_connection") + case "ip_address_assignment": + one, err := XMLIpAddressAssignmentReadOne(reader, &t, "ip_address_assignment") if err != nil { return nil, err } @@ -15765,8 +16416,8 @@ func XMLStorageConnectionReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLNetworkFilterParameterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkFilterParameter, error) { - builder := NewNetworkFilterParameterBuilder() +func XMLIscsiBondReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*IscsiBond, error) { + builder := NewIscsiBondBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15778,7 +16429,7 @@ func XMLNetworkFilterParameterReadOne(reader *XMLReader, start *xml.StartElement start = st } if expectedTag == "" { - expectedTag = "network_filter_parameter" + expectedTag = "iscsi_bond" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -15814,6 +16465,12 @@ func XMLNetworkFilterParameterReadOne(reader *XMLReader, start *xml.StartElement return nil, err } builder.Comment(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") + if err != nil { + return nil, err + } + builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { @@ -15826,18 +16483,18 @@ func XMLNetworkFilterParameterReadOne(reader *XMLReader, start *xml.StartElement return nil, err } builder.Name(v) - case "nic": - v, err := XMLNicReadOne(reader, &t, "nic") + case "networks": + v, err := XMLNetworkReadMany(reader, &t) if err != nil { return nil, err } - builder.Nic(v) - case "value": - v, err := reader.ReadString(&t) + builder.Networks(v) + case "storage_connections": + v, err := XMLStorageConnectionReadMany(reader, &t) if err != nil { return nil, err } - builder.Value(v) + builder.StorageConnections(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -15868,12 +16525,22 @@ func XMLNetworkFilterParameterReadOne(reader *XMLReader, start *xml.StartElement } for _, link := range links { switch *link.rel { + case "networks": + if one.networks == nil { + one.networks = new(NetworkSlice) + } + one.networks.href = link.href + case "storageconnections": + if one.storageConnections == nil { + one.storageConnections = new(StorageConnectionSlice) + } + one.storageConnections.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLNetworkFilterParameterReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkFilterParameterSlice, error) { +func XMLIscsiBondReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiBondSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15884,7 +16551,7 @@ func XMLNetworkFilterParameterReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var result NetworkFilterParameterSlice + var result IscsiBondSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -15898,8 +16565,8 @@ func XMLNetworkFilterParameterReadMany(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "network_filter_parameter": - one, err := XMLNetworkFilterParameterReadOne(reader, &t, "network_filter_parameter") + case "iscsi_bond": + one, err := XMLIscsiBondReadOne(reader, &t, "iscsi_bond") if err != nil { return nil, err } @@ -15916,8 +16583,8 @@ func XMLNetworkFilterParameterReadMany(reader *XMLReader, start *xml.StartElemen return &result, nil } -func XMLOpenStackSubnetReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackSubnet, error) { - builder := NewOpenStackSubnetBuilder() +func XMLIscsiDetailsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*IscsiDetails, error) { + builder := NewIscsiDetailsBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -15929,22 +16596,11 @@ func XMLOpenStackSubnetReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "openstack_subnet" + expectedTag = "iscsi_details" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -15959,54 +16615,108 @@ func XMLOpenStackSubnetReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cidr": + case "address": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Cidr(v) - case "comment": + builder.Address(v) + case "disk_id": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "description": + builder.DiskId(v) + case "initiator": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "dns_servers": - v, err := reader.ReadStrings(&t) + builder.Initiator(v) + case "lun_mapping": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.DnsServers(v) - case "gateway": + builder.LunMapping(v) + case "password": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Gateway(v) - case "ip_version": + builder.Password(v) + case "paths": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Paths(v) + case "port": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Port(v) + case "portal": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.IpVersion(v) - case "name": + builder.Portal(v) + case "product_id": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "openstack_network": - v, err := XMLOpenStackNetworkReadOne(reader, &t, "openstack_network") + builder.ProductId(v) + case "serial": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.OpenstackNetwork(v) + builder.Serial(v) + case "size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Size(v) + case "status": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Status(v) + case "storage_domain_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.StorageDomainId(v) + case "target": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Target(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) + case "vendor_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.VendorId(v) + case "volume_group_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.VolumeGroupId(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -16042,7 +16752,7 @@ func XMLOpenStackSubnetReadOne(reader *XMLReader, start *xml.StartElement, expec return one, nil } -func XMLOpenStackSubnetReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackSubnetSlice, error) { +func XMLIscsiDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiDetailsSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16053,7 +16763,7 @@ func XMLOpenStackSubnetReadMany(reader *XMLReader, start *xml.StartElement) (*Op } start = st } - var result OpenStackSubnetSlice + var result IscsiDetailsSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -16067,8 +16777,8 @@ func XMLOpenStackSubnetReadMany(reader *XMLReader, start *xml.StartElement) (*Op switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_subnet": - one, err := XMLOpenStackSubnetReadOne(reader, &t, "openstack_subnet") + case "iscsi_details": + one, err := XMLIscsiDetailsReadOne(reader, &t, "iscsi_details") if err != nil { return nil, err } @@ -16085,8 +16795,8 @@ func XMLOpenStackSubnetReadMany(reader *XMLReader, start *xml.StartElement) (*Op return &result, nil } -func XMLTagReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Tag, error) { - builder := NewTagBuilder() +func XMLJobReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Job, error) { + builder := NewJobBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16098,7 +16808,7 @@ func XMLTagReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "tag" + expectedTag = "job" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -16128,6 +16838,12 @@ func XMLTagReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "auto_cleared": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.AutoCleared(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -16140,48 +16856,55 @@ func XMLTagReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return nil, err } builder.Description(v) - case "group": - v, err := XMLGroupReadOne(reader, &t, "group") + case "end_time": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.Group(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + builder.EndTime(v) + case "external": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Host(v) + builder.External(v) + case "last_updated": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.LastUpdated(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "parent": - v, err := XMLTagReadOne(reader, &t, "parent") + case "owner": + v, err := XMLUserReadOne(reader, &t, "owner") if err != nil { return nil, err } - builder.Parent(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") + builder.Owner(v) + case "start_time": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.Template(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") + builder.StartTime(v) + case "status": + vp, err := XMLJobStatusReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.User(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.Status(v) + case "steps": + v, err := XMLStepReadMany(reader, &t) if err != nil { return nil, err } - builder.Vm(v) + builder.Steps(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -16212,12 +16935,17 @@ func XMLTagReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin } for _, link := range links { switch *link.rel { + case "steps": + if one.steps == nil { + one.steps = new(StepSlice) + } + one.steps.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLTagReadMany(reader *XMLReader, start *xml.StartElement) (*TagSlice, error) { +func XMLJobReadMany(reader *XMLReader, start *xml.StartElement) (*JobSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16228,7 +16956,7 @@ func XMLTagReadMany(reader *XMLReader, start *xml.StartElement) (*TagSlice, erro } start = st } - var result TagSlice + var result JobSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -16242,8 +16970,8 @@ func XMLTagReadMany(reader *XMLReader, start *xml.StartElement) (*TagSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "tag": - one, err := XMLTagReadOne(reader, &t, "tag") + case "job": + one, err := XMLJobReadOne(reader, &t, "job") if err != nil { return nil, err } @@ -16260,8 +16988,8 @@ func XMLTagReadMany(reader *XMLReader, start *xml.StartElement) (*TagSlice, erro return &result, nil } -func XMLAuthorizedKeyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AuthorizedKey, error) { - builder := NewAuthorizedKeyBuilder() +func XMLKatelloErratumReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*KatelloErratum, error) { + builder := NewKatelloErratumBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16273,7 +17001,7 @@ func XMLAuthorizedKeyReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "authorized_key" + expectedTag = "katello_erratum" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -16315,24 +17043,66 @@ func XMLAuthorizedKeyReadOne(reader *XMLReader, start *xml.StartElement, expecte return nil, err } builder.Description(v) - case "key": - v, err := reader.ReadString(&t) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Key(v) + builder.Host(v) + case "issued": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.Issued(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") + case "packages": + v, err := XMLPackageReadMany(reader, &t) if err != nil { return nil, err } - builder.User(v) + builder.Packages(v) + case "severity": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Severity(v) + case "solution": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Solution(v) + case "summary": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Summary(v) + case "title": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Title(v) + case "type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Type(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -16368,7 +17138,7 @@ func XMLAuthorizedKeyReadOne(reader *XMLReader, start *xml.StartElement, expecte return one, nil } -func XMLAuthorizedKeyReadMany(reader *XMLReader, start *xml.StartElement) (*AuthorizedKeySlice, error) { +func XMLKatelloErratumReadMany(reader *XMLReader, start *xml.StartElement) (*KatelloErratumSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16379,7 +17149,7 @@ func XMLAuthorizedKeyReadMany(reader *XMLReader, start *xml.StartElement) (*Auth } start = st } - var result AuthorizedKeySlice + var result KatelloErratumSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -16393,8 +17163,8 @@ func XMLAuthorizedKeyReadMany(reader *XMLReader, start *xml.StartElement) (*Auth switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authorized_key": - one, err := XMLAuthorizedKeyReadOne(reader, &t, "authorized_key") + case "katello_erratum": + one, err := XMLKatelloErratumReadOne(reader, &t, "katello_erratum") if err != nil { return nil, err } @@ -16411,8 +17181,8 @@ func XMLAuthorizedKeyReadMany(reader *XMLReader, start *xml.StartElement) (*Auth return &result, nil } -func XMLVnicProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VnicProfile, error) { - builder := NewVnicProfileBuilder() +func XMLKernelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Kernel, error) { + builder := NewKernelBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16424,22 +17194,11 @@ func XMLVnicProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "vnic_profile" + expectedTag = "kernel" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -16454,72 +17213,12 @@ func XMLVnicProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "custom_properties": - v, err := XMLCustomPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.CustomProperties(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "migratable": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Migratable(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "network": - v, err := XMLNetworkReadOne(reader, &t, "network") - if err != nil { - return nil, err - } - builder.Network(v) - case "network_filter": - v, err := XMLNetworkFilterReadOne(reader, &t, "network_filter") - if err != nil { - return nil, err - } - builder.NetworkFilter(v) - case "pass_through": - v, err := XMLVnicPassThroughReadOne(reader, &t, "pass_through") - if err != nil { - return nil, err - } - builder.PassThrough(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "port_mirroring": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.PortMirroring(v) - case "qos": - v, err := XMLQosReadOne(reader, &t, "qos") + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") if err != nil { return nil, err } - builder.Qos(v) + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -16550,17 +17249,12 @@ func XMLVnicProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedT } for _, link := range links { switch *link.rel { - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLVnicProfileReadMany(reader *XMLReader, start *xml.StartElement) (*VnicProfileSlice, error) { +func XMLKernelReadMany(reader *XMLReader, start *xml.StartElement) (*KernelSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16571,7 +17265,7 @@ func XMLVnicProfileReadMany(reader *XMLReader, start *xml.StartElement) (*VnicPr } start = st } - var result VnicProfileSlice + var result KernelSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -16585,8 +17279,8 @@ func XMLVnicProfileReadMany(reader *XMLReader, start *xml.StartElement) (*VnicPr switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vnic_profile": - one, err := XMLVnicProfileReadOne(reader, &t, "vnic_profile") + case "kernel": + one, err := XMLKernelReadOne(reader, &t, "kernel") if err != nil { return nil, err } @@ -16603,8 +17297,8 @@ func XMLVnicProfileReadMany(reader *XMLReader, start *xml.StartElement) (*VnicPr return &result, nil } -func XMLGraphicsConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GraphicsConsole, error) { - builder := NewGraphicsConsoleBuilder() +func XMLKsmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ksm, error) { + builder := NewKsmBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16616,22 +17310,11 @@ func XMLGraphicsConsoleReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "graphics_console" + expectedTag = "ksm" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -16646,67 +17329,18 @@ func XMLGraphicsConsoleReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "protocol": - vp, err := XMLGraphicsTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Protocol(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "tls_port": - v, err := reader.ReadInt64(&t) + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.TlsPort(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.Enabled(v) + case "merge_across_nodes": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Vm(v) + builder.MergeAcrossNodes(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -16742,7 +17376,7 @@ func XMLGraphicsConsoleReadOne(reader *XMLReader, start *xml.StartElement, expec return one, nil } -func XMLGraphicsConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*GraphicsConsoleSlice, error) { +func XMLKsmReadMany(reader *XMLReader, start *xml.StartElement) (*KsmSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16753,7 +17387,7 @@ func XMLGraphicsConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*Gr } start = st } - var result GraphicsConsoleSlice + var result KsmSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -16767,8 +17401,8 @@ func XMLGraphicsConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*Gr switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "graphics_console": - one, err := XMLGraphicsConsoleReadOne(reader, &t, "graphics_console") + case "ksm": + one, err := XMLKsmReadOne(reader, &t, "ksm") if err != nil { return nil, err } @@ -16785,8 +17419,8 @@ func XMLGraphicsConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*Gr return &result, nil } -func XMLIconReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Icon, error) { - builder := NewIconBuilder() +func XMLLinkLayerDiscoveryProtocolElementReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*LinkLayerDiscoveryProtocolElement, error) { + builder := NewLinkLayerDiscoveryProtocolElementBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16798,7 +17432,7 @@ func XMLIconReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "icon" + expectedTag = "link_layer_discovery_protocol_element" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -16834,30 +17468,42 @@ func XMLIconReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return nil, err } builder.Comment(v) - case "data": + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Data(v) - case "description": + builder.Description(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "media_type": - v, err := reader.ReadString(&t) + builder.Name(v) + case "oui": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.MediaType(v) - case "name": - v, err := reader.ReadString(&t) + builder.Oui(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) + builder.Properties(v) + case "subtype": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Subtype(v) + case "type": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -16893,7 +17539,7 @@ func XMLIconReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri return one, nil } -func XMLIconReadMany(reader *XMLReader, start *xml.StartElement) (*IconSlice, error) { +func XMLLinkLayerDiscoveryProtocolElementReadMany(reader *XMLReader, start *xml.StartElement) (*LinkLayerDiscoveryProtocolElementSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16904,7 +17550,7 @@ func XMLIconReadMany(reader *XMLReader, start *xml.StartElement) (*IconSlice, er } start = st } - var result IconSlice + var result LinkLayerDiscoveryProtocolElementSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -16918,8 +17564,8 @@ func XMLIconReadMany(reader *XMLReader, start *xml.StartElement) (*IconSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "icon": - one, err := XMLIconReadOne(reader, &t, "icon") + case "link_layer_discovery_protocol_element": + one, err := XMLLinkLayerDiscoveryProtocolElementReadOne(reader, &t, "link_layer_discovery_protocol_element") if err != nil { return nil, err } @@ -16936,8 +17582,8 @@ func XMLIconReadMany(reader *XMLReader, start *xml.StartElement) (*IconSlice, er return &result, nil } -func XMLDiskProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DiskProfile, error) { - builder := NewDiskProfileBuilder() +func XMLLogicalUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*LogicalUnit, error) { + builder := NewLogicalUnitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -16949,7 +17595,7 @@ func XMLDiskProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "disk_profile" + expectedTag = "logical_unit" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -16979,42 +17625,115 @@ func XMLDiskProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": + case "address": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "description": + builder.Address(v) + case "discard_max_size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.DiscardMaxSize(v) + case "discard_zeroes_data": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.DiscardZeroesData(v) + case "disk_id": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "name": + builder.DiskId(v) + case "lun_mapping": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.LunMapping(v) + case "password": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) + builder.Password(v) + case "paths": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Permissions(v) - case "qos": - v, err := XMLQosReadOne(reader, &t, "qos") + builder.Paths(v) + case "port": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Qos(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + builder.Port(v) + case "portal": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.StorageDomain(v) + builder.Portal(v) + case "product_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ProductId(v) + case "serial": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Serial(v) + case "size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Size(v) + case "status": + vp, err := XMLLunStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "storage_domain_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.StorageDomainId(v) + case "target": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Target(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) + case "vendor_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.VendorId(v) + case "volume_group_id": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.VolumeGroupId(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -17045,17 +17764,12 @@ func XMLDiskProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedT } for _, link := range links { switch *link.rel { - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLDiskProfileReadMany(reader *XMLReader, start *xml.StartElement) (*DiskProfileSlice, error) { +func XMLLogicalUnitReadMany(reader *XMLReader, start *xml.StartElement) (*LogicalUnitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17066,7 +17780,7 @@ func XMLDiskProfileReadMany(reader *XMLReader, start *xml.StartElement) (*DiskPr } start = st } - var result DiskProfileSlice + var result LogicalUnitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17080,8 +17794,8 @@ func XMLDiskProfileReadMany(reader *XMLReader, start *xml.StartElement) (*DiskPr switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "disk_profile": - one, err := XMLDiskProfileReadOne(reader, &t, "disk_profile") + case "logical_unit": + one, err := XMLLogicalUnitReadOne(reader, &t, "logical_unit") if err != nil { return nil, err } @@ -17098,8 +17812,8 @@ func XMLDiskProfileReadMany(reader *XMLReader, start *xml.StartElement) (*DiskPr return &result, nil } -func XMLImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Image, error) { - builder := NewImageBuilder() +func XMLMDevTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MDevType, error) { + builder := NewMDevTypeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17111,22 +17825,11 @@ func XMLImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "image" + expectedTag = "m_dev_type" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -17141,12 +17844,12 @@ func XMLImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) + case "available_instances": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Comment(v) + builder.AvailableInstances(v) case "description": v, err := reader.ReadString(&t) if err != nil { @@ -17159,25 +17862,6 @@ func XMLImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str return nil, err } builder.Name(v) - case "size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Size(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") - if err != nil { - return nil, err - } - builder.StorageDomain(v) - case "type": - vp, err := XMLImageFileTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -17213,7 +17897,7 @@ func XMLImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str return one, nil } -func XMLImageReadMany(reader *XMLReader, start *xml.StartElement) (*ImageSlice, error) { +func XMLMDevTypeReadMany(reader *XMLReader, start *xml.StartElement) (*MDevTypeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17224,7 +17908,7 @@ func XMLImageReadMany(reader *XMLReader, start *xml.StartElement) (*ImageSlice, } start = st } - var result ImageSlice + var result MDevTypeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17238,8 +17922,8 @@ func XMLImageReadMany(reader *XMLReader, start *xml.StartElement) (*ImageSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "image": - one, err := XMLImageReadOne(reader, &t, "image") + case "m_dev_type": + one, err := XMLMDevTypeReadOne(reader, &t, "m_dev_type") if err != nil { return nil, err } @@ -17256,8 +17940,8 @@ func XMLImageReadMany(reader *XMLReader, start *xml.StartElement) (*ImageSlice, return &result, nil } -func XMLEventSubscriptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*EventSubscription, error) { - builder := NewEventSubscriptionBuilder() +func XMLMacReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Mac, error) { + builder := NewMacBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17269,22 +17953,11 @@ func XMLEventSubscriptionReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "event_subscription" + expectedTag = "mac" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -17305,44 +17978,6 @@ func XMLEventSubscriptionReadOne(reader *XMLReader, start *xml.StartElement, exp return nil, err } builder.Address(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "event": - vp, err := XMLNotifiableEventReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Event(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "notification_method": - vp, err := XMLNotificationMethodReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.NotificationMethod(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") - if err != nil { - return nil, err - } - builder.User(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -17378,7 +18013,7 @@ func XMLEventSubscriptionReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLEventSubscriptionReadMany(reader *XMLReader, start *xml.StartElement) (*EventSubscriptionSlice, error) { +func XMLMacReadMany(reader *XMLReader, start *xml.StartElement) (*MacSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17389,7 +18024,7 @@ func XMLEventSubscriptionReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result EventSubscriptionSlice + var result MacSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17403,8 +18038,8 @@ func XMLEventSubscriptionReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "event_subscription": - one, err := XMLEventSubscriptionReadOne(reader, &t, "event_subscription") + case "mac": + one, err := XMLMacReadOne(reader, &t, "mac") if err != nil { return nil, err } @@ -17421,8 +18056,8 @@ func XMLEventSubscriptionReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLQuotaStorageLimitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*QuotaStorageLimit, error) { - builder := NewQuotaStorageLimitBuilder() +func XMLMacPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MacPool, error) { + builder := NewMacPoolBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17434,7 +18069,7 @@ func XMLQuotaStorageLimitReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "quota_storage_limit" + expectedTag = "mac_pool" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -17464,48 +18099,48 @@ func XMLQuotaStorageLimitReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "allow_duplicates": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.AllowDuplicates(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + case "default_pool": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Description(v) - case "limit": - v, err := reader.ReadInt64(&t) + builder.DefaultPool(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Limit(v) + builder.Description(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } - builder.StorageDomain(v) - case "usage": - v, err := reader.ReadFloat64(&t) + builder.Permissions(v) + case "ranges": + v, err := XMLRangeReadMany(reader, &t) if err != nil { return nil, err } - builder.Usage(v) + builder.Ranges(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -17536,12 +18171,17 @@ func XMLQuotaStorageLimitReadOne(reader *XMLReader, start *xml.StartElement, exp } for _, link := range links { switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLQuotaStorageLimitReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaStorageLimitSlice, error) { +func XMLMacPoolReadMany(reader *XMLReader, start *xml.StartElement) (*MacPoolSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17552,7 +18192,7 @@ func XMLQuotaStorageLimitReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result QuotaStorageLimitSlice + var result MacPoolSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17566,8 +18206,8 @@ func XMLQuotaStorageLimitReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "quota_storage_limit": - one, err := XMLQuotaStorageLimitReadOne(reader, &t, "quota_storage_limit") + case "mac_pool": + one, err := XMLMacPoolReadOne(reader, &t, "mac_pool") if err != nil { return nil, err } @@ -17584,8 +18224,8 @@ func XMLQuotaStorageLimitReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OperatingSystem, error) { - builder := NewOperatingSystemBuilder() +func XMLMemoryOverCommitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MemoryOverCommit, error) { + builder := NewMemoryOverCommitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17597,7 +18237,7 @@ func XMLOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "os" + expectedTag = "memory_over_commit" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -17616,54 +18256,12 @@ func XMLOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "boot": - v, err := XMLBootReadOne(reader, &t, "boot") - if err != nil { - return nil, err - } - builder.Boot(v) - case "cmdline": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Cmdline(v) - case "custom_kernel_cmdline": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomKernelCmdline(v) - case "initrd": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Initrd(v) - case "kernel": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Kernel(v) - case "reported_kernel_cmdline": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ReportedKernelCmdline(v) - case "type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Type(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + case "percent": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Version(v) + builder.Percent(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -17699,7 +18297,7 @@ func XMLOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expec return one, nil } -func XMLOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*OperatingSystemSlice, error) { +func XMLMemoryOverCommitReadMany(reader *XMLReader, start *xml.StartElement) (*MemoryOverCommitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17710,7 +18308,7 @@ func XMLOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*Op } start = st } - var result OperatingSystemSlice + var result MemoryOverCommitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17724,8 +18322,8 @@ func XMLOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*Op switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "os": - one, err := XMLOperatingSystemReadOne(reader, &t, "os") + case "memory_over_commit": + one, err := XMLMemoryOverCommitReadOne(reader, &t, "memory_over_commit") if err != nil { return nil, err } @@ -17742,8 +18340,8 @@ func XMLOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*Op return &result, nil } -func XMLVirtioScsiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VirtioScsi, error) { - builder := NewVirtioScsiBuilder() +func XMLMemoryPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MemoryPolicy, error) { + builder := NewMemoryPolicyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17755,7 +18353,7 @@ func XMLVirtioScsiReadOne(reader *XMLReader, start *xml.StartElement, expectedTa start = st } if expectedTag == "" { - expectedTag = "virtio_scsi" + expectedTag = "memory_policy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -17774,12 +18372,36 @@ func XMLVirtioScsiReadOne(reader *XMLReader, start *xml.StartElement, expectedTa switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": + case "ballooning": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Enabled(v) + builder.Ballooning(v) + case "guaranteed": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Guaranteed(v) + case "max": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Max(v) + case "over_commit": + v, err := XMLMemoryOverCommitReadOne(reader, &t, "over_commit") + if err != nil { + return nil, err + } + builder.OverCommit(v) + case "transparent_hugepages": + v, err := XMLTransparentHugePagesReadOne(reader, &t, "transparent_hugepages") + if err != nil { + return nil, err + } + builder.TransparentHugePages(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -17815,7 +18437,7 @@ func XMLVirtioScsiReadOne(reader *XMLReader, start *xml.StartElement, expectedTa return one, nil } -func XMLVirtioScsiReadMany(reader *XMLReader, start *xml.StartElement) (*VirtioScsiSlice, error) { +func XMLMemoryPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*MemoryPolicySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17826,7 +18448,7 @@ func XMLVirtioScsiReadMany(reader *XMLReader, start *xml.StartElement) (*VirtioS } start = st } - var result VirtioScsiSlice + var result MemoryPolicySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17840,8 +18462,8 @@ func XMLVirtioScsiReadMany(reader *XMLReader, start *xml.StartElement) (*VirtioS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "virtio_scsi": - one, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") + case "memory_policy": + one, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") if err != nil { return nil, err } @@ -17858,8 +18480,8 @@ func XMLVirtioScsiReadMany(reader *XMLReader, start *xml.StartElement) (*VirtioS return &result, nil } -func XMLVendorReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Vendor, error) { - builder := NewVendorBuilder() +func XMLMethodReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Method, error) { + builder := NewMethodBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17871,7 +18493,7 @@ func XMLVendorReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "vendor" + expectedTag = "method" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -17882,67 +18504,13 @@ func XMLVendorReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st value := attr.Value switch name { case "id": - builder.Id(value) + builder.Id(SsoMethod(value)) case "href": builder.Href(value) } } var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } + reader.Skip() one, err := builder.Build() if err != nil { return nil, err @@ -17954,7 +18522,7 @@ func XMLVendorReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLVendorReadMany(reader *XMLReader, start *xml.StartElement) (*VendorSlice, error) { +func XMLMethodReadMany(reader *XMLReader, start *xml.StartElement) (*MethodSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -17965,7 +18533,7 @@ func XMLVendorReadMany(reader *XMLReader, start *xml.StartElement) (*VendorSlice } start = st } - var result VendorSlice + var result MethodSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -17979,8 +18547,8 @@ func XMLVendorReadMany(reader *XMLReader, start *xml.StartElement) (*VendorSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vendor": - one, err := XMLVendorReadOne(reader, &t, "vendor") + case "method": + one, err := XMLMethodReadOne(reader, &t, "method") if err != nil { return nil, err } @@ -17997,8 +18565,8 @@ func XMLVendorReadMany(reader *XMLReader, start *xml.StartElement) (*VendorSlice return &result, nil } -func XMLAgentConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AgentConfiguration, error) { - builder := NewAgentConfigurationBuilder() +func XMLMigrationBandwidthReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MigrationBandwidth, error) { + builder := NewMigrationBandwidthBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18010,7 +18578,7 @@ func XMLAgentConfigurationReadOne(reader *XMLReader, start *xml.StartElement, ex start = st } if expectedTag == "" { - expectedTag = "agent_configuration" + expectedTag = "migration_bandwidth" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -18029,43 +18597,19 @@ func XMLAgentConfigurationReadOne(reader *XMLReader, start *xml.StartElement, ex switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "broker_type": - vp, err := XMLMessageBrokerTypeReadOne(reader, &t) + case "assignment_method": + vp, err := XMLMigrationBandwidthAssignmentMethodReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.BrokerType(v) - case "network_mappings": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.NetworkMappings(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "port": + builder.AssignmentMethod(v) + case "custom_value": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Port(v) - case "username": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Username(v) + builder.CustomValue(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -18101,7 +18645,7 @@ func XMLAgentConfigurationReadOne(reader *XMLReader, start *xml.StartElement, ex return one, nil } -func XMLAgentConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*AgentConfigurationSlice, error) { +func XMLMigrationBandwidthReadMany(reader *XMLReader, start *xml.StartElement) (*MigrationBandwidthSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18112,7 +18656,7 @@ func XMLAgentConfigurationReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var result AgentConfigurationSlice + var result MigrationBandwidthSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -18126,8 +18670,8 @@ func XMLAgentConfigurationReadMany(reader *XMLReader, start *xml.StartElement) ( switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "agent_configuration": - one, err := XMLAgentConfigurationReadOne(reader, &t, "agent_configuration") + case "migration_bandwidth": + one, err := XMLMigrationBandwidthReadOne(reader, &t, "migration_bandwidth") if err != nil { return nil, err } @@ -18144,8 +18688,8 @@ func XMLAgentConfigurationReadMany(reader *XMLReader, start *xml.StartElement) ( return &result, nil } -func XMLOpenStackImageProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackImageProvider, error) { - builder := NewOpenStackImageProviderBuilder() +func XMLMigrationOptionsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MigrationOptions, error) { + builder := NewMigrationOptionsBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18157,22 +18701,11 @@ func XMLOpenStackImageProviderReadOne(reader *XMLReader, start *xml.StartElement start = st } if expectedTag == "" { - expectedTag = "openstack_image_provider" + expectedTag = "migration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -18187,78 +18720,39 @@ func XMLOpenStackImageProviderReadOne(reader *XMLReader, start *xml.StartElement switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authentication_url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.AuthenticationUrl(v) - case "certificates": - v, err := XMLCertificateReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Certificates(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "images": - v, err := XMLOpenStackImageReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Images(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) + case "auto_converge": + vp, err := XMLInheritableBooleanReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Properties(v) - case "requires_authentication": - v, err := reader.ReadBool(&t) + builder.AutoConverge(v) + case "bandwidth": + v, err := XMLMigrationBandwidthReadOne(reader, &t, "bandwidth") if err != nil { return nil, err } - builder.RequiresAuthentication(v) - case "tenant_name": - v, err := reader.ReadString(&t) + builder.Bandwidth(v) + case "compressed": + vp, err := XMLInheritableBooleanReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.TenantName(v) - case "url": - v, err := reader.ReadString(&t) + builder.Compressed(v) + case "encrypted": + vp, err := XMLInheritableBooleanReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Url(v) - case "username": - v, err := reader.ReadString(&t) + builder.Encrypted(v) + case "policy": + v, err := XMLMigrationPolicyReadOne(reader, &t, "policy") if err != nil { return nil, err } - builder.Username(v) + builder.Policy(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -18289,22 +18783,12 @@ func XMLOpenStackImageProviderReadOne(reader *XMLReader, start *xml.StartElement } for _, link := range links { switch *link.rel { - case "certificates": - if one.certificates == nil { - one.certificates = new(CertificateSlice) - } - one.certificates.href = link.href - case "images": - if one.images == nil { - one.images = new(OpenStackImageSlice) - } - one.images.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLOpenStackImageProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackImageProviderSlice, error) { +func XMLMigrationOptionsReadMany(reader *XMLReader, start *xml.StartElement) (*MigrationOptionsSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18315,7 +18799,7 @@ func XMLOpenStackImageProviderReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var result OpenStackImageProviderSlice + var result MigrationOptionsSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -18329,8 +18813,8 @@ func XMLOpenStackImageProviderReadMany(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_image_provider": - one, err := XMLOpenStackImageProviderReadOne(reader, &t, "openstack_image_provider") + case "migration": + one, err := XMLMigrationOptionsReadOne(reader, &t, "migration") if err != nil { return nil, err } @@ -18347,8 +18831,8 @@ func XMLOpenStackImageProviderReadMany(reader *XMLReader, start *xml.StartElemen return &result, nil } -func XMLMigrationBandwidthReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MigrationBandwidth, error) { - builder := NewMigrationBandwidthBuilder() +func XMLMigrationPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MigrationPolicy, error) { + builder := NewMigrationPolicyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18360,11 +18844,22 @@ func XMLMigrationBandwidthReadOne(reader *XMLReader, start *xml.StartElement, ex start = st } if expectedTag == "" { - expectedTag = "migration_bandwidth" + expectedTag = "migration_policy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -18379,19 +18874,24 @@ func XMLMigrationBandwidthReadOne(reader *XMLReader, start *xml.StartElement, ex switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "assignment_method": - vp, err := XMLMigrationBandwidthAssignmentMethodReadOne(reader, &t) - v := *vp + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.AssignmentMethod(v) - case "custom_value": - v, err := reader.ReadInt64(&t) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.CustomValue(v) + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -18427,7 +18927,7 @@ func XMLMigrationBandwidthReadOne(reader *XMLReader, start *xml.StartElement, ex return one, nil } -func XMLMigrationBandwidthReadMany(reader *XMLReader, start *xml.StartElement) (*MigrationBandwidthSlice, error) { +func XMLMigrationPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*MigrationPolicySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18438,7 +18938,7 @@ func XMLMigrationBandwidthReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var result MigrationBandwidthSlice + var result MigrationPolicySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -18452,8 +18952,8 @@ func XMLMigrationBandwidthReadMany(reader *XMLReader, start *xml.StartElement) ( switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "migration_bandwidth": - one, err := XMLMigrationBandwidthReadOne(reader, &t, "migration_bandwidth") + case "migration_policy": + one, err := XMLMigrationPolicyReadOne(reader, &t, "migration_policy") if err != nil { return nil, err } @@ -18470,8 +18970,8 @@ func XMLMigrationBandwidthReadMany(reader *XMLReader, start *xml.StartElement) ( return &result, nil } -func XMLUnmanagedNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*UnmanagedNetwork, error) { - builder := NewUnmanagedNetworkBuilder() +func XMLNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Network, error) { + builder := NewNetworkBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18483,7 +18983,7 @@ func XMLUnmanagedNetworkReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "unmanaged_network" + expectedTag = "network" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -18513,36 +19013,145 @@ func XMLUnmanagedNetworkReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") + if err != nil { + return nil, err + } + builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + case "display": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Host(v) - case "host_nic": - v, err := XMLHostNicReadOne(reader, &t, "host_nic") + builder.Display(v) + case "dns_resolver_configuration": + v, err := XMLDnsResolverConfigurationReadOne(reader, &t, "dns_resolver_configuration") if err != nil { return nil, err } - builder.HostNic(v) + builder.DnsResolverConfiguration(v) + case "external_provider": + v, err := XMLOpenStackNetworkProviderReadOne(reader, &t, "external_provider") + if err != nil { + return nil, err + } + builder.ExternalProvider(v) + case "external_provider_physical_network": + v, err := XMLNetworkReadOne(reader, &t, "external_provider_physical_network") + if err != nil { + return nil, err + } + builder.ExternalProviderPhysicalNetwork(v) + case "ip": + v, err := XMLIpReadOne(reader, &t, "ip") + if err != nil { + return nil, err + } + builder.Ip(v) + case "mtu": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Mtu(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "network_labels": + v, err := XMLNetworkLabelReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.NetworkLabels(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "port_isolation": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.PortIsolation(v) + case "profile_required": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.ProfileRequired(v) + case "qos": + v, err := XMLQosReadOne(reader, &t, "qos") + if err != nil { + return nil, err + } + builder.Qos(v) + case "required": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Required(v) + case "status": + vp, err := XMLNetworkStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "stp": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Stp(v) + case "usages": + v, err := XMLNetworkUsageReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Usages(v) + case "vdsm_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.VdsmName(v) + case "vlan": + v, err := XMLVlanReadOne(reader, &t, "vlan") + if err != nil { + return nil, err + } + builder.Vlan(v) + case "vnic_profiles": + v, err := XMLVnicProfileReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.VnicProfiles(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -18573,12 +19182,27 @@ func XMLUnmanagedNetworkReadOne(reader *XMLReader, start *xml.StartElement, expe } for _, link := range links { switch *link.rel { + case "networklabels": + if one.networkLabels == nil { + one.networkLabels = new(NetworkLabelSlice) + } + one.networkLabels.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "vnicprofiles": + if one.vnicProfiles == nil { + one.vnicProfiles = new(VnicProfileSlice) + } + one.vnicProfiles.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLUnmanagedNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*UnmanagedNetworkSlice, error) { +func XMLNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18589,7 +19213,7 @@ func XMLUnmanagedNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*U } start = st } - var result UnmanagedNetworkSlice + var result NetworkSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -18603,8 +19227,8 @@ func XMLUnmanagedNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*U switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "unmanaged_network": - one, err := XMLUnmanagedNetworkReadOne(reader, &t, "unmanaged_network") + case "network": + one, err := XMLNetworkReadOne(reader, &t, "network") if err != nil { return nil, err } @@ -18621,8 +19245,8 @@ func XMLUnmanagedNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*U return &result, nil } -func XMLHostStorageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostStorage, error) { - builder := NewHostStorageBuilder() +func XMLNetworkAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkAttachment, error) { + builder := NewNetworkAttachmentBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18634,7 +19258,7 @@ func XMLHostStorageReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "host_storage" + expectedTag = "network_attachment" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -18664,12 +19288,6 @@ func XMLHostStorageReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -18682,122 +19300,66 @@ func XMLHostStorageReadOne(reader *XMLReader, start *xml.StartElement, expectedT return nil, err } builder.Description(v) - case "driver_options": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.DriverOptions(v) - case "driver_sensitive_options": - v, err := XMLPropertyReadMany(reader, &t) + case "dns_resolver_configuration": + v, err := XMLDnsResolverConfigurationReadOne(reader, &t, "dns_resolver_configuration") if err != nil { return nil, err } - builder.DriverSensitiveOptions(v) + builder.DnsResolverConfiguration(v) case "host": v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } builder.Host(v) - case "logical_units": - v, err := XMLLogicalUnitReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.LogicalUnits(v) - case "mount_options": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.MountOptions(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "nfs_retrans": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.NfsRetrans(v) - case "nfs_timeo": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.NfsTimeo(v) - case "nfs_version": - vp, err := XMLNfsVersionReadOne(reader, &t) - v := *vp + case "host_nic": + v, err := XMLHostNicReadOne(reader, &t, "host_nic") if err != nil { return nil, err } - builder.NfsVersion(v) - case "override_luns": + builder.HostNic(v) + case "in_sync": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.OverrideLuns(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "path": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Path(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "portal": - v, err := reader.ReadString(&t) + builder.InSync(v) + case "ip_address_assignments": + v, err := XMLIpAddressAssignmentReadMany(reader, &t) if err != nil { return nil, err } - builder.Portal(v) - case "target": + builder.IpAddressAssignments(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Target(v) - case "type": - vp, err := XMLStorageTypeReadOne(reader, &t) - v := *vp + builder.Name(v) + case "network": + v, err := XMLNetworkReadOne(reader, &t, "network") if err != nil { return nil, err } - builder.Type(v) - case "username": - v, err := reader.ReadString(&t) + builder.Network(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.Username(v) - case "vfs_type": - v, err := reader.ReadString(&t) + builder.Properties(v) + case "qos": + v, err := XMLQosReadOne(reader, &t, "qos") if err != nil { return nil, err } - builder.VfsType(v) - case "volume_group": - v, err := XMLVolumeGroupReadOne(reader, &t, "volume_group") + builder.Qos(v) + case "reported_configurations": + v, err := XMLReportedConfigurationReadMany(reader, &t) if err != nil { return nil, err } - builder.VolumeGroup(v) + builder.ReportedConfigurations(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -18833,7 +19395,7 @@ func XMLHostStorageReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLHostStorageReadMany(reader *XMLReader, start *xml.StartElement) (*HostStorageSlice, error) { +func XMLNetworkAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkAttachmentSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18844,7 +19406,7 @@ func XMLHostStorageReadMany(reader *XMLReader, start *xml.StartElement) (*HostSt } start = st } - var result HostStorageSlice + var result NetworkAttachmentSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -18858,8 +19420,8 @@ func XMLHostStorageReadMany(reader *XMLReader, start *xml.StartElement) (*HostSt switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host_storage": - one, err := XMLHostStorageReadOne(reader, &t, "host_storage") + case "network_attachment": + one, err := XMLNetworkAttachmentReadOne(reader, &t, "network_attachment") if err != nil { return nil, err } @@ -18876,8 +19438,8 @@ func XMLHostStorageReadMany(reader *XMLReader, start *xml.StartElement) (*HostSt return &result, nil } -func XMLErrorHandlingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ErrorHandling, error) { - builder := NewErrorHandlingBuilder() +func XMLNetworkConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkConfiguration, error) { + builder := NewNetworkConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18889,7 +19451,7 @@ func XMLErrorHandlingReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "error_handling" + expectedTag = "network_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -18908,13 +19470,18 @@ func XMLErrorHandlingReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "on_error": - vp, err := XMLMigrateOnErrorReadOne(reader, &t) - v := *vp + case "dns": + v, err := XMLDnsReadOne(reader, &t, "dns") if err != nil { return nil, err } - builder.OnError(v) + builder.Dns(v) + case "nics": + v, err := XMLNicReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Nics(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -18950,7 +19517,7 @@ func XMLErrorHandlingReadOne(reader *XMLReader, start *xml.StartElement, expecte return one, nil } -func XMLErrorHandlingReadMany(reader *XMLReader, start *xml.StartElement) (*ErrorHandlingSlice, error) { +func XMLNetworkConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -18961,7 +19528,7 @@ func XMLErrorHandlingReadMany(reader *XMLReader, start *xml.StartElement) (*Erro } start = st } - var result ErrorHandlingSlice + var result NetworkConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -18975,8 +19542,8 @@ func XMLErrorHandlingReadMany(reader *XMLReader, start *xml.StartElement) (*Erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "error_handling": - one, err := XMLErrorHandlingReadOne(reader, &t, "error_handling") + case "network_configuration": + one, err := XMLNetworkConfigurationReadOne(reader, &t, "network_configuration") if err != nil { return nil, err } @@ -18993,8 +19560,8 @@ func XMLErrorHandlingReadMany(reader *XMLReader, start *xml.StartElement) (*Erro return &result, nil } -func XMLGlusterHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterHook, error) { - builder := NewGlusterHookBuilder() +func XMLNetworkFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkFilter, error) { + builder := NewNetworkFilterBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19006,7 +19573,7 @@ func XMLGlusterHookReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "gluster_hook" + expectedTag = "network_filter" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -19036,87 +19603,30 @@ func XMLGlusterHookReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "checksum": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Checksum(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "conflict_status": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ConflictStatus(v) - case "conflicts": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Conflicts(v) - case "content": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Content(v) - case "content_type": - vp, err := XMLHookContentTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.ContentType(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "gluster_command": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.GlusterCommand(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "server_hooks": - v, err := XMLGlusterServerHookReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.ServerHooks(v) - case "stage": - vp, err := XMLHookStageReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Stage(v) - case "status": - vp, err := XMLGlusterHookStatusReadOne(reader, &t) - v := *vp + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") if err != nil { return nil, err } - builder.Status(v) + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -19147,17 +19657,12 @@ func XMLGlusterHookReadOne(reader *XMLReader, start *xml.StartElement, expectedT } for _, link := range links { switch *link.rel { - case "serverhooks": - if one.serverHooks == nil { - one.serverHooks = new(GlusterServerHookSlice) - } - one.serverHooks.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLGlusterHookReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterHookSlice, error) { +func XMLNetworkFilterReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkFilterSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19168,7 +19673,7 @@ func XMLGlusterHookReadMany(reader *XMLReader, start *xml.StartElement) (*Gluste } start = st } - var result GlusterHookSlice + var result NetworkFilterSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -19182,8 +19687,8 @@ func XMLGlusterHookReadMany(reader *XMLReader, start *xml.StartElement) (*Gluste switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "gluster_hook": - one, err := XMLGlusterHookReadOne(reader, &t, "gluster_hook") + case "network_filter": + one, err := XMLNetworkFilterReadOne(reader, &t, "network_filter") if err != nil { return nil, err } @@ -19200,8 +19705,8 @@ func XMLGlusterHookReadMany(reader *XMLReader, start *xml.StartElement) (*Gluste return &result, nil } -func XMLVolumeGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VolumeGroup, error) { - builder := NewVolumeGroupBuilder() +func XMLNetworkFilterParameterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkFilterParameter, error) { + builder := NewNetworkFilterParameterBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19213,7 +19718,7 @@ func XMLVolumeGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "volume_group" + expectedTag = "network_filter_parameter" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -19243,18 +19748,36 @@ func XMLVolumeGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "logical_units": - v, err := XMLLogicalUnitReadMany(reader, &t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.LogicalUnits(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "nic": + v, err := XMLNicReadOne(reader, &t, "nic") + if err != nil { + return nil, err + } + builder.Nic(v) + case "value": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -19290,7 +19813,7 @@ func XMLVolumeGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLVolumeGroupReadMany(reader *XMLReader, start *xml.StartElement) (*VolumeGroupSlice, error) { +func XMLNetworkFilterParameterReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkFilterParameterSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19301,7 +19824,7 @@ func XMLVolumeGroupReadMany(reader *XMLReader, start *xml.StartElement) (*Volume } start = st } - var result VolumeGroupSlice + var result NetworkFilterParameterSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -19315,8 +19838,8 @@ func XMLVolumeGroupReadMany(reader *XMLReader, start *xml.StartElement) (*Volume switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "volume_group": - one, err := XMLVolumeGroupReadOne(reader, &t, "volume_group") + case "network_filter_parameter": + one, err := XMLNetworkFilterParameterReadOne(reader, &t, "network_filter_parameter") if err != nil { return nil, err } @@ -19333,8 +19856,8 @@ func XMLVolumeGroupReadMany(reader *XMLReader, start *xml.StartElement) (*Volume return &result, nil } -func XMLDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Domain, error) { - builder := NewDomainBuilder() +func XMLNetworkLabelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkLabel, error) { + builder := NewNetworkLabelBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19346,7 +19869,7 @@ func XMLDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "domain" + expectedTag = "network_label" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -19388,30 +19911,24 @@ func XMLDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return nil, err } builder.Description(v) - case "groups": - v, err := XMLGroupReadMany(reader, &t) + case "host_nic": + v, err := XMLHostNicReadOne(reader, &t, "host_nic") if err != nil { return nil, err } - builder.Groups(v) + builder.HostNic(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") - if err != nil { - return nil, err - } - builder.User(v) - case "users": - v, err := XMLUserReadMany(reader, &t) + case "network": + v, err := XMLNetworkReadOne(reader, &t, "network") if err != nil { return nil, err } - builder.Users(v) + builder.Network(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -19442,22 +19959,12 @@ func XMLDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { - case "groups": - if one.groups == nil { - one.groups = new(GroupSlice) - } - one.groups.href = link.href - case "users": - if one.users == nil { - one.users = new(UserSlice) - } - one.users.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLDomainReadMany(reader *XMLReader, start *xml.StartElement) (*DomainSlice, error) { +func XMLNetworkLabelReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkLabelSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19468,7 +19975,7 @@ func XMLDomainReadMany(reader *XMLReader, start *xml.StartElement) (*DomainSlice } start = st } - var result DomainSlice + var result NetworkLabelSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -19482,8 +19989,8 @@ func XMLDomainReadMany(reader *XMLReader, start *xml.StartElement) (*DomainSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "domain": - one, err := XMLDomainReadOne(reader, &t, "domain") + case "network_label": + one, err := XMLNetworkLabelReadOne(reader, &t, "network_label") if err != nil { return nil, err } @@ -19500,8 +20007,8 @@ func XMLDomainReadMany(reader *XMLReader, start *xml.StartElement) (*DomainSlice return &result, nil } -func XMLRegistrationConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationConfiguration, error) { - builder := NewRegistrationConfigurationBuilder() +func XMLNfsProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NfsProfileDetail, error) { + builder := NewNfsProfileDetailBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19511,69 +20018,39 @@ func XMLRegistrationConfigurationReadOne(reader *XMLReader, start *xml.StartElem return nil, err } start = st - } - if expectedTag == "" { - expectedTag = "registration_configuration" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "affinity_group_mappings": - v, err := XMLRegistrationAffinityGroupMappingReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AffinityGroupMappings(v) - case "affinity_label_mappings": - v, err := XMLRegistrationAffinityLabelMappingReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AffinityLabelMappings(v) - case "cluster_mappings": - v, err := XMLRegistrationClusterMappingReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.ClusterMappings(v) - case "domain_mappings": - v, err := XMLRegistrationDomainMappingReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.DomainMappings(v) - case "lun_mappings": - v, err := XMLRegistrationLunMappingReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.LunMappings(v) - case "role_mappings": - v, err := XMLRegistrationRoleMappingReadMany(reader, &t) + } + if expectedTag == "" { + expectedTag = "nfs_profile_detail" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "nfs_server_ip": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.RoleMappings(v) - case "vnic_profile_mappings": - v, err := XMLRegistrationVnicProfileMappingReadMany(reader, &t) + builder.NfsServerIp(v) + case "profile_details": + v, err := XMLProfileDetailReadMany(reader, &t) if err != nil { return nil, err } - builder.VnicProfileMappings(v) + builder.ProfileDetails(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -19609,7 +20086,7 @@ func XMLRegistrationConfigurationReadOne(reader *XMLReader, start *xml.StartElem return one, nil } -func XMLRegistrationConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationConfigurationSlice, error) { +func XMLNfsProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*NfsProfileDetailSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19620,7 +20097,7 @@ func XMLRegistrationConfigurationReadMany(reader *XMLReader, start *xml.StartEle } start = st } - var result RegistrationConfigurationSlice + var result NfsProfileDetailSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -19634,8 +20111,8 @@ func XMLRegistrationConfigurationReadMany(reader *XMLReader, start *xml.StartEle switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_configuration": - one, err := XMLRegistrationConfigurationReadOne(reader, &t, "registration_configuration") + case "nfs_profile_detail": + one, err := XMLNfsProfileDetailReadOne(reader, &t, "nfs_profile_detail") if err != nil { return nil, err } @@ -19652,8 +20129,8 @@ func XMLRegistrationConfigurationReadMany(reader *XMLReader, start *xml.StartEle return &result, nil } -func XMLInstanceTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*InstanceType, error) { - builder := NewInstanceTypeBuilder() +func XMLNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Nic, error) { + builder := NewNicBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -19665,7 +20142,7 @@ func XMLInstanceTypeReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "instance_type" + expectedTag = "nic" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -19695,339 +20172,503 @@ func XMLInstanceTypeReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bios": - v, err := XMLBiosReadOne(reader, &t, "bios") - if err != nil { - return nil, err - } - builder.Bios(v) - case "cdroms": - v, err := XMLCdromReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Cdroms(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + case "boot_protocol": + vp, err := XMLBootProtocolReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Cluster(v) + builder.BootProtocol(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "console": - v, err := XMLConsoleReadOne(reader, &t, "console") - if err != nil { - return nil, err - } - builder.Console(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") - if err != nil { - return nil, err - } - builder.Cpu(v) - case "cpu_profile": - v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") - if err != nil { - return nil, err - } - builder.CpuProfile(v) - case "cpu_shares": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.CpuShares(v) - case "creation_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.CreationTime(v) - case "custom_compatibility_version": - v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") - if err != nil { - return nil, err - } - builder.CustomCompatibilityVersion(v) - case "custom_cpu_model": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomCpuModel(v) - case "custom_emulated_machine": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomEmulatedMachine(v) - case "custom_properties": - v, err := XMLCustomPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.CustomProperties(v) - case "delete_protected": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.DeleteProtected(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "disk_attachments": - v, err := XMLDiskAttachmentReadMany(reader, &t) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") if err != nil { return nil, err } - builder.DiskAttachments(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") + builder.InstanceType(v) + case "interface": + vp, err := XMLNicInterfaceReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Display(v) - case "domain": - v, err := XMLDomainReadOne(reader, &t, "domain") + builder.Interface(v) + case "linked": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Domain(v) - case "graphics_consoles": - v, err := XMLGraphicsConsoleReadMany(reader, &t) + builder.Linked(v) + case "mac": + v, err := XMLMacReadOne(reader, &t, "mac") if err != nil { return nil, err } - builder.GraphicsConsoles(v) - case "high_availability": - v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + builder.Mac(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.HighAvailability(v) - case "initialization": - v, err := XMLInitializationReadOne(reader, &t, "initialization") + builder.Name(v) + case "network": + v, err := XMLNetworkReadOne(reader, &t, "network") if err != nil { return nil, err } - builder.Initialization(v) - case "io": - v, err := XMLIoReadOne(reader, &t, "io") + builder.Network(v) + case "network_attachments": + v, err := XMLNetworkAttachmentReadMany(reader, &t) if err != nil { return nil, err } - builder.Io(v) - case "large_icon": - v, err := XMLIconReadOne(reader, &t, "large_icon") + builder.NetworkAttachments(v) + case "network_filter_parameters": + v, err := XMLNetworkFilterParameterReadMany(reader, &t) if err != nil { return nil, err } - builder.LargeIcon(v) - case "lease": - v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") + builder.NetworkFilterParameters(v) + case "network_labels": + v, err := XMLNetworkLabelReadMany(reader, &t) if err != nil { return nil, err } - builder.Lease(v) - case "memory": - v, err := reader.ReadInt64(&t) + builder.NetworkLabels(v) + case "on_boot": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Memory(v) - case "memory_policy": - v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + builder.OnBoot(v) + case "plugged": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.MemoryPolicy(v) - case "migration": - v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") + builder.Plugged(v) + case "reported_devices": + v, err := XMLReportedDeviceReadMany(reader, &t) if err != nil { return nil, err } - builder.Migration(v) - case "migration_downtime": - v, err := reader.ReadInt64(&t) + builder.ReportedDevices(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.MigrationDowntime(v) - case "multi_queues_enabled": - v, err := reader.ReadBool(&t) + builder.Statistics(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } - builder.MultiQueuesEnabled(v) - case "name": - v, err := reader.ReadString(&t) + builder.Template(v) + case "virtual_function_allowed_labels": + v, err := XMLNetworkLabelReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) - case "nics": - v, err := XMLNicReadMany(reader, &t) + builder.VirtualFunctionAllowedLabels(v) + case "virtual_function_allowed_networks": + v, err := XMLNetworkReadMany(reader, &t) if err != nil { return nil, err } - builder.Nics(v) - case "origin": - v, err := reader.ReadString(&t) + builder.VirtualFunctionAllowedNetworks(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } - builder.Origin(v) - case "os": - v, err := XMLOperatingSystemReadOne(reader, &t, "os") + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) if err != nil { return nil, err } - builder.Os(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) + builder.Vms(v) + case "vnic_profile": + v, err := XMLVnicProfileReadOne(reader, &t, "vnic_profile") if err != nil { return nil, err } - builder.Permissions(v) - case "placement_policy": - v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") - if err != nil { - return nil, err + builder.VnicProfile(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.PlacementPolicy(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.Quota(v) - case "rng_device": - v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + case "networkattachments": + if one.networkAttachments == nil { + one.networkAttachments = new(NetworkAttachmentSlice) + } + one.networkAttachments.href = link.href + case "networkfilterparameters": + if one.networkFilterParameters == nil { + one.networkFilterParameters = new(NetworkFilterParameterSlice) + } + one.networkFilterParameters.href = link.href + case "networklabels": + if one.networkLabels == nil { + one.networkLabels = new(NetworkLabelSlice) + } + one.networkLabels.href = link.href + case "reporteddevices": + if one.reportedDevices == nil { + one.reportedDevices = new(ReportedDeviceSlice) + } + one.reportedDevices.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + case "virtualfunctionallowedlabels": + if one.virtualFunctionAllowedLabels == nil { + one.virtualFunctionAllowedLabels = new(NetworkLabelSlice) + } + one.virtualFunctionAllowedLabels.href = link.href + case "virtualfunctionallowednetworks": + if one.virtualFunctionAllowedNetworks == nil { + one.virtualFunctionAllowedNetworks = new(NetworkSlice) + } + one.virtualFunctionAllowedNetworks.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href + } // end of switch + } // end of for-links + return one, nil +} + +func XMLNicReadMany(reader *XMLReader, start *xml.StartElement) (*NicSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result NicSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "nic": + one, err := XMLNicReadOne(reader, &t, "nic") if err != nil { return nil, err } - builder.RngDevice(v) - case "serial_number": - v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLNicConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NicConfiguration, error) { + builder := NewNicConfigurationBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "nic_configuration" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "boot_protocol": + vp, err := XMLBootProtocolReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.SerialNumber(v) - case "small_icon": - v, err := XMLIconReadOne(reader, &t, "small_icon") + builder.BootProtocol(v) + case "ip": + v, err := XMLIpReadOne(reader, &t, "ip") if err != nil { return nil, err } - builder.SmallIcon(v) - case "soundcard_enabled": - v, err := reader.ReadBool(&t) + builder.Ip(v) + case "ipv6": + v, err := XMLIpReadOne(reader, &t, "ipv6") if err != nil { return nil, err } - builder.SoundcardEnabled(v) - case "sso": - v, err := XMLSsoReadOne(reader, &t, "sso") + builder.Ipv6(v) + case "ipv6_boot_protocol": + vp, err := XMLBootProtocolReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Sso(v) - case "start_paused": - v, err := reader.ReadBool(&t) + builder.Ipv6BootProtocol(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.StartPaused(v) - case "stateless": + builder.Name(v) + case "on_boot": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Stateless(v) - case "status": - vp, err := XMLTemplateStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err + builder.OnBoot(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.Status(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.StorageDomain(v) - case "storage_error_resume_behaviour": - vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) - v := *vp + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLNicConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*NicConfigurationSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result NicConfigurationSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "nic_configuration": + one, err := XMLNicConfigurationReadOne(reader, &t, "nic_configuration") if err != nil { return nil, err } - builder.StorageErrorResumeBehaviour(v) - case "tags": - v, err := XMLTagReadMany(reader, &t) + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NumaNode, error) { + builder := NewNumaNodeBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "host_numa_node" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Tags(v) - case "time_zone": - v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") + builder.Comment(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") if err != nil { return nil, err } - builder.TimeZone(v) - case "tunnel_migration": - v, err := reader.ReadBool(&t) + builder.Cpu(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.TunnelMigration(v) - case "type": - vp, err := XMLVmTypeReadOne(reader, &t) - v := *vp + builder.Description(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Type(v) - case "usb": - v, err := XMLUsbReadOne(reader, &t, "usb") + builder.Host(v) + case "index": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Usb(v) - case "version": - v, err := XMLTemplateVersionReadOne(reader, &t, "version") + builder.Index(v) + case "memory": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Version(v) - case "virtio_scsi": - v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") + builder.Memory(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.VirtioScsi(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.Name(v) + case "node_distance": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Vm(v) - case "watchdogs": - v, err := XMLWatchdogReadMany(reader, &t) + builder.NodeDistance(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.Watchdogs(v) + builder.Statistics(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20058,47 +20699,17 @@ func XMLInstanceTypeReadOne(reader *XMLReader, start *xml.StartElement, expected } for _, link := range links { switch *link.rel { - case "cdroms": - if one.cdroms == nil { - one.cdroms = new(CdromSlice) - } - one.cdroms.href = link.href - case "diskattachments": - if one.diskAttachments == nil { - one.diskAttachments = new(DiskAttachmentSlice) - } - one.diskAttachments.href = link.href - case "graphicsconsoles": - if one.graphicsConsoles == nil { - one.graphicsConsoles = new(GraphicsConsoleSlice) - } - one.graphicsConsoles.href = link.href - case "nics": - if one.nics == nil { - one.nics = new(NicSlice) - } - one.nics.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "tags": - if one.tags == nil { - one.tags = new(TagSlice) - } - one.tags.href = link.href - case "watchdogs": - if one.watchdogs == nil { - one.watchdogs = new(WatchdogSlice) + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) } - one.watchdogs.href = link.href + one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLInstanceTypeReadMany(reader *XMLReader, start *xml.StartElement) (*InstanceTypeSlice, error) { +func XMLNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20109,7 +20720,7 @@ func XMLInstanceTypeReadMany(reader *XMLReader, start *xml.StartElement) (*Insta } start = st } - var result InstanceTypeSlice + var result NumaNodeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -20123,8 +20734,8 @@ func XMLInstanceTypeReadMany(reader *XMLReader, start *xml.StartElement) (*Insta switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "instance_type": - one, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + case "host_numa_node": + one, err := XMLNumaNodeReadOne(reader, &t, "host_numa_node") if err != nil { return nil, err } @@ -20141,8 +20752,8 @@ func XMLInstanceTypeReadMany(reader *XMLReader, start *xml.StartElement) (*Insta return &result, nil } -func XMLOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Option, error) { - builder := NewOptionBuilder() +func XMLNumaNodePinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NumaNodePin, error) { + builder := NewNumaNodePinBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20154,7 +20765,7 @@ func XMLOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "option" + expectedTag = "numa_node_pin" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -20173,24 +20784,24 @@ func XMLOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "name": - v, err := reader.ReadString(&t) + case "host_numa_node": + v, err := XMLNumaNodeReadOne(reader, &t, "host_numa_node") if err != nil { return nil, err } - builder.Name(v) - case "type": - v, err := reader.ReadString(&t) + builder.HostNumaNode(v) + case "index": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Type(v) - case "value": - v, err := reader.ReadString(&t) + builder.Index(v) + case "pinned": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Value(v) + builder.Pinned(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20226,7 +20837,7 @@ func XMLOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLOptionReadMany(reader *XMLReader, start *xml.StartElement) (*OptionSlice, error) { +func XMLNumaNodePinReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodePinSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20237,7 +20848,7 @@ func XMLOptionReadMany(reader *XMLReader, start *xml.StartElement) (*OptionSlice } start = st } - var result OptionSlice + var result NumaNodePinSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -20251,8 +20862,8 @@ func XMLOptionReadMany(reader *XMLReader, start *xml.StartElement) (*OptionSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "option": - one, err := XMLOptionReadOne(reader, &t, "option") + case "numa_node_pin": + one, err := XMLNumaNodePinReadOne(reader, &t, "numa_node_pin") if err != nil { return nil, err } @@ -20269,8 +20880,8 @@ func XMLOptionReadMany(reader *XMLReader, start *xml.StartElement) (*OptionSlice return &result, nil } -func XMLPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Property, error) { - builder := NewPropertyBuilder() +func XMLOpenStackImageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackImage, error) { + builder := NewOpenStackImageBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20282,11 +20893,22 @@ func XMLPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "property" + expectedTag = "openstack_image" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -20301,18 +20923,30 @@ func XMLPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "value": - v, err := reader.ReadString(&t) + case "openstack_image_provider": + v, err := XMLOpenStackImageProviderReadOne(reader, &t, "openstack_image_provider") if err != nil { return nil, err } - builder.Value(v) + builder.OpenstackImageProvider(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20348,7 +20982,7 @@ func XMLPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*PropertySlice, error) { +func XMLOpenStackImageReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackImageSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20359,7 +20993,7 @@ func XMLPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*PropertyS } start = st } - var result PropertySlice + var result OpenStackImageSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -20373,8 +21007,8 @@ func XMLPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*PropertyS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "property": - one, err := XMLPropertyReadOne(reader, &t, "property") + case "openstack_image": + one, err := XMLOpenStackImageReadOne(reader, &t, "openstack_image") if err != nil { return nil, err } @@ -20391,8 +21025,8 @@ func XMLPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*PropertyS return &result, nil } -func XMLPermissionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Permission, error) { - builder := NewPermissionBuilder() +func XMLOpenStackImageProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackImageProvider, error) { + builder := NewOpenStackImageProviderBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20404,7 +21038,7 @@ func XMLPermissionReadOne(reader *XMLReader, start *xml.StartElement, expectedTa start = st } if expectedTag == "" { - expectedTag = "permission" + expectedTag = "openstack_image_provider" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -20434,90 +21068,78 @@ func XMLPermissionReadOne(reader *XMLReader, start *xml.StartElement, expectedTa switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + case "authentication_url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Cluster(v) - case "comment": - v, err := reader.ReadString(&t) + builder.AuthenticationUrl(v) + case "certificates": + v, err := XMLCertificateReadMany(reader, &t) if err != nil { return nil, err } - builder.Comment(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") + builder.Certificates(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.DataCenter(v) + builder.Comment(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "disk": - v, err := XMLDiskReadOne(reader, &t, "disk") - if err != nil { - return nil, err - } - builder.Disk(v) - case "group": - v, err := XMLGroupReadOne(reader, &t, "group") - if err != nil { - return nil, err - } - builder.Group(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + case "images": + v, err := XMLOpenStackImageReadMany(reader, &t) if err != nil { return nil, err } - builder.Host(v) + builder.Images(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "role": - v, err := XMLRoleReadOne(reader, &t, "role") + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Role(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + builder.Password(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.StorageDomain(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") + builder.Properties(v) + case "requires_authentication": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Template(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") + builder.RequiresAuthentication(v) + case "tenant_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.User(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.TenantName(v) + case "url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Vm(v) - case "vm_pool": - v, err := XMLVmPoolReadOne(reader, &t, "vm_pool") + builder.Url(v) + case "username": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.VmPool(v) + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20548,12 +21170,22 @@ func XMLPermissionReadOne(reader *XMLReader, start *xml.StartElement, expectedTa } for _, link := range links { switch *link.rel { + case "certificates": + if one.certificates == nil { + one.certificates = new(CertificateSlice) + } + one.certificates.href = link.href + case "images": + if one.images == nil { + one.images = new(OpenStackImageSlice) + } + one.images.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLPermissionReadMany(reader *XMLReader, start *xml.StartElement) (*PermissionSlice, error) { +func XMLOpenStackImageProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackImageProviderSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20564,7 +21196,7 @@ func XMLPermissionReadMany(reader *XMLReader, start *xml.StartElement) (*Permiss } start = st } - var result PermissionSlice + var result OpenStackImageProviderSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -20578,8 +21210,8 @@ func XMLPermissionReadMany(reader *XMLReader, start *xml.StartElement) (*Permiss switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "permission": - one, err := XMLPermissionReadOne(reader, &t, "permission") + case "openstack_image_provider": + one, err := XMLOpenStackImageProviderReadOne(reader, &t, "openstack_image_provider") if err != nil { return nil, err } @@ -20596,8 +21228,8 @@ func XMLPermissionReadMany(reader *XMLReader, start *xml.StartElement) (*Permiss return &result, nil } -func XMLRngDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RngDevice, error) { - builder := NewRngDeviceBuilder() +func XMLOpenStackNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackNetwork, error) { + builder := NewOpenStackNetworkBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20609,11 +21241,22 @@ func XMLRngDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "rng_device" + expectedTag = "openstack_network" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -20628,19 +21271,30 @@ func XMLRngDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "rate": - v, err := XMLRateReadOne(reader, &t, "rate") + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Rate(v) - case "source": - vp, err := XMLRngSourceReadOne(reader, &t) - v := *vp + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Source(v) + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "openstack_network_provider": + v, err := XMLOpenStackNetworkProviderReadOne(reader, &t, "openstack_network_provider") + if err != nil { + return nil, err + } + builder.OpenstackNetworkProvider(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20676,7 +21330,7 @@ func XMLRngDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLRngDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*RngDeviceSlice, error) { +func XMLOpenStackNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackNetworkSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20687,7 +21341,7 @@ func XMLRngDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*RngDevic } start = st } - var result RngDeviceSlice + var result OpenStackNetworkSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -20701,8 +21355,8 @@ func XMLRngDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*RngDevic switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "rng_device": - one, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + case "openstack_network": + one, err := XMLOpenStackNetworkReadOne(reader, &t, "openstack_network") if err != nil { return nil, err } @@ -20719,8 +21373,8 @@ func XMLRngDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*RngDevic return &result, nil } -func XMLTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ticket, error) { - builder := NewTicketBuilder() +func XMLOpenStackNetworkProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackNetworkProvider, error) { + builder := NewOpenStackNetworkProviderBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20732,11 +21386,22 @@ func XMLTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "ticket" + expectedTag = "openstack_network_provider" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -20751,18 +21416,146 @@ func XMLTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "expiry": - v, err := reader.ReadInt64(&t) + case "agent_configuration": + v, err := XMLAgentConfigurationReadOne(reader, &t, "agent_configuration") + if err != nil { + return nil, err + } + builder.AgentConfiguration(v) + case "authentication_url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.AuthenticationUrl(v) + case "auto_sync": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.AutoSync(v) + case "certificates": + v, err := XMLCertificateReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Certificates(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "external_plugin_type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ExternalPluginType(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "networks": + v, err := XMLOpenStackNetworkReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Networks(v) + case "password": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Password(v) + case "plugin_type": + vp, err := XMLNetworkPluginTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.PluginType(v) + case "project_domain_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ProjectDomainName(v) + case "project_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ProjectName(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Properties(v) + case "read_only": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.ReadOnly(v) + case "requires_authentication": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.RequiresAuthentication(v) + case "subnets": + v, err := XMLOpenStackSubnetReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Subnets(v) + case "tenant_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.TenantName(v) + case "type": + vp, err := XMLOpenStackNetworkProviderTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "unmanaged": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Unmanaged(v) + case "url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Expiry(v) - case "value": + builder.Url(v) + case "user_domain_name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Value(v) + builder.UserDomainName(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20793,12 +21586,27 @@ func XMLTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { + case "certificates": + if one.certificates == nil { + one.certificates = new(CertificateSlice) + } + one.certificates.href = link.href + case "networks": + if one.networks == nil { + one.networks = new(OpenStackNetworkSlice) + } + one.networks.href = link.href + case "subnets": + if one.subnets == nil { + one.subnets = new(OpenStackSubnetSlice) + } + one.subnets.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLTicketReadMany(reader *XMLReader, start *xml.StartElement) (*TicketSlice, error) { +func XMLOpenStackNetworkProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackNetworkProviderSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20809,7 +21617,7 @@ func XMLTicketReadMany(reader *XMLReader, start *xml.StartElement) (*TicketSlice } start = st } - var result TicketSlice + var result OpenStackNetworkProviderSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -20823,8 +21631,8 @@ func XMLTicketReadMany(reader *XMLReader, start *xml.StartElement) (*TicketSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ticket": - one, err := XMLTicketReadOne(reader, &t, "ticket") + case "openstack_network_provider": + one, err := XMLOpenStackNetworkProviderReadOne(reader, &t, "openstack_network_provider") if err != nil { return nil, err } @@ -20841,8 +21649,8 @@ func XMLTicketReadMany(reader *XMLReader, start *xml.StartElement) (*TicketSlice return &result, nil } -func XMLJobReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Job, error) { - builder := NewJobBuilder() +func XMLOpenStackProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackProvider, error) { + builder := NewOpenStackProviderBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -20854,7 +21662,7 @@ func XMLJobReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "job" + expectedTag = "open_stack_provider" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -20884,12 +21692,12 @@ func XMLJobReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "auto_cleared": - v, err := reader.ReadBool(&t) + case "authentication_url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.AutoCleared(v) + builder.AuthenticationUrl(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -20902,55 +21710,48 @@ func XMLJobReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return nil, err } builder.Description(v) - case "end_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.EndTime(v) - case "external": - v, err := reader.ReadBool(&t) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.External(v) - case "last_updated": - v, err := reader.ReadTime(&t) + builder.Name(v) + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.LastUpdated(v) - case "name": - v, err := reader.ReadString(&t) + builder.Password(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) - case "owner": - v, err := XMLUserReadOne(reader, &t, "owner") + builder.Properties(v) + case "requires_authentication": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Owner(v) - case "start_time": - v, err := reader.ReadTime(&t) + builder.RequiresAuthentication(v) + case "tenant_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.StartTime(v) - case "status": - vp, err := XMLJobStatusReadOne(reader, &t) - v := *vp + builder.TenantName(v) + case "url": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Status(v) - case "steps": - v, err := XMLStepReadMany(reader, &t) + builder.Url(v) + case "username": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Steps(v) + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -20981,17 +21782,12 @@ func XMLJobReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin } for _, link := range links { switch *link.rel { - case "steps": - if one.steps == nil { - one.steps = new(StepSlice) - } - one.steps.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLJobReadMany(reader *XMLReader, start *xml.StartElement) (*JobSlice, error) { +func XMLOpenStackProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackProviderSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21002,7 +21798,7 @@ func XMLJobReadMany(reader *XMLReader, start *xml.StartElement) (*JobSlice, erro } start = st } - var result JobSlice + var result OpenStackProviderSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -21016,8 +21812,8 @@ func XMLJobReadMany(reader *XMLReader, start *xml.StartElement) (*JobSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "job": - one, err := XMLJobReadOne(reader, &t, "job") + case "open_stack_provider": + one, err := XMLOpenStackProviderReadOne(reader, &t, "open_stack_provider") if err != nil { return nil, err } @@ -21034,8 +21830,8 @@ func XMLJobReadMany(reader *XMLReader, start *xml.StartElement) (*JobSlice, erro return &result, nil } -func XMLClusterFeatureReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ClusterFeature, error) { - builder := NewClusterFeatureBuilder() +func XMLOpenStackSubnetReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackSubnet, error) { + builder := NewOpenStackSubnetBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21047,7 +21843,7 @@ func XMLClusterFeatureReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "cluster_feature" + expectedTag = "openstack_subnet" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -21077,12 +21873,12 @@ func XMLClusterFeatureReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster_level": - v, err := XMLClusterLevelReadOne(reader, &t, "cluster_level") + case "cidr": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ClusterLevel(v) + builder.Cidr(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -21095,12 +21891,36 @@ func XMLClusterFeatureReadOne(reader *XMLReader, start *xml.StartElement, expect return nil, err } builder.Description(v) + case "dns_servers": + v, err := reader.ReadStrings(&t) + if err != nil { + return nil, err + } + builder.DnsServers(v) + case "gateway": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Gateway(v) + case "ip_version": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.IpVersion(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "openstack_network": + v, err := XMLOpenStackNetworkReadOne(reader, &t, "openstack_network") + if err != nil { + return nil, err + } + builder.OpenstackNetwork(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -21136,7 +21956,7 @@ func XMLClusterFeatureReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLClusterFeatureReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterFeatureSlice, error) { +func XMLOpenStackSubnetReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackSubnetSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21147,7 +21967,7 @@ func XMLClusterFeatureReadMany(reader *XMLReader, start *xml.StartElement) (*Clu } start = st } - var result ClusterFeatureSlice + var result OpenStackSubnetSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -21161,8 +21981,8 @@ func XMLClusterFeatureReadMany(reader *XMLReader, start *xml.StartElement) (*Clu switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster_feature": - one, err := XMLClusterFeatureReadOne(reader, &t, "cluster_feature") + case "openstack_subnet": + one, err := XMLOpenStackSubnetReadOne(reader, &t, "openstack_subnet") if err != nil { return nil, err } @@ -21179,8 +21999,8 @@ func XMLClusterFeatureReadMany(reader *XMLReader, start *xml.StartElement) (*Clu return &result, nil } -func XMLBootReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Boot, error) { - builder := NewBootBuilder() +func XMLOpenStackVolumeProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackVolumeProvider, error) { + builder := NewOpenStackVolumeProviderBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21192,11 +22012,22 @@ func XMLBootReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "boot" + expectedTag = "openstack_volume_provider" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -21211,128 +22042,90 @@ func XMLBootReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "devices": - v, err := XMLBootDeviceReadMany(reader, &t) + case "authentication_keys": + v, err := XMLOpenstackVolumeAuthenticationKeyReadMany(reader, &t) if err != nil { return nil, err } - builder.Devices(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } + builder.AuthenticationKeys(v) + case "authentication_url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) + builder.AuthenticationUrl(v) + case "certificates": + v, err := XMLCertificateReadMany(reader, &t) + if err != nil { + return nil, err } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLBootReadMany(reader *XMLReader, start *xml.StartElement) (*BootSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result BootSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "boot": - one, err := XMLBootReadOne(reader, &t, "boot") + builder.Certificates(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - if one != nil { - result.slice = append(result.slice, one) + builder.Comment(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") + if err != nil { + return nil, err } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLTransparentHugePagesReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*TransparentHugePages, error) { - builder := NewTransparentHugePagesBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "transparent_hugepages" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "enabled": + builder.DataCenter(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "password": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Password(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Properties(v) + case "requires_authentication": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Enabled(v) + builder.RequiresAuthentication(v) + case "tenant_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.TenantName(v) + case "url": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Url(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) + case "volume_types": + v, err := XMLOpenStackVolumeTypeReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.VolumeTypes(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -21363,12 +22156,27 @@ func XMLTransparentHugePagesReadOne(reader *XMLReader, start *xml.StartElement, } for _, link := range links { switch *link.rel { + case "authenticationkeys": + if one.authenticationKeys == nil { + one.authenticationKeys = new(OpenstackVolumeAuthenticationKeySlice) + } + one.authenticationKeys.href = link.href + case "certificates": + if one.certificates == nil { + one.certificates = new(CertificateSlice) + } + one.certificates.href = link.href + case "volumetypes": + if one.volumeTypes == nil { + one.volumeTypes = new(OpenStackVolumeTypeSlice) + } + one.volumeTypes.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLTransparentHugePagesReadMany(reader *XMLReader, start *xml.StartElement) (*TransparentHugePagesSlice, error) { +func XMLOpenStackVolumeProviderReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackVolumeProviderSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21379,7 +22187,7 @@ func XMLTransparentHugePagesReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result TransparentHugePagesSlice + var result OpenStackVolumeProviderSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -21393,8 +22201,8 @@ func XMLTransparentHugePagesReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "transparent_hugepages": - one, err := XMLTransparentHugePagesReadOne(reader, &t, "transparent_hugepages") + case "openstack_volume_provider": + one, err := XMLOpenStackVolumeProviderReadOne(reader, &t, "openstack_volume_provider") if err != nil { return nil, err } @@ -21411,8 +22219,8 @@ func XMLTransparentHugePagesReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLExternalNetworkProviderConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalNetworkProviderConfiguration, error) { - builder := NewExternalNetworkProviderConfigurationBuilder() +func XMLOpenStackVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenStackVolumeType, error) { + builder := NewOpenStackVolumeTypeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21424,7 +22232,7 @@ func XMLExternalNetworkProviderConfigurationReadOne(reader *XMLReader, start *xm start = st } if expectedTag == "" { - expectedTag = "external_network_provider_configuration" + expectedTag = "open_stack_volume_type" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -21466,24 +22274,24 @@ func XMLExternalNetworkProviderConfigurationReadOne(reader *XMLReader, start *xm return nil, err } builder.Description(v) - case "external_network_provider": - v, err := XMLExternalProviderReadOne(reader, &t, "external_network_provider") + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ExternalNetworkProvider(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + builder.Name(v) + case "openstack_volume_provider": + v, err := XMLOpenStackVolumeProviderReadOne(reader, &t, "openstack_volume_provider") if err != nil { return nil, err } - builder.Host(v) - case "name": - v, err := reader.ReadString(&t) + builder.OpenstackVolumeProvider(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) + builder.Properties(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -21519,96 +22327,7 @@ func XMLExternalNetworkProviderConfigurationReadOne(reader *XMLReader, start *xm return one, nil } -func XMLExternalNetworkProviderConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalNetworkProviderConfigurationSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result ExternalNetworkProviderConfigurationSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "external_network_provider_configuration": - one, err := XMLExternalNetworkProviderConfigurationReadOne(reader, &t, "external_network_provider_configuration") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLVlanReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Vlan, error) { - builder := NewVlanBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "vlan" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - v, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return nil, err - } - builder.Id(v) - case "href": - builder.Href(value) - } - } - var links []Link - reader.Skip() - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLVlanReadMany(reader *XMLReader, start *xml.StartElement) (*VlanSlice, error) { +func XMLOpenStackVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) (*OpenStackVolumeTypeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21619,7 +22338,7 @@ func XMLVlanReadMany(reader *XMLReader, start *xml.StartElement) (*VlanSlice, er } start = st } - var result VlanSlice + var result OpenStackVolumeTypeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -21633,8 +22352,8 @@ func XMLVlanReadMany(reader *XMLReader, start *xml.StartElement) (*VlanSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vlan": - one, err := XMLVlanReadOne(reader, &t, "vlan") + case "open_stack_volume_type": + one, err := XMLOpenStackVolumeTypeReadOne(reader, &t, "open_stack_volume_type") if err != nil { return nil, err } @@ -21651,8 +22370,8 @@ func XMLVlanReadMany(reader *XMLReader, start *xml.StartElement) (*VlanSlice, er return &result, nil } -func XMLGlusterVolumeProfileDetailsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterVolumeProfileDetails, error) { - builder := NewGlusterVolumeProfileDetailsBuilder() +func XMLOpenstackVolumeAuthenticationKeyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenstackVolumeAuthenticationKey, error) { + builder := NewOpenstackVolumeAuthenticationKeyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21664,7 +22383,7 @@ func XMLGlusterVolumeProfileDetailsReadOne(reader *XMLReader, start *xml.StartEl start = st } if expectedTag == "" { - expectedTag = "gluster_volume_profile_details" + expectedTag = "openstack_volume_authentication_key" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -21693,19 +22412,19 @@ func XMLGlusterVolumeProfileDetailsReadOne(reader *XMLReader, start *xml.StartEl t = xml.CopyToken(t) switch t := t.(type) { case xml.StartElement: - switch t.Name.Local { - case "brick_profile_details": - v, err := XMLBrickProfileDetailReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.BrickProfileDetails(v) + switch t.Name.Local { case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) + case "creation_date": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.CreationDate(v) case "description": v, err := reader.ReadString(&t) if err != nil { @@ -21718,12 +22437,31 @@ func XMLGlusterVolumeProfileDetailsReadOne(reader *XMLReader, start *xml.StartEl return nil, err } builder.Name(v) - case "nfs_profile_details": - v, err := XMLNfsProfileDetailReadMany(reader, &t) + case "openstack_volume_provider": + v, err := XMLOpenStackVolumeProviderReadOne(reader, &t, "openstack_volume_provider") if err != nil { return nil, err } - builder.NfsProfileDetails(v) + builder.OpenstackVolumeProvider(v) + case "usage_type": + vp, err := XMLOpenstackVolumeAuthenticationKeyUsageTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.UsageType(v) + case "uuid": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Uuid(v) + case "value": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -21759,7 +22497,7 @@ func XMLGlusterVolumeProfileDetailsReadOne(reader *XMLReader, start *xml.StartEl return one, nil } -func XMLGlusterVolumeProfileDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeProfileDetailsSlice, error) { +func XMLOpenstackVolumeAuthenticationKeyReadMany(reader *XMLReader, start *xml.StartElement) (*OpenstackVolumeAuthenticationKeySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21770,7 +22508,7 @@ func XMLGlusterVolumeProfileDetailsReadMany(reader *XMLReader, start *xml.StartE } start = st } - var result GlusterVolumeProfileDetailsSlice + var result OpenstackVolumeAuthenticationKeySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -21784,8 +22522,8 @@ func XMLGlusterVolumeProfileDetailsReadMany(reader *XMLReader, start *xml.StartE switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "gluster_volume_profile_details": - one, err := XMLGlusterVolumeProfileDetailsReadOne(reader, &t, "gluster_volume_profile_details") + case "openstack_volume_authentication_key": + one, err := XMLOpenstackVolumeAuthenticationKeyReadOne(reader, &t, "openstack_volume_authentication_key") if err != nil { return nil, err } @@ -21802,8 +22540,8 @@ func XMLGlusterVolumeProfileDetailsReadMany(reader *XMLReader, start *xml.StartE return &result, nil } -func XMLRegistrationVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationVnicProfileMapping, error) { - builder := NewRegistrationVnicProfileMappingBuilder() +func XMLOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OperatingSystem, error) { + builder := NewOperatingSystemBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21815,7 +22553,7 @@ func XMLRegistrationVnicProfileMappingReadOne(reader *XMLReader, start *xml.Star start = st } if expectedTag == "" { - expectedTag = "registration_vnic_profile_mapping" + expectedTag = "os" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -21834,18 +22572,54 @@ func XMLRegistrationVnicProfileMappingReadOne(reader *XMLReader, start *xml.Star switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLVnicProfileReadOne(reader, &t, "from") + case "boot": + v, err := XMLBootReadOne(reader, &t, "boot") if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLVnicProfileReadOne(reader, &t, "to") + builder.Boot(v) + case "cmdline": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.To(v) + builder.Cmdline(v) + case "custom_kernel_cmdline": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomKernelCmdline(v) + case "initrd": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Initrd(v) + case "kernel": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Kernel(v) + case "reported_kernel_cmdline": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.ReportedKernelCmdline(v) + case "type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Type(v) + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") + if err != nil { + return nil, err + } + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -21881,7 +22655,7 @@ func XMLRegistrationVnicProfileMappingReadOne(reader *XMLReader, start *xml.Star return one, nil } -func XMLRegistrationVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationVnicProfileMappingSlice, error) { +func XMLOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*OperatingSystemSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21892,7 +22666,7 @@ func XMLRegistrationVnicProfileMappingReadMany(reader *XMLReader, start *xml.Sta } start = st } - var result RegistrationVnicProfileMappingSlice + var result OperatingSystemSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -21906,8 +22680,8 @@ func XMLRegistrationVnicProfileMappingReadMany(reader *XMLReader, start *xml.Sta switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_vnic_profile_mapping": - one, err := XMLRegistrationVnicProfileMappingReadOne(reader, &t, "registration_vnic_profile_mapping") + case "os": + one, err := XMLOperatingSystemReadOne(reader, &t, "os") if err != nil { return nil, err } @@ -21924,8 +22698,8 @@ func XMLRegistrationVnicProfileMappingReadMany(reader *XMLReader, start *xml.Sta return &result, nil } -func XMLNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Network, error) { - builder := NewNetworkBuilder() +func XMLOperatingSystemInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OperatingSystemInfo, error) { + builder := NewOperatingSystemInfoBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -21937,7 +22711,7 @@ func XMLNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "network" + expectedTag = "operating_system" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -21967,139 +22741,43 @@ func XMLNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + case "architecture": + vp, err := XMLArchitectureReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Cluster(v) + builder.Architecture(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") - if err != nil { - return nil, err - } - builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "display": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Display(v) - case "dns_resolver_configuration": - v, err := XMLDnsResolverConfigurationReadOne(reader, &t, "dns_resolver_configuration") - if err != nil { - return nil, err - } - builder.DnsResolverConfiguration(v) - case "external_provider": - v, err := XMLOpenStackNetworkProviderReadOne(reader, &t, "external_provider") - if err != nil { - return nil, err - } - builder.ExternalProvider(v) - case "external_provider_physical_network": - v, err := XMLNetworkReadOne(reader, &t, "external_provider_physical_network") - if err != nil { - return nil, err - } - builder.ExternalProviderPhysicalNetwork(v) - case "ip": - v, err := XMLIpReadOne(reader, &t, "ip") - if err != nil { - return nil, err - } - builder.Ip(v) - case "mtu": - v, err := reader.ReadInt64(&t) + case "large_icon": + v, err := XMLIconReadOne(reader, &t, "large_icon") if err != nil { return nil, err } - builder.Mtu(v) + builder.LargeIcon(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "network_labels": - v, err := XMLNetworkLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NetworkLabels(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "profile_required": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.ProfileRequired(v) - case "qos": - v, err := XMLQosReadOne(reader, &t, "qos") - if err != nil { - return nil, err - } - builder.Qos(v) - case "required": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Required(v) - case "status": - vp, err := XMLNetworkStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "stp": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Stp(v) - case "usages": - v, err := XMLNetworkUsageReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Usages(v) - case "vdsm_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.VdsmName(v) - case "vlan": - v, err := XMLVlanReadOne(reader, &t, "vlan") - if err != nil { - return nil, err - } - builder.Vlan(v) - case "vnic_profiles": - v, err := XMLVnicProfileReadMany(reader, &t) + case "small_icon": + v, err := XMLIconReadOne(reader, &t, "small_icon") if err != nil { return nil, err } - builder.VnicProfiles(v) + builder.SmallIcon(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -22130,27 +22808,12 @@ func XMLNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s } for _, link := range links { switch *link.rel { - case "networklabels": - if one.networkLabels == nil { - one.networkLabels = new(NetworkLabelSlice) - } - one.networkLabels.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "vnicprofiles": - if one.vnicProfiles == nil { - one.vnicProfiles = new(VnicProfileSlice) - } - one.vnicProfiles.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkSlice, error) { +func XMLOperatingSystemInfoReadMany(reader *XMLReader, start *xml.StartElement) (*OperatingSystemInfoSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22161,7 +22824,7 @@ func XMLNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkSli } start = st } - var result NetworkSlice + var result OperatingSystemInfoSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -22175,8 +22838,8 @@ func XMLNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "network": - one, err := XMLNetworkReadOne(reader, &t, "network") + case "operating_system": + one, err := XMLOperatingSystemInfoReadOne(reader, &t, "operating_system") if err != nil { return nil, err } @@ -22193,8 +22856,8 @@ func XMLNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkSli return &result, nil } -func XMLClusterLevelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ClusterLevel, error) { - builder := NewClusterLevelBuilder() +func XMLOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Option, error) { + builder := NewOptionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22206,22 +22869,11 @@ func XMLClusterLevelReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "cluster_level" + expectedTag = "option" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -22236,42 +22888,24 @@ func XMLClusterLevelReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster_features": - v, err := XMLClusterFeatureReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.ClusterFeatures(v) - case "comment": + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "cpu_types": - v, err := XMLCpuTypeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.CpuTypes(v) - case "description": + builder.Name(v) + case "type": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "name": + builder.Type(v) + case "value": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "permits": - v, err := XMLPermitReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permits(v) + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -22302,17 +22936,12 @@ func XMLClusterLevelReadOne(reader *XMLReader, start *xml.StartElement, expected } for _, link := range links { switch *link.rel { - case "clusterfeatures": - if one.clusterFeatures == nil { - one.clusterFeatures = new(ClusterFeatureSlice) - } - one.clusterFeatures.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLClusterLevelReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterLevelSlice, error) { +func XMLOptionReadMany(reader *XMLReader, start *xml.StartElement) (*OptionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22323,7 +22952,7 @@ func XMLClusterLevelReadMany(reader *XMLReader, start *xml.StartElement) (*Clust } start = st } - var result ClusterLevelSlice + var result OptionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -22337,8 +22966,8 @@ func XMLClusterLevelReadMany(reader *XMLReader, start *xml.StartElement) (*Clust switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster_level": - one, err := XMLClusterLevelReadOne(reader, &t, "cluster_level") + case "option": + one, err := XMLOptionReadOne(reader, &t, "option") if err != nil { return nil, err } @@ -22355,8 +22984,8 @@ func XMLClusterLevelReadMany(reader *XMLReader, start *xml.StartElement) (*Clust return &result, nil } -func XMLPowerManagementReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*PowerManagement, error) { - builder := NewPowerManagementBuilder() +func XMLPackageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Package, error) { + builder := NewPackageBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22368,7 +22997,7 @@ func XMLPowerManagementReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "power_management" + expectedTag = "package" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -22387,73 +23016,12 @@ func XMLPowerManagementReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "agents": - v, err := XMLAgentReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Agents(v) - case "automatic_pm_enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.AutomaticPmEnabled(v) - case "enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Enabled(v) - case "kdump_detection": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.KdumpDetection(v) - case "options": - v, err := XMLOptionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Options(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "pm_proxies": - v, err := XMLPmProxyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.PmProxies(v) - case "status": - vp, err := XMLPowerManagementStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Type(v) - case "username": + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Username(v) + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -22489,7 +23057,7 @@ func XMLPowerManagementReadOne(reader *XMLReader, start *xml.StartElement, expec return one, nil } -func XMLPowerManagementReadMany(reader *XMLReader, start *xml.StartElement) (*PowerManagementSlice, error) { +func XMLPackageReadMany(reader *XMLReader, start *xml.StartElement) (*PackageSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22500,7 +23068,7 @@ func XMLPowerManagementReadMany(reader *XMLReader, start *xml.StartElement) (*Po } start = st } - var result PowerManagementSlice + var result PackageSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -22514,8 +23082,8 @@ func XMLPowerManagementReadMany(reader *XMLReader, start *xml.StartElement) (*Po switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "power_management": - one, err := XMLPowerManagementReadOne(reader, &t, "power_management") + case "package": + one, err := XMLPackageReadOne(reader, &t, "package") if err != nil { return nil, err } @@ -22532,8 +23100,8 @@ func XMLPowerManagementReadMany(reader *XMLReader, start *xml.StartElement) (*Po return &result, nil } -func XMLAffinityGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*AffinityGroup, error) { - builder := NewAffinityGroupBuilder() +func XMLPayloadReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Payload, error) { + builder := NewPayloadBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22545,22 +23113,11 @@ func XMLAffinityGroupReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "affinity_group" + expectedTag = "payload" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -22575,84 +23132,25 @@ func XMLAffinityGroupReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "enforcing": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Enforcing(v) - case "host_labels": - v, err := XMLAffinityLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.HostLabels(v) - case "hosts": - v, err := XMLHostReadMany(reader, &t) + case "files": + v, err := XMLFileReadMany(reader, &t) if err != nil { return nil, err } - builder.Hosts(v) - case "hosts_rule": - v, err := XMLAffinityRuleReadOne(reader, &t, "hosts_rule") + builder.Files(v) + case "type": + vp, err := XMLVmDeviceTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.HostsRule(v) - case "name": + builder.Type(v) + case "volume_id": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "positive": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Positive(v) - case "priority": - v, err := reader.ReadFloat64(&t) - if err != nil { - return nil, err - } - builder.Priority(v) - case "vm_labels": - v, err := XMLAffinityLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.VmLabels(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Vms(v) - case "vms_rule": - v, err := XMLAffinityRuleReadOne(reader, &t, "vms_rule") - if err != nil { - return nil, err - } - builder.VmsRule(v) + builder.VolumeId(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -22669,46 +23167,26 @@ func XMLAffinityGroupReadOne(reader *XMLReader, start *xml.StartElement, expecte links = append(links, Link{&href, &rel}) } // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - case "hostlabels": - if one.hostLabels == nil { - one.hostLabels = new(AffinityLabelSlice) - } - one.hostLabels.href = link.href - case "hosts": - if one.hosts == nil { - one.hosts = new(HostSlice) - } - one.hosts.href = link.href - case "vmlabels": - if one.vmLabels == nil { - one.vmLabels = new(AffinityLabelSlice) - } - one.vmLabels.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) + reader.Skip() + default: + reader.Skip() } - one.vms.href = link.href + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { } // end of switch } // end of for-links return one, nil } -func XMLAffinityGroupReadMany(reader *XMLReader, start *xml.StartElement) (*AffinityGroupSlice, error) { +func XMLPayloadReadMany(reader *XMLReader, start *xml.StartElement) (*PayloadSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22719,7 +23197,7 @@ func XMLAffinityGroupReadMany(reader *XMLReader, start *xml.StartElement) (*Affi } start = st } - var result AffinityGroupSlice + var result PayloadSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -22733,8 +23211,8 @@ func XMLAffinityGroupReadMany(reader *XMLReader, start *xml.StartElement) (*Affi switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity_group": - one, err := XMLAffinityGroupReadOne(reader, &t, "affinity_group") + case "payload": + one, err := XMLPayloadReadOne(reader, &t, "payload") if err != nil { return nil, err } @@ -22751,8 +23229,8 @@ func XMLAffinityGroupReadMany(reader *XMLReader, start *xml.StartElement) (*Affi return &result, nil } -func XMLHardwareInformationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HardwareInformation, error) { - builder := NewHardwareInformationBuilder() +func XMLPermissionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Permission, error) { + builder := NewPermissionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22764,11 +23242,22 @@ func XMLHardwareInformationReadOne(reader *XMLReader, start *xml.StartElement, e start = st } if expectedTag == "" { - expectedTag = "hardware_information" + expectedTag = "permission" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -22783,48 +23272,90 @@ func XMLHardwareInformationReadOne(reader *XMLReader, start *xml.StartElement, e switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "family": - v, err := reader.ReadString(&t) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") if err != nil { return nil, err } - builder.Family(v) - case "manufacturer": + builder.Cluster(v) + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Manufacturer(v) - case "product_name": - v, err := reader.ReadString(&t) + builder.Comment(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") if err != nil { return nil, err } - builder.ProductName(v) - case "serial_number": + builder.DataCenter(v) + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.SerialNumber(v) - case "supported_rng_sources": - v, err := XMLRngSourceReadMany(reader, &t) + builder.Description(v) + case "disk": + v, err := XMLDiskReadOne(reader, &t, "disk") if err != nil { return nil, err } - builder.SupportedRngSources(v) - case "uuid": - v, err := reader.ReadString(&t) + builder.Disk(v) + case "group": + v, err := XMLGroupReadOne(reader, &t, "group") if err != nil { return nil, err } - builder.Uuid(v) - case "version": + builder.Group(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Version(v) + builder.Name(v) + case "role": + v, err := XMLRoleReadOne(reader, &t, "role") + if err != nil { + return nil, err + } + builder.Role(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") + if err != nil { + return nil, err + } + builder.User(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) + case "vm_pool": + v, err := XMLVmPoolReadOne(reader, &t, "vm_pool") + if err != nil { + return nil, err + } + builder.VmPool(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -22860,7 +23391,7 @@ func XMLHardwareInformationReadOne(reader *XMLReader, start *xml.StartElement, e return one, nil } -func XMLHardwareInformationReadMany(reader *XMLReader, start *xml.StartElement) (*HardwareInformationSlice, error) { +func XMLPermissionReadMany(reader *XMLReader, start *xml.StartElement) (*PermissionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22871,7 +23402,7 @@ func XMLHardwareInformationReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result HardwareInformationSlice + var result PermissionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -22885,8 +23416,8 @@ func XMLHardwareInformationReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "hardware_information": - one, err := XMLHardwareInformationReadOne(reader, &t, "hardware_information") + case "permission": + one, err := XMLPermissionReadOne(reader, &t, "permission") if err != nil { return nil, err } @@ -22903,8 +23434,8 @@ func XMLHardwareInformationReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLBalanceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Balance, error) { - builder := NewBalanceBuilder() +func XMLPermitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Permit, error) { + builder := NewPermitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -22916,7 +23447,7 @@ func XMLBalanceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "balance" + expectedTag = "permit" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -22946,6 +23477,12 @@ func XMLBalanceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "administrative": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Administrative(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -22964,18 +23501,12 @@ func XMLBalanceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return nil, err } builder.Name(v) - case "scheduling_policy": - v, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") - if err != nil { - return nil, err - } - builder.SchedulingPolicy(v) - case "scheduling_policy_unit": - v, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") + case "role": + v, err := XMLRoleReadOne(reader, &t, "role") if err != nil { return nil, err } - builder.SchedulingPolicyUnit(v) + builder.Role(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -23011,7 +23542,7 @@ func XMLBalanceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLBalanceReadMany(reader *XMLReader, start *xml.StartElement) (*BalanceSlice, error) { +func XMLPermitReadMany(reader *XMLReader, start *xml.StartElement) (*PermitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23022,7 +23553,7 @@ func XMLBalanceReadMany(reader *XMLReader, start *xml.StartElement) (*BalanceSli } start = st } - var result BalanceSlice + var result PermitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23036,8 +23567,8 @@ func XMLBalanceReadMany(reader *XMLReader, start *xml.StartElement) (*BalanceSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "balance": - one, err := XMLBalanceReadOne(reader, &t, "balance") + case "permit": + one, err := XMLPermitReadOne(reader, &t, "permit") if err != nil { return nil, err } @@ -23054,8 +23585,8 @@ func XMLBalanceReadMany(reader *XMLReader, start *xml.StartElement) (*BalanceSli return &result, nil } -func XMLIoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Io, error) { - builder := NewIoBuilder() +func XMLPmProxyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*PmProxy, error) { + builder := NewPmProxyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23067,7 +23598,7 @@ func XMLIoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string start = st } if expectedTag == "" { - expectedTag = "io" + expectedTag = "pm_proxy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -23086,12 +23617,13 @@ func XMLIoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "threads": - v, err := reader.ReadInt64(&t) + case "type": + vp, err := XMLPmProxyTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Threads(v) + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -23127,7 +23659,7 @@ func XMLIoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string return one, nil } -func XMLIoReadMany(reader *XMLReader, start *xml.StartElement) (*IoSlice, error) { +func XMLPmProxyReadMany(reader *XMLReader, start *xml.StartElement) (*PmProxySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23138,7 +23670,7 @@ func XMLIoReadMany(reader *XMLReader, start *xml.StartElement) (*IoSlice, error) } start = st } - var result IoSlice + var result PmProxySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23152,8 +23684,8 @@ func XMLIoReadMany(reader *XMLReader, start *xml.StartElement) (*IoSlice, error) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "io": - one, err := XMLIoReadOne(reader, &t, "io") + case "pm_proxy": + one, err := XMLPmProxyReadOne(reader, &t, "pm_proxy") if err != nil { return nil, err } @@ -23170,8 +23702,8 @@ func XMLIoReadMany(reader *XMLReader, start *xml.StartElement) (*IoSlice, error) return &result, nil } -func XMLGlusterClientReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterClient, error) { - builder := NewGlusterClientBuilder() +func XMLPortMirroringReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*PortMirroring, error) { + builder := NewPortMirroringBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23183,12 +23715,36 @@ func XMLGlusterClientReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "gluster_client" + expectedTag = "port_mirroring" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } var links []Link + reader.Skip() + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLPortMirroringReadMany(reader *XMLReader, start *xml.StartElement) (*PortMirroringSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result PortMirroringSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23202,30 +23758,123 @@ func XMLGlusterClientReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bytes_read": - v, err := reader.ReadInt64(&t) + case "port_mirroring": + one, err := XMLPortMirroringReadOne(reader, &t, "port_mirroring") if err != nil { return nil, err } - builder.BytesRead(v) - case "bytes_written": - v, err := reader.ReadInt64(&t) + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLPowerManagementReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*PowerManagement, error) { + builder := NewPowerManagementBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "power_management" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "address": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.BytesWritten(v) - case "client_port": - v, err := reader.ReadInt64(&t) + builder.Address(v) + case "agents": + v, err := XMLAgentReadMany(reader, &t) if err != nil { return nil, err } - builder.ClientPort(v) - case "host_name": + builder.Agents(v) + case "automatic_pm_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.AutomaticPmEnabled(v) + case "enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Enabled(v) + case "kdump_detection": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.KdumpDetection(v) + case "options": + v, err := XMLOptionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Options(v) + case "password": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.HostName(v) + builder.Password(v) + case "pm_proxies": + v, err := XMLPmProxyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.PmProxies(v) + case "status": + vp, err := XMLPowerManagementStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "type": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Type(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -23261,7 +23910,7 @@ func XMLGlusterClientReadOne(reader *XMLReader, start *xml.StartElement, expecte return one, nil } -func XMLGlusterClientReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterClientSlice, error) { +func XMLPowerManagementReadMany(reader *XMLReader, start *xml.StartElement) (*PowerManagementSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23272,7 +23921,7 @@ func XMLGlusterClientReadMany(reader *XMLReader, start *xml.StartElement) (*Glus } start = st } - var result GlusterClientSlice + var result PowerManagementSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23286,8 +23935,8 @@ func XMLGlusterClientReadMany(reader *XMLReader, start *xml.StartElement) (*Glus switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "gluster_client": - one, err := XMLGlusterClientReadOne(reader, &t, "gluster_client") + case "power_management": + one, err := XMLPowerManagementReadOne(reader, &t, "power_management") if err != nil { return nil, err } @@ -23304,8 +23953,8 @@ func XMLGlusterClientReadMany(reader *XMLReader, start *xml.StartElement) (*Glus return &result, nil } -func XMLGlusterMemoryPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterMemoryPool, error) { - builder := NewGlusterMemoryPoolBuilder() +func XMLProductReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Product, error) { + builder := NewProductBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23317,7 +23966,7 @@ func XMLGlusterMemoryPoolReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "memory_pool" + expectedTag = "product" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -23347,18 +23996,6 @@ func XMLGlusterMemoryPoolReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "alloc_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.AllocCount(v) - case "cold_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ColdCount(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -23371,48 +24008,12 @@ func XMLGlusterMemoryPoolReadOne(reader *XMLReader, start *xml.StartElement, exp return nil, err } builder.Description(v) - case "hot_count": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.HotCount(v) - case "max_alloc": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxAlloc(v) - case "max_stdalloc": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxStdalloc(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "padded_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.PaddedSize(v) - case "pool_misses": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.PoolMisses(v) - case "type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -23448,7 +24049,7 @@ func XMLGlusterMemoryPoolReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLGlusterMemoryPoolReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterMemoryPoolSlice, error) { +func XMLProductReadMany(reader *XMLReader, start *xml.StartElement) (*ProductSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23459,7 +24060,7 @@ func XMLGlusterMemoryPoolReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result GlusterMemoryPoolSlice + var result ProductSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23473,8 +24074,8 @@ func XMLGlusterMemoryPoolReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "memory_pool": - one, err := XMLGlusterMemoryPoolReadOne(reader, &t, "memory_pool") + case "product": + one, err := XMLProductReadOne(reader, &t, "product") if err != nil { return nil, err } @@ -23491,8 +24092,8 @@ func XMLGlusterMemoryPoolReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLInitializationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Initialization, error) { - builder := NewInitializationBuilder() +func XMLProductInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ProductInfo, error) { + builder := NewProductInfoBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23504,7 +24105,7 @@ func XMLInitializationReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "initialization" + expectedTag = "product_info" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -23523,139 +24124,30 @@ func XMLInitializationReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active_directory_ou": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ActiveDirectoryOu(v) - case "authorized_ssh_keys": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.AuthorizedSshKeys(v) - case "cloud_init": - v, err := XMLCloudInitReadOne(reader, &t, "cloud_init") - if err != nil { - return nil, err - } - builder.CloudInit(v) - case "cloud_init_network_protocol": - vp, err := XMLCloudInitNetworkProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.CloudInitNetworkProtocol(v) - case "configuration": - v, err := XMLConfigurationReadOne(reader, &t, "configuration") - if err != nil { - return nil, err - } - builder.Configuration(v) - case "custom_script": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomScript(v) - case "dns_search": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.DnsSearch(v) - case "dns_servers": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.DnsServers(v) - case "domain": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Domain(v) - case "host_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.HostName(v) - case "input_locale": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.InputLocale(v) - case "nic_configurations": - v, err := XMLNicConfigurationReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NicConfigurations(v) - case "org_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.OrgName(v) - case "regenerate_ids": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RegenerateIds(v) - case "regenerate_ssh_keys": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RegenerateSshKeys(v) - case "root_password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.RootPassword(v) - case "system_locale": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.SystemLocale(v) - case "timezone": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Timezone(v) - case "ui_language": + case "instance_id": v, err := reader.ReadString(&t) if err != nil { return nil, err - } - builder.UiLanguage(v) - case "user_locale": + } + builder.InstanceId(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.UserLocale(v) - case "user_name": + builder.Name(v) + case "vendor": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.UserName(v) - case "windows_license_key": - v, err := reader.ReadString(&t) + builder.Vendor(v) + case "version": + v, err := XMLVersionReadOne(reader, &t, "version") if err != nil { return nil, err } - builder.WindowsLicenseKey(v) + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -23691,7 +24183,7 @@ func XMLInitializationReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLInitializationReadMany(reader *XMLReader, start *xml.StartElement) (*InitializationSlice, error) { +func XMLProductInfoReadMany(reader *XMLReader, start *xml.StartElement) (*ProductInfoSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23702,7 +24194,7 @@ func XMLInitializationReadMany(reader *XMLReader, start *xml.StartElement) (*Ini } start = st } - var result InitializationSlice + var result ProductInfoSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23716,8 +24208,8 @@ func XMLInitializationReadMany(reader *XMLReader, start *xml.StartElement) (*Ini switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "initialization": - one, err := XMLInitializationReadOne(reader, &t, "initialization") + case "product_info": + one, err := XMLProductInfoReadOne(reader, &t, "product_info") if err != nil { return nil, err } @@ -23734,8 +24226,8 @@ func XMLInitializationReadMany(reader *XMLReader, start *xml.StartElement) (*Ini return &result, nil } -func XMLNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NumaNode, error) { - builder := NewNumaNodeBuilder() +func XMLProfileDetailReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ProfileDetail, error) { + builder := NewProfileDetailBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23747,22 +24239,11 @@ func XMLNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "host_numa_node" + expectedTag = "profile_detail" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -23777,54 +24258,30 @@ func XMLNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") - if err != nil { - return nil, err - } - builder.Cpu(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "index": - v, err := reader.ReadInt64(&t) + case "block_statistics": + v, err := XMLBlockStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.Index(v) - case "memory": + builder.BlockStatistics(v) + case "duration": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Memory(v) - case "name": - v, err := reader.ReadString(&t) + builder.Duration(v) + case "fop_statistics": + v, err := XMLFopStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) - case "node_distance": + builder.FopStatistics(v) + case "profile_type": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.NodeDistance(v) + builder.ProfileType(v) case "statistics": v, err := XMLStatisticReadMany(reader, &t) if err != nil { @@ -23861,17 +24318,12 @@ func XMLNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag } for _, link := range links { switch *link.rel { - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodeSlice, error) { +func XMLProfileDetailReadMany(reader *XMLReader, start *xml.StartElement) (*ProfileDetailSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23882,7 +24334,7 @@ func XMLNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodeS } start = st } - var result NumaNodeSlice + var result ProfileDetailSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -23896,8 +24348,8 @@ func XMLNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodeS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host_numa_node": - one, err := XMLNumaNodeReadOne(reader, &t, "host_numa_node") + case "profile_detail": + one, err := XMLProfileDetailReadOne(reader, &t, "profile_detail") if err != nil { return nil, err } @@ -23914,8 +24366,8 @@ func XMLNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*NumaNodeS return &result, nil } -func XMLMacReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Mac, error) { - builder := NewMacBuilder() +func XMLPropertyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Property, error) { + builder := NewPropertyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23927,7 +24379,7 @@ func XMLMacReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "mac" + expectedTag = "property" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -23946,12 +24398,18 @@ func XMLMacReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Address(v) + builder.Name(v) + case "value": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -23987,7 +24445,7 @@ func XMLMacReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLMacReadMany(reader *XMLReader, start *xml.StartElement) (*MacSlice, error) { +func XMLPropertyReadMany(reader *XMLReader, start *xml.StartElement) (*PropertySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -23998,7 +24456,7 @@ func XMLMacReadMany(reader *XMLReader, start *xml.StartElement) (*MacSlice, erro } start = st } - var result MacSlice + var result PropertySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -24012,8 +24470,8 @@ func XMLMacReadMany(reader *XMLReader, start *xml.StartElement) (*MacSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "mac": - one, err := XMLMacReadOne(reader, &t, "mac") + case "property": + one, err := XMLPropertyReadOne(reader, &t, "property") if err != nil { return nil, err } @@ -24030,8 +24488,8 @@ func XMLMacReadMany(reader *XMLReader, start *xml.StartElement) (*MacSlice, erro return &result, nil } -func XMLNetworkConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkConfiguration, error) { - builder := NewNetworkConfigurationBuilder() +func XMLProxyTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ProxyTicket, error) { + builder := NewProxyTicketBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24043,7 +24501,7 @@ func XMLNetworkConfigurationReadOne(reader *XMLReader, start *xml.StartElement, start = st } if expectedTag == "" { - expectedTag = "network_configuration" + expectedTag = "proxy_ticket" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -24062,18 +24520,12 @@ func XMLNetworkConfigurationReadOne(reader *XMLReader, start *xml.StartElement, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "dns": - v, err := XMLDnsReadOne(reader, &t, "dns") - if err != nil { - return nil, err - } - builder.Dns(v) - case "nics": - v, err := XMLNicReadMany(reader, &t) + case "value": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Nics(v) + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -24109,7 +24561,7 @@ func XMLNetworkConfigurationReadOne(reader *XMLReader, start *xml.StartElement, return one, nil } -func XMLNetworkConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkConfigurationSlice, error) { +func XMLProxyTicketReadMany(reader *XMLReader, start *xml.StartElement) (*ProxyTicketSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24120,7 +24572,7 @@ func XMLNetworkConfigurationReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result NetworkConfigurationSlice + var result ProxyTicketSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -24134,8 +24586,8 @@ func XMLNetworkConfigurationReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "network_configuration": - one, err := XMLNetworkConfigurationReadOne(reader, &t, "network_configuration") + case "proxy_ticket": + one, err := XMLProxyTicketReadOne(reader, &t, "proxy_ticket") if err != nil { return nil, err } @@ -24152,8 +24604,8 @@ func XMLNetworkConfigurationReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLExternalDiscoveredHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalDiscoveredHost, error) { - builder := NewExternalDiscoveredHostBuilder() +func XMLQosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Qos, error) { + builder := NewQosBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24165,7 +24617,7 @@ func XMLExternalDiscoveredHostReadOne(reader *XMLReader, start *xml.StartElement start = st } if expectedTag == "" { - expectedTag = "external_discovered_host" + expectedTag = "qos" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -24201,48 +24653,127 @@ func XMLExternalDiscoveredHostReadOne(reader *XMLReader, start *xml.StartElement return nil, err } builder.Comment(v) + case "cpu_limit": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.CpuLimit(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") + if err != nil { + return nil, err + } + builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + case "inbound_average": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.ExternalHostProvider(v) - case "ip": - v, err := reader.ReadString(&t) + builder.InboundAverage(v) + case "inbound_burst": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Ip(v) - case "last_report": - v, err := reader.ReadString(&t) + builder.InboundBurst(v) + case "inbound_peak": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.LastReport(v) - case "mac": - v, err := reader.ReadString(&t) + builder.InboundPeak(v) + case "max_iops": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Mac(v) + builder.MaxIops(v) + case "max_read_iops": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxReadIops(v) + case "max_read_throughput": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxReadThroughput(v) + case "max_throughput": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxThroughput(v) + case "max_write_iops": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxWriteIops(v) + case "max_write_throughput": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxWriteThroughput(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "subnet_name": - v, err := reader.ReadString(&t) + case "outbound_average": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.SubnetName(v) + builder.OutboundAverage(v) + case "outbound_average_linkshare": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.OutboundAverageLinkshare(v) + case "outbound_average_realtime": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.OutboundAverageRealtime(v) + case "outbound_average_upperlimit": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.OutboundAverageUpperlimit(v) + case "outbound_burst": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.OutboundBurst(v) + case "outbound_peak": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.OutboundPeak(v) + case "type": + vp, err := XMLQosTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -24278,7 +24809,7 @@ func XMLExternalDiscoveredHostReadOne(reader *XMLReader, start *xml.StartElement return one, nil } -func XMLExternalDiscoveredHostReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalDiscoveredHostSlice, error) { +func XMLQosReadMany(reader *XMLReader, start *xml.StartElement) (*QosSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24289,7 +24820,7 @@ func XMLExternalDiscoveredHostReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var result ExternalDiscoveredHostSlice + var result QosSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -24303,8 +24834,8 @@ func XMLExternalDiscoveredHostReadMany(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "external_discovered_host": - one, err := XMLExternalDiscoveredHostReadOne(reader, &t, "external_discovered_host") + case "qos": + one, err := XMLQosReadOne(reader, &t, "qos") if err != nil { return nil, err } @@ -24321,8 +24852,8 @@ func XMLExternalDiscoveredHostReadMany(reader *XMLReader, start *xml.StartElemen return &result, nil } -func XMLVmBaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmBase, error) { - builder := NewVmBaseBuilder() +func XMLQuotaReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Quota, error) { + builder := NewQuotaBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24334,7 +24865,7 @@ func XMLVmBaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "vm_base" + expectedTag = "quota" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -24364,278 +24895,90 @@ func XMLVmBaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "bios": - v, err := XMLBiosReadOne(reader, &t, "bios") + case "cluster_hard_limit_pct": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Bios(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + builder.ClusterHardLimitPct(v) + case "cluster_soft_limit_pct": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Cluster(v) + builder.ClusterSoftLimitPct(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "console": - v, err := XMLConsoleReadOne(reader, &t, "console") - if err != nil { - return nil, err - } - builder.Console(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") - if err != nil { - return nil, err - } - builder.Cpu(v) - case "cpu_profile": - v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") - if err != nil { - return nil, err - } - builder.CpuProfile(v) - case "cpu_shares": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.CpuShares(v) - case "creation_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.CreationTime(v) - case "custom_compatibility_version": - v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") - if err != nil { - return nil, err - } - builder.CustomCompatibilityVersion(v) - case "custom_cpu_model": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomCpuModel(v) - case "custom_emulated_machine": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.CustomEmulatedMachine(v) - case "custom_properties": - v, err := XMLCustomPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.CustomProperties(v) - case "delete_protected": - v, err := reader.ReadBool(&t) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") if err != nil { return nil, err } - builder.DeleteProtected(v) + builder.DataCenter(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") - if err != nil { - return nil, err - } - builder.Display(v) - case "domain": - v, err := XMLDomainReadOne(reader, &t, "domain") - if err != nil { - return nil, err - } - builder.Domain(v) - case "high_availability": - v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") - if err != nil { - return nil, err - } - builder.HighAvailability(v) - case "initialization": - v, err := XMLInitializationReadOne(reader, &t, "initialization") - if err != nil { - return nil, err - } - builder.Initialization(v) - case "io": - v, err := XMLIoReadOne(reader, &t, "io") - if err != nil { - return nil, err - } - builder.Io(v) - case "large_icon": - v, err := XMLIconReadOne(reader, &t, "large_icon") - if err != nil { - return nil, err - } - builder.LargeIcon(v) - case "lease": - v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") - if err != nil { - return nil, err - } - builder.Lease(v) - case "memory": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Memory(v) - case "memory_policy": - v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") - if err != nil { - return nil, err - } - builder.MemoryPolicy(v) - case "migration": - v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") - if err != nil { - return nil, err - } - builder.Migration(v) - case "migration_downtime": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MigrationDowntime(v) - case "multi_queues_enabled": - v, err := reader.ReadBool(&t) + case "disks": + v, err := XMLDiskReadMany(reader, &t) if err != nil { return nil, err } - builder.MultiQueuesEnabled(v) + builder.Disks(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "origin": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Origin(v) - case "os": - v, err := XMLOperatingSystemReadOne(reader, &t, "os") - if err != nil { - return nil, err - } - builder.Os(v) - case "placement_policy": - v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") - if err != nil { - return nil, err - } - builder.PlacementPolicy(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "rng_device": - v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") - if err != nil { - return nil, err - } - builder.RngDevice(v) - case "serial_number": - v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") - if err != nil { - return nil, err - } - builder.SerialNumber(v) - case "small_icon": - v, err := XMLIconReadOne(reader, &t, "small_icon") - if err != nil { - return nil, err - } - builder.SmallIcon(v) - case "soundcard_enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.SoundcardEnabled(v) - case "sso": - v, err := XMLSsoReadOne(reader, &t, "sso") - if err != nil { - return nil, err - } - builder.Sso(v) - case "start_paused": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.StartPaused(v) - case "stateless": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Stateless(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } - builder.StorageDomain(v) - case "storage_error_resume_behaviour": - vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) - v := *vp + builder.Permissions(v) + case "quota_cluster_limits": + v, err := XMLQuotaClusterLimitReadMany(reader, &t) if err != nil { return nil, err } - builder.StorageErrorResumeBehaviour(v) - case "time_zone": - v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") + builder.QuotaClusterLimits(v) + case "quota_storage_limits": + v, err := XMLQuotaStorageLimitReadMany(reader, &t) if err != nil { return nil, err } - builder.TimeZone(v) - case "tunnel_migration": - v, err := reader.ReadBool(&t) + builder.QuotaStorageLimits(v) + case "storage_hard_limit_pct": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.TunnelMigration(v) - case "type": - vp, err := XMLVmTypeReadOne(reader, &t) - v := *vp + builder.StorageHardLimitPct(v) + case "storage_soft_limit_pct": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Type(v) - case "usb": - v, err := XMLUsbReadOne(reader, &t, "usb") + builder.StorageSoftLimitPct(v) + case "users": + v, err := XMLUserReadMany(reader, &t) if err != nil { return nil, err } - builder.Usb(v) - case "virtio_scsi": - v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") + builder.Users(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) if err != nil { return nil, err } - builder.VirtioScsi(v) + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -24666,12 +25009,27 @@ func XMLVmBaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "quotaclusterlimits": + if one.quotaClusterLimits == nil { + one.quotaClusterLimits = new(QuotaClusterLimitSlice) + } + one.quotaClusterLimits.href = link.href + case "quotastoragelimits": + if one.quotaStorageLimits == nil { + one.quotaStorageLimits = new(QuotaStorageLimitSlice) + } + one.quotaStorageLimits.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLVmBaseReadMany(reader *XMLReader, start *xml.StartElement) (*VmBaseSlice, error) { +func XMLQuotaReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24682,7 +25040,7 @@ func XMLVmBaseReadMany(reader *XMLReader, start *xml.StartElement) (*VmBaseSlice } start = st } - var result VmBaseSlice + var result QuotaSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -24696,8 +25054,8 @@ func XMLVmBaseReadMany(reader *XMLReader, start *xml.StartElement) (*VmBaseSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vm_base": - one, err := XMLVmBaseReadOne(reader, &t, "vm_base") + case "quota": + one, err := XMLQuotaReadOne(reader, &t, "quota") if err != nil { return nil, err } @@ -24714,8 +25072,8 @@ func XMLVmBaseReadMany(reader *XMLReader, start *xml.StartElement) (*VmBaseSlice return &result, nil } -func XMLDnsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Dns, error) { - builder := NewDnsBuilder() +func XMLQuotaClusterLimitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*QuotaClusterLimit, error) { + builder := NewQuotaClusterLimitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24727,11 +25085,22 @@ func XMLDnsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "dns" + expectedTag = "quota_cluster_limit" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -24746,18 +25115,60 @@ func XMLDnsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "search_domains": - v, err := XMLHostReadMany(reader, &t) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") if err != nil { return nil, err } - builder.SearchDomains(v) - case "servers": - v, err := XMLHostReadMany(reader, &t) + builder.Cluster(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Servers(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "memory_limit": + v, err := reader.ReadFloat64(&t) + if err != nil { + return nil, err + } + builder.MemoryLimit(v) + case "memory_usage": + v, err := reader.ReadFloat64(&t) + if err != nil { + return nil, err + } + builder.MemoryUsage(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err + } + builder.Quota(v) + case "vcpu_limit": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.VcpuLimit(v) + case "vcpu_usage": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.VcpuUsage(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -24793,7 +25204,7 @@ func XMLDnsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLDnsReadMany(reader *XMLReader, start *xml.StartElement) (*DnsSlice, error) { +func XMLQuotaClusterLimitReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaClusterLimitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24804,7 +25215,7 @@ func XMLDnsReadMany(reader *XMLReader, start *xml.StartElement) (*DnsSlice, erro } start = st } - var result DnsSlice + var result QuotaClusterLimitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -24818,8 +25229,8 @@ func XMLDnsReadMany(reader *XMLReader, start *xml.StartElement) (*DnsSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "dns": - one, err := XMLDnsReadOne(reader, &t, "dns") + case "quota_cluster_limit": + one, err := XMLQuotaClusterLimitReadOne(reader, &t, "quota_cluster_limit") if err != nil { return nil, err } @@ -24836,8 +25247,8 @@ func XMLDnsReadMany(reader *XMLReader, start *xml.StartElement) (*DnsSlice, erro return &result, nil } -func XMLCpuProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuProfile, error) { - builder := NewCpuProfileBuilder() +func XMLQuotaStorageLimitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*QuotaStorageLimit, error) { + builder := NewQuotaStorageLimitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24849,7 +25260,7 @@ func XMLCpuProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTa start = st } if expectedTag == "" { - expectedTag = "cpu_profile" + expectedTag = "quota_storage_limit" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -24879,12 +25290,6 @@ func XMLCpuProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTa switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -24897,24 +25302,36 @@ func XMLCpuProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTa return nil, err } builder.Description(v) + case "limit": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Limit(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") if err != nil { return nil, err } - builder.Permissions(v) - case "qos": - v, err := XMLQosReadOne(reader, &t, "qos") + builder.Quota(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } - builder.Qos(v) + builder.StorageDomain(v) + case "usage": + v, err := reader.ReadFloat64(&t) + if err != nil { + return nil, err + } + builder.Usage(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -24945,17 +25362,12 @@ func XMLCpuProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTa } for _, link := range links { switch *link.rel { - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLCpuProfileReadMany(reader *XMLReader, start *xml.StartElement) (*CpuProfileSlice, error) { +func XMLQuotaStorageLimitReadMany(reader *XMLReader, start *xml.StartElement) (*QuotaStorageLimitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -24966,7 +25378,7 @@ func XMLCpuProfileReadMany(reader *XMLReader, start *xml.StartElement) (*CpuProf } start = st } - var result CpuProfileSlice + var result QuotaStorageLimitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -24980,8 +25392,8 @@ func XMLCpuProfileReadMany(reader *XMLReader, start *xml.StartElement) (*CpuProf switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cpu_profile": - one, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") + case "quota_storage_limit": + one, err := XMLQuotaStorageLimitReadOne(reader, &t, "quota_storage_limit") if err != nil { return nil, err } @@ -24998,8 +25410,8 @@ func XMLCpuProfileReadMany(reader *XMLReader, start *xml.StartElement) (*CpuProf return &result, nil } -func XMLExternalHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalHost, error) { - builder := NewExternalHostBuilder() +func XMLRangeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Range, error) { + builder := NewRangeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25011,22 +25423,11 @@ func XMLExternalHostReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "external_host" + expectedTag = "range" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -25041,36 +25442,18 @@ func XMLExternalHostReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": + case "from": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") - if err != nil { - return nil, err - } - builder.ExternalHostProvider(v) - case "name": + builder.From(v) + case "to": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) + builder.To(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -25106,7 +25489,7 @@ func XMLExternalHostReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLExternalHostReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalHostSlice, error) { +func XMLRangeReadMany(reader *XMLReader, start *xml.StartElement) (*RangeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25117,7 +25500,7 @@ func XMLExternalHostReadMany(reader *XMLReader, start *xml.StartElement) (*Exter } start = st } - var result ExternalHostSlice + var result RangeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -25131,8 +25514,8 @@ func XMLExternalHostReadMany(reader *XMLReader, start *xml.StartElement) (*Exter switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "external_host": - one, err := XMLExternalHostReadOne(reader, &t, "external_host") + case "range": + one, err := XMLRangeReadOne(reader, &t, "range") if err != nil { return nil, err } @@ -25149,8 +25532,8 @@ func XMLExternalHostReadMany(reader *XMLReader, start *xml.StartElement) (*Exter return &result, nil } -func XMLNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Nic, error) { - builder := NewNicBuilder() +func XMLRateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Rate, error) { + builder := NewRateBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25162,22 +25545,11 @@ func XMLNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "nic" + expectedTag = "rate" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -25192,140 +25564,18 @@ func XMLNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "boot_protocol": - vp, err := XMLBootProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.BootProtocol(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "interface": - vp, err := XMLNicInterfaceReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Interface(v) - case "linked": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Linked(v) - case "mac": - v, err := XMLMacReadOne(reader, &t, "mac") - if err != nil { - return nil, err - } - builder.Mac(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "network": - v, err := XMLNetworkReadOne(reader, &t, "network") - if err != nil { - return nil, err - } - builder.Network(v) - case "network_attachments": - v, err := XMLNetworkAttachmentReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NetworkAttachments(v) - case "network_filter_parameters": - v, err := XMLNetworkFilterParameterReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NetworkFilterParameters(v) - case "network_labels": - v, err := XMLNetworkLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NetworkLabels(v) - case "on_boot": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.OnBoot(v) - case "plugged": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Plugged(v) - case "reported_devices": - v, err := XMLReportedDeviceReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.ReportedDevices(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "virtual_function_allowed_labels": - v, err := XMLNetworkLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.VirtualFunctionAllowedLabels(v) - case "virtual_function_allowed_networks": - v, err := XMLNetworkReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.VirtualFunctionAllowedNetworks(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + case "bytes": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Vms(v) - case "vnic_profile": - v, err := XMLVnicProfileReadOne(reader, &t, "vnic_profile") + builder.Bytes(v) + case "period": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.VnicProfile(v) + builder.Period(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -25356,52 +25606,134 @@ func XMLNicReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin } for _, link := range links { switch *link.rel { - case "networkattachments": - if one.networkAttachments == nil { - one.networkAttachments = new(NetworkAttachmentSlice) - } - one.networkAttachments.href = link.href - case "networkfilterparameters": - if one.networkFilterParameters == nil { - one.networkFilterParameters = new(NetworkFilterParameterSlice) - } - one.networkFilterParameters.href = link.href - case "networklabels": - if one.networkLabels == nil { - one.networkLabels = new(NetworkLabelSlice) + } // end of switch + } // end of for-links + return one, nil +} + +func XMLRateReadMany(reader *XMLReader, start *xml.StartElement) (*RateSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil } - one.networkLabels.href = link.href - case "reporteddevices": - if one.reportedDevices == nil { - one.reportedDevices = new(ReportedDeviceSlice) + return nil, err + } + start = st + } + var result RateSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break } - one.reportedDevices.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "rate": + one, err := XMLRateReadOne(reader, &t, "rate") + if err != nil { + return nil, err + } + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() } - one.statistics.href = link.href - case "virtualfunctionallowedlabels": - if one.virtualFunctionAllowedLabels == nil { - one.virtualFunctionAllowedLabels = new(NetworkLabelSlice) + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLRegistrationAffinityGroupMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationAffinityGroupMapping, error) { + builder := NewRegistrationAffinityGroupMappingBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil } - one.virtualFunctionAllowedLabels.href = link.href - case "virtualfunctionallowednetworks": - if one.virtualFunctionAllowedNetworks == nil { - one.virtualFunctionAllowedNetworks = new(NetworkSlice) + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "registration_affinity_group_mapping" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break } - one.virtualFunctionAllowedNetworks.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "from": + v, err := XMLAffinityGroupReadOne(reader, &t, "from") + if err != nil { + return nil, err + } + builder.From(v) + case "to": + v, err := XMLAffinityGroupReadOne(reader, &t, "to") + if err != nil { + return nil, err + } + builder.To(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } + } + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) + } + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() } - one.vms.href = link.href + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { } // end of switch } // end of for-links return one, nil } -func XMLNicReadMany(reader *XMLReader, start *xml.StartElement) (*NicSlice, error) { +func XMLRegistrationAffinityGroupMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationAffinityGroupMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25412,7 +25744,7 @@ func XMLNicReadMany(reader *XMLReader, start *xml.StartElement) (*NicSlice, erro } start = st } - var result NicSlice + var result RegistrationAffinityGroupMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -25426,8 +25758,8 @@ func XMLNicReadMany(reader *XMLReader, start *xml.StartElement) (*NicSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "nic": - one, err := XMLNicReadOne(reader, &t, "nic") + case "registration_affinity_group_mapping": + one, err := XMLRegistrationAffinityGroupMappingReadOne(reader, &t, "registration_affinity_group_mapping") if err != nil { return nil, err } @@ -25444,8 +25776,8 @@ func XMLNicReadMany(reader *XMLReader, start *xml.StartElement) (*NicSlice, erro return &result, nil } -func XMLOpenstackVolumeAuthenticationKeyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*OpenstackVolumeAuthenticationKey, error) { - builder := NewOpenstackVolumeAuthenticationKeyBuilder() +func XMLRegistrationAffinityLabelMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationAffinityLabelMapping, error) { + builder := NewRegistrationAffinityLabelMappingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25457,22 +25789,11 @@ func XMLOpenstackVolumeAuthenticationKeyReadOne(reader *XMLReader, start *xml.St start = st } if expectedTag == "" { - expectedTag = "openstack_volume_authentication_key" + expectedTag = "registration_affinity_label_mapping" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -25487,55 +25808,18 @@ func XMLOpenstackVolumeAuthenticationKeyReadOne(reader *XMLReader, start *xml.St switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "creation_date": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.CreationDate(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "openstack_volume_provider": - v, err := XMLOpenStackVolumeProviderReadOne(reader, &t, "openstack_volume_provider") - if err != nil { - return nil, err - } - builder.OpenstackVolumeProvider(v) - case "usage_type": - vp, err := XMLOpenstackVolumeAuthenticationKeyUsageTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.UsageType(v) - case "uuid": - v, err := reader.ReadString(&t) + case "from": + v, err := XMLAffinityLabelReadOne(reader, &t, "from") if err != nil { return nil, err } - builder.Uuid(v) - case "value": - v, err := reader.ReadString(&t) + builder.From(v) + case "to": + v, err := XMLAffinityLabelReadOne(reader, &t, "to") if err != nil { return nil, err } - builder.Value(v) + builder.To(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -25571,7 +25855,7 @@ func XMLOpenstackVolumeAuthenticationKeyReadOne(reader *XMLReader, start *xml.St return one, nil } -func XMLOpenstackVolumeAuthenticationKeyReadMany(reader *XMLReader, start *xml.StartElement) (*OpenstackVolumeAuthenticationKeySlice, error) { +func XMLRegistrationAffinityLabelMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationAffinityLabelMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25582,7 +25866,7 @@ func XMLOpenstackVolumeAuthenticationKeyReadMany(reader *XMLReader, start *xml.S } start = st } - var result OpenstackVolumeAuthenticationKeySlice + var result RegistrationAffinityLabelMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -25596,8 +25880,8 @@ func XMLOpenstackVolumeAuthenticationKeyReadMany(reader *XMLReader, start *xml.S switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "openstack_volume_authentication_key": - one, err := XMLOpenstackVolumeAuthenticationKeyReadOne(reader, &t, "openstack_volume_authentication_key") + case "registration_affinity_label_mapping": + one, err := XMLRegistrationAffinityLabelMappingReadOne(reader, &t, "registration_affinity_label_mapping") if err != nil { return nil, err } @@ -25614,8 +25898,8 @@ func XMLOpenstackVolumeAuthenticationKeyReadMany(reader *XMLReader, start *xml.S return &result, nil } -func XMLCpuTopologyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuTopology, error) { - builder := NewCpuTopologyBuilder() +func XMLRegistrationClusterMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationClusterMapping, error) { + builder := NewRegistrationClusterMappingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25627,7 +25911,7 @@ func XMLCpuTopologyReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "cpu_topology" + expectedTag = "registration_cluster_mapping" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -25646,24 +25930,18 @@ func XMLCpuTopologyReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cores": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Cores(v) - case "sockets": - v, err := reader.ReadInt64(&t) + case "from": + v, err := XMLClusterReadOne(reader, &t, "from") if err != nil { return nil, err } - builder.Sockets(v) - case "threads": - v, err := reader.ReadInt64(&t) + builder.From(v) + case "to": + v, err := XMLClusterReadOne(reader, &t, "to") if err != nil { return nil, err } - builder.Threads(v) + builder.To(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -25699,7 +25977,7 @@ func XMLCpuTopologyReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLCpuTopologyReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTopologySlice, error) { +func XMLRegistrationClusterMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationClusterMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25710,7 +25988,7 @@ func XMLCpuTopologyReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTop } start = st } - var result CpuTopologySlice + var result RegistrationClusterMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -25724,8 +26002,8 @@ func XMLCpuTopologyReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTop switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cpu_topology": - one, err := XMLCpuTopologyReadOne(reader, &t, "cpu_topology") + case "registration_cluster_mapping": + one, err := XMLRegistrationClusterMappingReadOne(reader, &t, "registration_cluster_mapping") if err != nil { return nil, err } @@ -25742,8 +26020,8 @@ func XMLCpuTopologyReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTop return &result, nil } -func XMLExternalProviderReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalProvider, error) { - builder := NewExternalProviderBuilder() +func XMLRegistrationConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationConfiguration, error) { + builder := NewRegistrationConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25755,22 +26033,11 @@ func XMLExternalProviderReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "external_provider" + expectedTag = "registration_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -25785,60 +26052,48 @@ func XMLExternalProviderReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "authentication_url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.AuthenticationUrl(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + case "affinity_group_mappings": + v, err := XMLRegistrationAffinityGroupMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) + builder.AffinityGroupMappings(v) + case "affinity_label_mappings": + v, err := XMLRegistrationAffinityLabelMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.Name(v) - case "password": - v, err := reader.ReadString(&t) + builder.AffinityLabelMappings(v) + case "cluster_mappings": + v, err := XMLRegistrationClusterMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.Password(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) + builder.ClusterMappings(v) + case "domain_mappings": + v, err := XMLRegistrationDomainMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.Properties(v) - case "requires_authentication": - v, err := reader.ReadBool(&t) + builder.DomainMappings(v) + case "lun_mappings": + v, err := XMLRegistrationLunMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.RequiresAuthentication(v) - case "url": - v, err := reader.ReadString(&t) + builder.LunMappings(v) + case "role_mappings": + v, err := XMLRegistrationRoleMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.Url(v) - case "username": - v, err := reader.ReadString(&t) + builder.RoleMappings(v) + case "vnic_profile_mappings": + v, err := XMLRegistrationVnicProfileMappingReadMany(reader, &t) if err != nil { return nil, err } - builder.Username(v) + builder.VnicProfileMappings(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -25874,7 +26129,7 @@ func XMLExternalProviderReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLExternalProviderReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalProviderSlice, error) { +func XMLRegistrationConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25885,7 +26140,7 @@ func XMLExternalProviderReadMany(reader *XMLReader, start *xml.StartElement) (*E } start = st } - var result ExternalProviderSlice + var result RegistrationConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -25899,8 +26154,8 @@ func XMLExternalProviderReadMany(reader *XMLReader, start *xml.StartElement) (*E switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "external_provider": - one, err := XMLExternalProviderReadOne(reader, &t, "external_provider") + case "registration_configuration": + one, err := XMLRegistrationConfigurationReadOne(reader, &t, "registration_configuration") if err != nil { return nil, err } @@ -25917,8 +26172,8 @@ func XMLExternalProviderReadMany(reader *XMLReader, start *xml.StartElement) (*E return &result, nil } -func XMLExternalVmImportReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ExternalVmImport, error) { - builder := NewExternalVmImportBuilder() +func XMLRegistrationDomainMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationDomainMapping, error) { + builder := NewRegistrationDomainMappingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -25930,7 +26185,7 @@ func XMLExternalVmImportReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "external_vm_import" + expectedTag = "registration_domain_mapping" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -25949,85 +26204,18 @@ func XMLExternalVmImportReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) - case "cpu_profile": - v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") - if err != nil { - return nil, err - } - builder.CpuProfile(v) - case "drivers_iso": - v, err := XMLFileReadOne(reader, &t, "drivers_iso") - if err != nil { - return nil, err - } - builder.DriversIso(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Password(v) - case "provider": - vp, err := XMLExternalVmProviderTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Provider(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "sparse": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Sparse(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") - if err != nil { - return nil, err - } - builder.StorageDomain(v) - case "url": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Url(v) - case "username": - v, err := reader.ReadString(&t) + case "from": + v, err := XMLDomainReadOne(reader, &t, "from") if err != nil { return nil, err } - builder.Username(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.From(v) + case "to": + v, err := XMLDomainReadOne(reader, &t, "to") if err != nil { return nil, err } - builder.Vm(v) + builder.To(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -26063,7 +26251,7 @@ func XMLExternalVmImportReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLExternalVmImportReadMany(reader *XMLReader, start *xml.StartElement) (*ExternalVmImportSlice, error) { +func XMLRegistrationDomainMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationDomainMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26074,7 +26262,7 @@ func XMLExternalVmImportReadMany(reader *XMLReader, start *xml.StartElement) (*E } start = st } - var result ExternalVmImportSlice + var result RegistrationDomainMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -26088,8 +26276,8 @@ func XMLExternalVmImportReadMany(reader *XMLReader, start *xml.StartElement) (*E switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "external_vm_import": - one, err := XMLExternalVmImportReadOne(reader, &t, "external_vm_import") + case "registration_domain_mapping": + one, err := XMLRegistrationDomainMappingReadOne(reader, &t, "registration_domain_mapping") if err != nil { return nil, err } @@ -26106,8 +26294,8 @@ func XMLExternalVmImportReadMany(reader *XMLReader, start *xml.StartElement) (*E return &result, nil } -func XMLPackageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Package, error) { - builder := NewPackageBuilder() +func XMLRegistrationLunMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationLunMapping, error) { + builder := NewRegistrationLunMappingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26119,7 +26307,7 @@ func XMLPackageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "package" + expectedTag = "registration_lun_mapping" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -26138,12 +26326,18 @@ func XMLPackageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "name": - v, err := reader.ReadString(&t) + case "from": + v, err := XMLDiskReadOne(reader, &t, "from") if err != nil { return nil, err } - builder.Name(v) + builder.From(v) + case "to": + v, err := XMLDiskReadOne(reader, &t, "to") + if err != nil { + return nil, err + } + builder.To(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -26179,7 +26373,7 @@ func XMLPackageReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLPackageReadMany(reader *XMLReader, start *xml.StartElement) (*PackageSlice, error) { +func XMLRegistrationLunMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationLunMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26190,7 +26384,7 @@ func XMLPackageReadMany(reader *XMLReader, start *xml.StartElement) (*PackageSli } start = st } - var result PackageSlice + var result RegistrationLunMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -26204,8 +26398,8 @@ func XMLPackageReadMany(reader *XMLReader, start *xml.StartElement) (*PackageSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "package": - one, err := XMLPackageReadOne(reader, &t, "package") + case "registration_lun_mapping": + one, err := XMLRegistrationLunMappingReadOne(reader, &t, "registration_lun_mapping") if err != nil { return nil, err } @@ -26222,8 +26416,8 @@ func XMLPackageReadMany(reader *XMLReader, start *xml.StartElement) (*PackageSli return &result, nil } -func XMLQosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Qos, error) { - builder := NewQosBuilder() +func XMLRegistrationRoleMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationRoleMapping, error) { + builder := NewRegistrationRoleMappingBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26235,22 +26429,11 @@ func XMLQosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "qos" + expectedTag = "registration_role_mapping" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -26265,133 +26448,140 @@ func XMLQosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "cpu_limit": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.CpuLimit(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") - if err != nil { - return nil, err - } - builder.DataCenter(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "inbound_average": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.InboundAverage(v) - case "inbound_burst": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.InboundBurst(v) - case "inbound_peak": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.InboundPeak(v) - case "max_iops": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxIops(v) - case "max_read_iops": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxReadIops(v) - case "max_read_throughput": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxReadThroughput(v) - case "max_throughput": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxThroughput(v) - case "max_write_iops": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxWriteIops(v) - case "max_write_throughput": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxWriteThroughput(v) - case "name": - v, err := reader.ReadString(&t) + case "from": + v, err := XMLRoleReadOne(reader, &t, "from") if err != nil { return nil, err } - builder.Name(v) - case "outbound_average": - v, err := reader.ReadInt64(&t) + builder.From(v) + case "to": + v, err := XMLRoleReadOne(reader, &t, "to") if err != nil { return nil, err } - builder.OutboundAverage(v) - case "outbound_average_linkshare": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err + builder.To(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.OutboundAverageLinkshare(v) - case "outbound_average_realtime": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.OutboundAverageRealtime(v) - case "outbound_average_upperlimit": - v, err := reader.ReadInt64(&t) + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLRegistrationRoleMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationRoleMappingSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result RegistrationRoleMappingSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "registration_role_mapping": + one, err := XMLRegistrationRoleMappingReadOne(reader, &t, "registration_role_mapping") if err != nil { return nil, err } - builder.OutboundAverageUpperlimit(v) - case "outbound_burst": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err + if one != nil { + result.slice = append(result.slice, one) } - builder.OutboundBurst(v) - case "outbound_peak": - v, err := reader.ReadInt64(&t) + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLRegistrationVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationVnicProfileMapping, error) { + builder := NewRegistrationVnicProfileMappingBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "registration_vnic_profile_mapping" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "from": + v, err := XMLVnicProfileReadOne(reader, &t, "from") if err != nil { return nil, err } - builder.OutboundPeak(v) - case "type": - vp, err := XMLQosTypeReadOne(reader, &t) - v := *vp + builder.From(v) + case "to": + v, err := XMLVnicProfileReadOne(reader, &t, "to") if err != nil { return nil, err } - builder.Type(v) + builder.To(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -26427,7 +26617,7 @@ func XMLQosReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLQosReadMany(reader *XMLReader, start *xml.StartElement) (*QosSlice, error) { +func XMLRegistrationVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationVnicProfileMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26438,7 +26628,7 @@ func XMLQosReadMany(reader *XMLReader, start *xml.StartElement) (*QosSlice, erro } start = st } - var result QosSlice + var result RegistrationVnicProfileMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -26452,8 +26642,8 @@ func XMLQosReadMany(reader *XMLReader, start *xml.StartElement) (*QosSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "qos": - one, err := XMLQosReadOne(reader, &t, "qos") + case "registration_vnic_profile_mapping": + one, err := XMLRegistrationVnicProfileMappingReadOne(reader, &t, "registration_vnic_profile_mapping") if err != nil { return nil, err } @@ -26470,8 +26660,8 @@ func XMLQosReadMany(reader *XMLReader, start *xml.StartElement) (*QosSlice, erro return &result, nil } -func XMLNicConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NicConfiguration, error) { - builder := NewNicConfigurationBuilder() +func XMLReportedConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ReportedConfiguration, error) { + builder := NewReportedConfigurationBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26483,7 +26673,7 @@ func XMLNicConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "nic_configuration" + expectedTag = "reported_configuration" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -26502,44 +26692,30 @@ func XMLNicConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "boot_protocol": - vp, err := XMLBootProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.BootProtocol(v) - case "ip": - v, err := XMLIpReadOne(reader, &t, "ip") + case "actual_value": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Ip(v) - case "ipv6": - v, err := XMLIpReadOne(reader, &t, "ipv6") + builder.ActualValue(v) + case "expected_value": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Ipv6(v) - case "ipv6_boot_protocol": - vp, err := XMLBootProtocolReadOne(reader, &t) - v := *vp + builder.ExpectedValue(v) + case "in_sync": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Ipv6BootProtocol(v) + builder.InSync(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "on_boot": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.OnBoot(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -26575,7 +26751,7 @@ func XMLNicConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLNicConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*NicConfigurationSlice, error) { +func XMLReportedConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*ReportedConfigurationSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26586,7 +26762,7 @@ func XMLNicConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*N } start = st } - var result NicConfigurationSlice + var result ReportedConfigurationSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -26600,8 +26776,8 @@ func XMLNicConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*N switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "nic_configuration": - one, err := XMLNicConfigurationReadOne(reader, &t, "nic_configuration") + case "reported_configuration": + one, err := XMLReportedConfigurationReadOne(reader, &t, "reported_configuration") if err != nil { return nil, err } @@ -26618,8 +26794,8 @@ func XMLNicConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*N return &result, nil } -func XMLBlockStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*BlockStatistic, error) { - builder := NewBlockStatisticBuilder() +func XMLReportedDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ReportedDevice, error) { + builder := NewReportedDeviceBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26631,11 +26807,22 @@ func XMLBlockStatisticReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "block_statistic" + expectedTag = "reported_device" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -26650,12 +26837,49 @@ func XMLBlockStatisticReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Statistics(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "ips": + v, err := XMLIpReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Ips(v) + case "mac": + v, err := XMLMacReadOne(reader, &t, "mac") + if err != nil { + return nil, err + } + builder.Mac(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "type": + vp, err := XMLReportedDeviceTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -26691,7 +26915,7 @@ func XMLBlockStatisticReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLBlockStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*BlockStatisticSlice, error) { +func XMLReportedDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*ReportedDeviceSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26702,7 +26926,7 @@ func XMLBlockStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*Blo } start = st } - var result BlockStatisticSlice + var result ReportedDeviceSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -26716,8 +26940,8 @@ func XMLBlockStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*Blo switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "block_statistic": - one, err := XMLBlockStatisticReadOne(reader, &t, "block_statistic") + case "reported_device": + one, err := XMLReportedDeviceReadOne(reader, &t, "reported_device") if err != nil { return nil, err } @@ -26734,8 +26958,8 @@ func XMLBlockStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*Blo return &result, nil } -func XMLHighAvailabilityReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HighAvailability, error) { - builder := NewHighAvailabilityBuilder() +func XMLRngDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RngDevice, error) { + builder := NewRngDeviceBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26747,7 +26971,7 @@ func XMLHighAvailabilityReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "high_availability" + expectedTag = "rng_device" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -26766,18 +26990,19 @@ func XMLHighAvailabilityReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "rate": + v, err := XMLRateReadOne(reader, &t, "rate") if err != nil { return nil, err } - builder.Enabled(v) - case "priority": - v, err := reader.ReadInt64(&t) + builder.Rate(v) + case "source": + vp, err := XMLRngSourceReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Priority(v) + builder.Source(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -26813,7 +27038,7 @@ func XMLHighAvailabilityReadOne(reader *XMLReader, start *xml.StartElement, expe return one, nil } -func XMLHighAvailabilityReadMany(reader *XMLReader, start *xml.StartElement) (*HighAvailabilitySlice, error) { +func XMLRngDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*RngDeviceSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26824,7 +27049,7 @@ func XMLHighAvailabilityReadMany(reader *XMLReader, start *xml.StartElement) (*H } start = st } - var result HighAvailabilitySlice + var result RngDeviceSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -26838,8 +27063,8 @@ func XMLHighAvailabilityReadMany(reader *XMLReader, start *xml.StartElement) (*H switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "high_availability": - one, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + case "rng_device": + one, err := XMLRngDeviceReadOne(reader, &t, "rng_device") if err != nil { return nil, err } @@ -26856,8 +27081,8 @@ func XMLHighAvailabilityReadMany(reader *XMLReader, start *xml.StartElement) (*H return &result, nil } -func XMLDiskSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DiskSnapshot, error) { - builder := NewDiskSnapshotBuilder() +func XMLRoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Role, error) { + builder := NewRoleBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -26869,7 +27094,7 @@ func XMLDiskSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "disk_snapshot" + expectedTag = "role" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -26899,254 +27124,48 @@ func XMLDiskSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Active(v) - case "actual_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ActualSize(v) - case "alias": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Alias(v) - case "backup": - vp, err := XMLDiskBackupReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Backup(v) - case "bootable": + case "administrative": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Bootable(v) + builder.Administrative(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "content_type": - vp, err := XMLDiskContentTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.ContentType(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "disk": - v, err := XMLDiskReadOne(reader, &t, "disk") - if err != nil { - return nil, err - } - builder.Disk(v) - case "disk_profile": - v, err := XMLDiskProfileReadOne(reader, &t, "disk_profile") - if err != nil { - return nil, err - } - builder.DiskProfile(v) - case "format": - vp, err := XMLDiskFormatReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Format(v) - case "image_id": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ImageId(v) - case "initial_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.InitialSize(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) - case "interface": - vp, err := XMLDiskInterfaceReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Interface(v) - case "logical_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.LogicalName(v) - case "lun_storage": - v, err := XMLHostStorageReadOne(reader, &t, "lun_storage") + case "mutable": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.LunStorage(v) + builder.Mutable(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "openstack_volume_type": - v, err := XMLOpenStackVolumeTypeReadOne(reader, &t, "openstack_volume_type") - if err != nil { - return nil, err - } - builder.OpenstackVolumeType(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "propagate_errors": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.PropagateErrors(v) - case "provisioned_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ProvisionedSize(v) - case "qcow_version": - vp, err := XMLQcowVersionReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.QcowVersion(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "read_only": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.ReadOnly(v) - case "sgio": - vp, err := XMLScsiGenericIOReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Sgio(v) - case "shareable": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Shareable(v) - case "snapshot": - v, err := XMLSnapshotReadOne(reader, &t, "snapshot") - if err != nil { - return nil, err - } - builder.Snapshot(v) - case "sparse": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Sparse(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "status": - vp, err := XMLDiskStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") - if err != nil { - return nil, err - } - builder.StorageDomain(v) - case "storage_domains": - v, err := XMLStorageDomainReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.StorageDomains(v) - case "storage_type": - vp, err := XMLDiskStorageTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.StorageType(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "total_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.TotalSize(v) - case "uses_scsi_reservation": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.UsesScsiReservation(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + case "permits": + v, err := XMLPermitReadMany(reader, &t) if err != nil { return nil, err } - builder.Vms(v) - case "wipe_after_delete": - v, err := reader.ReadBool(&t) + builder.Permits(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } - builder.WipeAfterDelete(v) + builder.User(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -27177,32 +27196,17 @@ func XMLDiskSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expected } for _, link := range links { switch *link.rel { - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href - case "storagedomains": - if one.storageDomains == nil { - one.storageDomains = new(StorageDomainSlice) - } - one.storageDomains.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) + case "permits": + if one.permits == nil { + one.permits = new(PermitSlice) } - one.vms.href = link.href + one.permits.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLDiskSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSnapshotSlice, error) { +func XMLRoleReadMany(reader *XMLReader, start *xml.StartElement) (*RoleSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27213,7 +27217,7 @@ func XMLDiskSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*DiskS } start = st } - var result DiskSnapshotSlice + var result RoleSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -27227,8 +27231,8 @@ func XMLDiskSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*DiskS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "disk_snapshot": - one, err := XMLDiskSnapshotReadOne(reader, &t, "disk_snapshot") + case "role": + one, err := XMLRoleReadOne(reader, &t, "role") if err != nil { return nil, err } @@ -27245,8 +27249,8 @@ func XMLDiskSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*DiskS return &result, nil } -func XMLCdromReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Cdrom, error) { - builder := NewCdromBuilder() +func XMLSchedulingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SchedulingPolicy, error) { + builder := NewSchedulingPolicyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27258,7 +27262,7 @@ func XMLCdromReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "cdrom" + expectedTag = "scheduling_policy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -27288,54 +27292,60 @@ func XMLCdromReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "balances": + v, err := XMLBalanceReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Balances(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) + case "default_policy": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.DefaultPolicy(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "file": - v, err := XMLFileReadOne(reader, &t, "file") + case "filters": + v, err := XMLFilterReadMany(reader, &t) if err != nil { return nil, err } - builder.File(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + builder.Filters(v) + case "locked": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.InstanceType(v) + builder.Locked(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.Properties(v) + case "weight": + v, err := XMLWeightReadMany(reader, &t) if err != nil { return nil, err } - builder.Vms(v) + builder.Weight(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -27366,17 +27376,27 @@ func XMLCdromReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str } for _, link := range links { switch *link.rel { - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) + case "balances": + if one.balances == nil { + one.balances = new(BalanceSlice) } - one.vms.href = link.href + one.balances.href = link.href + case "filters": + if one.filters == nil { + one.filters = new(FilterSlice) + } + one.filters.href = link.href + case "weight": + if one.weight == nil { + one.weight = new(WeightSlice) + } + one.weight.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLCdromReadMany(reader *XMLReader, start *xml.StartElement) (*CdromSlice, error) { +func XMLSchedulingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*SchedulingPolicySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27387,7 +27407,7 @@ func XMLCdromReadMany(reader *XMLReader, start *xml.StartElement) (*CdromSlice, } start = st } - var result CdromSlice + var result SchedulingPolicySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -27401,8 +27421,8 @@ func XMLCdromReadMany(reader *XMLReader, start *xml.StartElement) (*CdromSlice, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cdrom": - one, err := XMLCdromReadOne(reader, &t, "cdrom") + case "scheduling_policy": + one, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") if err != nil { return nil, err } @@ -27419,8 +27439,8 @@ func XMLCdromReadMany(reader *XMLReader, start *xml.StartElement) (*CdromSlice, return &result, nil } -func XMLConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Console, error) { - builder := NewConsoleBuilder() +func XMLSeLinuxReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SeLinux, error) { + builder := NewSeLinuxBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27432,7 +27452,7 @@ func XMLConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "console" + expectedTag = "se_linux" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -27451,12 +27471,13 @@ func XMLConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "mode": + vp, err := XMLSeLinuxModeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Enabled(v) + builder.Mode(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -27492,7 +27513,7 @@ func XMLConsoleReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*ConsoleSlice, error) { +func XMLSeLinuxReadMany(reader *XMLReader, start *xml.StartElement) (*SeLinuxSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27503,7 +27524,7 @@ func XMLConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*ConsoleSli } start = st } - var result ConsoleSlice + var result SeLinuxSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -27517,8 +27538,8 @@ func XMLConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*ConsoleSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "console": - one, err := XMLConsoleReadOne(reader, &t, "console") + case "se_linux": + one, err := XMLSeLinuxReadOne(reader, &t, "se_linux") if err != nil { return nil, err } @@ -27535,8 +27556,8 @@ func XMLConsoleReadMany(reader *XMLReader, start *xml.StartElement) (*ConsoleSli return &result, nil } -func XMLFencingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*FencingPolicy, error) { - builder := NewFencingPolicyBuilder() +func XMLSchedulingPolicyUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SchedulingPolicyUnit, error) { + builder := NewSchedulingPolicyUnitBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27548,11 +27569,22 @@ func XMLFencingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expecte start = st } if expectedTag == "" { - expectedTag = "fencing_policy" + expectedTag = "scheduling_policy_unit" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -27567,36 +27599,49 @@ func XMLFencingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expecte switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) case "enabled": v, err := reader.ReadBool(&t) if err != nil { return nil, err } builder.Enabled(v) - case "skip_if_connectivity_broken": - v, err := XMLSkipIfConnectivityBrokenReadOne(reader, &t, "skip_if_connectivity_broken") + case "internal": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.SkipIfConnectivityBroken(v) - case "skip_if_gluster_bricks_up": - v, err := reader.ReadBool(&t) + builder.Internal(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.SkipIfGlusterBricksUp(v) - case "skip_if_gluster_quorum_not_met": - v, err := reader.ReadBool(&t) + builder.Name(v) + case "properties": + v, err := XMLPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.SkipIfGlusterQuorumNotMet(v) - case "skip_if_sd_active": - v, err := XMLSkipIfSdActiveReadOne(reader, &t, "skip_if_sd_active") + builder.Properties(v) + case "type": + vp, err := XMLPolicyUnitTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.SkipIfSdActive(v) + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -27632,7 +27677,7 @@ func XMLFencingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expecte return one, nil } -func XMLFencingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*FencingPolicySlice, error) { +func XMLSchedulingPolicyUnitReadMany(reader *XMLReader, start *xml.StartElement) (*SchedulingPolicyUnitSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27643,7 +27688,7 @@ func XMLFencingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Fenc } start = st } - var result FencingPolicySlice + var result SchedulingPolicyUnitSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -27657,8 +27702,8 @@ func XMLFencingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Fenc switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "fencing_policy": - one, err := XMLFencingPolicyReadOne(reader, &t, "fencing_policy") + case "scheduling_policy_unit": + one, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") if err != nil { return nil, err } @@ -27675,8 +27720,8 @@ func XMLFencingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Fenc return &result, nil } -func XMLSkipIfSdActiveReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SkipIfSdActive, error) { - builder := NewSkipIfSdActiveBuilder() +func XMLSerialNumberReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SerialNumber, error) { + builder := NewSerialNumberBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27688,7 +27733,7 @@ func XMLSkipIfSdActiveReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "skip_if_sd_active" + expectedTag = "serial_number" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -27707,12 +27752,19 @@ func XMLSkipIfSdActiveReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) + case "policy": + vp, err := XMLSerialNumberPolicyReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Enabled(v) + builder.Policy(v) + case "value": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Value(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -27748,7 +27800,7 @@ func XMLSkipIfSdActiveReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLSkipIfSdActiveReadMany(reader *XMLReader, start *xml.StartElement) (*SkipIfSdActiveSlice, error) { +func XMLSerialNumberReadMany(reader *XMLReader, start *xml.StartElement) (*SerialNumberSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27759,7 +27811,7 @@ func XMLSkipIfSdActiveReadMany(reader *XMLReader, start *xml.StartElement) (*Ski } start = st } - var result SkipIfSdActiveSlice + var result SerialNumberSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -27773,8 +27825,8 @@ func XMLSkipIfSdActiveReadMany(reader *XMLReader, start *xml.StartElement) (*Ski switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "skip_if_sd_active": - one, err := XMLSkipIfSdActiveReadOne(reader, &t, "skip_if_sd_active") + case "serial_number": + one, err := XMLSerialNumberReadOne(reader, &t, "serial_number") if err != nil { return nil, err } @@ -27791,8 +27843,8 @@ func XMLSkipIfSdActiveReadMany(reader *XMLReader, start *xml.StartElement) (*Ski return &result, nil } -func XMLPayloadReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Payload, error) { - builder := NewPayloadBuilder() +func XMLSessionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Session, error) { + builder := NewSessionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27804,11 +27856,22 @@ func XMLPayloadReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "payload" + expectedTag = "session" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -27823,25 +27886,54 @@ func XMLPayloadReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "files": - v, err := XMLFileReadMany(reader, &t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Files(v) - case "type": - vp, err := XMLVmDeviceTypeReadOne(reader, &t) - v := *vp + builder.Comment(v) + case "console_user": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Type(v) - case "volume_id": + builder.ConsoleUser(v) + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.VolumeId(v) + builder.Description(v) + case "ip": + v, err := XMLIpReadOne(reader, &t, "ip") + if err != nil { + return nil, err + } + builder.Ip(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "protocol": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Protocol(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") + if err != nil { + return nil, err + } + builder.User(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -27877,7 +27969,7 @@ func XMLPayloadReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLPayloadReadMany(reader *XMLReader, start *xml.StartElement) (*PayloadSlice, error) { +func XMLSessionReadMany(reader *XMLReader, start *xml.StartElement) (*SessionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27888,7 +27980,7 @@ func XMLPayloadReadMany(reader *XMLReader, start *xml.StartElement) (*PayloadSli } start = st } - var result PayloadSlice + var result SessionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -27902,8 +27994,8 @@ func XMLPayloadReadMany(reader *XMLReader, start *xml.StartElement) (*PayloadSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "payload": - one, err := XMLPayloadReadOne(reader, &t, "payload") + case "session": + one, err := XMLSessionReadOne(reader, &t, "session") if err != nil { return nil, err } @@ -27920,8 +28012,8 @@ func XMLPayloadReadMany(reader *XMLReader, start *xml.StartElement) (*PayloadSli return &result, nil } -func XMLSshPublicKeyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SshPublicKey, error) { - builder := NewSshPublicKeyBuilder() +func XMLSkipIfConnectivityBrokenReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SkipIfConnectivityBroken, error) { + builder := NewSkipIfConnectivityBrokenBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -27933,66 +28025,37 @@ func XMLSshPublicKeyReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "ssh_public_key" + expectedTag = "skip_if_connectivity_broken" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "content": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Content(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "name": - v, err := reader.ReadString(&t) + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Name(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") + builder.Enabled(v) + case "threshold": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.User(v) + builder.Threshold(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -28028,7 +28091,7 @@ func XMLSshPublicKeyReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLSshPublicKeyReadMany(reader *XMLReader, start *xml.StartElement) (*SshPublicKeySlice, error) { +func XMLSkipIfConnectivityBrokenReadMany(reader *XMLReader, start *xml.StartElement) (*SkipIfConnectivityBrokenSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28039,7 +28102,7 @@ func XMLSshPublicKeyReadMany(reader *XMLReader, start *xml.StartElement) (*SshPu } start = st } - var result SshPublicKeySlice + var result SkipIfConnectivityBrokenSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -28053,8 +28116,8 @@ func XMLSshPublicKeyReadMany(reader *XMLReader, start *xml.StartElement) (*SshPu switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ssh_public_key": - one, err := XMLSshPublicKeyReadOne(reader, &t, "ssh_public_key") + case "skip_if_connectivity_broken": + one, err := XMLSkipIfConnectivityBrokenReadOne(reader, &t, "skip_if_connectivity_broken") if err != nil { return nil, err } @@ -28071,8 +28134,8 @@ func XMLSshPublicKeyReadMany(reader *XMLReader, start *xml.StartElement) (*SshPu return &result, nil } -func XMLApiSummaryItemReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ApiSummaryItem, error) { - builder := NewApiSummaryItemBuilder() +func XMLSkipIfSdActiveReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SkipIfSdActive, error) { + builder := NewSkipIfSdActiveBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28084,7 +28147,7 @@ func XMLApiSummaryItemReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "api_summary_item" + expectedTag = "skip_if_sd_active" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -28103,18 +28166,12 @@ func XMLApiSummaryItemReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Active(v) - case "total": - v, err := reader.ReadInt64(&t) + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Total(v) + builder.Enabled(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -28150,7 +28207,7 @@ func XMLApiSummaryItemReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLApiSummaryItemReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSummaryItemSlice, error) { +func XMLSkipIfSdActiveReadMany(reader *XMLReader, start *xml.StartElement) (*SkipIfSdActiveSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28161,7 +28218,7 @@ func XMLApiSummaryItemReadMany(reader *XMLReader, start *xml.StartElement) (*Api } start = st } - var result ApiSummaryItemSlice + var result SkipIfSdActiveSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -28175,8 +28232,8 @@ func XMLApiSummaryItemReadMany(reader *XMLReader, start *xml.StartElement) (*Api switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "api_summary_item": - one, err := XMLApiSummaryItemReadOne(reader, &t, "api_summary_item") + case "skip_if_sd_active": + one, err := XMLSkipIfSdActiveReadOne(reader, &t, "skip_if_sd_active") if err != nil { return nil, err } @@ -28193,8 +28250,8 @@ func XMLApiSummaryItemReadMany(reader *XMLReader, start *xml.StartElement) (*Api return &result, nil } -func XMLDiskReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Disk, error) { - builder := NewDiskBuilder() +func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Snapshot, error) { + builder := NewSnapshotBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28206,7 +28263,7 @@ func XMLDiskReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "disk" + expectedTag = "snapshot" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -28236,180 +28293,429 @@ func XMLDiskReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active": - v, err := reader.ReadBool(&t) + case "affinity_labels": + v, err := XMLAffinityLabelReadMany(reader, &t) if err != nil { return nil, err } - builder.Active(v) - case "actual_size": - v, err := reader.ReadInt64(&t) + builder.AffinityLabels(v) + case "applications": + v, err := XMLApplicationReadMany(reader, &t) if err != nil { return nil, err } - builder.ActualSize(v) - case "alias": - v, err := reader.ReadString(&t) + builder.Applications(v) + case "bios": + v, err := XMLBiosReadOne(reader, &t, "bios") if err != nil { return nil, err } - builder.Alias(v) - case "backup": - vp, err := XMLDiskBackupReadOne(reader, &t) - v := *vp + builder.Bios(v) + case "cdroms": + v, err := XMLCdromReadMany(reader, &t) if err != nil { return nil, err } - builder.Backup(v) - case "bootable": - v, err := reader.ReadBool(&t) + builder.Cdroms(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") if err != nil { return nil, err } - builder.Bootable(v) + builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "content_type": - vp, err := XMLDiskContentTypeReadOne(reader, &t) - v := *vp + case "console": + v, err := XMLConsoleReadOne(reader, &t, "console") if err != nil { return nil, err } - builder.ContentType(v) + builder.Console(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") + if err != nil { + return nil, err + } + builder.Cpu(v) + case "cpu_profile": + v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") + if err != nil { + return nil, err + } + builder.CpuProfile(v) + case "cpu_shares": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.CpuShares(v) + case "creation_time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.CreationTime(v) + case "custom_compatibility_version": + v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") + if err != nil { + return nil, err + } + builder.CustomCompatibilityVersion(v) + case "custom_cpu_model": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomCpuModel(v) + case "custom_emulated_machine": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomEmulatedMachine(v) + case "custom_properties": + v, err := XMLCustomPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.CustomProperties(v) + case "date": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.Date(v) + case "delete_protected": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.DeleteProtected(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "disk_profile": - v, err := XMLDiskProfileReadOne(reader, &t, "disk_profile") + case "disk_attachments": + v, err := XMLDiskAttachmentReadMany(reader, &t) if err != nil { return nil, err } - builder.DiskProfile(v) - case "format": - vp, err := XMLDiskFormatReadOne(reader, &t) - v := *vp + builder.DiskAttachments(v) + case "disks": + v, err := XMLDiskReadMany(reader, &t) if err != nil { return nil, err } - builder.Format(v) - case "image_id": + builder.Disks(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") + if err != nil { + return nil, err + } + builder.Display(v) + case "domain": + v, err := XMLDomainReadOne(reader, &t, "domain") + if err != nil { + return nil, err + } + builder.Domain(v) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + if err != nil { + return nil, err + } + builder.ExternalHostProvider(v) + case "floppies": + v, err := XMLFloppyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Floppies(v) + case "fqdn": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ImageId(v) - case "initial_size": - v, err := reader.ReadInt64(&t) + builder.Fqdn(v) + case "graphics_consoles": + v, err := XMLGraphicsConsoleReadMany(reader, &t) if err != nil { return nil, err } - builder.InitialSize(v) + builder.GraphicsConsoles(v) + case "guest_operating_system": + v, err := XMLGuestOperatingSystemReadOne(reader, &t, "guest_operating_system") + if err != nil { + return nil, err + } + builder.GuestOperatingSystem(v) + case "guest_time_zone": + v, err := XMLTimeZoneReadOne(reader, &t, "guest_time_zone") + if err != nil { + return nil, err + } + builder.GuestTimeZone(v) + case "has_illegal_images": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.HasIllegalImages(v) + case "high_availability": + v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + if err != nil { + return nil, err + } + builder.HighAvailability(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "host_devices": + v, err := XMLHostDeviceReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.HostDevices(v) + case "initialization": + v, err := XMLInitializationReadOne(reader, &t, "initialization") + if err != nil { + return nil, err + } + builder.Initialization(v) case "instance_type": v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") if err != nil { return nil, err } builder.InstanceType(v) - case "interface": - vp, err := XMLDiskInterfaceReadOne(reader, &t) - v := *vp + case "io": + v, err := XMLIoReadOne(reader, &t, "io") if err != nil { return nil, err } - builder.Interface(v) - case "logical_name": - v, err := reader.ReadString(&t) + builder.Io(v) + case "katello_errata": + v, err := XMLKatelloErratumReadMany(reader, &t) if err != nil { return nil, err } - builder.LogicalName(v) - case "lun_storage": - v, err := XMLHostStorageReadOne(reader, &t, "lun_storage") + builder.KatelloErrata(v) + case "large_icon": + v, err := XMLIconReadOne(reader, &t, "large_icon") if err != nil { return nil, err } - builder.LunStorage(v) + builder.LargeIcon(v) + case "lease": + v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") + if err != nil { + return nil, err + } + builder.Lease(v) + case "memory": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Memory(v) + case "memory_policy": + v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + if err != nil { + return nil, err + } + builder.MemoryPolicy(v) + case "migration": + v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") + if err != nil { + return nil, err + } + builder.Migration(v) + case "migration_downtime": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MigrationDowntime(v) + case "multi_queues_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.MultiQueuesEnabled(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "openstack_volume_type": - v, err := XMLOpenStackVolumeTypeReadOne(reader, &t, "openstack_volume_type") + case "next_run_configuration_exists": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.OpenstackVolumeType(v) + builder.NextRunConfigurationExists(v) + case "nics": + v, err := XMLNicReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Nics(v) + case "host_numa_nodes": + v, err := XMLNumaNodeReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.NumaNodes(v) + case "numa_tune_mode": + vp, err := XMLNumaTuneModeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.NumaTuneMode(v) + case "origin": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Origin(v) + case "original_template": + v, err := XMLTemplateReadOne(reader, &t, "original_template") + if err != nil { + return nil, err + } + builder.OriginalTemplate(v) + case "os": + v, err := XMLOperatingSystemReadOne(reader, &t, "os") + if err != nil { + return nil, err + } + builder.Os(v) + case "payloads": + v, err := XMLPayloadReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Payloads(v) case "permissions": v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } builder.Permissions(v) - case "propagate_errors": + case "persist_memorystate": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.PropagateErrors(v) - case "provisioned_size": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.ProvisionedSize(v) - case "qcow_version": - vp, err := XMLQcowVersionReadOne(reader, &t) - v := *vp + builder.PersistMemorystate(v) + case "placement_policy": + v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") if err != nil { return nil, err } - builder.QcowVersion(v) + builder.PlacementPolicy(v) case "quota": v, err := XMLQuotaReadOne(reader, &t, "quota") if err != nil { return nil, err } builder.Quota(v) - case "read_only": + case "reported_devices": + v, err := XMLReportedDeviceReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.ReportedDevices(v) + case "rng_device": + v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + if err != nil { + return nil, err + } + builder.RngDevice(v) + case "run_once": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.ReadOnly(v) - case "sgio": - vp, err := XMLScsiGenericIOReadOne(reader, &t) + builder.RunOnce(v) + case "serial_number": + v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") + if err != nil { + return nil, err + } + builder.SerialNumber(v) + case "sessions": + v, err := XMLSessionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Sessions(v) + case "small_icon": + v, err := XMLIconReadOne(reader, &t, "small_icon") + if err != nil { + return nil, err + } + builder.SmallIcon(v) + case "snapshot_status": + vp, err := XMLSnapshotStatusReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.Sgio(v) - case "shareable": + builder.SnapshotStatus(v) + case "snapshot_type": + vp, err := XMLSnapshotTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.SnapshotType(v) + case "snapshots": + v, err := XMLSnapshotReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Snapshots(v) + case "soundcard_enabled": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Shareable(v) - case "snapshot": - v, err := XMLSnapshotReadOne(reader, &t, "snapshot") + builder.SoundcardEnabled(v) + case "sso": + v, err := XMLSsoReadOne(reader, &t, "sso") if err != nil { return nil, err } - builder.Snapshot(v) - case "sparse": + builder.Sso(v) + case "start_paused": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Sparse(v) + builder.StartPaused(v) + case "start_time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.StartTime(v) + case "stateless": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Stateless(v) case "statistics": v, err := XMLStatisticReadMany(reader, &t) if err != nil { @@ -28417,67 +28723,110 @@ func XMLDiskReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } builder.Statistics(v) case "status": - vp, err := XMLDiskStatusReadOne(reader, &t) + vp, err := XMLVmStatusReadOne(reader, &t) v := *vp if err != nil { return nil, err } builder.Status(v) + case "status_detail": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.StatusDetail(v) + case "stop_reason": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.StopReason(v) + case "stop_time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.StopTime(v) case "storage_domain": v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } builder.StorageDomain(v) - case "storage_domains": - v, err := XMLStorageDomainReadMany(reader, &t) + case "storage_error_resume_behaviour": + vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.StorageDomains(v) - case "storage_type": - vp, err := XMLDiskStorageTypeReadOne(reader, &t) - v := *vp + builder.StorageErrorResumeBehaviour(v) + case "tags": + v, err := XMLTagReadMany(reader, &t) if err != nil { return nil, err } - builder.StorageType(v) + builder.Tags(v) case "template": v, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } builder.Template(v) - case "total_size": - v, err := reader.ReadInt64(&t) + case "time_zone": + v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") + if err != nil { + return nil, err + } + builder.TimeZone(v) + case "tunnel_migration": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.TunnelMigration(v) + case "type": + vp, err := XMLVmTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "usb": + v, err := XMLUsbReadOne(reader, &t, "usb") + if err != nil { + return nil, err + } + builder.Usb(v) + case "use_latest_template_version": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.TotalSize(v) - case "uses_scsi_reservation": - v, err := reader.ReadBool(&t) + builder.UseLatestTemplateVersion(v) + case "virtio_scsi": + v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") if err != nil { return nil, err } - builder.UsesScsiReservation(v) + builder.VirtioScsi(v) case "vm": v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + case "vm_pool": + v, err := XMLVmPoolReadOne(reader, &t, "vm_pool") if err != nil { return nil, err } - builder.Vms(v) - case "wipe_after_delete": - v, err := reader.ReadBool(&t) + builder.VmPool(v) + case "watchdogs": + v, err := XMLWatchdogReadMany(reader, &t) if err != nil { return nil, err } - builder.WipeAfterDelete(v) + builder.Watchdogs(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -28508,32 +28857,102 @@ func XMLDiskReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { + case "affinitylabels": + if one.affinityLabels == nil { + one.affinityLabels = new(AffinityLabelSlice) + } + one.affinityLabels.href = link.href + case "applications": + if one.applications == nil { + one.applications = new(ApplicationSlice) + } + one.applications.href = link.href + case "cdroms": + if one.cdroms == nil { + one.cdroms = new(CdromSlice) + } + one.cdroms.href = link.href + case "diskattachments": + if one.diskAttachments == nil { + one.diskAttachments = new(DiskAttachmentSlice) + } + one.diskAttachments.href = link.href + case "disks": + if one.disks == nil { + one.disks = new(DiskSlice) + } + one.disks.href = link.href + case "floppies": + if one.floppies == nil { + one.floppies = new(FloppySlice) + } + one.floppies.href = link.href + case "graphicsconsoles": + if one.graphicsConsoles == nil { + one.graphicsConsoles = new(GraphicsConsoleSlice) + } + one.graphicsConsoles.href = link.href + case "hostdevices": + if one.hostDevices == nil { + one.hostDevices = new(HostDeviceSlice) + } + one.hostDevices.href = link.href + case "katelloerrata": + if one.katelloErrata == nil { + one.katelloErrata = new(KatelloErratumSlice) + } + one.katelloErrata.href = link.href + case "nics": + if one.nics == nil { + one.nics = new(NicSlice) + } + one.nics.href = link.href + case "numanodes": + if one.numaNodes == nil { + one.numaNodes = new(NumaNodeSlice) + } + one.numaNodes.href = link.href case "permissions": if one.permissions == nil { one.permissions = new(PermissionSlice) } one.permissions.href = link.href + case "reporteddevices": + if one.reportedDevices == nil { + one.reportedDevices = new(ReportedDeviceSlice) + } + one.reportedDevices.href = link.href + case "sessions": + if one.sessions == nil { + one.sessions = new(SessionSlice) + } + one.sessions.href = link.href + case "snapshots": + if one.snapshots == nil { + one.snapshots = new(SnapshotSlice) + } + one.snapshots.href = link.href case "statistics": if one.statistics == nil { one.statistics = new(StatisticSlice) } one.statistics.href = link.href - case "storagedomains": - if one.storageDomains == nil { - one.storageDomains = new(StorageDomainSlice) + case "tags": + if one.tags == nil { + one.tags = new(TagSlice) } - one.storageDomains.href = link.href - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) + one.tags.href = link.href + case "watchdogs": + if one.watchdogs == nil { + one.watchdogs = new(WatchdogSlice) } - one.vms.href = link.href + one.watchdogs.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLDiskReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSlice, error) { +func XMLSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*SnapshotSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28544,7 +28963,7 @@ func XMLDiskReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSlice, er } start = st } - var result DiskSlice + var result SnapshotSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -28558,8 +28977,8 @@ func XMLDiskReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "disk": - one, err := XMLDiskReadOne(reader, &t, "disk") + case "snapshot": + one, err := XMLSnapshotReadOne(reader, &t, "snapshot") if err != nil { return nil, err } @@ -28576,8 +28995,8 @@ func XMLDiskReadMany(reader *XMLReader, start *xml.StartElement) (*DiskSlice, er return &result, nil } -func XMLNetworkLabelReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkLabel, error) { - builder := NewNetworkLabelBuilder() +func XMLSpecialObjectsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SpecialObjects, error) { + builder := NewSpecialObjectsBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28589,22 +29008,11 @@ func XMLNetworkLabelReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "network_label" + expectedTag = "special_objects" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -28619,36 +29027,18 @@ func XMLNetworkLabelReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "host_nic": - v, err := XMLHostNicReadOne(reader, &t, "host_nic") - if err != nil { - return nil, err - } - builder.HostNic(v) - case "name": - v, err := reader.ReadString(&t) + case "blank_template": + v, err := XMLTemplateReadOne(reader, &t, "blank_template") if err != nil { return nil, err } - builder.Name(v) - case "network": - v, err := XMLNetworkReadOne(reader, &t, "network") + builder.BlankTemplate(v) + case "root_tag": + v, err := XMLTagReadOne(reader, &t, "root_tag") if err != nil { return nil, err } - builder.Network(v) + builder.RootTag(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -28684,7 +29074,7 @@ func XMLNetworkLabelReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLNetworkLabelReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkLabelSlice, error) { +func XMLSpecialObjectsReadMany(reader *XMLReader, start *xml.StartElement) (*SpecialObjectsSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28695,7 +29085,7 @@ func XMLNetworkLabelReadMany(reader *XMLReader, start *xml.StartElement) (*Netwo } start = st } - var result NetworkLabelSlice + var result SpecialObjectsSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -28709,8 +29099,8 @@ func XMLNetworkLabelReadMany(reader *XMLReader, start *xml.StartElement) (*Netwo switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "network_label": - one, err := XMLNetworkLabelReadOne(reader, &t, "network_label") + case "special_objects": + one, err := XMLSpecialObjectsReadOne(reader, &t, "special_objects") if err != nil { return nil, err } @@ -28850,8 +29240,8 @@ func XMLSpmReadMany(reader *XMLReader, start *xml.StartElement) (*SpmSlice, erro return &result, nil } -func XMLHostDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostDevice, error) { - builder := NewHostDeviceBuilder() +func XMLSshReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ssh, error) { + builder := NewSshBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -28863,7 +29253,7 @@ func XMLHostDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTa start = st } if expectedTag == "" { - expectedTag = "host_device" + expectedTag = "ssh" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -28893,12 +29283,13 @@ func XMLHostDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTa switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "capability": - v, err := reader.ReadString(&t) + case "authentication_method": + vp, err := XMLSshAuthenticationMethodReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Capability(v) + builder.AuthenticationMethod(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -28911,317 +29302,30 @@ func XMLHostDeviceReadOne(reader *XMLReader, start *xml.StartElement, expectedTa return nil, err } builder.Description(v) - case "driver": + case "fingerprint": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Driver(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "iommu_group": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.IommuGroup(v) - case "m_dev_types": - v, err := XMLMDevTypeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.MDevTypes(v) + builder.Fingerprint(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "parent_device": - v, err := XMLHostDeviceReadOne(reader, &t, "parent_device") - if err != nil { - return nil, err - } - builder.ParentDevice(v) - case "physical_function": - v, err := XMLHostDeviceReadOne(reader, &t, "physical_function") - if err != nil { - return nil, err - } - builder.PhysicalFunction(v) - case "placeholder": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Placeholder(v) - case "product": - v, err := XMLProductReadOne(reader, &t, "product") - if err != nil { - return nil, err - } - builder.Product(v) - case "vendor": - v, err := XMLVendorReadOne(reader, &t, "vendor") - if err != nil { - return nil, err - } - builder.Vendor(v) - case "virtual_functions": + case "port": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.VirtualFunctions(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") - if err != nil { - return nil, err - } - builder.Vm(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLHostDeviceReadMany(reader *XMLReader, start *xml.StartElement) (*HostDeviceSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result HostDeviceSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "host_device": - one, err := XMLHostDeviceReadOne(reader, &t, "host_device") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLPmProxyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*PmProxy, error) { - builder := NewPmProxyBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "pm_proxy" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "type": - vp, err := XMLPmProxyTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Type(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLPmProxyReadMany(reader *XMLReader, start *xml.StartElement) (*PmProxySlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result PmProxySlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "pm_proxy": - one, err := XMLPmProxyReadOne(reader, &t, "pm_proxy") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLSkipIfConnectivityBrokenReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SkipIfConnectivityBroken, error) { - builder := NewSkipIfConnectivityBrokenBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "skip_if_connectivity_broken" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Enabled(v) - case "threshold": - v, err := reader.ReadInt64(&t) + builder.Port(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } - builder.Threshold(v) + builder.User(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -29257,7 +29361,7 @@ func XMLSkipIfConnectivityBrokenReadOne(reader *XMLReader, start *xml.StartEleme return one, nil } -func XMLSkipIfConnectivityBrokenReadMany(reader *XMLReader, start *xml.StartElement) (*SkipIfConnectivityBrokenSlice, error) { +func XMLSshReadMany(reader *XMLReader, start *xml.StartElement) (*SshSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29268,7 +29372,7 @@ func XMLSkipIfConnectivityBrokenReadMany(reader *XMLReader, start *xml.StartElem } start = st } - var result SkipIfConnectivityBrokenSlice + var result SshSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -29282,8 +29386,8 @@ func XMLSkipIfConnectivityBrokenReadMany(reader *XMLReader, start *xml.StartElem switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "skip_if_connectivity_broken": - one, err := XMLSkipIfConnectivityBrokenReadOne(reader, &t, "skip_if_connectivity_broken") + case "ssh": + one, err := XMLSshReadOne(reader, &t, "ssh") if err != nil { return nil, err } @@ -29300,8 +29404,8 @@ func XMLSkipIfConnectivityBrokenReadMany(reader *XMLReader, start *xml.StartElem return &result, nil } -func XMLSchedulingPolicyUnitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SchedulingPolicyUnit, error) { - builder := NewSchedulingPolicyUnitBuilder() +func XMLSshPublicKeyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SshPublicKey, error) { + builder := NewSshPublicKeyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29313,7 +29417,7 @@ func XMLSchedulingPolicyUnitReadOne(reader *XMLReader, start *xml.StartElement, start = st } if expectedTag == "" { - expectedTag = "scheduling_policy_unit" + expectedTag = "ssh_public_key" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -29344,48 +29448,35 @@ func XMLSchedulingPolicyUnitReadOne(reader *XMLReader, start *xml.StartElement, case xml.StartElement: switch t.Name.Local { case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "enabled": - v, err := reader.ReadBool(&t) + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Enabled(v) - case "internal": - v, err := reader.ReadBool(&t) + builder.Comment(v) + case "content": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Internal(v) - case "name": + builder.Content(v) + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Properties(v) - case "type": - vp, err := XMLPolicyUnitTypeReadOne(reader, &t) - v := *vp + builder.Name(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } - builder.Type(v) + builder.User(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -29421,7 +29512,7 @@ func XMLSchedulingPolicyUnitReadOne(reader *XMLReader, start *xml.StartElement, return one, nil } -func XMLSchedulingPolicyUnitReadMany(reader *XMLReader, start *xml.StartElement) (*SchedulingPolicyUnitSlice, error) { +func XMLSshPublicKeyReadMany(reader *XMLReader, start *xml.StartElement) (*SshPublicKeySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29432,7 +29523,7 @@ func XMLSchedulingPolicyUnitReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result SchedulingPolicyUnitSlice + var result SshPublicKeySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -29446,8 +29537,8 @@ func XMLSchedulingPolicyUnitReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "scheduling_policy_unit": - one, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") + case "ssh_public_key": + one, err := XMLSshPublicKeyReadOne(reader, &t, "ssh_public_key") if err != nil { return nil, err } @@ -29464,8 +29555,8 @@ func XMLSchedulingPolicyUnitReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLVnicPassThroughReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VnicPassThrough, error) { - builder := NewVnicPassThroughBuilder() +func XMLSsoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Sso, error) { + builder := NewSsoBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29477,7 +29568,7 @@ func XMLVnicPassThroughReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "vnic_pass_through" + expectedTag = "sso" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -29496,13 +29587,12 @@ func XMLVnicPassThroughReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "mode": - vp, err := XMLVnicPassThroughModeReadOne(reader, &t) - v := *vp + case "methods": + v, err := XMLMethodReadMany(reader, &t) if err != nil { return nil, err } - builder.Mode(v) + builder.Methods(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -29538,7 +29628,7 @@ func XMLVnicPassThroughReadOne(reader *XMLReader, start *xml.StartElement, expec return one, nil } -func XMLVnicPassThroughReadMany(reader *XMLReader, start *xml.StartElement) (*VnicPassThroughSlice, error) { +func XMLSsoReadMany(reader *XMLReader, start *xml.StartElement) (*SsoSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29549,7 +29639,7 @@ func XMLVnicPassThroughReadMany(reader *XMLReader, start *xml.StartElement) (*Vn } start = st } - var result VnicPassThroughSlice + var result SsoSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -29563,8 +29653,8 @@ func XMLVnicPassThroughReadMany(reader *XMLReader, start *xml.StartElement) (*Vn switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vnic_pass_through": - one, err := XMLVnicPassThroughReadOne(reader, &t, "vnic_pass_through") + case "sso": + one, err := XMLSsoReadOne(reader, &t, "sso") if err != nil { return nil, err } @@ -29581,8 +29671,8 @@ func XMLVnicPassThroughReadMany(reader *XMLReader, start *xml.StartElement) (*Vn return &result, nil } -func XMLPermitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Permit, error) { - builder := NewPermitBuilder() +func XMLStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Statistic, error) { + builder := NewStatisticBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29594,7 +29684,7 @@ func XMLPermitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "permit" + expectedTag = "statistic" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -29624,12 +29714,12 @@ func XMLPermitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "administrative": - v, err := reader.ReadBool(&t) + case "brick": + v, err := XMLGlusterBrickReadOne(reader, &t, "brick") if err != nil { return nil, err } - builder.Administrative(v) + builder.Brick(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -29642,18 +29732,87 @@ func XMLPermitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return nil, err } builder.Description(v) + case "disk": + v, err := XMLDiskReadOne(reader, &t, "disk") + if err != nil { + return nil, err + } + builder.Disk(v) + case "gluster_volume": + v, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") + if err != nil { + return nil, err + } + builder.GlusterVolume(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "host_nic": + v, err := XMLHostNicReadOne(reader, &t, "host_nic") + if err != nil { + return nil, err + } + builder.HostNic(v) + case "host_numa_node": + v, err := XMLNumaNodeReadOne(reader, &t, "host_numa_node") + if err != nil { + return nil, err + } + builder.HostNumaNode(v) + case "kind": + vp, err := XMLStatisticKindReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Kind(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "role": - v, err := XMLRoleReadOne(reader, &t, "role") + case "nic": + v, err := XMLNicReadOne(reader, &t, "nic") if err != nil { return nil, err } - builder.Role(v) + builder.Nic(v) + case "step": + v, err := XMLStepReadOne(reader, &t, "step") + if err != nil { + return nil, err + } + builder.Step(v) + case "type": + vp, err := XMLValueTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "unit": + vp, err := XMLStatisticUnitReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Unit(v) + case "values": + v, err := XMLValueReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Values(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -29689,7 +29848,7 @@ func XMLPermitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLPermitReadMany(reader *XMLReader, start *xml.StartElement) (*PermitSlice, error) { +func XMLStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*StatisticSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29700,7 +29859,7 @@ func XMLPermitReadMany(reader *XMLReader, start *xml.StartElement) (*PermitSlice } start = st } - var result PermitSlice + var result StatisticSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -29714,8 +29873,8 @@ func XMLPermitReadMany(reader *XMLReader, start *xml.StartElement) (*PermitSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "permit": - one, err := XMLPermitReadOne(reader, &t, "permit") + case "statistic": + one, err := XMLStatisticReadOne(reader, &t, "statistic") if err != nil { return nil, err } @@ -29732,8 +29891,8 @@ func XMLPermitReadMany(reader *XMLReader, start *xml.StartElement) (*PermitSlice return &result, nil } -func XMLClusterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Cluster, error) { - builder := NewClusterBuilder() +func XMLStepReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Step, error) { + builder := NewStepBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -29745,7 +29904,7 @@ func XMLClusterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "cluster" + expectedTag = "step" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -29775,268 +29934,335 @@ func XMLClusterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity_groups": - v, err := XMLAffinityGroupReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AffinityGroups(v) - case "ballooning_enabled": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.BallooningEnabled(v) - case "bios_type": - vp, err := XMLBiosTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.BiosType(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Cpu(v) - case "cpu_profiles": - v, err := XMLCpuProfileReadMany(reader, &t) + builder.Description(v) + case "end_time": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.CpuProfiles(v) - case "custom_scheduling_policy_properties": - v, err := XMLPropertyReadMany(reader, &t) + builder.EndTime(v) + case "execution_host": + v, err := XMLHostReadOne(reader, &t, "execution_host") if err != nil { return nil, err } - builder.CustomSchedulingPolicyProperties(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") + builder.ExecutionHost(v) + case "external": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.DataCenter(v) - case "description": - v, err := reader.ReadString(&t) + builder.External(v) + case "external_type": + vp, err := XMLExternalSystemTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Description(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") + builder.ExternalType(v) + case "job": + v, err := XMLJobReadOne(reader, &t, "job") if err != nil { return nil, err } - builder.Display(v) - case "enabled_features": - v, err := XMLClusterFeatureReadMany(reader, &t) + builder.Job(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.EnabledFeatures(v) - case "error_handling": - v, err := XMLErrorHandlingReadOne(reader, &t, "error_handling") + builder.Name(v) + case "number": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.ErrorHandling(v) - case "external_network_providers": - v, err := XMLExternalProviderReadMany(reader, &t) + builder.Number(v) + case "parent_step": + v, err := XMLStepReadOne(reader, &t, "parent_step") if err != nil { return nil, err } - builder.ExternalNetworkProviders(v) - case "fencing_policy": - v, err := XMLFencingPolicyReadOne(reader, &t, "fencing_policy") + builder.ParentStep(v) + case "progress": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.FencingPolicy(v) - case "firewall_type": - vp, err := XMLFirewallTypeReadOne(reader, &t) - v := *vp + builder.Progress(v) + case "start_time": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.FirewallType(v) - case "gluster_hooks": - v, err := XMLGlusterHookReadMany(reader, &t) + builder.StartTime(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) if err != nil { return nil, err } - builder.GlusterHooks(v) - case "gluster_service": - v, err := reader.ReadBool(&t) + builder.Statistics(v) + case "status": + vp, err := XMLStepStatusReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.GlusterService(v) - case "gluster_tuned_profile": - v, err := reader.ReadString(&t) + builder.Status(v) + case "type": + vp, err := XMLStepEnumReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.GlusterTunedProfile(v) - case "gluster_volumes": - v, err := XMLGlusterVolumeReadMany(reader, &t) - if err != nil { - return nil, err + builder.Type(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.GlusterVolumes(v) - case "ha_reservation": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.HaReservation(v) - case "ksm": - v, err := XMLKsmReadOne(reader, &t, "ksm") + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + } // end of switch + } // end of for-links + return one, nil +} + +func XMLStepReadMany(reader *XMLReader, start *xml.StartElement) (*StepSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result StepSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "step": + one, err := XMLStepReadOne(reader, &t, "step") if err != nil { return nil, err } - builder.Ksm(v) - case "log_max_memory_used_threshold": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err + if one != nil { + result.slice = append(result.slice, one) } - builder.LogMaxMemoryUsedThreshold(v) - case "log_max_memory_used_threshold_type": - vp, err := XMLLogMaxMemoryUsedThresholdTypeReadOne(reader, &t) - v := *vp + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLStorageConnectionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageConnection, error) { + builder := NewStorageConnectionBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "storage_connection" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "address": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.LogMaxMemoryUsedThresholdType(v) - case "mac_pool": - v, err := XMLMacPoolReadOne(reader, &t, "mac_pool") + builder.Address(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.MacPool(v) - case "maintenance_reason_required": - v, err := reader.ReadBool(&t) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.MaintenanceReasonRequired(v) - case "management_network": - v, err := XMLNetworkReadOne(reader, &t, "management_network") + builder.Description(v) + case "gluster_volume": + v, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") if err != nil { return nil, err } - builder.ManagementNetwork(v) - case "memory_policy": - v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + builder.GlusterVolume(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.MemoryPolicy(v) - case "migration": - v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") + builder.Host(v) + case "mount_options": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Migration(v) + builder.MountOptions(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "network_filters": - v, err := XMLNetworkFilterReadMany(reader, &t) + case "nfs_retrans": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.NetworkFilters(v) - case "networks": - v, err := XMLNetworkReadMany(reader, &t) + builder.NfsRetrans(v) + case "nfs_timeo": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Networks(v) - case "optional_reason": - v, err := reader.ReadBool(&t) + builder.NfsTimeo(v) + case "nfs_version": + vp, err := XMLNfsVersionReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.OptionalReason(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) + builder.NfsVersion(v) + case "password": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Permissions(v) - case "required_rng_sources": - v, err := XMLRngSourceReadMany(reader, &t) + builder.Password(v) + case "path": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.RequiredRngSources(v) - case "scheduling_policy": - v, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") + builder.Path(v) + case "port": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.SchedulingPolicy(v) - case "serial_number": - v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") + builder.Port(v) + case "portal": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.SerialNumber(v) - case "supported_versions": - v, err := XMLVersionReadMany(reader, &t) + builder.Portal(v) + case "target": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.SupportedVersions(v) - case "switch_type": - vp, err := XMLSwitchTypeReadOne(reader, &t) + builder.Target(v) + case "type": + vp, err := XMLStorageTypeReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.SwitchType(v) - case "threads_as_cores": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.ThreadsAsCores(v) - case "trusted_service": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.TrustedService(v) - case "tunnel_migration": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.TunnelMigration(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + builder.Type(v) + case "username": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Version(v) - case "virt_service": - v, err := reader.ReadBool(&t) + builder.Username(v) + case "vfs_type": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.VirtService(v) + builder.VfsType(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -30067,57 +30293,12 @@ func XMLClusterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s } for _, link := range links { switch *link.rel { - case "affinitygroups": - if one.affinityGroups == nil { - one.affinityGroups = new(AffinityGroupSlice) - } - one.affinityGroups.href = link.href - case "cpuprofiles": - if one.cpuProfiles == nil { - one.cpuProfiles = new(CpuProfileSlice) - } - one.cpuProfiles.href = link.href - case "enabledfeatures": - if one.enabledFeatures == nil { - one.enabledFeatures = new(ClusterFeatureSlice) - } - one.enabledFeatures.href = link.href - case "externalnetworkproviders": - if one.externalNetworkProviders == nil { - one.externalNetworkProviders = new(ExternalProviderSlice) - } - one.externalNetworkProviders.href = link.href - case "glusterhooks": - if one.glusterHooks == nil { - one.glusterHooks = new(GlusterHookSlice) - } - one.glusterHooks.href = link.href - case "glustervolumes": - if one.glusterVolumes == nil { - one.glusterVolumes = new(GlusterVolumeSlice) - } - one.glusterVolumes.href = link.href - case "networkfilters": - if one.networkFilters == nil { - one.networkFilters = new(NetworkFilterSlice) - } - one.networkFilters.href = link.href - case "networks": - if one.networks == nil { - one.networks = new(NetworkSlice) - } - one.networks.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLClusterReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterSlice, error) { +func XMLStorageConnectionReadMany(reader *XMLReader, start *xml.StartElement) (*StorageConnectionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30128,7 +30309,7 @@ func XMLClusterReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterSli } start = st } - var result ClusterSlice + var result StorageConnectionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -30142,8 +30323,8 @@ func XMLClusterReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cluster": - one, err := XMLClusterReadOne(reader, &t, "cluster") + case "storage_connection": + one, err := XMLStorageConnectionReadOne(reader, &t, "storage_connection") if err != nil { return nil, err } @@ -30160,8 +30341,8 @@ func XMLClusterReadMany(reader *XMLReader, start *xml.StartElement) (*ClusterSli return &result, nil } -func XMLGlusterBrickMemoryInfoReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterBrickMemoryInfo, error) { - builder := NewGlusterBrickMemoryInfoBuilder() +func XMLStorageConnectionExtensionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageConnectionExtension, error) { + builder := NewStorageConnectionExtensionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30173,11 +30354,22 @@ func XMLGlusterBrickMemoryInfoReadOne(reader *XMLReader, start *xml.StartElement start = st } if expectedTag == "" { - expectedTag = "brick_memoryinfo" + expectedTag = "storage_connection_extension" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -30192,12 +30384,48 @@ func XMLGlusterBrickMemoryInfoReadOne(reader *XMLReader, start *xml.StartElement switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "memory_pools": - v, err := XMLGlusterMemoryPoolReadMany(reader, &t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.MemoryPools(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "password": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Password(v) + case "target": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Target(v) + case "username": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Username(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -30233,7 +30461,7 @@ func XMLGlusterBrickMemoryInfoReadOne(reader *XMLReader, start *xml.StartElement return one, nil } -func XMLGlusterBrickMemoryInfoReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterBrickMemoryInfoSlice, error) { +func XMLStorageConnectionExtensionReadMany(reader *XMLReader, start *xml.StartElement) (*StorageConnectionExtensionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30244,7 +30472,7 @@ func XMLGlusterBrickMemoryInfoReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var result GlusterBrickMemoryInfoSlice + var result StorageConnectionExtensionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -30258,8 +30486,8 @@ func XMLGlusterBrickMemoryInfoReadMany(reader *XMLReader, start *xml.StartElemen switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "brick_memoryinfo": - one, err := XMLGlusterBrickMemoryInfoReadOne(reader, &t, "brick_memoryinfo") + case "storage_connection_extension": + one, err := XMLStorageConnectionExtensionReadOne(reader, &t, "storage_connection_extension") if err != nil { return nil, err } @@ -30276,8 +30504,8 @@ func XMLGlusterBrickMemoryInfoReadMany(reader *XMLReader, start *xml.StartElemen return &result, nil } -func XMLVmPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmPool, error) { - builder := NewVmPoolBuilder() +func XMLStorageDomainReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageDomain, error) { + builder := NewStorageDomainBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30289,7 +30517,7 @@ func XMLVmPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "vm_pool" + expectedTag = "storage_domain" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -30319,48 +30547,121 @@ func XMLVmPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "auto_storage_select": + case "available": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Available(v) + case "backup": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.AutoStorageSelect(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") + builder.Backup(v) + case "block_size": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Cluster(v) + builder.BlockSize(v) case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Comment(v) + case "committed": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Committed(v) + case "critical_space_action_blocker": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.CriticalSpaceActionBlocker(v) + case "data_center": + v, err := XMLDataCenterReadOne(reader, &t, "data_center") + if err != nil { + return nil, err + } + builder.DataCenter(v) + case "data_centers": + v, err := XMLDataCenterReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DataCenters(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") + case "discard_after_delete": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Display(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + builder.DiscardAfterDelete(v) + case "disk_profiles": + v, err := XMLDiskProfileReadMany(reader, &t) if err != nil { return nil, err } - builder.InstanceType(v) - case "max_user_vms": - v, err := reader.ReadInt64(&t) + builder.DiskProfiles(v) + case "disk_snapshots": + v, err := XMLDiskSnapshotReadMany(reader, &t) if err != nil { return nil, err } - builder.MaxUserVms(v) + builder.DiskSnapshots(v) + case "disks": + v, err := XMLDiskReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Disks(v) + case "external_status": + vp, err := XMLExternalStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.ExternalStatus(v) + case "files": + v, err := XMLFileReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Files(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "images": + v, err := XMLImageReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Images(v) + case "import": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Import(v) + case "master": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Master(v) case "name": v, err := reader.ReadString(&t) if err != nil { @@ -30373,61 +30674,81 @@ func XMLVmPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return nil, err } builder.Permissions(v) - case "prestarted_vms": - v, err := reader.ReadInt64(&t) + case "status": + vp, err := XMLStorageDomainStatusReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.PrestartedVms(v) - case "rng_device": - v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + builder.Status(v) + case "storage": + v, err := XMLHostStorageReadOne(reader, &t, "storage") if err != nil { return nil, err } - builder.RngDevice(v) - case "size": - v, err := reader.ReadInt64(&t) + builder.Storage(v) + case "storage_connections": + v, err := XMLStorageConnectionReadMany(reader, &t) if err != nil { return nil, err } - builder.Size(v) - case "soundcard_enabled": + builder.StorageConnections(v) + case "storage_format": + vp, err := XMLStorageFormatReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.StorageFormat(v) + case "supports_discard": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.SoundcardEnabled(v) - case "stateful": + builder.SupportsDiscard(v) + case "supports_discard_zeroes_data": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Stateful(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") + builder.SupportsDiscardZeroesData(v) + case "templates": + v, err := XMLTemplateReadMany(reader, &t) if err != nil { return nil, err } - builder.Template(v) + builder.Templates(v) case "type": - vp, err := XMLVmPoolTypeReadOne(reader, &t) + vp, err := XMLStorageDomainTypeReadOne(reader, &t) v := *vp if err != nil { return nil, err } builder.Type(v) - case "use_latest_template_version": - v, err := reader.ReadBool(&t) + case "used": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.UseLatestTemplateVersion(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.Used(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) if err != nil { return nil, err } - builder.Vm(v) + builder.Vms(v) + case "warning_low_space_indicator": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.WarningLowSpaceIndicator(v) + case "wipe_after_delete": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.WipeAfterDelete(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -30458,17 +30779,62 @@ func XMLVmPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { + case "datacenters": + if one.dataCenters == nil { + one.dataCenters = new(DataCenterSlice) + } + one.dataCenters.href = link.href + case "diskprofiles": + if one.diskProfiles == nil { + one.diskProfiles = new(DiskProfileSlice) + } + one.diskProfiles.href = link.href + case "disksnapshots": + if one.diskSnapshots == nil { + one.diskSnapshots = new(DiskSnapshotSlice) + } + one.diskSnapshots.href = link.href + case "disks": + if one.disks == nil { + one.disks = new(DiskSlice) + } + one.disks.href = link.href + case "files": + if one.files == nil { + one.files = new(FileSlice) + } + one.files.href = link.href + case "images": + if one.images == nil { + one.images = new(ImageSlice) + } + one.images.href = link.href case "permissions": if one.permissions == nil { one.permissions = new(PermissionSlice) } one.permissions.href = link.href + case "storageconnections": + if one.storageConnections == nil { + one.storageConnections = new(StorageConnectionSlice) + } + one.storageConnections.href = link.href + case "templates": + if one.templates == nil { + one.templates = new(TemplateSlice) + } + one.templates.href = link.href + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) + } + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLVmPoolReadMany(reader *XMLReader, start *xml.StartElement) (*VmPoolSlice, error) { +func XMLStorageDomainReadMany(reader *XMLReader, start *xml.StartElement) (*StorageDomainSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30479,7 +30845,7 @@ func XMLVmPoolReadMany(reader *XMLReader, start *xml.StartElement) (*VmPoolSlice } start = st } - var result VmPoolSlice + var result StorageDomainSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -30493,8 +30859,8 @@ func XMLVmPoolReadMany(reader *XMLReader, start *xml.StartElement) (*VmPoolSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "vm_pool": - one, err := XMLVmPoolReadOne(reader, &t, "vm_pool") + case "storage_domain": + one, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } @@ -30511,8 +30877,8 @@ func XMLVmPoolReadMany(reader *XMLReader, start *xml.StartElement) (*VmPoolSlice return &result, nil } -func XMLProxyTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ProxyTicket, error) { - builder := NewProxyTicketBuilder() +func XMLStorageDomainLeaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageDomainLease, error) { + builder := NewStorageDomainLeaseBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30524,7 +30890,7 @@ func XMLProxyTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "proxy_ticket" + expectedTag = "storage_domain_lease" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -30543,12 +30909,157 @@ func XMLProxyTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "value": + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + if err != nil { + return nil, err + } + builder.StorageDomain(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } + } + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) + } + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLStorageDomainLeaseReadMany(reader *XMLReader, start *xml.StartElement) (*StorageDomainLeaseSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result StorageDomainLeaseSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "storage_domain_lease": + one, err := XMLStorageDomainLeaseReadOne(reader, &t, "storage_domain_lease") + if err != nil { + return nil, err + } + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLSystemOptionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SystemOption, error) { + builder := NewSystemOptionBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "system_option" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Value(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "values": + v, err := XMLSystemOptionValueReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Values(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -30584,7 +31095,7 @@ func XMLProxyTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLProxyTicketReadMany(reader *XMLReader, start *xml.StartElement) (*ProxyTicketSlice, error) { +func XMLSystemOptionReadMany(reader *XMLReader, start *xml.StartElement) (*SystemOptionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30595,7 +31106,7 @@ func XMLProxyTicketReadMany(reader *XMLReader, start *xml.StartElement) (*ProxyT } start = st } - var result ProxyTicketSlice + var result SystemOptionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -30609,8 +31120,8 @@ func XMLProxyTicketReadMany(reader *XMLReader, start *xml.StartElement) (*ProxyT switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "proxy_ticket": - one, err := XMLProxyTicketReadOne(reader, &t, "proxy_ticket") + case "system_option": + one, err := XMLSystemOptionReadOne(reader, &t, "system_option") if err != nil { return nil, err } @@ -30627,8 +31138,8 @@ func XMLProxyTicketReadMany(reader *XMLReader, start *xml.StartElement) (*ProxyT return &result, nil } -func XMLGlusterServerHookReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterServerHook, error) { - builder := NewGlusterServerHookBuilder() +func XMLSystemOptionValueReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SystemOptionValue, error) { + builder := NewSystemOptionValueBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30640,22 +31151,11 @@ func XMLGlusterServerHookReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "server_hook" + expectedTag = "system_option_value" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -30670,50 +31170,18 @@ func XMLGlusterServerHookReadOne(reader *XMLReader, start *xml.StartElement, exp switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "checksum": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Checksum(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "content_type": - vp, err := XMLHookContentTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.ContentType(v) - case "description": + case "value": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Description(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "name": + builder.Value(v) + case "version": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "status": - vp, err := XMLGlusterHookStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) + builder.Version(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -30749,7 +31217,7 @@ func XMLGlusterServerHookReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLGlusterServerHookReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterServerHookSlice, error) { +func XMLSystemOptionValueReadMany(reader *XMLReader, start *xml.StartElement) (*SystemOptionValueSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30760,7 +31228,7 @@ func XMLGlusterServerHookReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result GlusterServerHookSlice + var result SystemOptionValueSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -30774,8 +31242,8 @@ func XMLGlusterServerHookReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "server_hook": - one, err := XMLGlusterServerHookReadOne(reader, &t, "server_hook") + case "system_option_value": + one, err := XMLSystemOptionValueReadOne(reader, &t, "system_option_value") if err != nil { return nil, err } @@ -30792,8 +31260,8 @@ func XMLGlusterServerHookReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Statistic, error) { - builder := NewStatisticBuilder() +func XMLTagReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Tag, error) { + builder := NewTagBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30805,7 +31273,7 @@ func XMLStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "statistic" + expectedTag = "tag" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -30835,12 +31303,6 @@ func XMLStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "brick": - v, err := XMLGlusterBrickReadOne(reader, &t, "brick") - if err != nil { - return nil, err - } - builder.Brick(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -30853,81 +31315,42 @@ func XMLStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Description(v) - case "disk": - v, err := XMLDiskReadOne(reader, &t, "disk") - if err != nil { - return nil, err - } - builder.Disk(v) - case "gluster_volume": - v, err := XMLGlusterVolumeReadOne(reader, &t, "gluster_volume") + case "group": + v, err := XMLGroupReadOne(reader, &t, "group") if err != nil { return nil, err } - builder.GlusterVolume(v) + builder.Group(v) case "host": v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } builder.Host(v) - case "host_nic": - v, err := XMLHostNicReadOne(reader, &t, "host_nic") - if err != nil { - return nil, err - } - builder.HostNic(v) - case "host_numa_node": - v, err := XMLNumaNodeReadOne(reader, &t, "host_numa_node") - if err != nil { - return nil, err - } - builder.HostNumaNode(v) - case "kind": - vp, err := XMLStatisticKindReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Kind(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "nic": - v, err := XMLNicReadOne(reader, &t, "nic") - if err != nil { - return nil, err - } - builder.Nic(v) - case "step": - v, err := XMLStepReadOne(reader, &t, "step") - if err != nil { - return nil, err - } - builder.Step(v) - case "type": - vp, err := XMLValueTypeReadOne(reader, &t) - v := *vp + case "parent": + v, err := XMLTagReadOne(reader, &t, "parent") if err != nil { return nil, err } - builder.Type(v) - case "unit": - vp, err := XMLStatisticUnitReadOne(reader, &t) - v := *vp + builder.Parent(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } - builder.Unit(v) - case "values": - v, err := XMLValueReadMany(reader, &t) + builder.Template(v) + case "user": + v, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } - builder.Values(v) + builder.User(v) case "vm": v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { @@ -30969,7 +31392,7 @@ func XMLStatisticReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*StatisticSlice, error) { +func XMLTagReadMany(reader *XMLReader, start *xml.StartElement) (*TagSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -30980,7 +31403,7 @@ func XMLStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*Statisti } start = st } - var result StatisticSlice + var result TagSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -30994,8 +31417,8 @@ func XMLStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*Statisti switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "statistic": - one, err := XMLStatisticReadOne(reader, &t, "statistic") + case "tag": + one, err := XMLTagReadOne(reader, &t, "tag") if err != nil { return nil, err } @@ -31012,8 +31435,8 @@ func XMLStatisticReadMany(reader *XMLReader, start *xml.StartElement) (*Statisti return &result, nil } -func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Snapshot, error) { - builder := NewSnapshotBuilder() +func XMLTemplateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Template, error) { + builder := NewTemplateBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -31025,7 +31448,7 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "snapshot" + expectedTag = "template" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -31055,18 +31478,6 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "affinity_labels": - v, err := XMLAffinityLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AffinityLabels(v) - case "applications": - v, err := XMLApplicationReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Applications(v) case "bios": v, err := XMLBiosReadOne(reader, &t, "bios") if err != nil { @@ -31145,12 +31556,6 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.CustomProperties(v) - case "date": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.Date(v) case "delete_protected": v, err := reader.ReadBool(&t) if err != nil { @@ -31169,12 +31574,6 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.DiskAttachments(v) - case "disks": - v, err := XMLDiskReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Disks(v) case "display": v, err := XMLDisplayReadOne(reader, &t, "display") if err != nil { @@ -31187,90 +31586,30 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Domain(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") - if err != nil { - return nil, err - } - builder.ExternalHostProvider(v) - case "floppies": - v, err := XMLFloppyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Floppies(v) - case "fqdn": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Fqdn(v) case "graphics_consoles": v, err := XMLGraphicsConsoleReadMany(reader, &t) if err != nil { return nil, err } builder.GraphicsConsoles(v) - case "guest_operating_system": - v, err := XMLGuestOperatingSystemReadOne(reader, &t, "guest_operating_system") - if err != nil { - return nil, err - } - builder.GuestOperatingSystem(v) - case "guest_time_zone": - v, err := XMLTimeZoneReadOne(reader, &t, "guest_time_zone") - if err != nil { - return nil, err - } - builder.GuestTimeZone(v) - case "has_illegal_images": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.HasIllegalImages(v) case "high_availability": v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") if err != nil { return nil, err } builder.HighAvailability(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") - if err != nil { - return nil, err - } - builder.Host(v) - case "host_devices": - v, err := XMLHostDeviceReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.HostDevices(v) case "initialization": v, err := XMLInitializationReadOne(reader, &t, "initialization") if err != nil { return nil, err } builder.Initialization(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") - if err != nil { - return nil, err - } - builder.InstanceType(v) case "io": v, err := XMLIoReadOne(reader, &t, "io") if err != nil { return nil, err } builder.Io(v) - case "katello_errata": - v, err := XMLKatelloErratumReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.KatelloErrata(v) case "large_icon": v, err := XMLIconReadOne(reader, &t, "large_icon") if err != nil { @@ -31319,135 +31658,60 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Name(v) - case "next_run_configuration_exists": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.NextRunConfigurationExists(v) case "nics": v, err := XMLNicReadMany(reader, &t) if err != nil { return nil, err } builder.Nics(v) - case "host_numa_nodes": - v, err := XMLNumaNodeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NumaNodes(v) - case "numa_tune_mode": - vp, err := XMLNumaTuneModeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.NumaTuneMode(v) case "origin": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Origin(v) - case "original_template": - v, err := XMLTemplateReadOne(reader, &t, "original_template") - if err != nil { - return nil, err - } - builder.OriginalTemplate(v) case "os": v, err := XMLOperatingSystemReadOne(reader, &t, "os") if err != nil { return nil, err } builder.Os(v) - case "payloads": - v, err := XMLPayloadReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Payloads(v) case "permissions": v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } builder.Permissions(v) - case "persist_memorystate": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.PersistMemorystate(v) case "placement_policy": v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") if err != nil { return nil, err } - builder.PlacementPolicy(v) - case "quota": - v, err := XMLQuotaReadOne(reader, &t, "quota") - if err != nil { - return nil, err - } - builder.Quota(v) - case "reported_devices": - v, err := XMLReportedDeviceReadMany(reader, &t) + builder.PlacementPolicy(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") if err != nil { return nil, err } - builder.ReportedDevices(v) + builder.Quota(v) case "rng_device": v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") if err != nil { return nil, err } builder.RngDevice(v) - case "run_once": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.RunOnce(v) case "serial_number": v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") if err != nil { return nil, err } builder.SerialNumber(v) - case "sessions": - v, err := XMLSessionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Sessions(v) case "small_icon": v, err := XMLIconReadOne(reader, &t, "small_icon") if err != nil { return nil, err } builder.SmallIcon(v) - case "snapshot_status": - vp, err := XMLSnapshotStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.SnapshotStatus(v) - case "snapshot_type": - vp, err := XMLSnapshotTypeReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.SnapshotType(v) - case "snapshots": - v, err := XMLSnapshotReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Snapshots(v) case "soundcard_enabled": v, err := reader.ReadBool(&t) if err != nil { @@ -31466,49 +31730,19 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.StartPaused(v) - case "start_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.StartTime(v) case "stateless": v, err := reader.ReadBool(&t) if err != nil { return nil, err } builder.Stateless(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) case "status": - vp, err := XMLVmStatusReadOne(reader, &t) + vp, err := XMLTemplateStatusReadOne(reader, &t) v := *vp if err != nil { return nil, err } builder.Status(v) - case "status_detail": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.StatusDetail(v) - case "stop_reason": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.StopReason(v) - case "stop_time": - v, err := reader.ReadTime(&t) - if err != nil { - return nil, err - } - builder.StopTime(v) case "storage_domain": v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { @@ -31528,12 +31762,6 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Tags(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err - } - builder.Template(v) case "time_zone": v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") if err != nil { @@ -31559,12 +31787,12 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Usb(v) - case "use_latest_template_version": - v, err := reader.ReadBool(&t) + case "version": + v, err := XMLTemplateVersionReadOne(reader, &t, "version") if err != nil { return nil, err } - builder.UseLatestTemplateVersion(v) + builder.Version(v) case "virtio_scsi": v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") if err != nil { @@ -31577,12 +31805,6 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return nil, err } builder.Vm(v) - case "vm_pool": - v, err := XMLVmPoolReadOne(reader, &t, "vm_pool") - if err != nil { - return nil, err - } - builder.VmPool(v) case "watchdogs": v, err := XMLWatchdogReadMany(reader, &t) if err != nil { @@ -31619,16 +31841,6 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag } for _, link := range links { switch *link.rel { - case "affinitylabels": - if one.affinityLabels == nil { - one.affinityLabels = new(AffinityLabelSlice) - } - one.affinityLabels.href = link.href - case "applications": - if one.applications == nil { - one.applications = new(ApplicationSlice) - } - one.applications.href = link.href case "cdroms": if one.cdroms == nil { one.cdroms = new(CdromSlice) @@ -31639,66 +31851,21 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag one.diskAttachments = new(DiskAttachmentSlice) } one.diskAttachments.href = link.href - case "disks": - if one.disks == nil { - one.disks = new(DiskSlice) - } - one.disks.href = link.href - case "floppies": - if one.floppies == nil { - one.floppies = new(FloppySlice) - } - one.floppies.href = link.href case "graphicsconsoles": if one.graphicsConsoles == nil { one.graphicsConsoles = new(GraphicsConsoleSlice) } one.graphicsConsoles.href = link.href - case "hostdevices": - if one.hostDevices == nil { - one.hostDevices = new(HostDeviceSlice) - } - one.hostDevices.href = link.href - case "katelloerrata": - if one.katelloErrata == nil { - one.katelloErrata = new(KatelloErratumSlice) - } - one.katelloErrata.href = link.href case "nics": if one.nics == nil { one.nics = new(NicSlice) } one.nics.href = link.href - case "numanodes": - if one.numaNodes == nil { - one.numaNodes = new(NumaNodeSlice) - } - one.numaNodes.href = link.href case "permissions": if one.permissions == nil { one.permissions = new(PermissionSlice) } one.permissions.href = link.href - case "reporteddevices": - if one.reportedDevices == nil { - one.reportedDevices = new(ReportedDeviceSlice) - } - one.reportedDevices.href = link.href - case "sessions": - if one.sessions == nil { - one.sessions = new(SessionSlice) - } - one.sessions.href = link.href - case "snapshots": - if one.snapshots == nil { - one.snapshots = new(SnapshotSlice) - } - one.snapshots.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href case "tags": if one.tags == nil { one.tags = new(TagSlice) @@ -31714,7 +31881,7 @@ func XMLSnapshotReadOne(reader *XMLReader, start *xml.StartElement, expectedTag return one, nil } -func XMLSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*SnapshotSlice, error) { +func XMLTemplateReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -31725,7 +31892,7 @@ func XMLSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*SnapshotS } start = st } - var result SnapshotSlice + var result TemplateSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -31739,8 +31906,8 @@ func XMLSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*SnapshotS switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "snapshot": - one, err := XMLSnapshotReadOne(reader, &t, "snapshot") + case "template": + one, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } @@ -31757,8 +31924,8 @@ func XMLSnapshotReadMany(reader *XMLReader, start *xml.StartElement) (*SnapshotS return &result, nil } -func XMLHostedEngineReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*HostedEngine, error) { - builder := NewHostedEngineBuilder() +func XMLTemplateVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*TemplateVersion, error) { + builder := NewTemplateVersionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -31770,7 +31937,7 @@ func XMLHostedEngineReadOne(reader *XMLReader, start *xml.StartElement, expected start = st } if expectedTag == "" { - expectedTag = "hosted_engine" + expectedTag = "template_version" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -31789,36 +31956,24 @@ func XMLHostedEngineReadOne(reader *XMLReader, start *xml.StartElement, expected switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Active(v) - case "configured": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Configured(v) - case "global_maintenance": - v, err := reader.ReadBool(&t) + case "base_template": + v, err := XMLTemplateReadOne(reader, &t, "base_template") if err != nil { return nil, err } - builder.GlobalMaintenance(v) - case "local_maintenance": - v, err := reader.ReadBool(&t) + builder.BaseTemplate(v) + case "version_name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.LocalMaintenance(v) - case "score": + builder.VersionName(v) + case "version_number": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Score(v) + builder.VersionNumber(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -31854,7 +32009,7 @@ func XMLHostedEngineReadOne(reader *XMLReader, start *xml.StartElement, expected return one, nil } -func XMLHostedEngineReadMany(reader *XMLReader, start *xml.StartElement) (*HostedEngineSlice, error) { +func XMLTemplateVersionReadMany(reader *XMLReader, start *xml.StartElement) (*TemplateVersionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -31865,7 +32020,7 @@ func XMLHostedEngineReadMany(reader *XMLReader, start *xml.StartElement) (*Hoste } start = st } - var result HostedEngineSlice + var result TemplateVersionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -31879,8 +32034,8 @@ func XMLHostedEngineReadMany(reader *XMLReader, start *xml.StartElement) (*Hoste switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "hosted_engine": - one, err := XMLHostedEngineReadOne(reader, &t, "hosted_engine") + case "template_version": + one, err := XMLTemplateVersionReadOne(reader, &t, "template_version") if err != nil { return nil, err } @@ -31897,8 +32052,8 @@ func XMLHostedEngineReadMany(reader *XMLReader, start *xml.StartElement) (*Hoste return &result, nil } -func XMLDiskAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*DiskAttachment, error) { - builder := NewDiskAttachmentBuilder() +func XMLTicketReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ticket, error) { + builder := NewTicketBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -31910,22 +32065,11 @@ func XMLDiskAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "disk_attachment" + expectedTag = "ticket" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -31940,85 +32084,256 @@ func XMLDiskAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "active": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.Active(v) - case "bootable": - v, err := reader.ReadBool(&t) + case "expiry": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Bootable(v) - case "comment": + builder.Expiry(v) + case "value": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err + builder.Value(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.Description(v) - case "disk": - v, err := XMLDiskReadOne(reader, &t, "disk") - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.Disk(v) - case "interface": - vp, err := XMLDiskInterfaceReadOne(reader, &t) - v := *vp + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLTicketReadMany(reader *XMLReader, start *xml.StartElement) (*TicketSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result TicketSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "ticket": + one, err := XMLTicketReadOne(reader, &t, "ticket") if err != nil { return nil, err } - builder.Interface(v) - case "logical_name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err + if one != nil { + result.slice = append(result.slice, one) } - builder.LogicalName(v) + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLTimeZoneReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*TimeZone, error) { + builder := NewTimeZoneBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "time_zone" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "pass_discard": - v, err := reader.ReadBool(&t) + case "utc_offset": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.PassDiscard(v) - case "read_only": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err + builder.UtcOffset(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.ReadOnly(v) - case "template": - v, err := XMLTemplateReadOne(reader, &t, "template") - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.Template(v) - case "uses_scsi_reservation": - v, err := reader.ReadBool(&t) + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLTimeZoneReadMany(reader *XMLReader, start *xml.StartElement) (*TimeZoneSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result TimeZoneSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "time_zone": + one, err := XMLTimeZoneReadOne(reader, &t, "time_zone") if err != nil { return nil, err } - builder.UsesScsiReservation(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLTransparentHugePagesReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*TransparentHugePages, error) { + builder := NewTransparentHugePagesBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "transparent_hugepages" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Vm(v) + builder.Enabled(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -32054,7 +32369,7 @@ func XMLDiskAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expect return one, nil } -func XMLDiskAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*DiskAttachmentSlice, error) { +func XMLTransparentHugePagesReadMany(reader *XMLReader, start *xml.StartElement) (*TransparentHugePagesSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32065,7 +32380,7 @@ func XMLDiskAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*Dis } start = st } - var result DiskAttachmentSlice + var result TransparentHugePagesSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -32079,8 +32394,8 @@ func XMLDiskAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*Dis switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "disk_attachment": - one, err := XMLDiskAttachmentReadOne(reader, &t, "disk_attachment") + case "transparent_hugepages": + one, err := XMLTransparentHugePagesReadOne(reader, &t, "transparent_hugepages") if err != nil { return nil, err } @@ -32097,8 +32412,8 @@ func XMLDiskAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*Dis return &result, nil } -func XMLCertificateReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Certificate, error) { - builder := NewCertificateBuilder() +func XMLUnmanagedNetworkReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*UnmanagedNetwork, error) { + builder := NewUnmanagedNetworkBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32110,7 +32425,7 @@ func XMLCertificateReadOne(reader *XMLReader, start *xml.StartElement, expectedT start = st } if expectedTag == "" { - expectedTag = "certificate" + expectedTag = "unmanaged_network" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -32146,36 +32461,30 @@ func XMLCertificateReadOne(reader *XMLReader, start *xml.StartElement, expectedT return nil, err } builder.Comment(v) - case "content": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Content(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "name": - v, err := reader.ReadString(&t) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") if err != nil { return nil, err } - builder.Name(v) - case "organization": - v, err := reader.ReadString(&t) + builder.Host(v) + case "host_nic": + v, err := XMLHostNicReadOne(reader, &t, "host_nic") if err != nil { return nil, err } - builder.Organization(v) - case "subject": + builder.HostNic(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Subject(v) + builder.Name(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -32211,7 +32520,7 @@ func XMLCertificateReadOne(reader *XMLReader, start *xml.StartElement, expectedT return one, nil } -func XMLCertificateReadMany(reader *XMLReader, start *xml.StartElement) (*CertificateSlice, error) { +func XMLUnmanagedNetworkReadMany(reader *XMLReader, start *xml.StartElement) (*UnmanagedNetworkSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32222,7 +32531,7 @@ func XMLCertificateReadMany(reader *XMLReader, start *xml.StartElement) (*Certif } start = st } - var result CertificateSlice + var result UnmanagedNetworkSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -32236,8 +32545,8 @@ func XMLCertificateReadMany(reader *XMLReader, start *xml.StartElement) (*Certif switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "certificate": - one, err := XMLCertificateReadOne(reader, &t, "certificate") + case "unmanaged_network": + one, err := XMLUnmanagedNetworkReadOne(reader, &t, "unmanaged_network") if err != nil { return nil, err } @@ -32254,8 +32563,8 @@ func XMLCertificateReadMany(reader *XMLReader, start *xml.StartElement) (*Certif return &result, nil } -func XMLReportedConfigurationReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ReportedConfiguration, error) { - builder := NewReportedConfigurationBuilder() +func XMLUsbReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Usb, error) { + builder := NewUsbBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32267,7 +32576,7 @@ func XMLReportedConfigurationReadOne(reader *XMLReader, start *xml.StartElement, start = st } if expectedTag == "" { - expectedTag = "reported_configuration" + expectedTag = "usb" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -32286,30 +32595,19 @@ func XMLReportedConfigurationReadOne(reader *XMLReader, start *xml.StartElement, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "actual_value": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ActualValue(v) - case "expected_value": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.ExpectedValue(v) - case "in_sync": + case "enabled": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.InSync(v) - case "name": - v, err := reader.ReadString(&t) + builder.Enabled(v) + case "type": + vp, err := XMLUsbTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Name(v) + builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -32345,7 +32643,7 @@ func XMLReportedConfigurationReadOne(reader *XMLReader, start *xml.StartElement, return one, nil } -func XMLReportedConfigurationReadMany(reader *XMLReader, start *xml.StartElement) (*ReportedConfigurationSlice, error) { +func XMLUsbReadMany(reader *XMLReader, start *xml.StartElement) (*UsbSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32356,7 +32654,7 @@ func XMLReportedConfigurationReadMany(reader *XMLReader, start *xml.StartElement } start = st } - var result ReportedConfigurationSlice + var result UsbSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -32370,8 +32668,8 @@ func XMLReportedConfigurationReadMany(reader *XMLReader, start *xml.StartElement switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "reported_configuration": - one, err := XMLReportedConfigurationReadOne(reader, &t, "reported_configuration") + case "usb": + one, err := XMLUsbReadOne(reader, &t, "usb") if err != nil { return nil, err } @@ -32388,8 +32686,8 @@ func XMLReportedConfigurationReadMany(reader *XMLReader, start *xml.StartElement return &result, nil } -func XMLBackupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Backup, error) { - builder := NewBackupBuilder() +func XMLUserReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*User, error) { + builder := NewUserBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32401,7 +32699,7 @@ func XMLBackupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "backup" + expectedTag = "user" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -32437,55 +32735,114 @@ func XMLBackupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return nil, err } builder.Comment(v) - case "creation_date": - v, err := reader.ReadTime(&t) + case "department": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.CreationDate(v) + builder.Department(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) - case "disks": - v, err := XMLDiskReadMany(reader, &t) + case "domain": + v, err := XMLDomainReadOne(reader, &t, "domain") if err != nil { return nil, err } - builder.Disks(v) - case "from_checkpoint_id": + builder.Domain(v) + case "domain_entry_id": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.FromCheckpointId(v) + builder.DomainEntryId(v) + case "email": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Email(v) + case "groups": + v, err := XMLGroupReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Groups(v) + case "last_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.LastName(v) + case "logged_in": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.LoggedIn(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "phase": - vp, err := XMLBackupPhaseReadOne(reader, &t) - v := *vp + case "namespace": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Phase(v) - case "to_checkpoint_id": + builder.Namespace(v) + case "password": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.ToCheckpointId(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.Password(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } - builder.Vm(v) + builder.Permissions(v) + case "principal": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Principal(v) + case "roles": + v, err := XMLRoleReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Roles(v) + case "ssh_public_keys": + v, err := XMLSshPublicKeyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.SshPublicKeys(v) + case "tags": + v, err := XMLTagReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Tags(v) + case "user_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.UserName(v) + case "user_options": + v, err := XMLPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.UserOptions(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -32516,17 +32873,37 @@ func XMLBackupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st } for _, link := range links { switch *link.rel { - case "disks": - if one.disks == nil { - one.disks = new(DiskSlice) + case "groups": + if one.groups == nil { + one.groups = new(GroupSlice) } - one.disks.href = link.href + one.groups.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "roles": + if one.roles == nil { + one.roles = new(RoleSlice) + } + one.roles.href = link.href + case "sshpublickeys": + if one.sshPublicKeys == nil { + one.sshPublicKeys = new(SshPublicKeySlice) + } + one.sshPublicKeys.href = link.href + case "tags": + if one.tags == nil { + one.tags = new(TagSlice) + } + one.tags.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLBackupReadMany(reader *XMLReader, start *xml.StartElement) (*BackupSlice, error) { +func XMLUserReadMany(reader *XMLReader, start *xml.StartElement) (*UserSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32537,7 +32914,7 @@ func XMLBackupReadMany(reader *XMLReader, start *xml.StartElement) (*BackupSlice } start = st } - var result BackupSlice + var result UserSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -32551,8 +32928,8 @@ func XMLBackupReadMany(reader *XMLReader, start *xml.StartElement) (*BackupSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "backup": - one, err := XMLBackupReadOne(reader, &t, "backup") + case "user": + one, err := XMLUserReadOne(reader, &t, "user") if err != nil { return nil, err } @@ -32569,8 +32946,8 @@ func XMLBackupReadMany(reader *XMLReader, start *xml.StartElement) (*BackupSlice return &result, nil } -func XMLSchedulingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SchedulingPolicy, error) { - builder := NewSchedulingPolicyBuilder() +func XMLValueReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Value, error) { + builder := NewValueBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32582,22 +32959,11 @@ func XMLSchedulingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expe start = st } if expectedTag == "" { - expectedTag = "scheduling_policy" + expectedTag = "value" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -32612,60 +32978,140 @@ func XMLSchedulingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expe switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "balances": - v, err := XMLBalanceReadMany(reader, &t) + case "datum": + v, err := reader.ReadFloat64(&t) if err != nil { return nil, err } - builder.Balances(v) - case "comment": + builder.Datum(v) + case "detail": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "default_policy": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err + builder.Detail(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.DefaultPolicy(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.Description(v) - case "filters": - v, err := XMLFilterReadMany(reader, &t) + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLValueReadMany(reader *XMLReader, start *xml.StartElement) (*ValueSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result ValueSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "value": + one, err := XMLValueReadOne(reader, &t, "value") if err != nil { return nil, err } - builder.Filters(v) - case "locked": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err + if one != nil { + result.slice = append(result.slice, one) } - builder.Locked(v) - case "name": + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLVcpuPinReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VcpuPin, error) { + builder := NewVcpuPinBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "vcpu_pin" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "cpu_set": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Properties(v) - case "weight": - v, err := XMLWeightReadMany(reader, &t) + builder.CpuSet(v) + case "vcpu": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Weight(v) + builder.Vcpu(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -32696,27 +33142,12 @@ func XMLSchedulingPolicyReadOne(reader *XMLReader, start *xml.StartElement, expe } for _, link := range links { switch *link.rel { - case "balances": - if one.balances == nil { - one.balances = new(BalanceSlice) - } - one.balances.href = link.href - case "filters": - if one.filters == nil { - one.filters = new(FilterSlice) - } - one.filters.href = link.href - case "weight": - if one.weight == nil { - one.weight = new(WeightSlice) - } - one.weight.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLSchedulingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*SchedulingPolicySlice, error) { +func XMLVcpuPinReadMany(reader *XMLReader, start *xml.StartElement) (*VcpuPinSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32727,7 +33158,7 @@ func XMLSchedulingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*S } start = st } - var result SchedulingPolicySlice + var result VcpuPinSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -32741,8 +33172,8 @@ func XMLSchedulingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*S switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "scheduling_policy": - one, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") + case "vcpu_pin": + one, err := XMLVcpuPinReadOne(reader, &t, "vcpu_pin") if err != nil { return nil, err } @@ -32759,8 +33190,8 @@ func XMLSchedulingPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*S return &result, nil } -func XMLCpuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Cpu, error) { - builder := NewCpuBuilder() +func XMLVendorReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Vendor, error) { + builder := NewVendorBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32772,11 +33203,22 @@ func XMLCpuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin start = st } if expectedTag == "" { - expectedTag = "cpu" + expectedTag = "vendor" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -32791,62 +33233,24 @@ func XMLCpuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "architecture": - vp, err := XMLArchitectureReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Architecture(v) - case "cores": - v, err := XMLCoreReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Cores(v) - case "cpu_tune": - v, err := XMLCpuTuneReadOne(reader, &t, "cpu_tune") - if err != nil { - return nil, err - } - builder.CpuTune(v) - case "level": - v, err := reader.ReadInt64(&t) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Level(v) - case "mode": - vp, err := XMLCpuModeReadOne(reader, &t) - v := *vp + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Mode(v) + builder.Description(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "speed": - v, err := reader.ReadFloat64(&t) - if err != nil { - return nil, err - } - builder.Speed(v) - case "topology": - v, err := XMLCpuTopologyReadOne(reader, &t, "topology") - if err != nil { - return nil, err - } - builder.Topology(v) - case "type": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Type(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -32882,7 +33286,7 @@ func XMLCpuReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin return one, nil } -func XMLCpuReadMany(reader *XMLReader, start *xml.StartElement) (*CpuSlice, error) { +func XMLVendorReadMany(reader *XMLReader, start *xml.StartElement) (*VendorSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32893,7 +33297,7 @@ func XMLCpuReadMany(reader *XMLReader, start *xml.StartElement) (*CpuSlice, erro } start = st } - var result CpuSlice + var result VendorSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -32907,8 +33311,8 @@ func XMLCpuReadMany(reader *XMLReader, start *xml.StartElement) (*CpuSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cpu": - one, err := XMLCpuReadOne(reader, &t, "cpu") + case "vendor": + one, err := XMLVendorReadOne(reader, &t, "vendor") if err != nil { return nil, err } @@ -32925,8 +33329,8 @@ func XMLCpuReadMany(reader *XMLReader, start *xml.StartElement) (*CpuSlice, erro return &result, nil } -func XMLRegistrationAffinityLabelMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*RegistrationAffinityLabelMapping, error) { - builder := NewRegistrationAffinityLabelMappingBuilder() +func XMLVersionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Version, error) { + builder := NewVersionBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -32938,11 +33342,22 @@ func XMLRegistrationAffinityLabelMappingReadOne(reader *XMLReader, start *xml.St start = st } if expectedTag == "" { - expectedTag = "registration_affinity_label_mapping" + expectedTag = "version" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -32957,18 +33372,54 @@ func XMLRegistrationAffinityLabelMappingReadOne(reader *XMLReader, start *xml.St switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "from": - v, err := XMLAffinityLabelReadOne(reader, &t, "from") + case "build": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.From(v) - case "to": - v, err := XMLAffinityLabelReadOne(reader, &t, "to") + builder.Build_(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.To(v) + builder.Comment(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "full_version": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.FullVersion(v) + case "major": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Major(v) + case "minor": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Minor(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "revision": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Revision(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -33004,7 +33455,7 @@ func XMLRegistrationAffinityLabelMappingReadOne(reader *XMLReader, start *xml.St return one, nil } -func XMLRegistrationAffinityLabelMappingReadMany(reader *XMLReader, start *xml.StartElement) (*RegistrationAffinityLabelMappingSlice, error) { +func XMLVersionReadMany(reader *XMLReader, start *xml.StartElement) (*VersionSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33015,7 +33466,7 @@ func XMLRegistrationAffinityLabelMappingReadMany(reader *XMLReader, start *xml.S } start = st } - var result RegistrationAffinityLabelMappingSlice + var result VersionSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -33029,8 +33480,8 @@ func XMLRegistrationAffinityLabelMappingReadMany(reader *XMLReader, start *xml.S switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "registration_affinity_label_mapping": - one, err := XMLRegistrationAffinityLabelMappingReadOne(reader, &t, "registration_affinity_label_mapping") + case "version": + one, err := XMLVersionReadOne(reader, &t, "version") if err != nil { return nil, err } @@ -33047,8 +33498,8 @@ func XMLRegistrationAffinityLabelMappingReadMany(reader *XMLReader, start *xml.S return &result, nil } -func XMLIpAddressAssignmentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*IpAddressAssignment, error) { - builder := NewIpAddressAssignmentBuilder() +func XMLVirtioScsiReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VirtioScsi, error) { + builder := NewVirtioScsiBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33060,7 +33511,7 @@ func XMLIpAddressAssignmentReadOne(reader *XMLReader, start *xml.StartElement, e start = st } if expectedTag == "" { - expectedTag = "ip_address_assignment" + expectedTag = "virtio_scsi" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -33079,19 +33530,12 @@ func XMLIpAddressAssignmentReadOne(reader *XMLReader, start *xml.StartElement, e switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "assignment_method": - vp, err := XMLBootProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.AssignmentMethod(v) - case "ip": - v, err := XMLIpReadOne(reader, &t, "ip") + case "enabled": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Ip(v) + builder.Enabled(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -33127,7 +33571,7 @@ func XMLIpAddressAssignmentReadOne(reader *XMLReader, start *xml.StartElement, e return one, nil } -func XMLIpAddressAssignmentReadMany(reader *XMLReader, start *xml.StartElement) (*IpAddressAssignmentSlice, error) { +func XMLVirtioScsiReadMany(reader *XMLReader, start *xml.StartElement) (*VirtioScsiSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33138,7 +33582,7 @@ func XMLIpAddressAssignmentReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result IpAddressAssignmentSlice + var result VirtioScsiSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -33152,8 +33596,8 @@ func XMLIpAddressAssignmentReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ip_address_assignment": - one, err := XMLIpAddressAssignmentReadOne(reader, &t, "ip_address_assignment") + case "virtio_scsi": + one, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") if err != nil { return nil, err } @@ -33170,8 +33614,8 @@ func XMLIpAddressAssignmentReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLGuestOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GuestOperatingSystem, error) { - builder := NewGuestOperatingSystemBuilder() +func XMLVirtualNumaNodeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VirtualNumaNode, error) { + builder := NewVirtualNumaNodeBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33183,11 +33627,22 @@ func XMLGuestOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, start = st } if expectedTag == "" { - expectedTag = "guest_operating_system" + expectedTag = "vm_numa_node" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -33202,42 +33657,79 @@ func XMLGuestOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "architecture": + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Architecture(v) - case "codename": + builder.Comment(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") + if err != nil { + return nil, err + } + builder.Cpu(v) + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Codename(v) - case "distribution": + builder.Description(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "index": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Index(v) + case "memory": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Memory(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Distribution(v) - case "family": + builder.Name(v) + case "node_distance": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Family(v) - case "kernel": - v, err := XMLKernelReadOne(reader, &t, "kernel") + builder.NodeDistance(v) + case "numa_node_pins": + v, err := XMLNumaNodePinReadMany(reader, &t) if err != nil { return nil, err } - builder.Kernel(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + builder.NumaNodePins(v) + case "numa_tune_mode": + vp, err := XMLNumaTuneModeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Version(v) + builder.NumaTuneMode(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Statistics(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -33268,12 +33760,17 @@ func XMLGuestOperatingSystemReadOne(reader *XMLReader, start *xml.StartElement, } for _, link := range links { switch *link.rel { + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLGuestOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) (*GuestOperatingSystemSlice, error) { +func XMLVirtualNumaNodeReadMany(reader *XMLReader, start *xml.StartElement) (*VirtualNumaNodeSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33284,7 +33781,7 @@ func XMLGuestOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var result GuestOperatingSystemSlice + var result VirtualNumaNodeSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -33298,8 +33795,8 @@ func XMLGuestOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "guest_operating_system": - one, err := XMLGuestOperatingSystemReadOne(reader, &t, "guest_operating_system") + case "vm_numa_node": + one, err := XMLVirtualNumaNodeReadOne(reader, &t, "vm_numa_node") if err != nil { return nil, err } @@ -33316,8 +33813,8 @@ func XMLGuestOperatingSystemReadMany(reader *XMLReader, start *xml.StartElement) return &result, nil } -func XMLCpuTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CpuType, error) { - builder := NewCpuTypeBuilder() +func XMLVlanReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Vlan, error) { + builder := NewVlanBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33329,68 +33826,28 @@ func XMLCpuTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s start = st } if expectedTag == "" { - expectedTag = "cpu_type" + expectedTag = "vlan" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "architecture": - vp, err := XMLArchitectureReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Architecture(v) - case "level": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Level(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return nil, err } - case xml.EndElement: - depth-- + builder.Id(v) + case "href": + builder.Href(value) } } + var links []Link + reader.Skip() one, err := builder.Build() if err != nil { return nil, err @@ -33402,7 +33859,7 @@ func XMLCpuTypeReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLCpuTypeReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTypeSlice, error) { +func XMLVlanReadMany(reader *XMLReader, start *xml.StartElement) (*VlanSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33413,7 +33870,7 @@ func XMLCpuTypeReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTypeSli } start = st } - var result CpuTypeSlice + var result VlanSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -33427,8 +33884,8 @@ func XMLCpuTypeReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTypeSli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "cpu_type": - one, err := XMLCpuTypeReadOne(reader, &t, "cpu_type") + case "vlan": + one, err := XMLVlanReadOne(reader, &t, "vlan") if err != nil { return nil, err } @@ -33445,8 +33902,8 @@ func XMLCpuTypeReadMany(reader *XMLReader, start *xml.StartElement) (*CpuTypeSli return &result, nil } -func XMLSpecialObjectsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*SpecialObjects, error) { - builder := NewSpecialObjectsBuilder() +func XMLVmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Vm, error) { + builder := NewVmBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -33458,11 +33915,22 @@ func XMLSpecialObjectsReadOne(reader *XMLReader, start *xml.StartElement, expect start = st } if expectedTag == "" { - expectedTag = "special_objects" + expectedTag = "vm" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -33477,519 +33945,502 @@ func XMLSpecialObjectsReadOne(reader *XMLReader, start *xml.StartElement, expect switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "blank_template": - v, err := XMLTemplateReadOne(reader, &t, "blank_template") + case "affinity_labels": + v, err := XMLAffinityLabelReadMany(reader, &t) if err != nil { return nil, err } - builder.BlankTemplate(v) - case "root_tag": - v, err := XMLTagReadOne(reader, &t, "root_tag") + builder.AffinityLabels(v) + case "applications": + v, err := XMLApplicationReadMany(reader, &t) if err != nil { return nil, err } - builder.RootTag(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } + builder.Applications(v) + case "bios": + v, err := XMLBiosReadOne(reader, &t, "bios") + if err != nil { + return nil, err } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) + builder.Bios(v) + case "cdroms": + v, err := XMLCdromReadMany(reader, &t) + if err != nil { + return nil, err } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLSpecialObjectsReadMany(reader *XMLReader, start *xml.StartElement) (*SpecialObjectsSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result SpecialObjectsSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "special_objects": - one, err := XMLSpecialObjectsReadOne(reader, &t, "special_objects") + builder.Cdroms(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) + case "comment": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Comment(v) + case "console": + v, err := XMLConsoleReadOne(reader, &t, "console") + if err != nil { + return nil, err + } + builder.Console(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") + if err != nil { + return nil, err + } + builder.Cpu(v) + case "cpu_profile": + v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") + if err != nil { + return nil, err + } + builder.CpuProfile(v) + case "cpu_shares": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.CpuShares(v) + case "creation_time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.CreationTime(v) + case "custom_compatibility_version": + v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") + if err != nil { + return nil, err + } + builder.CustomCompatibilityVersion(v) + case "custom_cpu_model": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomCpuModel(v) + case "custom_emulated_machine": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.CustomEmulatedMachine(v) + case "custom_properties": + v, err := XMLCustomPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.CustomProperties(v) + case "delete_protected": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.DeleteProtected(v) + case "description": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Description(v) + case "disk_attachments": + v, err := XMLDiskAttachmentReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.DiskAttachments(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") + if err != nil { + return nil, err + } + builder.Display(v) + case "domain": + v, err := XMLDomainReadOne(reader, &t, "domain") + if err != nil { + return nil, err + } + builder.Domain(v) + case "external_host_provider": + v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") + if err != nil { + return nil, err + } + builder.ExternalHostProvider(v) + case "floppies": + v, err := XMLFloppyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Floppies(v) + case "fqdn": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Fqdn(v) + case "graphics_consoles": + v, err := XMLGraphicsConsoleReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.GraphicsConsoles(v) + case "guest_operating_system": + v, err := XMLGuestOperatingSystemReadOne(reader, &t, "guest_operating_system") + if err != nil { + return nil, err + } + builder.GuestOperatingSystem(v) + case "guest_time_zone": + v, err := XMLTimeZoneReadOne(reader, &t, "guest_time_zone") + if err != nil { + return nil, err + } + builder.GuestTimeZone(v) + case "has_illegal_images": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.HasIllegalImages(v) + case "high_availability": + v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + if err != nil { + return nil, err + } + builder.HighAvailability(v) + case "host": + v, err := XMLHostReadOne(reader, &t, "host") + if err != nil { + return nil, err + } + builder.Host(v) + case "host_devices": + v, err := XMLHostDeviceReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.HostDevices(v) + case "initialization": + v, err := XMLInitializationReadOne(reader, &t, "initialization") + if err != nil { + return nil, err + } + builder.Initialization(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "io": + v, err := XMLIoReadOne(reader, &t, "io") + if err != nil { + return nil, err + } + builder.Io(v) + case "katello_errata": + v, err := XMLKatelloErratumReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.KatelloErrata(v) + case "large_icon": + v, err := XMLIconReadOne(reader, &t, "large_icon") + if err != nil { + return nil, err + } + builder.LargeIcon(v) + case "lease": + v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") + if err != nil { + return nil, err + } + builder.Lease(v) + case "memory": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Memory(v) + case "memory_policy": + v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") + if err != nil { + return nil, err + } + builder.MemoryPolicy(v) + case "migration": + v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") if err != nil { return nil, err } - if one != nil { - result.slice = append(result.slice, one) + builder.Migration(v) + case "migration_downtime": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLSessionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Session, error) { - builder := NewSessionBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "session" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "comment": + builder.MigrationDowntime(v) + case "multi_queues_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.MultiQueuesEnabled(v) + case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Comment(v) - case "console_user": + builder.Name(v) + case "next_run_configuration_exists": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.ConsoleUser(v) - case "description": - v, err := reader.ReadString(&t) + builder.NextRunConfigurationExists(v) + case "nics": + v, err := XMLNicReadMany(reader, &t) if err != nil { return nil, err } - builder.Description(v) - case "ip": - v, err := XMLIpReadOne(reader, &t, "ip") + builder.Nics(v) + case "host_numa_nodes": + v, err := XMLNumaNodeReadMany(reader, &t) if err != nil { return nil, err } - builder.Ip(v) - case "name": - v, err := reader.ReadString(&t) + builder.NumaNodes(v) + case "numa_tune_mode": + vp, err := XMLNumaTuneModeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Name(v) - case "protocol": + builder.NumaTuneMode(v) + case "origin": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Protocol(v) - case "user": - v, err := XMLUserReadOne(reader, &t, "user") + builder.Origin(v) + case "original_template": + v, err := XMLTemplateReadOne(reader, &t, "original_template") if err != nil { return nil, err } - builder.User(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + builder.OriginalTemplate(v) + case "os": + v, err := XMLOperatingSystemReadOne(reader, &t, "os") if err != nil { return nil, err } - builder.Vm(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } + builder.Os(v) + case "payloads": + v, err := XMLPayloadReadMany(reader, &t) + if err != nil { + return nil, err } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) + builder.Payloads(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLSessionReadMany(reader *XMLReader, start *xml.StartElement) (*SessionSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result SessionSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "session": - one, err := XMLSessionReadOne(reader, &t, "session") + builder.Permissions(v) + case "placement_policy": + v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") if err != nil { return nil, err } - if one != nil { - result.slice = append(result.slice, one) + builder.PlacementPolicy(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLGlusterBrickAdvancedDetailsReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*GlusterBrickAdvancedDetails, error) { - builder := NewGlusterBrickAdvancedDetailsBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "gluster_brick_advanced_details" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) + builder.Quota(v) + case "reported_devices": + v, err := XMLReportedDeviceReadMany(reader, &t) if err != nil { return nil, err } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + builder.ReportedDevices(v) + case "rng_device": + v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") if err != nil { return nil, err } - builder.Description(v) - case "device": - v, err := reader.ReadString(&t) + builder.RngDevice(v) + case "run_once": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Device(v) - case "fs_name": - v, err := reader.ReadString(&t) + builder.RunOnce(v) + case "serial_number": + v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") if err != nil { return nil, err } - builder.FsName(v) - case "gluster_clients": - v, err := XMLGlusterClientReadMany(reader, &t) + builder.SerialNumber(v) + case "sessions": + v, err := XMLSessionReadMany(reader, &t) if err != nil { return nil, err } - builder.GlusterClients(v) - case "instance_type": - v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + builder.Sessions(v) + case "small_icon": + v, err := XMLIconReadOne(reader, &t, "small_icon") if err != nil { return nil, err } - builder.InstanceType(v) - case "memory_pools": - v, err := XMLGlusterMemoryPoolReadMany(reader, &t) + builder.SmallIcon(v) + case "snapshots": + v, err := XMLSnapshotReadMany(reader, &t) if err != nil { return nil, err } - builder.MemoryPools(v) - case "mnt_options": + builder.Snapshots(v) + case "soundcard_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.SoundcardEnabled(v) + case "sso": + v, err := XMLSsoReadOne(reader, &t, "sso") + if err != nil { + return nil, err + } + builder.Sso(v) + case "start_paused": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.StartPaused(v) + case "start_time": + v, err := reader.ReadTime(&t) + if err != nil { + return nil, err + } + builder.StartTime(v) + case "stateless": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Stateless(v) + case "statistics": + v, err := XMLStatisticReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Statistics(v) + case "status": + vp, err := XMLVmStatusReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Status(v) + case "status_detail": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.MntOptions(v) - case "name": + builder.StatusDetail(v) + case "stop_reason": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Name(v) - case "pid": - v, err := reader.ReadInt64(&t) + builder.StopReason(v) + case "stop_time": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.Pid(v) - case "port": - v, err := reader.ReadInt64(&t) + builder.StopTime(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } - builder.Port(v) + builder.StorageDomain(v) + case "storage_error_resume_behaviour": + vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.StorageErrorResumeBehaviour(v) + case "tags": + v, err := XMLTagReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Tags(v) case "template": v, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } builder.Template(v) - case "vm": - v, err := XMLVmReadOne(reader, &t, "vm") + case "time_zone": + v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") if err != nil { return nil, err } - builder.Vm(v) - case "vms": - v, err := XMLVmReadMany(reader, &t) + builder.TimeZone(v) + case "tunnel_migration": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Vms(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - case "vms": - if one.vms == nil { - one.vms = new(VmSlice) - } - one.vms.href = link.href - } // end of switch - } // end of for-links - return one, nil -} - -func XMLGlusterBrickAdvancedDetailsReadMany(reader *XMLReader, start *xml.StartElement) (*GlusterBrickAdvancedDetailsSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result GlusterBrickAdvancedDetailsSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "gluster_brick_advanced_details": - one, err := XMLGlusterBrickAdvancedDetailsReadOne(reader, &t, "gluster_brick_advanced_details") + builder.TunnelMigration(v) + case "type": + vp, err := XMLVmTypeReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - if one != nil { - result.slice = append(result.slice, one) + builder.Type(v) + case "usb": + v, err := XMLUsbReadOne(reader, &t, "usb") + if err != nil { + return nil, err } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLKsmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Ksm, error) { - builder := NewKsmBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "ksm" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "enabled": + builder.Usb(v) + case "use_latest_template_version": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Enabled(v) - case "merge_across_nodes": - v, err := reader.ReadBool(&t) + builder.UseLatestTemplateVersion(v) + case "virtio_scsi": + v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") + if err != nil { + return nil, err + } + builder.VirtioScsi(v) + case "vm_pool": + v, err := XMLVmPoolReadOne(reader, &t, "vm_pool") + if err != nil { + return nil, err + } + builder.VmPool(v) + case "watchdogs": + v, err := XMLWatchdogReadMany(reader, &t) if err != nil { return nil, err } - builder.MergeAcrossNodes(v) + builder.Watchdogs(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -34020,12 +34471,97 @@ func XMLKsmReadOne(reader *XMLReader, start *xml.StartElement, expectedTag strin } for _, link := range links { switch *link.rel { + case "affinitylabels": + if one.affinityLabels == nil { + one.affinityLabels = new(AffinityLabelSlice) + } + one.affinityLabels.href = link.href + case "applications": + if one.applications == nil { + one.applications = new(ApplicationSlice) + } + one.applications.href = link.href + case "cdroms": + if one.cdroms == nil { + one.cdroms = new(CdromSlice) + } + one.cdroms.href = link.href + case "diskattachments": + if one.diskAttachments == nil { + one.diskAttachments = new(DiskAttachmentSlice) + } + one.diskAttachments.href = link.href + case "floppies": + if one.floppies == nil { + one.floppies = new(FloppySlice) + } + one.floppies.href = link.href + case "graphicsconsoles": + if one.graphicsConsoles == nil { + one.graphicsConsoles = new(GraphicsConsoleSlice) + } + one.graphicsConsoles.href = link.href + case "hostdevices": + if one.hostDevices == nil { + one.hostDevices = new(HostDeviceSlice) + } + one.hostDevices.href = link.href + case "katelloerrata": + if one.katelloErrata == nil { + one.katelloErrata = new(KatelloErratumSlice) + } + one.katelloErrata.href = link.href + case "nics": + if one.nics == nil { + one.nics = new(NicSlice) + } + one.nics.href = link.href + case "numanodes": + if one.numaNodes == nil { + one.numaNodes = new(NumaNodeSlice) + } + one.numaNodes.href = link.href + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + case "reporteddevices": + if one.reportedDevices == nil { + one.reportedDevices = new(ReportedDeviceSlice) + } + one.reportedDevices.href = link.href + case "sessions": + if one.sessions == nil { + one.sessions = new(SessionSlice) + } + one.sessions.href = link.href + case "snapshots": + if one.snapshots == nil { + one.snapshots = new(SnapshotSlice) + } + one.snapshots.href = link.href + case "statistics": + if one.statistics == nil { + one.statistics = new(StatisticSlice) + } + one.statistics.href = link.href + case "tags": + if one.tags == nil { + one.tags = new(TagSlice) + } + one.tags.href = link.href + case "watchdogs": + if one.watchdogs == nil { + one.watchdogs = new(WatchdogSlice) + } + one.watchdogs.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLKsmReadMany(reader *XMLReader, start *xml.StartElement) (*KsmSlice, error) { +func XMLVmReadMany(reader *XMLReader, start *xml.StartElement) (*VmSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34036,7 +34572,7 @@ func XMLKsmReadMany(reader *XMLReader, start *xml.StartElement) (*KsmSlice, erro } start = st } - var result KsmSlice + var result VmSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -34050,8 +34586,8 @@ func XMLKsmReadMany(reader *XMLReader, start *xml.StartElement) (*KsmSlice, erro switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "ksm": - one, err := XMLKsmReadOne(reader, &t, "ksm") + case "vm": + one, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } @@ -34068,8 +34604,8 @@ func XMLKsmReadMany(reader *XMLReader, start *xml.StartElement) (*KsmSlice, erro return &result, nil } -func XMLValueReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Value, error) { - builder := NewValueBuilder() +func XMLVmBaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmBase, error) { + builder := NewVmBaseBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34081,11 +34617,22 @@ func XMLValueReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str start = st } if expectedTag == "" { - expectedTag = "value" + expectedTag = "vm_base" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } + // Process the attributes + for _, attr := range start.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "id": + builder.Id(value) + case "href": + builder.Href(value) + } + } var links []Link depth := 1 for depth > 0 { @@ -34100,365 +34647,278 @@ func XMLValueReadOne(reader *XMLReader, start *xml.StartElement, expectedTag str switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "datum": - v, err := reader.ReadFloat64(&t) + case "bios": + v, err := XMLBiosReadOne(reader, &t, "bios") if err != nil { return nil, err } - builder.Datum(v) - case "detail": + builder.Bios(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) + case "comment": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Detail(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } + builder.Comment(v) + case "console": + v, err := XMLConsoleReadOne(reader, &t, "console") + if err != nil { + return nil, err } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) + builder.Console(v) + case "cpu": + v, err := XMLCpuReadOne(reader, &t, "cpu") + if err != nil { + return nil, err } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLValueReadMany(reader *XMLReader, start *xml.StartElement) (*ValueSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result ValueSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "value": - one, err := XMLValueReadOne(reader, &t, "value") + builder.Cpu(v) + case "cpu_profile": + v, err := XMLCpuProfileReadOne(reader, &t, "cpu_profile") if err != nil { return nil, err } - if one != nil { - result.slice = append(result.slice, one) + builder.CpuProfile(v) + case "cpu_shares": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLCloudInitReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*CloudInit, error) { - builder := NewCloudInitBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "cloud_init" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "authorized_keys": - v, err := XMLAuthorizedKeyReadMany(reader, &t) + builder.CpuShares(v) + case "creation_time": + v, err := reader.ReadTime(&t) if err != nil { return nil, err } - builder.AuthorizedKeys(v) - case "files": - v, err := XMLFileReadMany(reader, &t) + builder.CreationTime(v) + case "custom_compatibility_version": + v, err := XMLVersionReadOne(reader, &t, "custom_compatibility_version") if err != nil { return nil, err } - builder.Files(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + builder.CustomCompatibilityVersion(v) + case "custom_cpu_model": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Host(v) - case "network_configuration": - v, err := XMLNetworkConfigurationReadOne(reader, &t, "network_configuration") + builder.CustomCpuModel(v) + case "custom_emulated_machine": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.NetworkConfiguration(v) - case "regenerate_ssh_keys": + builder.CustomEmulatedMachine(v) + case "custom_properties": + v, err := XMLCustomPropertyReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.CustomProperties(v) + case "delete_protected": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.RegenerateSshKeys(v) - case "timezone": + builder.DeleteProtected(v) + case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.Timezone(v) - case "users": - v, err := XMLUserReadMany(reader, &t) + builder.Description(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") if err != nil { return nil, err } - builder.Users(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } + builder.Display(v) + case "domain": + v, err := XMLDomainReadOne(reader, &t, "domain") + if err != nil { + return nil, err } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) + builder.Domain(v) + case "high_availability": + v, err := XMLHighAvailabilityReadOne(reader, &t, "high_availability") + if err != nil { + return nil, err } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLCloudInitReadMany(reader *XMLReader, start *xml.StartElement) (*CloudInitSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result CloudInitSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "cloud_init": - one, err := XMLCloudInitReadOne(reader, &t, "cloud_init") + builder.HighAvailability(v) + case "initialization": + v, err := XMLInitializationReadOne(reader, &t, "initialization") if err != nil { return nil, err } - if one != nil { - result.slice = append(result.slice, one) + builder.Initialization(v) + case "io": + v, err := XMLIoReadOne(reader, &t, "io") + if err != nil { + return nil, err } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLDisplayReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Display, error) { - builder := NewDisplayBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "display" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) + builder.Io(v) + case "large_icon": + v, err := XMLIconReadOne(reader, &t, "large_icon") if err != nil { return nil, err } - builder.Address(v) - case "allow_override": - v, err := reader.ReadBool(&t) + builder.LargeIcon(v) + case "lease": + v, err := XMLStorageDomainLeaseReadOne(reader, &t, "lease") if err != nil { return nil, err } - builder.AllowOverride(v) - case "certificate": - v, err := XMLCertificateReadOne(reader, &t, "certificate") + builder.Lease(v) + case "memory": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Certificate(v) - case "copy_paste_enabled": - v, err := reader.ReadBool(&t) + builder.Memory(v) + case "memory_policy": + v, err := XMLMemoryPolicyReadOne(reader, &t, "memory_policy") if err != nil { return nil, err } - builder.CopyPasteEnabled(v) - case "disconnect_action": - v, err := reader.ReadString(&t) + builder.MemoryPolicy(v) + case "migration": + v, err := XMLMigrationOptionsReadOne(reader, &t, "migration") if err != nil { return nil, err } - builder.DisconnectAction(v) - case "file_transfer_enabled": + builder.Migration(v) + case "migration_downtime": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MigrationDowntime(v) + case "multi_queues_enabled": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.FileTransferEnabled(v) - case "keyboard_layout": + builder.MultiQueuesEnabled(v) + case "name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.Name(v) + case "origin": v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.KeyboardLayout(v) - case "monitors": - v, err := reader.ReadInt64(&t) + builder.Origin(v) + case "os": + v, err := XMLOperatingSystemReadOne(reader, &t, "os") + if err != nil { + return nil, err + } + builder.Os(v) + case "placement_policy": + v, err := XMLVmPlacementPolicyReadOne(reader, &t, "placement_policy") + if err != nil { + return nil, err + } + builder.PlacementPolicy(v) + case "quota": + v, err := XMLQuotaReadOne(reader, &t, "quota") + if err != nil { + return nil, err + } + builder.Quota(v) + case "rng_device": + v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + if err != nil { + return nil, err + } + builder.RngDevice(v) + case "serial_number": + v, err := XMLSerialNumberReadOne(reader, &t, "serial_number") + if err != nil { + return nil, err + } + builder.SerialNumber(v) + case "small_icon": + v, err := XMLIconReadOne(reader, &t, "small_icon") + if err != nil { + return nil, err + } + builder.SmallIcon(v) + case "soundcard_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.SoundcardEnabled(v) + case "sso": + v, err := XMLSsoReadOne(reader, &t, "sso") + if err != nil { + return nil, err + } + builder.Sso(v) + case "start_paused": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Monitors(v) - case "port": - v, err := reader.ReadInt64(&t) + builder.StartPaused(v) + case "stateless": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Port(v) - case "proxy": - v, err := reader.ReadString(&t) + builder.Stateless(v) + case "storage_domain": + v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") if err != nil { return nil, err } - builder.Proxy(v) - case "secure_port": - v, err := reader.ReadInt64(&t) + builder.StorageDomain(v) + case "storage_error_resume_behaviour": + vp, err := XMLVmStorageErrorResumeBehaviourReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.SecurePort(v) - case "single_qxl_pci": - v, err := reader.ReadBool(&t) + builder.StorageErrorResumeBehaviour(v) + case "time_zone": + v, err := XMLTimeZoneReadOne(reader, &t, "time_zone") if err != nil { return nil, err } - builder.SingleQxlPci(v) - case "smartcard_enabled": + builder.TimeZone(v) + case "tunnel_migration": v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.SmartcardEnabled(v) + builder.TunnelMigration(v) case "type": - vp, err := XMLDisplayTypeReadOne(reader, &t) + vp, err := XMLVmTypeReadOne(reader, &t) v := *vp if err != nil { return nil, err } builder.Type(v) + case "usb": + v, err := XMLUsbReadOne(reader, &t, "usb") + if err != nil { + return nil, err + } + builder.Usb(v) + case "virtio_scsi": + v, err := XMLVirtioScsiReadOne(reader, &t, "virtio_scsi") + if err != nil { + return nil, err + } + builder.VirtioScsi(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -34494,7 +34954,7 @@ func XMLDisplayReadOne(reader *XMLReader, start *xml.StartElement, expectedTag s return one, nil } -func XMLDisplayReadMany(reader *XMLReader, start *xml.StartElement) (*DisplaySlice, error) { +func XMLVmBaseReadMany(reader *XMLReader, start *xml.StartElement) (*VmBaseSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34505,7 +34965,7 @@ func XMLDisplayReadMany(reader *XMLReader, start *xml.StartElement) (*DisplaySli } start = st } - var result DisplaySlice + var result VmBaseSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -34519,8 +34979,8 @@ func XMLDisplayReadMany(reader *XMLReader, start *xml.StartElement) (*DisplaySli switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "display": - one, err := XMLDisplayReadOne(reader, &t, "display") + case "vm_base": + one, err := XMLVmBaseReadOne(reader, &t, "vm_base") if err != nil { return nil, err } @@ -34537,8 +34997,8 @@ func XMLDisplayReadMany(reader *XMLReader, start *xml.StartElement) (*DisplaySli return &result, nil } -func XMLStorageDomainLeaseReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*StorageDomainLease, error) { - builder := NewStorageDomainLeaseBuilder() +func XMLVmPlacementPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmPlacementPolicy, error) { + builder := NewVmPlacementPolicyBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34550,7 +35010,7 @@ func XMLStorageDomainLeaseReadOne(reader *XMLReader, start *xml.StartElement, ex start = st } if expectedTag == "" { - expectedTag = "storage_domain_lease" + expectedTag = "vm_placement_policy" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -34569,12 +35029,19 @@ func XMLStorageDomainLeaseReadOne(reader *XMLReader, start *xml.StartElement, ex switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "storage_domain": - v, err := XMLStorageDomainReadOne(reader, &t, "storage_domain") + case "affinity": + vp, err := XMLVmAffinityReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.StorageDomain(v) + builder.Affinity(v) + case "hosts": + v, err := XMLHostReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Hosts(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -34605,12 +35072,17 @@ func XMLStorageDomainLeaseReadOne(reader *XMLReader, start *xml.StartElement, ex } for _, link := range links { switch *link.rel { + case "hosts": + if one.hosts == nil { + one.hosts = new(HostSlice) + } + one.hosts.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLStorageDomainLeaseReadMany(reader *XMLReader, start *xml.StartElement) (*StorageDomainLeaseSlice, error) { +func XMLVmPlacementPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*VmPlacementPolicySlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34621,7 +35093,7 @@ func XMLStorageDomainLeaseReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var result StorageDomainLeaseSlice + var result VmPlacementPolicySlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -34635,8 +35107,8 @@ func XMLStorageDomainLeaseReadMany(reader *XMLReader, start *xml.StartElement) ( switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "storage_domain_lease": - one, err := XMLStorageDomainLeaseReadOne(reader, &t, "storage_domain_lease") + case "vm_placement_policy": + one, err := XMLVmPlacementPolicyReadOne(reader, &t, "vm_placement_policy") if err != nil { return nil, err } @@ -34653,8 +35125,8 @@ func XMLStorageDomainLeaseReadMany(reader *XMLReader, start *xml.StartElement) ( return &result, nil } -func XMLMigrationPolicyReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*MigrationPolicy, error) { - builder := NewMigrationPolicyBuilder() +func XMLVmPoolReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmPool, error) { + builder := NewVmPoolBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34666,7 +35138,7 @@ func XMLMigrationPolicyReadOne(reader *XMLReader, start *xml.StartElement, expec start = st } if expectedTag == "" { - expectedTag = "migration_policy" + expectedTag = "vm_pool" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -34696,6 +35168,18 @@ func XMLMigrationPolicyReadOne(reader *XMLReader, start *xml.StartElement, expec switch t := t.(type) { case xml.StartElement: switch t.Name.Local { + case "auto_storage_select": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.AutoStorageSelect(v) + case "cluster": + v, err := XMLClusterReadOne(reader, &t, "cluster") + if err != nil { + return nil, err + } + builder.Cluster(v) case "comment": v, err := reader.ReadString(&t) if err != nil { @@ -34708,12 +35192,91 @@ func XMLMigrationPolicyReadOne(reader *XMLReader, start *xml.StartElement, expec return nil, err } builder.Description(v) + case "display": + v, err := XMLDisplayReadOne(reader, &t, "display") + if err != nil { + return nil, err + } + builder.Display(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "max_user_vms": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.MaxUserVms(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Permissions(v) + case "prestarted_vms": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.PrestartedVms(v) + case "rng_device": + v, err := XMLRngDeviceReadOne(reader, &t, "rng_device") + if err != nil { + return nil, err + } + builder.RngDevice(v) + case "size": + v, err := reader.ReadInt64(&t) + if err != nil { + return nil, err + } + builder.Size(v) + case "soundcard_enabled": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.SoundcardEnabled(v) + case "stateful": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.Stateful(v) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") + if err != nil { + return nil, err + } + builder.Template(v) + case "type": + vp, err := XMLVmPoolTypeReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Type(v) + case "use_latest_template_version": + v, err := reader.ReadBool(&t) + if err != nil { + return nil, err + } + builder.UseLatestTemplateVersion(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") + if err != nil { + return nil, err + } + builder.Vm(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -34744,12 +35307,17 @@ func XMLMigrationPolicyReadOne(reader *XMLReader, start *xml.StartElement, expec } for _, link := range links { switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLMigrationPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*MigrationPolicySlice, error) { +func XMLVmPoolReadMany(reader *XMLReader, start *xml.StartElement) (*VmPoolSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34760,7 +35328,7 @@ func XMLMigrationPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Mi } start = st } - var result MigrationPolicySlice + var result VmPoolSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -34774,8 +35342,8 @@ func XMLMigrationPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Mi switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "migration_policy": - one, err := XMLMigrationPolicyReadOne(reader, &t, "migration_policy") + case "vm_pool": + one, err := XMLVmPoolReadOne(reader, &t, "vm_pool") if err != nil { return nil, err } @@ -34792,8 +35360,8 @@ func XMLMigrationPolicyReadMany(reader *XMLReader, start *xml.StartElement) (*Mi return &result, nil } -func XMLHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Host, error) { - builder := NewHostBuilder() +func XMLVmSummaryReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VmSummary, error) { + builder := NewVmSummaryBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -34805,22 +35373,11 @@ func XMLHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri start = st } if expectedTag == "" { - expectedTag = "host" + expectedTag = "vm_summary" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} } - // Process the attributes - for _, attr := range start.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "id": - builder.Id(value) - case "href": - builder.Href(value) - } - } var links []Link depth := 1 for depth > 0 { @@ -34835,337 +35392,141 @@ func XMLHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "address": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Address(v) - case "affinity_labels": - v, err := XMLAffinityLabelReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.AffinityLabels(v) - case "agents": - v, err := XMLAgentReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Agents(v) - case "auto_numa_status": - vp, err := XMLAutoNumaStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.AutoNumaStatus(v) - case "certificate": - v, err := XMLCertificateReadOne(reader, &t, "certificate") - if err != nil { - return nil, err - } - builder.Certificate(v) - case "cluster": - v, err := XMLClusterReadOne(reader, &t, "cluster") - if err != nil { - return nil, err - } - builder.Cluster(v) - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "cpu": - v, err := XMLCpuReadOne(reader, &t, "cpu") - if err != nil { - return nil, err - } - builder.Cpu(v) - case "description": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Description(v) - case "device_passthrough": - v, err := XMLHostDevicePassthroughReadOne(reader, &t, "device_passthrough") - if err != nil { - return nil, err - } - builder.DevicePassthrough(v) - case "devices": - v, err := XMLHostDeviceReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Devices(v) - case "display": - v, err := XMLDisplayReadOne(reader, &t, "display") - if err != nil { - return nil, err - } - builder.Display(v) - case "external_host_provider": - v, err := XMLExternalHostProviderReadOne(reader, &t, "external_host_provider") - if err != nil { - return nil, err - } - builder.ExternalHostProvider(v) - case "external_network_provider_configurations": - v, err := XMLExternalNetworkProviderConfigurationReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.ExternalNetworkProviderConfigurations(v) - case "external_status": - vp, err := XMLExternalStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.ExternalStatus(v) - case "hardware_information": - v, err := XMLHardwareInformationReadOne(reader, &t, "hardware_information") - if err != nil { - return nil, err - } - builder.HardwareInformation(v) - case "hooks": - v, err := XMLHookReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Hooks(v) - case "hosted_engine": - v, err := XMLHostedEngineReadOne(reader, &t, "hosted_engine") - if err != nil { - return nil, err - } - builder.HostedEngine(v) - case "iscsi": - v, err := XMLIscsiDetailsReadOne(reader, &t, "iscsi") - if err != nil { - return nil, err - } - builder.Iscsi(v) - case "katello_errata": - v, err := XMLKatelloErratumReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.KatelloErrata(v) - case "kdump_status": - vp, err := XMLKdumpStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.KdumpStatus(v) - case "ksm": - v, err := XMLKsmReadOne(reader, &t, "ksm") - if err != nil { - return nil, err - } - builder.Ksm(v) - case "libvirt_version": - v, err := XMLVersionReadOne(reader, &t, "libvirt_version") - if err != nil { - return nil, err - } - builder.LibvirtVersion(v) - case "max_scheduling_memory": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.MaxSchedulingMemory(v) - case "memory": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Memory(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "network_attachments": - v, err := XMLNetworkAttachmentReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NetworkAttachments(v) - case "network_operation_in_progress": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.NetworkOperationInProgress(v) - case "nics": - v, err := XMLHostNicReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Nics(v) - case "host_numa_nodes": - v, err := XMLNumaNodeReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.NumaNodes(v) - case "numa_supported": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.NumaSupported(v) - case "os": - v, err := XMLOperatingSystemReadOne(reader, &t, "os") - if err != nil { - return nil, err - } - builder.Os(v) - case "override_iptables": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err - } - builder.OverrideIptables(v) - case "permissions": - v, err := XMLPermissionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Permissions(v) - case "port": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Port(v) - case "power_management": - v, err := XMLPowerManagementReadOne(reader, &t, "power_management") - if err != nil { - return nil, err - } - builder.PowerManagement(v) - case "protocol": - vp, err := XMLHostProtocolReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Protocol(v) - case "root_password": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.RootPassword(v) - case "se_linux": - v, err := XMLSeLinuxReadOne(reader, &t, "se_linux") - if err != nil { - return nil, err - } - builder.SeLinux(v) - case "spm": - v, err := XMLSpmReadOne(reader, &t, "spm") - if err != nil { - return nil, err - } - builder.Spm(v) - case "ssh": - v, err := XMLSshReadOne(reader, &t, "ssh") - if err != nil { - return nil, err - } - builder.Ssh(v) - case "statistics": - v, err := XMLStatisticReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Statistics(v) - case "status": - vp, err := XMLHostStatusReadOne(reader, &t) - v := *vp - if err != nil { - return nil, err - } - builder.Status(v) - case "status_detail": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.StatusDetail(v) - case "storage_connection_extensions": - v, err := XMLStorageConnectionExtensionReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.StorageConnectionExtensions(v) - case "storages": - v, err := XMLHostStorageReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Storages(v) - case "summary": - v, err := XMLVmSummaryReadOne(reader, &t, "summary") - if err != nil { - return nil, err - } - builder.Summary(v) - case "tags": - v, err := XMLTagReadMany(reader, &t) + case "active": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Tags(v) - case "transparent_hugepages": - v, err := XMLTransparentHugePagesReadOne(reader, &t, "transparent_hugepages") + builder.Active(v) + case "migrating": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.TransparentHugePages(v) - case "type": - vp, err := XMLHostTypeReadOne(reader, &t) - v := *vp + builder.Migrating(v) + case "total": + v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Type(v) - case "unmanaged_networks": - v, err := XMLUnmanagedNetworkReadMany(reader, &t) - if err != nil { - return nil, err + builder.Total(v) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } } - builder.UnmanagedNetworks(v) - case "update_available": - v, err := reader.ReadBool(&t) - if err != nil { - return nil, err + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) } - builder.UpdateAvailable(v) - case "version": - v, err := XMLVersionReadOne(reader, &t, "version") + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + } // end of switch + } // end of for-links + return one, nil +} + +func XMLVmSummaryReadMany(reader *XMLReader, start *xml.StartElement) (*VmSummarySlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result VmSummarySlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "vm_summary": + one, err := XMLVmSummaryReadOne(reader, &t, "vm_summary") if err != nil { return nil, err } - builder.Version(v) - case "vgpu_placement": - vp, err := XMLVgpuPlacementReadOne(reader, &t) + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLVnicPassThroughReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VnicPassThrough, error) { + builder := NewVnicPassThroughBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "vnic_pass_through" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "mode": + vp, err := XMLVnicPassThroughModeReadOne(reader, &t) v := *vp if err != nil { return nil, err } - builder.VgpuPlacement(v) + builder.Mode(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -35196,87 +35557,12 @@ func XMLHostReadOne(reader *XMLReader, start *xml.StartElement, expectedTag stri } for _, link := range links { switch *link.rel { - case "affinitylabels": - if one.affinityLabels == nil { - one.affinityLabels = new(AffinityLabelSlice) - } - one.affinityLabels.href = link.href - case "agents": - if one.agents == nil { - one.agents = new(AgentSlice) - } - one.agents.href = link.href - case "devices": - if one.devices == nil { - one.devices = new(HostDeviceSlice) - } - one.devices.href = link.href - case "externalnetworkproviderconfigurations": - if one.externalNetworkProviderConfigurations == nil { - one.externalNetworkProviderConfigurations = new(ExternalNetworkProviderConfigurationSlice) - } - one.externalNetworkProviderConfigurations.href = link.href - case "hooks": - if one.hooks == nil { - one.hooks = new(HookSlice) - } - one.hooks.href = link.href - case "katelloerrata": - if one.katelloErrata == nil { - one.katelloErrata = new(KatelloErratumSlice) - } - one.katelloErrata.href = link.href - case "networkattachments": - if one.networkAttachments == nil { - one.networkAttachments = new(NetworkAttachmentSlice) - } - one.networkAttachments.href = link.href - case "nics": - if one.nics == nil { - one.nics = new(HostNicSlice) - } - one.nics.href = link.href - case "numanodes": - if one.numaNodes == nil { - one.numaNodes = new(NumaNodeSlice) - } - one.numaNodes.href = link.href - case "permissions": - if one.permissions == nil { - one.permissions = new(PermissionSlice) - } - one.permissions.href = link.href - case "statistics": - if one.statistics == nil { - one.statistics = new(StatisticSlice) - } - one.statistics.href = link.href - case "storageconnectionextensions": - if one.storageConnectionExtensions == nil { - one.storageConnectionExtensions = new(StorageConnectionExtensionSlice) - } - one.storageConnectionExtensions.href = link.href - case "storages": - if one.storages == nil { - one.storages = new(HostStorageSlice) - } - one.storages.href = link.href - case "tags": - if one.tags == nil { - one.tags = new(TagSlice) - } - one.tags.href = link.href - case "unmanagednetworks": - if one.unmanagedNetworks == nil { - one.unmanagedNetworks = new(UnmanagedNetworkSlice) - } - one.unmanagedNetworks.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLHostReadMany(reader *XMLReader, start *xml.StartElement) (*HostSlice, error) { +func XMLVnicPassThroughReadMany(reader *XMLReader, start *xml.StartElement) (*VnicPassThroughSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35287,7 +35573,7 @@ func XMLHostReadMany(reader *XMLReader, start *xml.StartElement) (*HostSlice, er } start = st } - var result HostSlice + var result VnicPassThroughSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -35301,8 +35587,8 @@ func XMLHostReadMany(reader *XMLReader, start *xml.StartElement) (*HostSlice, er switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "host": - one, err := XMLHostReadOne(reader, &t, "host") + case "vnic_pass_through": + one, err := XMLVnicPassThroughReadOne(reader, &t, "vnic_pass_through") if err != nil { return nil, err } @@ -35319,8 +35605,8 @@ func XMLHostReadMany(reader *XMLReader, start *xml.StartElement) (*HostSlice, er return &result, nil } -func XMLNetworkAttachmentReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*NetworkAttachment, error) { - builder := NewNetworkAttachmentBuilder() +func XMLVnicProfileReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VnicProfile, error) { + builder := NewVnicProfileBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35332,7 +35618,7 @@ func XMLNetworkAttachmentReadOne(reader *XMLReader, start *xml.StartElement, exp start = st } if expectedTag == "" { - expectedTag = "network_attachment" + expectedTag = "vnic_profile" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -35368,72 +35654,199 @@ func XMLNetworkAttachmentReadOne(reader *XMLReader, start *xml.StartElement, exp return nil, err } builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + case "custom_properties": + v, err := XMLCustomPropertyReadMany(reader, &t) if err != nil { return nil, err } - builder.Description(v) - case "dns_resolver_configuration": - v, err := XMLDnsResolverConfigurationReadOne(reader, &t, "dns_resolver_configuration") + builder.CustomProperties(v) + case "description": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.DnsResolverConfiguration(v) - case "host": - v, err := XMLHostReadOne(reader, &t, "host") + builder.Description(v) + case "migratable": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Host(v) - case "host_nic": - v, err := XMLHostNicReadOne(reader, &t, "host_nic") + builder.Migratable(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.HostNic(v) - case "in_sync": - v, err := reader.ReadBool(&t) + builder.Name(v) + case "network": + v, err := XMLNetworkReadOne(reader, &t, "network") if err != nil { return nil, err } - builder.InSync(v) - case "ip_address_assignments": - v, err := XMLIpAddressAssignmentReadMany(reader, &t) + builder.Network(v) + case "network_filter": + v, err := XMLNetworkFilterReadOne(reader, &t, "network_filter") if err != nil { return nil, err } - builder.IpAddressAssignments(v) - case "name": - v, err := reader.ReadString(&t) + builder.NetworkFilter(v) + case "pass_through": + v, err := XMLVnicPassThroughReadOne(reader, &t, "pass_through") if err != nil { return nil, err } - builder.Name(v) - case "network": - v, err := XMLNetworkReadOne(reader, &t, "network") + builder.PassThrough(v) + case "permissions": + v, err := XMLPermissionReadMany(reader, &t) if err != nil { return nil, err } - builder.Network(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) + builder.Permissions(v) + case "port_mirroring": + v, err := reader.ReadBool(&t) if err != nil { return nil, err } - builder.Properties(v) + builder.PortMirroring(v) case "qos": v, err := XMLQosReadOne(reader, &t, "qos") if err != nil { return nil, err } builder.Qos(v) - case "reported_configurations": - v, err := XMLReportedConfigurationReadMany(reader, &t) + case "link": + var rel, href string + for _, attr := range t.Attr { + name := attr.Name.Local + value := attr.Value + switch name { + case "href": + href = value + case "rel": + rel = value + } + } + if rel != "" && href != "" { + links = append(links, Link{&href, &rel}) + } + // just has attributes, so must skip manually + reader.Skip() + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + one, err := builder.Build() + if err != nil { + return nil, err + } + for _, link := range links { + switch *link.rel { + case "permissions": + if one.permissions == nil { + one.permissions = new(PermissionSlice) + } + one.permissions.href = link.href + } // end of switch + } // end of for-links + return one, nil +} + +func XMLVnicProfileReadMany(reader *XMLReader, start *xml.StartElement) (*VnicProfileSlice, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var result VnicProfileSlice + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "vnic_profile": + one, err := XMLVnicProfileReadOne(reader, &t, "vnic_profile") if err != nil { return nil, err } - builder.ReportedConfigurations(v) + if one != nil { + result.slice = append(result.slice, one) + } + default: + reader.Skip() + } + case xml.EndElement: + depth-- + } + } + return &result, nil +} + +func XMLVnicProfileMappingReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VnicProfileMapping, error) { + builder := NewVnicProfileMappingBuilder() + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + if expectedTag == "" { + expectedTag = "vnic_profile_mapping" + } + if start.Name.Local != expectedTag { + return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} + } + var links []Link + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + switch t.Name.Local { + case "source_network_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.SourceNetworkName(v) + case "source_network_profile_name": + v, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + builder.SourceNetworkProfileName(v) + case "target_vnic_profile": + v, err := XMLVnicProfileReadOne(reader, &t, "target_vnic_profile") + if err != nil { + return nil, err + } + builder.TargetVnicProfile(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -35469,7 +35882,7 @@ func XMLNetworkAttachmentReadOne(reader *XMLReader, start *xml.StartElement, exp return one, nil } -func XMLNetworkAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (*NetworkAttachmentSlice, error) { +func XMLVnicProfileMappingReadMany(reader *XMLReader, start *xml.StartElement) (*VnicProfileMappingSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35480,7 +35893,7 @@ func XMLNetworkAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (* } start = st } - var result NetworkAttachmentSlice + var result VnicProfileMappingSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -35494,8 +35907,8 @@ func XMLNetworkAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (* switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "network_attachment": - one, err := XMLNetworkAttachmentReadOne(reader, &t, "network_attachment") + case "vnic_profile_mapping": + one, err := XMLVnicProfileMappingReadOne(reader, &t, "vnic_profile_mapping") if err != nil { return nil, err } @@ -35512,8 +35925,8 @@ func XMLNetworkAttachmentReadMany(reader *XMLReader, start *xml.StartElement) (* return &result, nil } -func XMLFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Filter, error) { - builder := NewFilterBuilder() +func XMLVolumeGroupReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*VolumeGroup, error) { + builder := NewVolumeGroupBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35525,7 +35938,7 @@ func XMLFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st start = st } if expectedTag == "" { - expectedTag = "filter" + expectedTag = "volume_group" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -35555,36 +35968,18 @@ func XMLFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Comment(v) - case "description": - v, err := reader.ReadString(&t) + case "logical_units": + v, err := XMLLogicalUnitReadMany(reader, &t) if err != nil { return nil, err } - builder.Description(v) + builder.LogicalUnits(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "position": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Position(v) - case "scheduling_policy_unit": - v, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") - if err != nil { - return nil, err - } - builder.SchedulingPolicyUnit(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -35620,7 +36015,7 @@ func XMLFilterReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return one, nil } -func XMLFilterReadMany(reader *XMLReader, start *xml.StartElement) (*FilterSlice, error) { +func XMLVolumeGroupReadMany(reader *XMLReader, start *xml.StartElement) (*VolumeGroupSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35631,7 +36026,7 @@ func XMLFilterReadMany(reader *XMLReader, start *xml.StartElement) (*FilterSlice } start = st } - var result FilterSlice + var result VolumeGroupSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -35645,8 +36040,8 @@ func XMLFilterReadMany(reader *XMLReader, start *xml.StartElement) (*FilterSlice switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "filter": - one, err := XMLFilterReadOne(reader, &t, "filter") + case "volume_group": + one, err := XMLVolumeGroupReadOne(reader, &t, "volume_group") if err != nil { return nil, err } @@ -35663,8 +36058,8 @@ func XMLFilterReadMany(reader *XMLReader, start *xml.StartElement) (*FilterSlice return &result, nil } -func XMLIscsiBondReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*IscsiBond, error) { - builder := NewIscsiBondBuilder() +func XMLWatchdogReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Watchdog, error) { + builder := NewWatchdogBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35676,7 +36071,7 @@ func XMLIscsiBondReadOne(reader *XMLReader, start *xml.StartElement, expectedTag start = st } if expectedTag == "" { - expectedTag = "iscsi_bond" + expectedTag = "watchdog" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -35706,42 +36101,62 @@ func XMLIscsiBondReadOne(reader *XMLReader, start *xml.StartElement, expectedTag switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "comment": - v, err := reader.ReadString(&t) + case "action": + vp, err := XMLWatchdogActionReadOne(reader, &t) + v := *vp if err != nil { return nil, err } - builder.Comment(v) - case "data_center": - v, err := XMLDataCenterReadOne(reader, &t, "data_center") + builder.Action(v) + case "comment": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.DataCenter(v) + builder.Comment(v) case "description": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Description(v) + case "instance_type": + v, err := XMLInstanceTypeReadOne(reader, &t, "instance_type") + if err != nil { + return nil, err + } + builder.InstanceType(v) + case "model": + vp, err := XMLWatchdogModelReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.Model(v) case "name": v, err := reader.ReadString(&t) if err != nil { return nil, err } builder.Name(v) - case "networks": - v, err := XMLNetworkReadMany(reader, &t) + case "template": + v, err := XMLTemplateReadOne(reader, &t, "template") if err != nil { return nil, err } - builder.Networks(v) - case "storage_connections": - v, err := XMLStorageConnectionReadMany(reader, &t) + builder.Template(v) + case "vm": + v, err := XMLVmReadOne(reader, &t, "vm") if err != nil { return nil, err } - builder.StorageConnections(v) + builder.Vm(v) + case "vms": + v, err := XMLVmReadMany(reader, &t) + if err != nil { + return nil, err + } + builder.Vms(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -35772,22 +36187,17 @@ func XMLIscsiBondReadOne(reader *XMLReader, start *xml.StartElement, expectedTag } for _, link := range links { switch *link.rel { - case "networks": - if one.networks == nil { - one.networks = new(NetworkSlice) - } - one.networks.href = link.href - case "storageconnections": - if one.storageConnections == nil { - one.storageConnections = new(StorageConnectionSlice) + case "vms": + if one.vms == nil { + one.vms = new(VmSlice) } - one.storageConnections.href = link.href + one.vms.href = link.href } // end of switch } // end of for-links return one, nil } -func XMLIscsiBondReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiBondSlice, error) { +func XMLWatchdogReadMany(reader *XMLReader, start *xml.StartElement) (*WatchdogSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35798,7 +36208,7 @@ func XMLIscsiBondReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiBon } start = st } - var result IscsiBondSlice + var result WatchdogSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -35812,8 +36222,8 @@ func XMLIscsiBondReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiBon switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "iscsi_bond": - one, err := XMLIscsiBondReadOne(reader, &t, "iscsi_bond") + case "watchdog": + one, err := XMLWatchdogReadOne(reader, &t, "watchdog") if err != nil { return nil, err } @@ -35830,8 +36240,8 @@ func XMLIscsiBondReadMany(reader *XMLReader, start *xml.StartElement) (*IscsiBon return &result, nil } -func XMLLinkLayerDiscoveryProtocolElementReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*LinkLayerDiscoveryProtocolElement, error) { - builder := NewLinkLayerDiscoveryProtocolElementBuilder() +func XMLWeightReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*Weight, error) { + builder := NewWeightBuilder() if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -35843,7 +36253,7 @@ func XMLLinkLayerDiscoveryProtocolElementReadOne(reader *XMLReader, start *xml.S start = st } if expectedTag == "" { - expectedTag = "link_layer_discovery_protocol_element" + expectedTag = "weight" } if start.Name.Local != expectedTag { return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} @@ -35885,170 +36295,30 @@ func XMLLinkLayerDiscoveryProtocolElementReadOne(reader *XMLReader, start *xml.S return nil, err } builder.Description(v) - case "name": - v, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - builder.Name(v) - case "oui": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Oui(v) - case "properties": - v, err := XMLPropertyReadMany(reader, &t) - if err != nil { - return nil, err - } - builder.Properties(v) - case "subtype": - v, err := reader.ReadInt64(&t) - if err != nil { - return nil, err - } - builder.Subtype(v) - case "type": + case "factor": v, err := reader.ReadInt64(&t) if err != nil { return nil, err } - builder.Type(v) - case "link": - var rel, href string - for _, attr := range t.Attr { - name := attr.Name.Local - value := attr.Value - switch name { - case "href": - href = value - case "rel": - rel = value - } - } - if rel != "" && href != "" { - links = append(links, Link{&href, &rel}) - } - // just has attributes, so must skip manually - reader.Skip() - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - one, err := builder.Build() - if err != nil { - return nil, err - } - for _, link := range links { - switch *link.rel { - } // end of switch - } // end of for-links - return one, nil -} - -func XMLLinkLayerDiscoveryProtocolElementReadMany(reader *XMLReader, start *xml.StartElement) (*LinkLayerDiscoveryProtocolElementSlice, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var result LinkLayerDiscoveryProtocolElementSlice - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "link_layer_discovery_protocol_element": - one, err := XMLLinkLayerDiscoveryProtocolElementReadOne(reader, &t, "link_layer_discovery_protocol_element") - if err != nil { - return nil, err - } - if one != nil { - result.slice = append(result.slice, one) - } - default: - reader.Skip() - } - case xml.EndElement: - depth-- - } - } - return &result, nil -} - -func XMLApiSummaryReadOne(reader *XMLReader, start *xml.StartElement, expectedTag string) (*ApiSummary, error) { - builder := NewApiSummaryBuilder() - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - if expectedTag == "" { - expectedTag = "api_summary" - } - if start.Name.Local != expectedTag { - return nil, XMLTagNotMatchError{start.Name.Local, expectedTag} - } - var links []Link - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - switch t.Name.Local { - case "hosts": - v, err := XMLApiSummaryItemReadOne(reader, &t, "hosts") - if err != nil { - return nil, err - } - builder.Hosts(v) - case "storage_domains": - v, err := XMLApiSummaryItemReadOne(reader, &t, "storage_domains") + builder.Factor(v) + case "name": + v, err := reader.ReadString(&t) if err != nil { return nil, err } - builder.StorageDomains(v) - case "users": - v, err := XMLApiSummaryItemReadOne(reader, &t, "users") + builder.Name(v) + case "scheduling_policy": + v, err := XMLSchedulingPolicyReadOne(reader, &t, "scheduling_policy") if err != nil { return nil, err } - builder.Users(v) - case "vms": - v, err := XMLApiSummaryItemReadOne(reader, &t, "vms") + builder.SchedulingPolicy(v) + case "scheduling_policy_unit": + v, err := XMLSchedulingPolicyUnitReadOne(reader, &t, "scheduling_policy_unit") if err != nil { return nil, err } - builder.Vms(v) + builder.SchedulingPolicyUnit(v) case "link": var rel, href string for _, attr := range t.Attr { @@ -36084,7 +36354,7 @@ func XMLApiSummaryReadOne(reader *XMLReader, start *xml.StartElement, expectedTa return one, nil } -func XMLApiSummaryReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSummarySlice, error) { +func XMLWeightReadMany(reader *XMLReader, start *xml.StartElement) (*WeightSlice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -36095,7 +36365,7 @@ func XMLApiSummaryReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSumm } start = st } - var result ApiSummarySlice + var result WeightSlice depth := 1 for depth > 0 { t, err := reader.Next() @@ -36109,8 +36379,8 @@ func XMLApiSummaryReadMany(reader *XMLReader, start *xml.StartElement) (*ApiSumm switch t := t.(type) { case xml.StartElement: switch t.Name.Local { - case "api_summary": - one, err := XMLApiSummaryReadOne(reader, &t, "api_summary") + case "weight": + one, err := XMLWeightReadOne(reader, &t, "weight") if err != nil { return nil, err } @@ -36438,6 +36708,13 @@ func XMLActionReadOne(reader *XMLReader, start *xml.StartElement, expectedTag st return nil, err } builder.AuthorizedKey(v) + case "auto_pinning_policy": + vp, err := XMLAutoPinningPolicyReadOne(reader, &t) + v := *vp + if err != nil { + return nil, err + } + builder.AutoPinningPolicy(v) case "bricks": v, err := XMLGlusterBrickReadMany(reader, &t) if err != nil { @@ -37033,62 +37310,6 @@ func XMLActionReadMany(reader *XMLReader, start *xml.StartElement) (*ActionSlice return &result, nil } -func XMLGlusterHookStatusReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterHookStatus, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - s, err := reader.ReadString(start) - if err != nil { - return nil, err - } - result := new(GlusterHookStatus) - *result = GlusterHookStatus(s) - return result, nil -} - -func XMLGlusterHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterHookStatus, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var results []GlusterHookStatus - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - one, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - results = append(results, GlusterHookStatus(one)) - case xml.EndElement: - depth-- - } - } - return results, nil -} - func XMLGlusterBrickStatusReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterBrickStatus, error) { if start == nil { st, err := reader.FindStartElement() @@ -37145,231 +37366,7 @@ func XMLGlusterBrickStatusReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLGlusterVolumeStatusReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeStatus, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - s, err := reader.ReadString(start) - if err != nil { - return nil, err - } - result := new(GlusterVolumeStatus) - *result = GlusterVolumeStatus(s) - return result, nil -} - -func XMLGlusterVolumeStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterVolumeStatus, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var results []GlusterVolumeStatus - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - one, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - results = append(results, GlusterVolumeStatus(one)) - case xml.EndElement: - depth-- - } - } - return results, nil -} - -func XMLNicInterfaceReadOne(reader *XMLReader, start *xml.StartElement) (*NicInterface, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - s, err := reader.ReadString(start) - if err != nil { - return nil, err - } - result := new(NicInterface) - *result = NicInterface(s) - return result, nil -} - -func XMLNicInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]NicInterface, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var results []NicInterface - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - one, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - results = append(results, NicInterface(one)) - case xml.EndElement: - depth-- - } - } - return results, nil -} - -func XMLGraphicsTypeReadOne(reader *XMLReader, start *xml.StartElement) (*GraphicsType, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - s, err := reader.ReadString(start) - if err != nil { - return nil, err - } - result := new(GraphicsType) - *result = GraphicsType(s) - return result, nil -} - -func XMLGraphicsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]GraphicsType, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var results []GraphicsType - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - one, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - results = append(results, GraphicsType(one)) - case xml.EndElement: - depth-- - } - } - return results, nil -} - -func XMLSnapshotStatusReadOne(reader *XMLReader, start *xml.StartElement) (*SnapshotStatus, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - s, err := reader.ReadString(start) - if err != nil { - return nil, err - } - result := new(SnapshotStatus) - *result = SnapshotStatus(s) - return result, nil -} - -func XMLSnapshotStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SnapshotStatus, error) { - if start == nil { - st, err := reader.FindStartElement() - if err != nil { - if err == io.EOF { - return nil, nil - } - return nil, err - } - start = st - } - var results []SnapshotStatus - depth := 1 - for depth > 0 { - t, err := reader.Next() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - t = xml.CopyToken(t) - switch t := t.(type) { - case xml.StartElement: - one, err := reader.ReadString(&t) - if err != nil { - return nil, err - } - results = append(results, SnapshotStatus(one)) - case xml.EndElement: - depth-- - } - } - return results, nil -} - -func XMLImageFileTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ImageFileType, error) { +func XMLGlusterHookStatusReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterHookStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37384,12 +37381,12 @@ func XMLImageFileTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Image if err != nil { return nil, err } - result := new(ImageFileType) - *result = ImageFileType(s) + result := new(GlusterHookStatus) + *result = GlusterHookStatus(s) return result, nil } -func XMLImageFileTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ImageFileType, error) { +func XMLGlusterHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterHookStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37400,7 +37397,7 @@ func XMLImageFileTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Ima } start = st } - var results []ImageFileType + var results []GlusterHookStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -37417,7 +37414,7 @@ func XMLImageFileTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Ima if err != nil { return nil, err } - results = append(results, ImageFileType(one)) + results = append(results, GlusterHookStatus(one)) case xml.EndElement: depth-- } @@ -37425,7 +37422,7 @@ func XMLImageFileTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Ima return results, nil } -func XMLDiskStorageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskStorageType, error) { +func XMLGlusterVolumeStatusReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37440,12 +37437,12 @@ func XMLDiskStorageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Dis if err != nil { return nil, err } - result := new(DiskStorageType) - *result = DiskStorageType(s) + result := new(GlusterVolumeStatus) + *result = GlusterVolumeStatus(s) return result, nil } -func XMLDiskStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskStorageType, error) { +func XMLGlusterVolumeStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterVolumeStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37456,7 +37453,7 @@ func XMLDiskStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]D } start = st } - var results []DiskStorageType + var results []GlusterVolumeStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -37473,7 +37470,7 @@ func XMLDiskStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]D if err != nil { return nil, err } - results = append(results, DiskStorageType(one)) + results = append(results, GlusterVolumeStatus(one)) case xml.EndElement: depth-- } @@ -37481,7 +37478,7 @@ func XMLDiskStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]D return results, nil } -func XMLSpmStatusReadOne(reader *XMLReader, start *xml.StartElement) (*SpmStatus, error) { +func XMLAccessProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*AccessProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37496,12 +37493,12 @@ func XMLSpmStatusReadOne(reader *XMLReader, start *xml.StartElement) (*SpmStatus if err != nil { return nil, err } - result := new(SpmStatus) - *result = SpmStatus(s) + result := new(AccessProtocol) + *result = AccessProtocol(s) return result, nil } -func XMLSpmStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SpmStatus, error) { +func XMLAccessProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]AccessProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37512,7 +37509,7 @@ func XMLSpmStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SpmStat } start = st } - var results []SpmStatus + var results []AccessProtocol depth := 1 for depth > 0 { t, err := reader.Next() @@ -37529,7 +37526,7 @@ func XMLSpmStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SpmStat if err != nil { return nil, err } - results = append(results, SpmStatus(one)) + results = append(results, AccessProtocol(one)) case xml.EndElement: depth-- } @@ -37537,7 +37534,7 @@ func XMLSpmStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SpmStat return results, nil } -func XMLImageTransferDirectionReadOne(reader *XMLReader, start *xml.StartElement) (*ImageTransferDirection, error) { +func XMLArchitectureReadOne(reader *XMLReader, start *xml.StartElement) (*Architecture, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37552,12 +37549,12 @@ func XMLImageTransferDirectionReadOne(reader *XMLReader, start *xml.StartElement if err != nil { return nil, err } - result := new(ImageTransferDirection) - *result = ImageTransferDirection(s) + result := new(Architecture) + *result = Architecture(s) return result, nil } -func XMLImageTransferDirectionReadMany(reader *XMLReader, start *xml.StartElement) ([]ImageTransferDirection, error) { +func XMLArchitectureReadMany(reader *XMLReader, start *xml.StartElement) ([]Architecture, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37568,7 +37565,7 @@ func XMLImageTransferDirectionReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var results []ImageTransferDirection + var results []Architecture depth := 1 for depth > 0 { t, err := reader.Next() @@ -37585,7 +37582,7 @@ func XMLImageTransferDirectionReadMany(reader *XMLReader, start *xml.StartElemen if err != nil { return nil, err } - results = append(results, ImageTransferDirection(one)) + results = append(results, Architecture(one)) case xml.EndElement: depth-- } @@ -37593,7 +37590,7 @@ func XMLImageTransferDirectionReadMany(reader *XMLReader, start *xml.StartElemen return results, nil } -func XMLAccessProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*AccessProtocol, error) { +func XMLAutoNumaStatusReadOne(reader *XMLReader, start *xml.StartElement) (*AutoNumaStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37608,12 +37605,12 @@ func XMLAccessProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*Acce if err != nil { return nil, err } - result := new(AccessProtocol) - *result = AccessProtocol(s) + result := new(AutoNumaStatus) + *result = AutoNumaStatus(s) return result, nil } -func XMLAccessProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]AccessProtocol, error) { +func XMLAutoNumaStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]AutoNumaStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37624,7 +37621,7 @@ func XMLAccessProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Ac } start = st } - var results []AccessProtocol + var results []AutoNumaStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -37641,7 +37638,7 @@ func XMLAccessProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Ac if err != nil { return nil, err } - results = append(results, AccessProtocol(one)) + results = append(results, AutoNumaStatus(one)) case xml.EndElement: depth-- } @@ -37649,7 +37646,7 @@ func XMLAccessProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Ac return results, nil } -func XMLStorageFormatReadOne(reader *XMLReader, start *xml.StartElement) (*StorageFormat, error) { +func XMLAutoPinningPolicyReadOne(reader *XMLReader, start *xml.StartElement) (*AutoPinningPolicy, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37664,12 +37661,12 @@ func XMLStorageFormatReadOne(reader *XMLReader, start *xml.StartElement) (*Stora if err != nil { return nil, err } - result := new(StorageFormat) - *result = StorageFormat(s) + result := new(AutoPinningPolicy) + *result = AutoPinningPolicy(s) return result, nil } -func XMLStorageFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageFormat, error) { +func XMLAutoPinningPolicyReadMany(reader *XMLReader, start *xml.StartElement) ([]AutoPinningPolicy, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37680,7 +37677,7 @@ func XMLStorageFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]Sto } start = st } - var results []StorageFormat + var results []AutoPinningPolicy depth := 1 for depth > 0 { t, err := reader.Next() @@ -37697,7 +37694,7 @@ func XMLStorageFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]Sto if err != nil { return nil, err } - results = append(results, StorageFormat(one)) + results = append(results, AutoPinningPolicy(one)) case xml.EndElement: depth-- } @@ -37705,7 +37702,7 @@ func XMLStorageFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]Sto return results, nil } -func XMLVnicPassThroughModeReadOne(reader *XMLReader, start *xml.StartElement) (*VnicPassThroughMode, error) { +func XMLBackupPhaseReadOne(reader *XMLReader, start *xml.StartElement) (*BackupPhase, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37720,12 +37717,12 @@ func XMLVnicPassThroughModeReadOne(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - result := new(VnicPassThroughMode) - *result = VnicPassThroughMode(s) + result := new(BackupPhase) + *result = BackupPhase(s) return result, nil } -func XMLVnicPassThroughModeReadMany(reader *XMLReader, start *xml.StartElement) ([]VnicPassThroughMode, error) { +func XMLBackupPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]BackupPhase, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37736,7 +37733,7 @@ func XMLVnicPassThroughModeReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var results []VnicPassThroughMode + var results []BackupPhase depth := 1 for depth > 0 { t, err := reader.Next() @@ -37753,7 +37750,7 @@ func XMLVnicPassThroughModeReadMany(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - results = append(results, VnicPassThroughMode(one)) + results = append(results, BackupPhase(one)) case xml.EndElement: depth-- } @@ -37761,7 +37758,7 @@ func XMLVnicPassThroughModeReadMany(reader *XMLReader, start *xml.StartElement) return results, nil } -func XMLNicStatusReadOne(reader *XMLReader, start *xml.StartElement) (*NicStatus, error) { +func XMLBiosTypeReadOne(reader *XMLReader, start *xml.StartElement) (*BiosType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37776,12 +37773,12 @@ func XMLNicStatusReadOne(reader *XMLReader, start *xml.StartElement) (*NicStatus if err != nil { return nil, err } - result := new(NicStatus) - *result = NicStatus(s) + result := new(BiosType) + *result = BiosType(s) return result, nil } -func XMLNicStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NicStatus, error) { +func XMLBiosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]BiosType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37792,7 +37789,7 @@ func XMLNicStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NicStat } start = st } - var results []NicStatus + var results []BiosType depth := 1 for depth > 0 { t, err := reader.Next() @@ -37809,7 +37806,7 @@ func XMLNicStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NicStat if err != nil { return nil, err } - results = append(results, NicStatus(one)) + results = append(results, BiosType(one)) case xml.EndElement: depth-- } @@ -37817,7 +37814,7 @@ func XMLNicStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NicStat return results, nil } -func XMLLogMaxMemoryUsedThresholdTypeReadOne(reader *XMLReader, start *xml.StartElement) (*LogMaxMemoryUsedThresholdType, error) { +func XMLBootDeviceReadOne(reader *XMLReader, start *xml.StartElement) (*BootDevice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37832,12 +37829,12 @@ func XMLLogMaxMemoryUsedThresholdTypeReadOne(reader *XMLReader, start *xml.Start if err != nil { return nil, err } - result := new(LogMaxMemoryUsedThresholdType) - *result = LogMaxMemoryUsedThresholdType(s) + result := new(BootDevice) + *result = BootDevice(s) return result, nil } -func XMLLogMaxMemoryUsedThresholdTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]LogMaxMemoryUsedThresholdType, error) { +func XMLBootDeviceReadMany(reader *XMLReader, start *xml.StartElement) ([]BootDevice, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37848,7 +37845,7 @@ func XMLLogMaxMemoryUsedThresholdTypeReadMany(reader *XMLReader, start *xml.Star } start = st } - var results []LogMaxMemoryUsedThresholdType + var results []BootDevice depth := 1 for depth > 0 { t, err := reader.Next() @@ -37865,7 +37862,7 @@ func XMLLogMaxMemoryUsedThresholdTypeReadMany(reader *XMLReader, start *xml.Star if err != nil { return nil, err } - results = append(results, LogMaxMemoryUsedThresholdType(one)) + results = append(results, BootDevice(one)) case xml.EndElement: depth-- } @@ -37873,7 +37870,7 @@ func XMLLogMaxMemoryUsedThresholdTypeReadMany(reader *XMLReader, start *xml.Star return results, nil } -func XMLNetworkStatusReadOne(reader *XMLReader, start *xml.StartElement) (*NetworkStatus, error) { +func XMLBootProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*BootProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37888,12 +37885,12 @@ func XMLNetworkStatusReadOne(reader *XMLReader, start *xml.StartElement) (*Netwo if err != nil { return nil, err } - result := new(NetworkStatus) - *result = NetworkStatus(s) + result := new(BootProtocol) + *result = BootProtocol(s) return result, nil } -func XMLNetworkStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NetworkStatus, error) { +func XMLBootProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]BootProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37904,7 +37901,7 @@ func XMLNetworkStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Net } start = st } - var results []NetworkStatus + var results []BootProtocol depth := 1 for depth > 0 { t, err := reader.Next() @@ -37921,7 +37918,7 @@ func XMLNetworkStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Net if err != nil { return nil, err } - results = append(results, NetworkStatus(one)) + results = append(results, BootProtocol(one)) case xml.EndElement: depth-- } @@ -37929,7 +37926,7 @@ func XMLNetworkStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Net return results, nil } -func XMLDiskStatusReadOne(reader *XMLReader, start *xml.StartElement) (*DiskStatus, error) { +func XMLCloudInitNetworkProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*CloudInitNetworkProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37944,12 +37941,12 @@ func XMLDiskStatusReadOne(reader *XMLReader, start *xml.StartElement) (*DiskStat if err != nil { return nil, err } - result := new(DiskStatus) - *result = DiskStatus(s) + result := new(CloudInitNetworkProtocol) + *result = CloudInitNetworkProtocol(s) return result, nil } -func XMLDiskStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskStatus, error) { +func XMLCloudInitNetworkProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]CloudInitNetworkProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -37960,7 +37957,7 @@ func XMLDiskStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskSt } start = st } - var results []DiskStatus + var results []CloudInitNetworkProtocol depth := 1 for depth > 0 { t, err := reader.Next() @@ -37977,7 +37974,7 @@ func XMLDiskStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskSt if err != nil { return nil, err } - results = append(results, DiskStatus(one)) + results = append(results, CloudInitNetworkProtocol(one)) case xml.EndElement: depth-- } @@ -37985,7 +37982,7 @@ func XMLDiskStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskSt return results, nil } -func XMLPolicyUnitTypeReadOne(reader *XMLReader, start *xml.StartElement) (*PolicyUnitType, error) { +func XMLClusterUpgradeActionReadOne(reader *XMLReader, start *xml.StartElement) (*ClusterUpgradeAction, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38000,12 +37997,12 @@ func XMLPolicyUnitTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Poli if err != nil { return nil, err } - result := new(PolicyUnitType) - *result = PolicyUnitType(s) + result := new(ClusterUpgradeAction) + *result = ClusterUpgradeAction(s) return result, nil } -func XMLPolicyUnitTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PolicyUnitType, error) { +func XMLClusterUpgradeActionReadMany(reader *XMLReader, start *xml.StartElement) ([]ClusterUpgradeAction, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38016,7 +38013,7 @@ func XMLPolicyUnitTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Po } start = st } - var results []PolicyUnitType + var results []ClusterUpgradeAction depth := 1 for depth > 0 { t, err := reader.Next() @@ -38033,7 +38030,7 @@ func XMLPolicyUnitTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Po if err != nil { return nil, err } - results = append(results, PolicyUnitType(one)) + results = append(results, ClusterUpgradeAction(one)) case xml.EndElement: depth-- } @@ -38041,7 +38038,7 @@ func XMLPolicyUnitTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Po return results, nil } -func XMLHookStageReadOne(reader *XMLReader, start *xml.StartElement) (*HookStage, error) { +func XMLConfigurationTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ConfigurationType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38056,12 +38053,12 @@ func XMLHookStageReadOne(reader *XMLReader, start *xml.StartElement) (*HookStage if err != nil { return nil, err } - result := new(HookStage) - *result = HookStage(s) + result := new(ConfigurationType) + *result = ConfigurationType(s) return result, nil } -func XMLHookStageReadMany(reader *XMLReader, start *xml.StartElement) ([]HookStage, error) { +func XMLConfigurationTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ConfigurationType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38072,7 +38069,7 @@ func XMLHookStageReadMany(reader *XMLReader, start *xml.StartElement) ([]HookSta } start = st } - var results []HookStage + var results []ConfigurationType depth := 1 for depth > 0 { t, err := reader.Next() @@ -38089,7 +38086,7 @@ func XMLHookStageReadMany(reader *XMLReader, start *xml.StartElement) ([]HookSta if err != nil { return nil, err } - results = append(results, HookStage(one)) + results = append(results, ConfigurationType(one)) case xml.EndElement: depth-- } @@ -38097,7 +38094,7 @@ func XMLHookStageReadMany(reader *XMLReader, start *xml.StartElement) ([]HookSta return results, nil } -func XMLNotifiableEventReadOne(reader *XMLReader, start *xml.StartElement) (*NotifiableEvent, error) { +func XMLCpuModeReadOne(reader *XMLReader, start *xml.StartElement) (*CpuMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38112,12 +38109,12 @@ func XMLNotifiableEventReadOne(reader *XMLReader, start *xml.StartElement) (*Not if err != nil { return nil, err } - result := new(NotifiableEvent) - *result = NotifiableEvent(s) + result := new(CpuMode) + *result = CpuMode(s) return result, nil } -func XMLNotifiableEventReadMany(reader *XMLReader, start *xml.StartElement) ([]NotifiableEvent, error) { +func XMLCpuModeReadMany(reader *XMLReader, start *xml.StartElement) ([]CpuMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38128,7 +38125,7 @@ func XMLNotifiableEventReadMany(reader *XMLReader, start *xml.StartElement) ([]N } start = st } - var results []NotifiableEvent + var results []CpuMode depth := 1 for depth > 0 { t, err := reader.Next() @@ -38145,7 +38142,7 @@ func XMLNotifiableEventReadMany(reader *XMLReader, start *xml.StartElement) ([]N if err != nil { return nil, err } - results = append(results, NotifiableEvent(one)) + results = append(results, CpuMode(one)) case xml.EndElement: depth-- } @@ -38209,7 +38206,7 @@ func XMLCreationStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Cr return results, nil } -func XMLConfigurationTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ConfigurationType, error) { +func XMLDataCenterStatusReadOne(reader *XMLReader, start *xml.StartElement) (*DataCenterStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38224,12 +38221,12 @@ func XMLConfigurationTypeReadOne(reader *XMLReader, start *xml.StartElement) (*C if err != nil { return nil, err } - result := new(ConfigurationType) - *result = ConfigurationType(s) + result := new(DataCenterStatus) + *result = DataCenterStatus(s) return result, nil } -func XMLConfigurationTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ConfigurationType, error) { +func XMLDataCenterStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DataCenterStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38240,7 +38237,7 @@ func XMLConfigurationTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ } start = st } - var results []ConfigurationType + var results []DataCenterStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -38257,7 +38254,7 @@ func XMLConfigurationTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ if err != nil { return nil, err } - results = append(results, ConfigurationType(one)) + results = append(results, DataCenterStatus(one)) case xml.EndElement: depth-- } @@ -38265,7 +38262,7 @@ func XMLConfigurationTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ return results, nil } -func XMLVgpuPlacementReadOne(reader *XMLReader, start *xml.StartElement) (*VgpuPlacement, error) { +func XMLDiskBackupReadOne(reader *XMLReader, start *xml.StartElement) (*DiskBackup, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38280,12 +38277,12 @@ func XMLVgpuPlacementReadOne(reader *XMLReader, start *xml.StartElement) (*VgpuP if err != nil { return nil, err } - result := new(VgpuPlacement) - *result = VgpuPlacement(s) + result := new(DiskBackup) + *result = DiskBackup(s) return result, nil } -func XMLVgpuPlacementReadMany(reader *XMLReader, start *xml.StartElement) ([]VgpuPlacement, error) { +func XMLDiskBackupReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskBackup, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38296,7 +38293,7 @@ func XMLVgpuPlacementReadMany(reader *XMLReader, start *xml.StartElement) ([]Vgp } start = st } - var results []VgpuPlacement + var results []DiskBackup depth := 1 for depth > 0 { t, err := reader.Next() @@ -38313,7 +38310,7 @@ func XMLVgpuPlacementReadMany(reader *XMLReader, start *xml.StartElement) ([]Vgp if err != nil { return nil, err } - results = append(results, VgpuPlacement(one)) + results = append(results, DiskBackup(one)) case xml.EndElement: depth-- } @@ -38321,7 +38318,7 @@ func XMLVgpuPlacementReadMany(reader *XMLReader, start *xml.StartElement) ([]Vgp return results, nil } -func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OpenstackVolumeAuthenticationKeyUsageType, error) { +func XMLDiskBackupModeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskBackupMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38336,12 +38333,12 @@ func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadOne(reader *XMLReader, star if err != nil { return nil, err } - result := new(OpenstackVolumeAuthenticationKeyUsageType) - *result = OpenstackVolumeAuthenticationKeyUsageType(s) + result := new(DiskBackupMode) + *result = DiskBackupMode(s) return result, nil } -func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OpenstackVolumeAuthenticationKeyUsageType, error) { +func XMLDiskBackupModeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskBackupMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38352,7 +38349,7 @@ func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadMany(reader *XMLReader, sta } start = st } - var results []OpenstackVolumeAuthenticationKeyUsageType + var results []DiskBackupMode depth := 1 for depth > 0 { t, err := reader.Next() @@ -38369,7 +38366,7 @@ func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadMany(reader *XMLReader, sta if err != nil { return nil, err } - results = append(results, OpenstackVolumeAuthenticationKeyUsageType(one)) + results = append(results, DiskBackupMode(one)) case xml.EndElement: depth-- } @@ -38377,7 +38374,7 @@ func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadMany(reader *XMLReader, sta return results, nil } -func XMLTransportTypeReadOne(reader *XMLReader, start *xml.StartElement) (*TransportType, error) { +func XMLDiskContentTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskContentType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38392,12 +38389,12 @@ func XMLTransportTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Trans if err != nil { return nil, err } - result := new(TransportType) - *result = TransportType(s) + result := new(DiskContentType) + *result = DiskContentType(s) return result, nil } -func XMLTransportTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]TransportType, error) { +func XMLDiskContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskContentType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38408,7 +38405,7 @@ func XMLTransportTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Tra } start = st } - var results []TransportType + var results []DiskContentType depth := 1 for depth > 0 { t, err := reader.Next() @@ -38425,7 +38422,7 @@ func XMLTransportTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Tra if err != nil { return nil, err } - results = append(results, TransportType(one)) + results = append(results, DiskContentType(one)) case xml.EndElement: depth-- } @@ -38433,7 +38430,7 @@ func XMLTransportTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Tra return results, nil } -func XMLExternalVmProviderTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ExternalVmProviderType, error) { +func XMLDiskFormatReadOne(reader *XMLReader, start *xml.StartElement) (*DiskFormat, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38448,12 +38445,12 @@ func XMLExternalVmProviderTypeReadOne(reader *XMLReader, start *xml.StartElement if err != nil { return nil, err } - result := new(ExternalVmProviderType) - *result = ExternalVmProviderType(s) + result := new(DiskFormat) + *result = DiskFormat(s) return result, nil } -func XMLExternalVmProviderTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ExternalVmProviderType, error) { +func XMLDiskFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskFormat, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38464,7 +38461,7 @@ func XMLExternalVmProviderTypeReadMany(reader *XMLReader, start *xml.StartElemen } start = st } - var results []ExternalVmProviderType + var results []DiskFormat depth := 1 for depth > 0 { t, err := reader.Next() @@ -38481,7 +38478,7 @@ func XMLExternalVmProviderTypeReadMany(reader *XMLReader, start *xml.StartElemen if err != nil { return nil, err } - results = append(results, ExternalVmProviderType(one)) + results = append(results, DiskFormat(one)) case xml.EndElement: depth-- } @@ -38489,7 +38486,7 @@ func XMLExternalVmProviderTypeReadMany(reader *XMLReader, start *xml.StartElemen return results, nil } -func XMLMessageBrokerTypeReadOne(reader *XMLReader, start *xml.StartElement) (*MessageBrokerType, error) { +func XMLDiskInterfaceReadOne(reader *XMLReader, start *xml.StartElement) (*DiskInterface, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38504,12 +38501,12 @@ func XMLMessageBrokerTypeReadOne(reader *XMLReader, start *xml.StartElement) (*M if err != nil { return nil, err } - result := new(MessageBrokerType) - *result = MessageBrokerType(s) + result := new(DiskInterface) + *result = DiskInterface(s) return result, nil } -func XMLMessageBrokerTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]MessageBrokerType, error) { +func XMLDiskInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskInterface, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38520,7 +38517,7 @@ func XMLMessageBrokerTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ } start = st } - var results []MessageBrokerType + var results []DiskInterface depth := 1 for depth > 0 { t, err := reader.Next() @@ -38537,7 +38534,7 @@ func XMLMessageBrokerTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ if err != nil { return nil, err } - results = append(results, MessageBrokerType(one)) + results = append(results, DiskInterface(one)) case xml.EndElement: depth-- } @@ -38545,7 +38542,7 @@ func XMLMessageBrokerTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ return results, nil } -func XMLBootDeviceReadOne(reader *XMLReader, start *xml.StartElement) (*BootDevice, error) { +func XMLDiskStatusReadOne(reader *XMLReader, start *xml.StartElement) (*DiskStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38560,12 +38557,12 @@ func XMLBootDeviceReadOne(reader *XMLReader, start *xml.StartElement) (*BootDevi if err != nil { return nil, err } - result := new(BootDevice) - *result = BootDevice(s) + result := new(DiskStatus) + *result = DiskStatus(s) return result, nil } -func XMLBootDeviceReadMany(reader *XMLReader, start *xml.StartElement) ([]BootDevice, error) { +func XMLDiskStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38576,7 +38573,7 @@ func XMLBootDeviceReadMany(reader *XMLReader, start *xml.StartElement) ([]BootDe } start = st } - var results []BootDevice + var results []DiskStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -38593,7 +38590,7 @@ func XMLBootDeviceReadMany(reader *XMLReader, start *xml.StartElement) ([]BootDe if err != nil { return nil, err } - results = append(results, BootDevice(one)) + results = append(results, DiskStatus(one)) case xml.EndElement: depth-- } @@ -38601,7 +38598,7 @@ func XMLBootDeviceReadMany(reader *XMLReader, start *xml.StartElement) ([]BootDe return results, nil } -func XMLStatisticKindReadOne(reader *XMLReader, start *xml.StartElement) (*StatisticKind, error) { +func XMLDiskStorageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskStorageType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38616,12 +38613,12 @@ func XMLStatisticKindReadOne(reader *XMLReader, start *xml.StartElement) (*Stati if err != nil { return nil, err } - result := new(StatisticKind) - *result = StatisticKind(s) + result := new(DiskStorageType) + *result = DiskStorageType(s) return result, nil } -func XMLStatisticKindReadMany(reader *XMLReader, start *xml.StartElement) ([]StatisticKind, error) { +func XMLDiskStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskStorageType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38632,7 +38629,7 @@ func XMLStatisticKindReadMany(reader *XMLReader, start *xml.StartElement) ([]Sta } start = st } - var results []StatisticKind + var results []DiskStorageType depth := 1 for depth > 0 { t, err := reader.Next() @@ -38649,7 +38646,7 @@ func XMLStatisticKindReadMany(reader *XMLReader, start *xml.StartElement) ([]Sta if err != nil { return nil, err } - results = append(results, StatisticKind(one)) + results = append(results, DiskStorageType(one)) case xml.EndElement: depth-- } @@ -38657,7 +38654,7 @@ func XMLStatisticKindReadMany(reader *XMLReader, start *xml.StartElement) ([]Sta return results, nil } -func XMLJobStatusReadOne(reader *XMLReader, start *xml.StartElement) (*JobStatus, error) { +func XMLDiskTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38672,12 +38669,12 @@ func XMLJobStatusReadOne(reader *XMLReader, start *xml.StartElement) (*JobStatus if err != nil { return nil, err } - result := new(JobStatus) - *result = JobStatus(s) + result := new(DiskType) + *result = DiskType(s) return result, nil } -func XMLJobStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]JobStatus, error) { +func XMLDiskTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38688,7 +38685,7 @@ func XMLJobStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]JobStat } start = st } - var results []JobStatus + var results []DiskType depth := 1 for depth > 0 { t, err := reader.Next() @@ -38705,7 +38702,7 @@ func XMLJobStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]JobStat if err != nil { return nil, err } - results = append(results, JobStatus(one)) + results = append(results, DiskType(one)) case xml.EndElement: depth-- } @@ -38713,7 +38710,7 @@ func XMLJobStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]JobStat return results, nil } -func XMLDiskBackupReadOne(reader *XMLReader, start *xml.StartElement) (*DiskBackup, error) { +func XMLDisplayTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DisplayType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38728,12 +38725,12 @@ func XMLDiskBackupReadOne(reader *XMLReader, start *xml.StartElement) (*DiskBack if err != nil { return nil, err } - result := new(DiskBackup) - *result = DiskBackup(s) + result := new(DisplayType) + *result = DisplayType(s) return result, nil } -func XMLDiskBackupReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskBackup, error) { +func XMLDisplayTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DisplayType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38744,7 +38741,7 @@ func XMLDiskBackupReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskBa } start = st } - var results []DiskBackup + var results []DisplayType depth := 1 for depth > 0 { t, err := reader.Next() @@ -38761,7 +38758,7 @@ func XMLDiskBackupReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskBa if err != nil { return nil, err } - results = append(results, DiskBackup(one)) + results = append(results, DisplayType(one)) case xml.EndElement: depth-- } @@ -38769,7 +38766,7 @@ func XMLDiskBackupReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskBa return results, nil } -func XMLQcowVersionReadOne(reader *XMLReader, start *xml.StartElement) (*QcowVersion, error) { +func XMLEntityExternalStatusReadOne(reader *XMLReader, start *xml.StartElement) (*EntityExternalStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38784,12 +38781,12 @@ func XMLQcowVersionReadOne(reader *XMLReader, start *xml.StartElement) (*QcowVer if err != nil { return nil, err } - result := new(QcowVersion) - *result = QcowVersion(s) + result := new(EntityExternalStatus) + *result = EntityExternalStatus(s) return result, nil } -func XMLQcowVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]QcowVersion, error) { +func XMLEntityExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]EntityExternalStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38800,7 +38797,7 @@ func XMLQcowVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]QcowV } start = st } - var results []QcowVersion + var results []EntityExternalStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -38817,7 +38814,175 @@ func XMLQcowVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]QcowV if err != nil { return nil, err } - results = append(results, QcowVersion(one)) + results = append(results, EntityExternalStatus(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLExternalStatusReadOne(reader *XMLReader, start *xml.StartElement) (*ExternalStatus, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(ExternalStatus) + *result = ExternalStatus(s) + return result, nil +} + +func XMLExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]ExternalStatus, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []ExternalStatus + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, ExternalStatus(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLExternalSystemTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ExternalSystemType, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(ExternalSystemType) + *result = ExternalSystemType(s) + return result, nil +} + +func XMLExternalSystemTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ExternalSystemType, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []ExternalSystemType + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, ExternalSystemType(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLExternalVmProviderTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ExternalVmProviderType, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(ExternalVmProviderType) + *result = ExternalVmProviderType(s) + return result, nil +} + +func XMLExternalVmProviderTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ExternalVmProviderType, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []ExternalVmProviderType + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, ExternalVmProviderType(one)) case xml.EndElement: depth-- } @@ -38881,7 +39046,7 @@ func XMLFenceTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]FenceTy return results, nil } -func XMLPowerManagementStatusReadOne(reader *XMLReader, start *xml.StartElement) (*PowerManagementStatus, error) { +func XMLFirewallTypeReadOne(reader *XMLReader, start *xml.StartElement) (*FirewallType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38896,12 +39061,12 @@ func XMLPowerManagementStatusReadOne(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - result := new(PowerManagementStatus) - *result = PowerManagementStatus(s) + result := new(FirewallType) + *result = FirewallType(s) return result, nil } -func XMLPowerManagementStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]PowerManagementStatus, error) { +func XMLFirewallTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]FirewallType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38912,7 +39077,7 @@ func XMLPowerManagementStatusReadMany(reader *XMLReader, start *xml.StartElement } start = st } - var results []PowerManagementStatus + var results []FirewallType depth := 1 for depth > 0 { t, err := reader.Next() @@ -38929,7 +39094,7 @@ func XMLPowerManagementStatusReadMany(reader *XMLReader, start *xml.StartElement if err != nil { return nil, err } - results = append(results, PowerManagementStatus(one)) + results = append(results, FirewallType(one)) case xml.EndElement: depth-- } @@ -38937,7 +39102,7 @@ func XMLPowerManagementStatusReadMany(reader *XMLReader, start *xml.StartElement return results, nil } -func XMLQosTypeReadOne(reader *XMLReader, start *xml.StartElement) (*QosType, error) { +func XMLGlusterStateReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterState, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38952,12 +39117,12 @@ func XMLQosTypeReadOne(reader *XMLReader, start *xml.StartElement) (*QosType, er if err != nil { return nil, err } - result := new(QosType) - *result = QosType(s) + result := new(GlusterState) + *result = GlusterState(s) return result, nil } -func XMLQosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QosType, error) { +func XMLGlusterStateReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterState, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -38968,7 +39133,7 @@ func XMLQosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QosType, } start = st } - var results []QosType + var results []GlusterState depth := 1 for depth > 0 { t, err := reader.Next() @@ -38985,7 +39150,7 @@ func XMLQosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QosType, if err != nil { return nil, err } - results = append(results, QosType(one)) + results = append(results, GlusterState(one)) case xml.EndElement: depth-- } @@ -38993,7 +39158,7 @@ func XMLQosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QosType, return results, nil } -func XMLStepEnumReadOne(reader *XMLReader, start *xml.StartElement) (*StepEnum, error) { +func XMLGlusterVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39008,12 +39173,12 @@ func XMLStepEnumReadOne(reader *XMLReader, start *xml.StartElement) (*StepEnum, if err != nil { return nil, err } - result := new(StepEnum) - *result = StepEnum(s) + result := new(GlusterVolumeType) + *result = GlusterVolumeType(s) return result, nil } -func XMLStepEnumReadMany(reader *XMLReader, start *xml.StartElement) ([]StepEnum, error) { +func XMLGlusterVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterVolumeType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39024,7 +39189,7 @@ func XMLStepEnumReadMany(reader *XMLReader, start *xml.StartElement) ([]StepEnum } start = st } - var results []StepEnum + var results []GlusterVolumeType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39041,7 +39206,7 @@ func XMLStepEnumReadMany(reader *XMLReader, start *xml.StartElement) ([]StepEnum if err != nil { return nil, err } - results = append(results, StepEnum(one)) + results = append(results, GlusterVolumeType(one)) case xml.EndElement: depth-- } @@ -39049,7 +39214,7 @@ func XMLStepEnumReadMany(reader *XMLReader, start *xml.StartElement) ([]StepEnum return results, nil } -func XMLSsoMethodReadOne(reader *XMLReader, start *xml.StartElement) (*SsoMethod, error) { +func XMLGraphicsTypeReadOne(reader *XMLReader, start *xml.StartElement) (*GraphicsType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39064,12 +39229,12 @@ func XMLSsoMethodReadOne(reader *XMLReader, start *xml.StartElement) (*SsoMethod if err != nil { return nil, err } - result := new(SsoMethod) - *result = SsoMethod(s) + result := new(GraphicsType) + *result = GraphicsType(s) return result, nil } -func XMLSsoMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SsoMethod, error) { +func XMLGraphicsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]GraphicsType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39080,7 +39245,7 @@ func XMLSsoMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SsoMeth } start = st } - var results []SsoMethod + var results []GraphicsType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39097,7 +39262,7 @@ func XMLSsoMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SsoMeth if err != nil { return nil, err } - results = append(results, SsoMethod(one)) + results = append(results, GraphicsType(one)) case xml.EndElement: depth-- } @@ -39105,7 +39270,7 @@ func XMLSsoMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SsoMeth return results, nil } -func XMLSnapshotTypeReadOne(reader *XMLReader, start *xml.StartElement) (*SnapshotType, error) { +func XMLHookContentTypeReadOne(reader *XMLReader, start *xml.StartElement) (*HookContentType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39120,12 +39285,12 @@ func XMLSnapshotTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Snapsh if err != nil { return nil, err } - result := new(SnapshotType) - *result = SnapshotType(s) + result := new(HookContentType) + *result = HookContentType(s) return result, nil } -func XMLSnapshotTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]SnapshotType, error) { +func XMLHookContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HookContentType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39136,7 +39301,7 @@ func XMLSnapshotTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Snap } start = st } - var results []SnapshotType + var results []HookContentType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39153,7 +39318,7 @@ func XMLSnapshotTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Snap if err != nil { return nil, err } - results = append(results, SnapshotType(one)) + results = append(results, HookContentType(one)) case xml.EndElement: depth-- } @@ -39161,7 +39326,7 @@ func XMLSnapshotTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Snap return results, nil } -func XMLGlusterStateReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterState, error) { +func XMLHookStageReadOne(reader *XMLReader, start *xml.StartElement) (*HookStage, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39176,12 +39341,12 @@ func XMLGlusterStateReadOne(reader *XMLReader, start *xml.StartElement) (*Gluste if err != nil { return nil, err } - result := new(GlusterState) - *result = GlusterState(s) + result := new(HookStage) + *result = HookStage(s) return result, nil } -func XMLGlusterStateReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterState, error) { +func XMLHookStageReadMany(reader *XMLReader, start *xml.StartElement) ([]HookStage, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39192,7 +39357,7 @@ func XMLGlusterStateReadMany(reader *XMLReader, start *xml.StartElement) ([]Glus } start = st } - var results []GlusterState + var results []HookStage depth := 1 for depth > 0 { t, err := reader.Next() @@ -39209,7 +39374,7 @@ func XMLGlusterStateReadMany(reader *XMLReader, start *xml.StartElement) ([]Glus if err != nil { return nil, err } - results = append(results, GlusterState(one)) + results = append(results, HookStage(one)) case xml.EndElement: depth-- } @@ -39217,7 +39382,7 @@ func XMLGlusterStateReadMany(reader *XMLReader, start *xml.StartElement) ([]Glus return results, nil } -func XMLNumaTuneModeReadOne(reader *XMLReader, start *xml.StartElement) (*NumaTuneMode, error) { +func XMLHookStatusReadOne(reader *XMLReader, start *xml.StartElement) (*HookStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39232,12 +39397,12 @@ func XMLNumaTuneModeReadOne(reader *XMLReader, start *xml.StartElement) (*NumaTu if err != nil { return nil, err } - result := new(NumaTuneMode) - *result = NumaTuneMode(s) + result := new(HookStatus) + *result = HookStatus(s) return result, nil } -func XMLNumaTuneModeReadMany(reader *XMLReader, start *xml.StartElement) ([]NumaTuneMode, error) { +func XMLHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HookStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39248,7 +39413,7 @@ func XMLNumaTuneModeReadMany(reader *XMLReader, start *xml.StartElement) ([]Numa } start = st } - var results []NumaTuneMode + var results []HookStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -39265,7 +39430,7 @@ func XMLNumaTuneModeReadMany(reader *XMLReader, start *xml.StartElement) ([]Numa if err != nil { return nil, err } - results = append(results, NumaTuneMode(one)) + results = append(results, HookStatus(one)) case xml.EndElement: depth-- } @@ -39273,7 +39438,7 @@ func XMLNumaTuneModeReadMany(reader *XMLReader, start *xml.StartElement) ([]Numa return results, nil } -func XMLMigrationBandwidthAssignmentMethodReadOne(reader *XMLReader, start *xml.StartElement) (*MigrationBandwidthAssignmentMethod, error) { +func XMLHostProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*HostProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39288,12 +39453,12 @@ func XMLMigrationBandwidthAssignmentMethodReadOne(reader *XMLReader, start *xml. if err != nil { return nil, err } - result := new(MigrationBandwidthAssignmentMethod) - *result = MigrationBandwidthAssignmentMethod(s) + result := new(HostProtocol) + *result = HostProtocol(s) return result, nil } -func XMLMigrationBandwidthAssignmentMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]MigrationBandwidthAssignmentMethod, error) { +func XMLHostProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]HostProtocol, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39304,7 +39469,7 @@ func XMLMigrationBandwidthAssignmentMethodReadMany(reader *XMLReader, start *xml } start = st } - var results []MigrationBandwidthAssignmentMethod + var results []HostProtocol depth := 1 for depth > 0 { t, err := reader.Next() @@ -39321,7 +39486,7 @@ func XMLMigrationBandwidthAssignmentMethodReadMany(reader *XMLReader, start *xml if err != nil { return nil, err } - results = append(results, MigrationBandwidthAssignmentMethod(one)) + results = append(results, HostProtocol(one)) case xml.EndElement: depth-- } @@ -39329,7 +39494,7 @@ func XMLMigrationBandwidthAssignmentMethodReadMany(reader *XMLReader, start *xml return results, nil } -func XMLBackupPhaseReadOne(reader *XMLReader, start *xml.StartElement) (*BackupPhase, error) { +func XMLHostStatusReadOne(reader *XMLReader, start *xml.StartElement) (*HostStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39344,12 +39509,12 @@ func XMLBackupPhaseReadOne(reader *XMLReader, start *xml.StartElement) (*BackupP if err != nil { return nil, err } - result := new(BackupPhase) - *result = BackupPhase(s) + result := new(HostStatus) + *result = HostStatus(s) return result, nil } -func XMLBackupPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]BackupPhase, error) { +func XMLHostStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HostStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39360,7 +39525,7 @@ func XMLBackupPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]Backu } start = st } - var results []BackupPhase + var results []HostStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -39377,7 +39542,7 @@ func XMLBackupPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]Backu if err != nil { return nil, err } - results = append(results, BackupPhase(one)) + results = append(results, HostStatus(one)) case xml.EndElement: depth-- } @@ -39385,7 +39550,7 @@ func XMLBackupPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]Backu return results, nil } -func XMLResolutionTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ResolutionType, error) { +func XMLHostTypeReadOne(reader *XMLReader, start *xml.StartElement) (*HostType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39400,12 +39565,12 @@ func XMLResolutionTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Reso if err != nil { return nil, err } - result := new(ResolutionType) - *result = ResolutionType(s) + result := new(HostType) + *result = HostType(s) return result, nil } -func XMLResolutionTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ResolutionType, error) { +func XMLHostTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HostType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39416,7 +39581,7 @@ func XMLResolutionTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Re } start = st } - var results []ResolutionType + var results []HostType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39433,7 +39598,7 @@ func XMLResolutionTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Re if err != nil { return nil, err } - results = append(results, ResolutionType(one)) + results = append(results, HostType(one)) case xml.EndElement: depth-- } @@ -39441,7 +39606,7 @@ func XMLResolutionTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Re return results, nil } -func XMLVmDeviceTypeReadOne(reader *XMLReader, start *xml.StartElement) (*VmDeviceType, error) { +func XMLImageFileTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ImageFileType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39456,12 +39621,12 @@ func XMLVmDeviceTypeReadOne(reader *XMLReader, start *xml.StartElement) (*VmDevi if err != nil { return nil, err } - result := new(VmDeviceType) - *result = VmDeviceType(s) + result := new(ImageFileType) + *result = ImageFileType(s) return result, nil } -func XMLVmDeviceTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmDeviceType, error) { +func XMLImageFileTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ImageFileType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39472,7 +39637,7 @@ func XMLVmDeviceTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmDe } start = st } - var results []VmDeviceType + var results []ImageFileType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39489,7 +39654,7 @@ func XMLVmDeviceTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmDe if err != nil { return nil, err } - results = append(results, VmDeviceType(one)) + results = append(results, ImageFileType(one)) case xml.EndElement: depth-- } @@ -39497,7 +39662,7 @@ func XMLVmDeviceTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmDe return results, nil } -func XMLIpVersionReadOne(reader *XMLReader, start *xml.StartElement) (*IpVersion, error) { +func XMLImageTransferDirectionReadOne(reader *XMLReader, start *xml.StartElement) (*ImageTransferDirection, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39512,12 +39677,12 @@ func XMLIpVersionReadOne(reader *XMLReader, start *xml.StartElement) (*IpVersion if err != nil { return nil, err } - result := new(IpVersion) - *result = IpVersion(s) + result := new(ImageTransferDirection) + *result = ImageTransferDirection(s) return result, nil } -func XMLIpVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]IpVersion, error) { +func XMLImageTransferDirectionReadMany(reader *XMLReader, start *xml.StartElement) ([]ImageTransferDirection, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39528,7 +39693,7 @@ func XMLIpVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]IpVersi } start = st } - var results []IpVersion + var results []ImageTransferDirection depth := 1 for depth > 0 { t, err := reader.Next() @@ -39545,7 +39710,7 @@ func XMLIpVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]IpVersi if err != nil { return nil, err } - results = append(results, IpVersion(one)) + results = append(results, ImageTransferDirection(one)) case xml.EndElement: depth-- } @@ -39553,7 +39718,7 @@ func XMLIpVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]IpVersi return results, nil } -func XMLValueTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ValueType, error) { +func XMLImageTransferPhaseReadOne(reader *XMLReader, start *xml.StartElement) (*ImageTransferPhase, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39568,12 +39733,12 @@ func XMLValueTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ValueType if err != nil { return nil, err } - result := new(ValueType) - *result = ValueType(s) + result := new(ImageTransferPhase) + *result = ImageTransferPhase(s) return result, nil } -func XMLValueTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ValueType, error) { +func XMLImageTransferPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]ImageTransferPhase, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39584,7 +39749,7 @@ func XMLValueTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ValueTy } start = st } - var results []ValueType + var results []ImageTransferPhase depth := 1 for depth > 0 { t, err := reader.Next() @@ -39601,7 +39766,7 @@ func XMLValueTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ValueTy if err != nil { return nil, err } - results = append(results, ValueType(one)) + results = append(results, ImageTransferPhase(one)) case xml.EndElement: depth-- } @@ -39609,7 +39774,7 @@ func XMLValueTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ValueTy return results, nil } -func XMLSshAuthenticationMethodReadOne(reader *XMLReader, start *xml.StartElement) (*SshAuthenticationMethod, error) { +func XMLInheritableBooleanReadOne(reader *XMLReader, start *xml.StartElement) (*InheritableBoolean, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39624,12 +39789,12 @@ func XMLSshAuthenticationMethodReadOne(reader *XMLReader, start *xml.StartElemen if err != nil { return nil, err } - result := new(SshAuthenticationMethod) - *result = SshAuthenticationMethod(s) + result := new(InheritableBoolean) + *result = InheritableBoolean(s) return result, nil } -func XMLSshAuthenticationMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SshAuthenticationMethod, error) { +func XMLInheritableBooleanReadMany(reader *XMLReader, start *xml.StartElement) ([]InheritableBoolean, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39640,7 +39805,7 @@ func XMLSshAuthenticationMethodReadMany(reader *XMLReader, start *xml.StartEleme } start = st } - var results []SshAuthenticationMethod + var results []InheritableBoolean depth := 1 for depth > 0 { t, err := reader.Next() @@ -39657,7 +39822,119 @@ func XMLSshAuthenticationMethodReadMany(reader *XMLReader, start *xml.StartEleme if err != nil { return nil, err } - results = append(results, SshAuthenticationMethod(one)) + results = append(results, InheritableBoolean(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLIpVersionReadOne(reader *XMLReader, start *xml.StartElement) (*IpVersion, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(IpVersion) + *result = IpVersion(s) + return result, nil +} + +func XMLIpVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]IpVersion, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []IpVersion + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, IpVersion(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLJobStatusReadOne(reader *XMLReader, start *xml.StartElement) (*JobStatus, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(JobStatus) + *result = JobStatus(s) + return result, nil +} + +func XMLJobStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]JobStatus, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []JobStatus + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, JobStatus(one)) case xml.EndElement: depth-- } @@ -39721,7 +39998,7 @@ func XMLKdumpStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Kdump return results, nil } -func XMLTemplateStatusReadOne(reader *XMLReader, start *xml.StartElement) (*TemplateStatus, error) { +func XMLLogMaxMemoryUsedThresholdTypeReadOne(reader *XMLReader, start *xml.StartElement) (*LogMaxMemoryUsedThresholdType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39736,12 +40013,12 @@ func XMLTemplateStatusReadOne(reader *XMLReader, start *xml.StartElement) (*Temp if err != nil { return nil, err } - result := new(TemplateStatus) - *result = TemplateStatus(s) + result := new(LogMaxMemoryUsedThresholdType) + *result = LogMaxMemoryUsedThresholdType(s) return result, nil } -func XMLTemplateStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]TemplateStatus, error) { +func XMLLogMaxMemoryUsedThresholdTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]LogMaxMemoryUsedThresholdType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39752,7 +40029,7 @@ func XMLTemplateStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Te } start = st } - var results []TemplateStatus + var results []LogMaxMemoryUsedThresholdType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39769,7 +40046,7 @@ func XMLTemplateStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Te if err != nil { return nil, err } - results = append(results, TemplateStatus(one)) + results = append(results, LogMaxMemoryUsedThresholdType(one)) case xml.EndElement: depth-- } @@ -39777,7 +40054,7 @@ func XMLTemplateStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Te return results, nil } -func XMLNetworkUsageReadOne(reader *XMLReader, start *xml.StartElement) (*NetworkUsage, error) { +func XMLLogSeverityReadOne(reader *XMLReader, start *xml.StartElement) (*LogSeverity, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39792,12 +40069,12 @@ func XMLNetworkUsageReadOne(reader *XMLReader, start *xml.StartElement) (*Networ if err != nil { return nil, err } - result := new(NetworkUsage) - *result = NetworkUsage(s) + result := new(LogSeverity) + *result = LogSeverity(s) return result, nil } -func XMLNetworkUsageReadMany(reader *XMLReader, start *xml.StartElement) ([]NetworkUsage, error) { +func XMLLogSeverityReadMany(reader *XMLReader, start *xml.StartElement) ([]LogSeverity, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39808,7 +40085,7 @@ func XMLNetworkUsageReadMany(reader *XMLReader, start *xml.StartElement) ([]Netw } start = st } - var results []NetworkUsage + var results []LogSeverity depth := 1 for depth > 0 { t, err := reader.Next() @@ -39825,7 +40102,7 @@ func XMLNetworkUsageReadMany(reader *XMLReader, start *xml.StartElement) ([]Netw if err != nil { return nil, err } - results = append(results, NetworkUsage(one)) + results = append(results, LogSeverity(one)) case xml.EndElement: depth-- } @@ -39833,7 +40110,7 @@ func XMLNetworkUsageReadMany(reader *XMLReader, start *xml.StartElement) ([]Netw return results, nil } -func XMLStepStatusReadOne(reader *XMLReader, start *xml.StartElement) (*StepStatus, error) { +func XMLLunStatusReadOne(reader *XMLReader, start *xml.StartElement) (*LunStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39848,12 +40125,12 @@ func XMLStepStatusReadOne(reader *XMLReader, start *xml.StartElement) (*StepStat if err != nil { return nil, err } - result := new(StepStatus) - *result = StepStatus(s) + result := new(LunStatus) + *result = LunStatus(s) return result, nil } -func XMLStepStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StepStatus, error) { +func XMLLunStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]LunStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39864,7 +40141,7 @@ func XMLStepStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StepSt } start = st } - var results []StepStatus + var results []LunStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -39881,7 +40158,7 @@ func XMLStepStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StepSt if err != nil { return nil, err } - results = append(results, StepStatus(one)) + results = append(results, LunStatus(one)) case xml.EndElement: depth-- } @@ -39889,7 +40166,7 @@ func XMLStepStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StepSt return results, nil } -func XMLLunStatusReadOne(reader *XMLReader, start *xml.StartElement) (*LunStatus, error) { +func XMLMessageBrokerTypeReadOne(reader *XMLReader, start *xml.StartElement) (*MessageBrokerType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39904,12 +40181,12 @@ func XMLLunStatusReadOne(reader *XMLReader, start *xml.StartElement) (*LunStatus if err != nil { return nil, err } - result := new(LunStatus) - *result = LunStatus(s) + result := new(MessageBrokerType) + *result = MessageBrokerType(s) return result, nil } -func XMLLunStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]LunStatus, error) { +func XMLMessageBrokerTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]MessageBrokerType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39920,7 +40197,7 @@ func XMLLunStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]LunStat } start = st } - var results []LunStatus + var results []MessageBrokerType depth := 1 for depth > 0 { t, err := reader.Next() @@ -39937,7 +40214,7 @@ func XMLLunStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]LunStat if err != nil { return nil, err } - results = append(results, LunStatus(one)) + results = append(results, MessageBrokerType(one)) case xml.EndElement: depth-- } @@ -39945,7 +40222,7 @@ func XMLLunStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]LunStat return results, nil } -func XMLNetworkPluginTypeReadOne(reader *XMLReader, start *xml.StartElement) (*NetworkPluginType, error) { +func XMLMigrateOnErrorReadOne(reader *XMLReader, start *xml.StartElement) (*MigrateOnError, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39960,12 +40237,12 @@ func XMLNetworkPluginTypeReadOne(reader *XMLReader, start *xml.StartElement) (*N if err != nil { return nil, err } - result := new(NetworkPluginType) - *result = NetworkPluginType(s) + result := new(MigrateOnError) + *result = MigrateOnError(s) return result, nil } -func XMLNetworkPluginTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]NetworkPluginType, error) { +func XMLMigrateOnErrorReadMany(reader *XMLReader, start *xml.StartElement) ([]MigrateOnError, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -39976,7 +40253,7 @@ func XMLNetworkPluginTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ } start = st } - var results []NetworkPluginType + var results []MigrateOnError depth := 1 for depth > 0 { t, err := reader.Next() @@ -39993,7 +40270,7 @@ func XMLNetworkPluginTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ if err != nil { return nil, err } - results = append(results, NetworkPluginType(one)) + results = append(results, MigrateOnError(one)) case xml.EndElement: depth-- } @@ -40001,7 +40278,7 @@ func XMLNetworkPluginTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ return results, nil } -func XMLHostProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*HostProtocol, error) { +func XMLMigrationBandwidthAssignmentMethodReadOne(reader *XMLReader, start *xml.StartElement) (*MigrationBandwidthAssignmentMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40016,12 +40293,12 @@ func XMLHostProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*HostPr if err != nil { return nil, err } - result := new(HostProtocol) - *result = HostProtocol(s) + result := new(MigrationBandwidthAssignmentMethod) + *result = MigrationBandwidthAssignmentMethod(s) return result, nil } -func XMLHostProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]HostProtocol, error) { +func XMLMigrationBandwidthAssignmentMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]MigrationBandwidthAssignmentMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40032,7 +40309,7 @@ func XMLHostProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Host } start = st } - var results []HostProtocol + var results []MigrationBandwidthAssignmentMethod depth := 1 for depth > 0 { t, err := reader.Next() @@ -40049,7 +40326,7 @@ func XMLHostProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Host if err != nil { return nil, err } - results = append(results, HostProtocol(one)) + results = append(results, MigrationBandwidthAssignmentMethod(one)) case xml.EndElement: depth-- } @@ -40057,7 +40334,7 @@ func XMLHostProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Host return results, nil } -func XMLFirewallTypeReadOne(reader *XMLReader, start *xml.StartElement) (*FirewallType, error) { +func XMLNetworkPluginTypeReadOne(reader *XMLReader, start *xml.StartElement) (*NetworkPluginType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40072,12 +40349,12 @@ func XMLFirewallTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Firewa if err != nil { return nil, err } - result := new(FirewallType) - *result = FirewallType(s) + result := new(NetworkPluginType) + *result = NetworkPluginType(s) return result, nil } -func XMLFirewallTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]FirewallType, error) { +func XMLNetworkPluginTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]NetworkPluginType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40088,7 +40365,7 @@ func XMLFirewallTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Fire } start = st } - var results []FirewallType + var results []NetworkPluginType depth := 1 for depth > 0 { t, err := reader.Next() @@ -40105,7 +40382,7 @@ func XMLFirewallTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Fire if err != nil { return nil, err } - results = append(results, FirewallType(one)) + results = append(results, NetworkPluginType(one)) case xml.EndElement: depth-- } @@ -40113,7 +40390,7 @@ func XMLFirewallTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Fire return results, nil } -func XMLVmStorageErrorResumeBehaviourReadOne(reader *XMLReader, start *xml.StartElement) (*VmStorageErrorResumeBehaviour, error) { +func XMLNetworkStatusReadOne(reader *XMLReader, start *xml.StartElement) (*NetworkStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40128,12 +40405,12 @@ func XMLVmStorageErrorResumeBehaviourReadOne(reader *XMLReader, start *xml.Start if err != nil { return nil, err } - result := new(VmStorageErrorResumeBehaviour) - *result = VmStorageErrorResumeBehaviour(s) + result := new(NetworkStatus) + *result = NetworkStatus(s) return result, nil } -func XMLVmStorageErrorResumeBehaviourReadMany(reader *XMLReader, start *xml.StartElement) ([]VmStorageErrorResumeBehaviour, error) { +func XMLNetworkStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NetworkStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40144,7 +40421,7 @@ func XMLVmStorageErrorResumeBehaviourReadMany(reader *XMLReader, start *xml.Star } start = st } - var results []VmStorageErrorResumeBehaviour + var results []NetworkStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -40161,7 +40438,7 @@ func XMLVmStorageErrorResumeBehaviourReadMany(reader *XMLReader, start *xml.Star if err != nil { return nil, err } - results = append(results, VmStorageErrorResumeBehaviour(one)) + results = append(results, NetworkStatus(one)) case xml.EndElement: depth-- } @@ -40169,7 +40446,7 @@ func XMLVmStorageErrorResumeBehaviourReadMany(reader *XMLReader, start *xml.Star return results, nil } -func XMLSeLinuxModeReadOne(reader *XMLReader, start *xml.StartElement) (*SeLinuxMode, error) { +func XMLNetworkUsageReadOne(reader *XMLReader, start *xml.StartElement) (*NetworkUsage, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40184,12 +40461,12 @@ func XMLSeLinuxModeReadOne(reader *XMLReader, start *xml.StartElement) (*SeLinux if err != nil { return nil, err } - result := new(SeLinuxMode) - *result = SeLinuxMode(s) + result := new(NetworkUsage) + *result = NetworkUsage(s) return result, nil } -func XMLSeLinuxModeReadMany(reader *XMLReader, start *xml.StartElement) ([]SeLinuxMode, error) { +func XMLNetworkUsageReadMany(reader *XMLReader, start *xml.StartElement) ([]NetworkUsage, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40200,7 +40477,7 @@ func XMLSeLinuxModeReadMany(reader *XMLReader, start *xml.StartElement) ([]SeLin } start = st } - var results []SeLinuxMode + var results []NetworkUsage depth := 1 for depth > 0 { t, err := reader.Next() @@ -40217,7 +40494,7 @@ func XMLSeLinuxModeReadMany(reader *XMLReader, start *xml.StartElement) ([]SeLin if err != nil { return nil, err } - results = append(results, SeLinuxMode(one)) + results = append(results, NetworkUsage(one)) case xml.EndElement: depth-- } @@ -40225,7 +40502,7 @@ func XMLSeLinuxModeReadMany(reader *XMLReader, start *xml.StartElement) ([]SeLin return results, nil } -func XMLStorageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*StorageType, error) { +func XMLNfsVersionReadOne(reader *XMLReader, start *xml.StartElement) (*NfsVersion, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40240,12 +40517,12 @@ func XMLStorageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Storage if err != nil { return nil, err } - result := new(StorageType) - *result = StorageType(s) + result := new(NfsVersion) + *result = NfsVersion(s) return result, nil } -func XMLStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageType, error) { +func XMLNfsVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]NfsVersion, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40256,7 +40533,7 @@ func XMLStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Stora } start = st } - var results []StorageType + var results []NfsVersion depth := 1 for depth > 0 { t, err := reader.Next() @@ -40273,7 +40550,7 @@ func XMLStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Stora if err != nil { return nil, err } - results = append(results, StorageType(one)) + results = append(results, NfsVersion(one)) case xml.EndElement: depth-- } @@ -40281,7 +40558,7 @@ func XMLStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Stora return results, nil } -func XMLOpenStackNetworkProviderTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OpenStackNetworkProviderType, error) { +func XMLNicInterfaceReadOne(reader *XMLReader, start *xml.StartElement) (*NicInterface, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40296,12 +40573,12 @@ func XMLOpenStackNetworkProviderTypeReadOne(reader *XMLReader, start *xml.StartE if err != nil { return nil, err } - result := new(OpenStackNetworkProviderType) - *result = OpenStackNetworkProviderType(s) + result := new(NicInterface) + *result = NicInterface(s) return result, nil } -func XMLOpenStackNetworkProviderTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OpenStackNetworkProviderType, error) { +func XMLNicInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]NicInterface, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40312,7 +40589,7 @@ func XMLOpenStackNetworkProviderTypeReadMany(reader *XMLReader, start *xml.Start } start = st } - var results []OpenStackNetworkProviderType + var results []NicInterface depth := 1 for depth > 0 { t, err := reader.Next() @@ -40329,7 +40606,7 @@ func XMLOpenStackNetworkProviderTypeReadMany(reader *XMLReader, start *xml.Start if err != nil { return nil, err } - results = append(results, OpenStackNetworkProviderType(one)) + results = append(results, NicInterface(one)) case xml.EndElement: depth-- } @@ -40337,7 +40614,7 @@ func XMLOpenStackNetworkProviderTypeReadMany(reader *XMLReader, start *xml.Start return results, nil } -func XMLSerialNumberPolicyReadOne(reader *XMLReader, start *xml.StartElement) (*SerialNumberPolicy, error) { +func XMLNicStatusReadOne(reader *XMLReader, start *xml.StartElement) (*NicStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40352,12 +40629,12 @@ func XMLSerialNumberPolicyReadOne(reader *XMLReader, start *xml.StartElement) (* if err != nil { return nil, err } - result := new(SerialNumberPolicy) - *result = SerialNumberPolicy(s) + result := new(NicStatus) + *result = NicStatus(s) return result, nil } -func XMLSerialNumberPolicyReadMany(reader *XMLReader, start *xml.StartElement) ([]SerialNumberPolicy, error) { +func XMLNicStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]NicStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40368,7 +40645,7 @@ func XMLSerialNumberPolicyReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var results []SerialNumberPolicy + var results []NicStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -40385,7 +40662,7 @@ func XMLSerialNumberPolicyReadMany(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - results = append(results, SerialNumberPolicy(one)) + results = append(results, NicStatus(one)) case xml.EndElement: depth-- } @@ -40393,7 +40670,7 @@ func XMLSerialNumberPolicyReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLEntityExternalStatusReadOne(reader *XMLReader, start *xml.StartElement) (*EntityExternalStatus, error) { +func XMLNotifiableEventReadOne(reader *XMLReader, start *xml.StartElement) (*NotifiableEvent, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40408,12 +40685,12 @@ func XMLEntityExternalStatusReadOne(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - result := new(EntityExternalStatus) - *result = EntityExternalStatus(s) + result := new(NotifiableEvent) + *result = NotifiableEvent(s) return result, nil } -func XMLEntityExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]EntityExternalStatus, error) { +func XMLNotifiableEventReadMany(reader *XMLReader, start *xml.StartElement) ([]NotifiableEvent, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40424,7 +40701,7 @@ func XMLEntityExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var results []EntityExternalStatus + var results []NotifiableEvent depth := 1 for depth > 0 { t, err := reader.Next() @@ -40441,7 +40718,7 @@ func XMLEntityExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - results = append(results, EntityExternalStatus(one)) + results = append(results, NotifiableEvent(one)) case xml.EndElement: depth-- } @@ -40449,7 +40726,7 @@ func XMLEntityExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) return results, nil } -func XMLScsiGenericIOReadOne(reader *XMLReader, start *xml.StartElement) (*ScsiGenericIO, error) { +func XMLNotificationMethodReadOne(reader *XMLReader, start *xml.StartElement) (*NotificationMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40464,12 +40741,12 @@ func XMLScsiGenericIOReadOne(reader *XMLReader, start *xml.StartElement) (*ScsiG if err != nil { return nil, err } - result := new(ScsiGenericIO) - *result = ScsiGenericIO(s) + result := new(NotificationMethod) + *result = NotificationMethod(s) return result, nil } -func XMLScsiGenericIOReadMany(reader *XMLReader, start *xml.StartElement) ([]ScsiGenericIO, error) { +func XMLNotificationMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]NotificationMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40480,7 +40757,7 @@ func XMLScsiGenericIOReadMany(reader *XMLReader, start *xml.StartElement) ([]Scs } start = st } - var results []ScsiGenericIO + var results []NotificationMethod depth := 1 for depth > 0 { t, err := reader.Next() @@ -40497,7 +40774,7 @@ func XMLScsiGenericIOReadMany(reader *XMLReader, start *xml.StartElement) ([]Scs if err != nil { return nil, err } - results = append(results, ScsiGenericIO(one)) + results = append(results, NotificationMethod(one)) case xml.EndElement: depth-- } @@ -40505,7 +40782,7 @@ func XMLScsiGenericIOReadMany(reader *XMLReader, start *xml.StartElement) ([]Scs return results, nil } -func XMLCloudInitNetworkProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*CloudInitNetworkProtocol, error) { +func XMLNumaTuneModeReadOne(reader *XMLReader, start *xml.StartElement) (*NumaTuneMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40520,12 +40797,12 @@ func XMLCloudInitNetworkProtocolReadOne(reader *XMLReader, start *xml.StartEleme if err != nil { return nil, err } - result := new(CloudInitNetworkProtocol) - *result = CloudInitNetworkProtocol(s) + result := new(NumaTuneMode) + *result = NumaTuneMode(s) return result, nil } -func XMLCloudInitNetworkProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]CloudInitNetworkProtocol, error) { +func XMLNumaTuneModeReadMany(reader *XMLReader, start *xml.StartElement) ([]NumaTuneMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40536,7 +40813,7 @@ func XMLCloudInitNetworkProtocolReadMany(reader *XMLReader, start *xml.StartElem } start = st } - var results []CloudInitNetworkProtocol + var results []NumaTuneMode depth := 1 for depth > 0 { t, err := reader.Next() @@ -40553,7 +40830,7 @@ func XMLCloudInitNetworkProtocolReadMany(reader *XMLReader, start *xml.StartElem if err != nil { return nil, err } - results = append(results, CloudInitNetworkProtocol(one)) + results = append(results, NumaTuneMode(one)) case xml.EndElement: depth-- } @@ -40561,7 +40838,7 @@ func XMLCloudInitNetworkProtocolReadMany(reader *XMLReader, start *xml.StartElem return results, nil } -func XMLSwitchTypeReadOne(reader *XMLReader, start *xml.StartElement) (*SwitchType, error) { +func XMLOpenStackNetworkProviderTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OpenStackNetworkProviderType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40576,12 +40853,12 @@ func XMLSwitchTypeReadOne(reader *XMLReader, start *xml.StartElement) (*SwitchTy if err != nil { return nil, err } - result := new(SwitchType) - *result = SwitchType(s) + result := new(OpenStackNetworkProviderType) + *result = OpenStackNetworkProviderType(s) return result, nil } -func XMLSwitchTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]SwitchType, error) { +func XMLOpenStackNetworkProviderTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OpenStackNetworkProviderType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40592,7 +40869,7 @@ func XMLSwitchTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Switch } start = st } - var results []SwitchType + var results []OpenStackNetworkProviderType depth := 1 for depth > 0 { t, err := reader.Next() @@ -40609,7 +40886,7 @@ func XMLSwitchTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Switch if err != nil { return nil, err } - results = append(results, SwitchType(one)) + results = append(results, OpenStackNetworkProviderType(one)) case xml.EndElement: depth-- } @@ -40617,7 +40894,7 @@ func XMLSwitchTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Switch return results, nil } -func XMLDiskTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskType, error) { +func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OpenstackVolumeAuthenticationKeyUsageType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40632,12 +40909,12 @@ func XMLDiskTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskType, if err != nil { return nil, err } - result := new(DiskType) - *result = DiskType(s) + result := new(OpenstackVolumeAuthenticationKeyUsageType) + *result = OpenstackVolumeAuthenticationKeyUsageType(s) return result, nil } -func XMLDiskTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskType, error) { +func XMLOpenstackVolumeAuthenticationKeyUsageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OpenstackVolumeAuthenticationKeyUsageType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40648,7 +40925,7 @@ func XMLDiskTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskType } start = st } - var results []DiskType + var results []OpenstackVolumeAuthenticationKeyUsageType depth := 1 for depth > 0 { t, err := reader.Next() @@ -40665,7 +40942,7 @@ func XMLDiskTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskType if err != nil { return nil, err } - results = append(results, DiskType(one)) + results = append(results, OpenstackVolumeAuthenticationKeyUsageType(one)) case xml.EndElement: depth-- } @@ -40673,7 +40950,7 @@ func XMLDiskTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskType return results, nil } -func XMLDiskInterfaceReadOne(reader *XMLReader, start *xml.StartElement) (*DiskInterface, error) { +func XMLOsTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OsType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40688,12 +40965,12 @@ func XMLDiskInterfaceReadOne(reader *XMLReader, start *xml.StartElement) (*DiskI if err != nil { return nil, err } - result := new(DiskInterface) - *result = DiskInterface(s) + result := new(OsType) + *result = OsType(s) return result, nil } -func XMLDiskInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskInterface, error) { +func XMLOsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OsType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40704,7 +40981,7 @@ func XMLDiskInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]Dis } start = st } - var results []DiskInterface + var results []OsType depth := 1 for depth > 0 { t, err := reader.Next() @@ -40721,7 +40998,7 @@ func XMLDiskInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]Dis if err != nil { return nil, err } - results = append(results, DiskInterface(one)) + results = append(results, OsType(one)) case xml.EndElement: depth-- } @@ -40729,7 +41006,7 @@ func XMLDiskInterfaceReadMany(reader *XMLReader, start *xml.StartElement) ([]Dis return results, nil } -func XMLDisplayTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DisplayType, error) { +func XMLPayloadEncodingReadOne(reader *XMLReader, start *xml.StartElement) (*PayloadEncoding, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40744,12 +41021,12 @@ func XMLDisplayTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Display if err != nil { return nil, err } - result := new(DisplayType) - *result = DisplayType(s) + result := new(PayloadEncoding) + *result = PayloadEncoding(s) return result, nil } -func XMLDisplayTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DisplayType, error) { +func XMLPayloadEncodingReadMany(reader *XMLReader, start *xml.StartElement) ([]PayloadEncoding, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40760,7 +41037,7 @@ func XMLDisplayTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Displ } start = st } - var results []DisplayType + var results []PayloadEncoding depth := 1 for depth > 0 { t, err := reader.Next() @@ -40777,7 +41054,7 @@ func XMLDisplayTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Displ if err != nil { return nil, err } - results = append(results, DisplayType(one)) + results = append(results, PayloadEncoding(one)) case xml.EndElement: depth-- } @@ -40785,7 +41062,7 @@ func XMLDisplayTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Displ return results, nil } -func XMLInheritableBooleanReadOne(reader *XMLReader, start *xml.StartElement) (*InheritableBoolean, error) { +func XMLPmProxyTypeReadOne(reader *XMLReader, start *xml.StartElement) (*PmProxyType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40800,12 +41077,12 @@ func XMLInheritableBooleanReadOne(reader *XMLReader, start *xml.StartElement) (* if err != nil { return nil, err } - result := new(InheritableBoolean) - *result = InheritableBoolean(s) + result := new(PmProxyType) + *result = PmProxyType(s) return result, nil } -func XMLInheritableBooleanReadMany(reader *XMLReader, start *xml.StartElement) ([]InheritableBoolean, error) { +func XMLPmProxyTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PmProxyType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40816,7 +41093,7 @@ func XMLInheritableBooleanReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var results []InheritableBoolean + var results []PmProxyType depth := 1 for depth > 0 { t, err := reader.Next() @@ -40833,7 +41110,7 @@ func XMLInheritableBooleanReadMany(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - results = append(results, InheritableBoolean(one)) + results = append(results, PmProxyType(one)) case xml.EndElement: depth-- } @@ -40841,7 +41118,7 @@ func XMLInheritableBooleanReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLOsTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OsType, error) { +func XMLPolicyUnitTypeReadOne(reader *XMLReader, start *xml.StartElement) (*PolicyUnitType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40856,12 +41133,12 @@ func XMLOsTypeReadOne(reader *XMLReader, start *xml.StartElement) (*OsType, erro if err != nil { return nil, err } - result := new(OsType) - *result = OsType(s) + result := new(PolicyUnitType) + *result = PolicyUnitType(s) return result, nil } -func XMLOsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OsType, error) { +func XMLPolicyUnitTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PolicyUnitType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40872,7 +41149,7 @@ func XMLOsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OsType, er } start = st } - var results []OsType + var results []PolicyUnitType depth := 1 for depth > 0 { t, err := reader.Next() @@ -40889,7 +41166,7 @@ func XMLOsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OsType, er if err != nil { return nil, err } - results = append(results, OsType(one)) + results = append(results, PolicyUnitType(one)) case xml.EndElement: depth-- } @@ -40897,7 +41174,7 @@ func XMLOsTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]OsType, er return results, nil } -func XMLImageTransferPhaseReadOne(reader *XMLReader, start *xml.StartElement) (*ImageTransferPhase, error) { +func XMLPowerManagementStatusReadOne(reader *XMLReader, start *xml.StartElement) (*PowerManagementStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40912,12 +41189,12 @@ func XMLImageTransferPhaseReadOne(reader *XMLReader, start *xml.StartElement) (* if err != nil { return nil, err } - result := new(ImageTransferPhase) - *result = ImageTransferPhase(s) + result := new(PowerManagementStatus) + *result = PowerManagementStatus(s) return result, nil } -func XMLImageTransferPhaseReadMany(reader *XMLReader, start *xml.StartElement) ([]ImageTransferPhase, error) { +func XMLPowerManagementStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]PowerManagementStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40928,7 +41205,7 @@ func XMLImageTransferPhaseReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var results []ImageTransferPhase + var results []PowerManagementStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -40945,7 +41222,7 @@ func XMLImageTransferPhaseReadMany(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - results = append(results, ImageTransferPhase(one)) + results = append(results, PowerManagementStatus(one)) case xml.EndElement: depth-- } @@ -40953,7 +41230,7 @@ func XMLImageTransferPhaseReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLCpuModeReadOne(reader *XMLReader, start *xml.StartElement) (*CpuMode, error) { +func XMLQcowVersionReadOne(reader *XMLReader, start *xml.StartElement) (*QcowVersion, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40968,12 +41245,12 @@ func XMLCpuModeReadOne(reader *XMLReader, start *xml.StartElement) (*CpuMode, er if err != nil { return nil, err } - result := new(CpuMode) - *result = CpuMode(s) + result := new(QcowVersion) + *result = QcowVersion(s) return result, nil } -func XMLCpuModeReadMany(reader *XMLReader, start *xml.StartElement) ([]CpuMode, error) { +func XMLQcowVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]QcowVersion, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -40984,7 +41261,7 @@ func XMLCpuModeReadMany(reader *XMLReader, start *xml.StartElement) ([]CpuMode, } start = st } - var results []CpuMode + var results []QcowVersion depth := 1 for depth > 0 { t, err := reader.Next() @@ -41001,7 +41278,7 @@ func XMLCpuModeReadMany(reader *XMLReader, start *xml.StartElement) ([]CpuMode, if err != nil { return nil, err } - results = append(results, CpuMode(one)) + results = append(results, QcowVersion(one)) case xml.EndElement: depth-- } @@ -41009,7 +41286,7 @@ func XMLCpuModeReadMany(reader *XMLReader, start *xml.StartElement) ([]CpuMode, return results, nil } -func XMLHostTypeReadOne(reader *XMLReader, start *xml.StartElement) (*HostType, error) { +func XMLQosTypeReadOne(reader *XMLReader, start *xml.StartElement) (*QosType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41024,12 +41301,12 @@ func XMLHostTypeReadOne(reader *XMLReader, start *xml.StartElement) (*HostType, if err != nil { return nil, err } - result := new(HostType) - *result = HostType(s) + result := new(QosType) + *result = QosType(s) return result, nil } -func XMLHostTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HostType, error) { +func XMLQosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QosType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41040,7 +41317,7 @@ func XMLHostTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HostType } start = st } - var results []HostType + var results []QosType depth := 1 for depth > 0 { t, err := reader.Next() @@ -41057,7 +41334,7 @@ func XMLHostTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HostType if err != nil { return nil, err } - results = append(results, HostType(one)) + results = append(results, QosType(one)) case xml.EndElement: depth-- } @@ -41065,7 +41342,7 @@ func XMLHostTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HostType return results, nil } -func XMLBootProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*BootProtocol, error) { +func XMLQuotaModeTypeReadOne(reader *XMLReader, start *xml.StartElement) (*QuotaModeType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41080,12 +41357,12 @@ func XMLBootProtocolReadOne(reader *XMLReader, start *xml.StartElement) (*BootPr if err != nil { return nil, err } - result := new(BootProtocol) - *result = BootProtocol(s) + result := new(QuotaModeType) + *result = QuotaModeType(s) return result, nil } -func XMLBootProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]BootProtocol, error) { +func XMLQuotaModeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QuotaModeType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41096,7 +41373,7 @@ func XMLBootProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Boot } start = st } - var results []BootProtocol + var results []QuotaModeType depth := 1 for depth > 0 { t, err := reader.Next() @@ -41113,7 +41390,7 @@ func XMLBootProtocolReadMany(reader *XMLReader, start *xml.StartElement) ([]Boot if err != nil { return nil, err } - results = append(results, BootProtocol(one)) + results = append(results, QuotaModeType(one)) case xml.EndElement: depth-- } @@ -41177,7 +41454,7 @@ func XMLReportedDeviceTypeReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLHookContentTypeReadOne(reader *XMLReader, start *xml.StartElement) (*HookContentType, error) { +func XMLResolutionTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ResolutionType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41192,12 +41469,12 @@ func XMLHookContentTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Hoo if err != nil { return nil, err } - result := new(HookContentType) - *result = HookContentType(s) + result := new(ResolutionType) + *result = ResolutionType(s) return result, nil } -func XMLHookContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]HookContentType, error) { +func XMLResolutionTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ResolutionType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41208,7 +41485,7 @@ func XMLHookContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]H } start = st } - var results []HookContentType + var results []ResolutionType depth := 1 for depth > 0 { t, err := reader.Next() @@ -41225,7 +41502,7 @@ func XMLHookContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]H if err != nil { return nil, err } - results = append(results, HookContentType(one)) + results = append(results, ResolutionType(one)) case xml.EndElement: depth-- } @@ -41233,7 +41510,7 @@ func XMLHookContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]H return results, nil } -func XMLStorageDomainStatusReadOne(reader *XMLReader, start *xml.StartElement) (*StorageDomainStatus, error) { +func XMLRngSourceReadOne(reader *XMLReader, start *xml.StartElement) (*RngSource, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41248,12 +41525,12 @@ func XMLStorageDomainStatusReadOne(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - result := new(StorageDomainStatus) - *result = StorageDomainStatus(s) + result := new(RngSource) + *result = RngSource(s) return result, nil } -func XMLStorageDomainStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageDomainStatus, error) { +func XMLRngSourceReadMany(reader *XMLReader, start *xml.StartElement) ([]RngSource, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41264,7 +41541,7 @@ func XMLStorageDomainStatusReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var results []StorageDomainStatus + var results []RngSource depth := 1 for depth > 0 { t, err := reader.Next() @@ -41281,7 +41558,7 @@ func XMLStorageDomainStatusReadMany(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - results = append(results, StorageDomainStatus(one)) + results = append(results, RngSource(one)) case xml.EndElement: depth-- } @@ -41289,7 +41566,7 @@ func XMLStorageDomainStatusReadMany(reader *XMLReader, start *xml.StartElement) return results, nil } -func XMLWatchdogActionReadOne(reader *XMLReader, start *xml.StartElement) (*WatchdogAction, error) { +func XMLRoleTypeReadOne(reader *XMLReader, start *xml.StartElement) (*RoleType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41304,12 +41581,12 @@ func XMLWatchdogActionReadOne(reader *XMLReader, start *xml.StartElement) (*Watc if err != nil { return nil, err } - result := new(WatchdogAction) - *result = WatchdogAction(s) + result := new(RoleType) + *result = RoleType(s) return result, nil } -func XMLWatchdogActionReadMany(reader *XMLReader, start *xml.StartElement) ([]WatchdogAction, error) { +func XMLRoleTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]RoleType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41320,7 +41597,7 @@ func XMLWatchdogActionReadMany(reader *XMLReader, start *xml.StartElement) ([]Wa } start = st } - var results []WatchdogAction + var results []RoleType depth := 1 for depth > 0 { t, err := reader.Next() @@ -41337,7 +41614,7 @@ func XMLWatchdogActionReadMany(reader *XMLReader, start *xml.StartElement) ([]Wa if err != nil { return nil, err } - results = append(results, WatchdogAction(one)) + results = append(results, RoleType(one)) case xml.EndElement: depth-- } @@ -41345,7 +41622,7 @@ func XMLWatchdogActionReadMany(reader *XMLReader, start *xml.StartElement) ([]Wa return results, nil } -func XMLHookStatusReadOne(reader *XMLReader, start *xml.StartElement) (*HookStatus, error) { +func XMLScsiGenericIOReadOne(reader *XMLReader, start *xml.StartElement) (*ScsiGenericIO, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41360,12 +41637,12 @@ func XMLHookStatusReadOne(reader *XMLReader, start *xml.StartElement) (*HookStat if err != nil { return nil, err } - result := new(HookStatus) - *result = HookStatus(s) + result := new(ScsiGenericIO) + *result = ScsiGenericIO(s) return result, nil } -func XMLHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HookStatus, error) { +func XMLScsiGenericIOReadMany(reader *XMLReader, start *xml.StartElement) ([]ScsiGenericIO, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41376,7 +41653,7 @@ func XMLHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HookSt } start = st } - var results []HookStatus + var results []ScsiGenericIO depth := 1 for depth > 0 { t, err := reader.Next() @@ -41393,7 +41670,7 @@ func XMLHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HookSt if err != nil { return nil, err } - results = append(results, HookStatus(one)) + results = append(results, ScsiGenericIO(one)) case xml.EndElement: depth-- } @@ -41401,7 +41678,7 @@ func XMLHookStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HookSt return results, nil } -func XMLStatisticUnitReadOne(reader *XMLReader, start *xml.StartElement) (*StatisticUnit, error) { +func XMLSeLinuxModeReadOne(reader *XMLReader, start *xml.StartElement) (*SeLinuxMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41416,12 +41693,12 @@ func XMLStatisticUnitReadOne(reader *XMLReader, start *xml.StartElement) (*Stati if err != nil { return nil, err } - result := new(StatisticUnit) - *result = StatisticUnit(s) + result := new(SeLinuxMode) + *result = SeLinuxMode(s) return result, nil } -func XMLStatisticUnitReadMany(reader *XMLReader, start *xml.StartElement) ([]StatisticUnit, error) { +func XMLSeLinuxModeReadMany(reader *XMLReader, start *xml.StartElement) ([]SeLinuxMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41432,7 +41709,7 @@ func XMLStatisticUnitReadMany(reader *XMLReader, start *xml.StartElement) ([]Sta } start = st } - var results []StatisticUnit + var results []SeLinuxMode depth := 1 for depth > 0 { t, err := reader.Next() @@ -41449,7 +41726,7 @@ func XMLStatisticUnitReadMany(reader *XMLReader, start *xml.StartElement) ([]Sta if err != nil { return nil, err } - results = append(results, StatisticUnit(one)) + results = append(results, SeLinuxMode(one)) case xml.EndElement: depth-- } @@ -41457,7 +41734,7 @@ func XMLStatisticUnitReadMany(reader *XMLReader, start *xml.StartElement) ([]Sta return results, nil } -func XMLArchitectureReadOne(reader *XMLReader, start *xml.StartElement) (*Architecture, error) { +func XMLSerialNumberPolicyReadOne(reader *XMLReader, start *xml.StartElement) (*SerialNumberPolicy, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41472,12 +41749,12 @@ func XMLArchitectureReadOne(reader *XMLReader, start *xml.StartElement) (*Archit if err != nil { return nil, err } - result := new(Architecture) - *result = Architecture(s) + result := new(SerialNumberPolicy) + *result = SerialNumberPolicy(s) return result, nil } -func XMLArchitectureReadMany(reader *XMLReader, start *xml.StartElement) ([]Architecture, error) { +func XMLSerialNumberPolicyReadMany(reader *XMLReader, start *xml.StartElement) ([]SerialNumberPolicy, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41488,7 +41765,7 @@ func XMLArchitectureReadMany(reader *XMLReader, start *xml.StartElement) ([]Arch } start = st } - var results []Architecture + var results []SerialNumberPolicy depth := 1 for depth > 0 { t, err := reader.Next() @@ -41505,7 +41782,7 @@ func XMLArchitectureReadMany(reader *XMLReader, start *xml.StartElement) ([]Arch if err != nil { return nil, err } - results = append(results, Architecture(one)) + results = append(results, SerialNumberPolicy(one)) case xml.EndElement: depth-- } @@ -41513,7 +41790,7 @@ func XMLArchitectureReadMany(reader *XMLReader, start *xml.StartElement) ([]Arch return results, nil } -func XMLNfsVersionReadOne(reader *XMLReader, start *xml.StartElement) (*NfsVersion, error) { +func XMLSnapshotStatusReadOne(reader *XMLReader, start *xml.StartElement) (*SnapshotStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41528,12 +41805,12 @@ func XMLNfsVersionReadOne(reader *XMLReader, start *xml.StartElement) (*NfsVersi if err != nil { return nil, err } - result := new(NfsVersion) - *result = NfsVersion(s) + result := new(SnapshotStatus) + *result = SnapshotStatus(s) return result, nil } -func XMLNfsVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]NfsVersion, error) { +func XMLSnapshotStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SnapshotStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41544,7 +41821,7 @@ func XMLNfsVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]NfsVer } start = st } - var results []NfsVersion + var results []SnapshotStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -41561,7 +41838,7 @@ func XMLNfsVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]NfsVer if err != nil { return nil, err } - results = append(results, NfsVersion(one)) + results = append(results, SnapshotStatus(one)) case xml.EndElement: depth-- } @@ -41569,7 +41846,7 @@ func XMLNfsVersionReadMany(reader *XMLReader, start *xml.StartElement) ([]NfsVer return results, nil } -func XMLGlusterVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement) (*GlusterVolumeType, error) { +func XMLSnapshotTypeReadOne(reader *XMLReader, start *xml.StartElement) (*SnapshotType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41584,12 +41861,12 @@ func XMLGlusterVolumeTypeReadOne(reader *XMLReader, start *xml.StartElement) (*G if err != nil { return nil, err } - result := new(GlusterVolumeType) - *result = GlusterVolumeType(s) + result := new(SnapshotType) + *result = SnapshotType(s) return result, nil } -func XMLGlusterVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]GlusterVolumeType, error) { +func XMLSnapshotTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]SnapshotType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41600,7 +41877,7 @@ func XMLGlusterVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ } start = st } - var results []GlusterVolumeType + var results []SnapshotType depth := 1 for depth > 0 { t, err := reader.Next() @@ -41617,7 +41894,7 @@ func XMLGlusterVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ if err != nil { return nil, err } - results = append(results, GlusterVolumeType(one)) + results = append(results, SnapshotType(one)) case xml.EndElement: depth-- } @@ -41625,7 +41902,7 @@ func XMLGlusterVolumeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ return results, nil } -func XMLDiskContentTypeReadOne(reader *XMLReader, start *xml.StartElement) (*DiskContentType, error) { +func XMLSpmStatusReadOne(reader *XMLReader, start *xml.StartElement) (*SpmStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41640,12 +41917,12 @@ func XMLDiskContentTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Dis if err != nil { return nil, err } - result := new(DiskContentType) - *result = DiskContentType(s) + result := new(SpmStatus) + *result = SpmStatus(s) return result, nil } -func XMLDiskContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskContentType, error) { +func XMLSpmStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]SpmStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41656,7 +41933,7 @@ func XMLDiskContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]D } start = st } - var results []DiskContentType + var results []SpmStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -41673,7 +41950,7 @@ func XMLDiskContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]D if err != nil { return nil, err } - results = append(results, DiskContentType(one)) + results = append(results, SpmStatus(one)) case xml.EndElement: depth-- } @@ -41681,7 +41958,7 @@ func XMLDiskContentTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]D return results, nil } -func XMLVmAffinityReadOne(reader *XMLReader, start *xml.StartElement) (*VmAffinity, error) { +func XMLSshAuthenticationMethodReadOne(reader *XMLReader, start *xml.StartElement) (*SshAuthenticationMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41696,12 +41973,12 @@ func XMLVmAffinityReadOne(reader *XMLReader, start *xml.StartElement) (*VmAffini if err != nil { return nil, err } - result := new(VmAffinity) - *result = VmAffinity(s) + result := new(SshAuthenticationMethod) + *result = SshAuthenticationMethod(s) return result, nil } -func XMLVmAffinityReadMany(reader *XMLReader, start *xml.StartElement) ([]VmAffinity, error) { +func XMLSshAuthenticationMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SshAuthenticationMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41712,7 +41989,7 @@ func XMLVmAffinityReadMany(reader *XMLReader, start *xml.StartElement) ([]VmAffi } start = st } - var results []VmAffinity + var results []SshAuthenticationMethod depth := 1 for depth > 0 { t, err := reader.Next() @@ -41729,7 +42006,7 @@ func XMLVmAffinityReadMany(reader *XMLReader, start *xml.StartElement) ([]VmAffi if err != nil { return nil, err } - results = append(results, VmAffinity(one)) + results = append(results, SshAuthenticationMethod(one)) case xml.EndElement: depth-- } @@ -41737,7 +42014,7 @@ func XMLVmAffinityReadMany(reader *XMLReader, start *xml.StartElement) ([]VmAffi return results, nil } -func XMLAutoNumaStatusReadOne(reader *XMLReader, start *xml.StartElement) (*AutoNumaStatus, error) { +func XMLSsoMethodReadOne(reader *XMLReader, start *xml.StartElement) (*SsoMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41752,12 +42029,12 @@ func XMLAutoNumaStatusReadOne(reader *XMLReader, start *xml.StartElement) (*Auto if err != nil { return nil, err } - result := new(AutoNumaStatus) - *result = AutoNumaStatus(s) + result := new(SsoMethod) + *result = SsoMethod(s) return result, nil } -func XMLAutoNumaStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]AutoNumaStatus, error) { +func XMLSsoMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]SsoMethod, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41768,7 +42045,7 @@ func XMLAutoNumaStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Au } start = st } - var results []AutoNumaStatus + var results []SsoMethod depth := 1 for depth > 0 { t, err := reader.Next() @@ -41785,7 +42062,7 @@ func XMLAutoNumaStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Au if err != nil { return nil, err } - results = append(results, AutoNumaStatus(one)) + results = append(results, SsoMethod(one)) case xml.EndElement: depth-- } @@ -41793,7 +42070,7 @@ func XMLAutoNumaStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Au return results, nil } -func XMLClusterUpgradeActionReadOne(reader *XMLReader, start *xml.StartElement) (*ClusterUpgradeAction, error) { +func XMLStatisticKindReadOne(reader *XMLReader, start *xml.StartElement) (*StatisticKind, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41808,12 +42085,12 @@ func XMLClusterUpgradeActionReadOne(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - result := new(ClusterUpgradeAction) - *result = ClusterUpgradeAction(s) + result := new(StatisticKind) + *result = StatisticKind(s) return result, nil } -func XMLClusterUpgradeActionReadMany(reader *XMLReader, start *xml.StartElement) ([]ClusterUpgradeAction, error) { +func XMLStatisticKindReadMany(reader *XMLReader, start *xml.StartElement) ([]StatisticKind, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41824,7 +42101,7 @@ func XMLClusterUpgradeActionReadMany(reader *XMLReader, start *xml.StartElement) } start = st } - var results []ClusterUpgradeAction + var results []StatisticKind depth := 1 for depth > 0 { t, err := reader.Next() @@ -41841,7 +42118,7 @@ func XMLClusterUpgradeActionReadMany(reader *XMLReader, start *xml.StartElement) if err != nil { return nil, err } - results = append(results, ClusterUpgradeAction(one)) + results = append(results, StatisticKind(one)) case xml.EndElement: depth-- } @@ -41849,7 +42126,7 @@ func XMLClusterUpgradeActionReadMany(reader *XMLReader, start *xml.StartElement) return results, nil } -func XMLExternalSystemTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ExternalSystemType, error) { +func XMLStatisticUnitReadOne(reader *XMLReader, start *xml.StartElement) (*StatisticUnit, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41864,12 +42141,12 @@ func XMLExternalSystemTypeReadOne(reader *XMLReader, start *xml.StartElement) (* if err != nil { return nil, err } - result := new(ExternalSystemType) - *result = ExternalSystemType(s) + result := new(StatisticUnit) + *result = StatisticUnit(s) return result, nil } -func XMLExternalSystemTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ExternalSystemType, error) { +func XMLStatisticUnitReadMany(reader *XMLReader, start *xml.StartElement) ([]StatisticUnit, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41880,7 +42157,7 @@ func XMLExternalSystemTypeReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var results []ExternalSystemType + var results []StatisticUnit depth := 1 for depth > 0 { t, err := reader.Next() @@ -41897,7 +42174,7 @@ func XMLExternalSystemTypeReadMany(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - results = append(results, ExternalSystemType(one)) + results = append(results, StatisticUnit(one)) case xml.EndElement: depth-- } @@ -41905,7 +42182,7 @@ func XMLExternalSystemTypeReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLRngSourceReadOne(reader *XMLReader, start *xml.StartElement) (*RngSource, error) { +func XMLStepEnumReadOne(reader *XMLReader, start *xml.StartElement) (*StepEnum, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41920,12 +42197,12 @@ func XMLRngSourceReadOne(reader *XMLReader, start *xml.StartElement) (*RngSource if err != nil { return nil, err } - result := new(RngSource) - *result = RngSource(s) + result := new(StepEnum) + *result = StepEnum(s) return result, nil } -func XMLRngSourceReadMany(reader *XMLReader, start *xml.StartElement) ([]RngSource, error) { +func XMLStepEnumReadMany(reader *XMLReader, start *xml.StartElement) ([]StepEnum, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41936,7 +42213,7 @@ func XMLRngSourceReadMany(reader *XMLReader, start *xml.StartElement) ([]RngSour } start = st } - var results []RngSource + var results []StepEnum depth := 1 for depth > 0 { t, err := reader.Next() @@ -41953,7 +42230,7 @@ func XMLRngSourceReadMany(reader *XMLReader, start *xml.StartElement) ([]RngSour if err != nil { return nil, err } - results = append(results, RngSource(one)) + results = append(results, StepEnum(one)) case xml.EndElement: depth-- } @@ -41961,7 +42238,7 @@ func XMLRngSourceReadMany(reader *XMLReader, start *xml.StartElement) ([]RngSour return results, nil } -func XMLBiosTypeReadOne(reader *XMLReader, start *xml.StartElement) (*BiosType, error) { +func XMLStepStatusReadOne(reader *XMLReader, start *xml.StartElement) (*StepStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41976,12 +42253,12 @@ func XMLBiosTypeReadOne(reader *XMLReader, start *xml.StartElement) (*BiosType, if err != nil { return nil, err } - result := new(BiosType) - *result = BiosType(s) + result := new(StepStatus) + *result = StepStatus(s) return result, nil } -func XMLBiosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]BiosType, error) { +func XMLStepStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StepStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -41992,7 +42269,7 @@ func XMLBiosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]BiosType } start = st } - var results []BiosType + var results []StepStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -42009,7 +42286,7 @@ func XMLBiosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]BiosType if err != nil { return nil, err } - results = append(results, BiosType(one)) + results = append(results, StepStatus(one)) case xml.EndElement: depth-- } @@ -42017,7 +42294,7 @@ func XMLBiosTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]BiosType return results, nil } -func XMLDiskFormatReadOne(reader *XMLReader, start *xml.StartElement) (*DiskFormat, error) { +func XMLStorageDomainStatusReadOne(reader *XMLReader, start *xml.StartElement) (*StorageDomainStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42032,12 +42309,12 @@ func XMLDiskFormatReadOne(reader *XMLReader, start *xml.StartElement) (*DiskForm if err != nil { return nil, err } - result := new(DiskFormat) - *result = DiskFormat(s) + result := new(StorageDomainStatus) + *result = StorageDomainStatus(s) return result, nil } -func XMLDiskFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskFormat, error) { +func XMLStorageDomainStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageDomainStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42048,7 +42325,7 @@ func XMLDiskFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskFo } start = st } - var results []DiskFormat + var results []StorageDomainStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -42065,7 +42342,7 @@ func XMLDiskFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskFo if err != nil { return nil, err } - results = append(results, DiskFormat(one)) + results = append(results, StorageDomainStatus(one)) case xml.EndElement: depth-- } @@ -42073,7 +42350,7 @@ func XMLDiskFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]DiskFo return results, nil } -func XMLRoleTypeReadOne(reader *XMLReader, start *xml.StartElement) (*RoleType, error) { +func XMLStorageDomainTypeReadOne(reader *XMLReader, start *xml.StartElement) (*StorageDomainType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42088,12 +42365,12 @@ func XMLRoleTypeReadOne(reader *XMLReader, start *xml.StartElement) (*RoleType, if err != nil { return nil, err } - result := new(RoleType) - *result = RoleType(s) + result := new(StorageDomainType) + *result = StorageDomainType(s) return result, nil } -func XMLRoleTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]RoleType, error) { +func XMLStorageDomainTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageDomainType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42104,7 +42381,7 @@ func XMLRoleTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]RoleType } start = st } - var results []RoleType + var results []StorageDomainType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42121,7 +42398,7 @@ func XMLRoleTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]RoleType if err != nil { return nil, err } - results = append(results, RoleType(one)) + results = append(results, StorageDomainType(one)) case xml.EndElement: depth-- } @@ -42129,7 +42406,7 @@ func XMLRoleTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]RoleType return results, nil } -func XMLDataCenterStatusReadOne(reader *XMLReader, start *xml.StartElement) (*DataCenterStatus, error) { +func XMLStorageFormatReadOne(reader *XMLReader, start *xml.StartElement) (*StorageFormat, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42144,12 +42421,12 @@ func XMLDataCenterStatusReadOne(reader *XMLReader, start *xml.StartElement) (*Da if err != nil { return nil, err } - result := new(DataCenterStatus) - *result = DataCenterStatus(s) + result := new(StorageFormat) + *result = StorageFormat(s) return result, nil } -func XMLDataCenterStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]DataCenterStatus, error) { +func XMLStorageFormatReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageFormat, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42160,7 +42437,7 @@ func XMLDataCenterStatusReadMany(reader *XMLReader, start *xml.StartElement) ([] } start = st } - var results []DataCenterStatus + var results []StorageFormat depth := 1 for depth > 0 { t, err := reader.Next() @@ -42177,7 +42454,7 @@ func XMLDataCenterStatusReadMany(reader *XMLReader, start *xml.StartElement) ([] if err != nil { return nil, err } - results = append(results, DataCenterStatus(one)) + results = append(results, StorageFormat(one)) case xml.EndElement: depth-- } @@ -42185,7 +42462,7 @@ func XMLDataCenterStatusReadMany(reader *XMLReader, start *xml.StartElement) ([] return results, nil } -func XMLVmPoolTypeReadOne(reader *XMLReader, start *xml.StartElement) (*VmPoolType, error) { +func XMLStorageTypeReadOne(reader *XMLReader, start *xml.StartElement) (*StorageType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42200,12 +42477,12 @@ func XMLVmPoolTypeReadOne(reader *XMLReader, start *xml.StartElement) (*VmPoolTy if err != nil { return nil, err } - result := new(VmPoolType) - *result = VmPoolType(s) + result := new(StorageType) + *result = StorageType(s) return result, nil } -func XMLVmPoolTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmPoolType, error) { +func XMLStorageTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42216,7 +42493,7 @@ func XMLVmPoolTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmPool } start = st } - var results []VmPoolType + var results []StorageType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42233,7 +42510,7 @@ func XMLVmPoolTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmPool if err != nil { return nil, err } - results = append(results, VmPoolType(one)) + results = append(results, StorageType(one)) case xml.EndElement: depth-- } @@ -42241,7 +42518,7 @@ func XMLVmPoolTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmPool return results, nil } -func XMLPayloadEncodingReadOne(reader *XMLReader, start *xml.StartElement) (*PayloadEncoding, error) { +func XMLSwitchTypeReadOne(reader *XMLReader, start *xml.StartElement) (*SwitchType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42256,12 +42533,12 @@ func XMLPayloadEncodingReadOne(reader *XMLReader, start *xml.StartElement) (*Pay if err != nil { return nil, err } - result := new(PayloadEncoding) - *result = PayloadEncoding(s) + result := new(SwitchType) + *result = SwitchType(s) return result, nil } -func XMLPayloadEncodingReadMany(reader *XMLReader, start *xml.StartElement) ([]PayloadEncoding, error) { +func XMLSwitchTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]SwitchType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42272,7 +42549,7 @@ func XMLPayloadEncodingReadMany(reader *XMLReader, start *xml.StartElement) ([]P } start = st } - var results []PayloadEncoding + var results []SwitchType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42289,7 +42566,7 @@ func XMLPayloadEncodingReadMany(reader *XMLReader, start *xml.StartElement) ([]P if err != nil { return nil, err } - results = append(results, PayloadEncoding(one)) + results = append(results, SwitchType(one)) case xml.EndElement: depth-- } @@ -42297,7 +42574,7 @@ func XMLPayloadEncodingReadMany(reader *XMLReader, start *xml.StartElement) ([]P return results, nil } -func XMLStorageDomainTypeReadOne(reader *XMLReader, start *xml.StartElement) (*StorageDomainType, error) { +func XMLTemplateStatusReadOne(reader *XMLReader, start *xml.StartElement) (*TemplateStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42312,12 +42589,12 @@ func XMLStorageDomainTypeReadOne(reader *XMLReader, start *xml.StartElement) (*S if err != nil { return nil, err } - result := new(StorageDomainType) - *result = StorageDomainType(s) + result := new(TemplateStatus) + *result = TemplateStatus(s) return result, nil } -func XMLStorageDomainTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]StorageDomainType, error) { +func XMLTemplateStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]TemplateStatus, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42328,7 +42605,7 @@ func XMLStorageDomainTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ } start = st } - var results []StorageDomainType + var results []TemplateStatus depth := 1 for depth > 0 { t, err := reader.Next() @@ -42345,7 +42622,7 @@ func XMLStorageDomainTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ if err != nil { return nil, err } - results = append(results, StorageDomainType(one)) + results = append(results, TemplateStatus(one)) case xml.EndElement: depth-- } @@ -42353,7 +42630,7 @@ func XMLStorageDomainTypeReadMany(reader *XMLReader, start *xml.StartElement) ([ return results, nil } -func XMLNotificationMethodReadOne(reader *XMLReader, start *xml.StartElement) (*NotificationMethod, error) { +func XMLTransportTypeReadOne(reader *XMLReader, start *xml.StartElement) (*TransportType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42368,12 +42645,12 @@ func XMLNotificationMethodReadOne(reader *XMLReader, start *xml.StartElement) (* if err != nil { return nil, err } - result := new(NotificationMethod) - *result = NotificationMethod(s) + result := new(TransportType) + *result = TransportType(s) return result, nil } -func XMLNotificationMethodReadMany(reader *XMLReader, start *xml.StartElement) ([]NotificationMethod, error) { +func XMLTransportTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]TransportType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42384,7 +42661,7 @@ func XMLNotificationMethodReadMany(reader *XMLReader, start *xml.StartElement) ( } start = st } - var results []NotificationMethod + var results []TransportType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42401,7 +42678,7 @@ func XMLNotificationMethodReadMany(reader *XMLReader, start *xml.StartElement) ( if err != nil { return nil, err } - results = append(results, NotificationMethod(one)) + results = append(results, TransportType(one)) case xml.EndElement: depth-- } @@ -42409,7 +42686,7 @@ func XMLNotificationMethodReadMany(reader *XMLReader, start *xml.StartElement) ( return results, nil } -func XMLQuotaModeTypeReadOne(reader *XMLReader, start *xml.StartElement) (*QuotaModeType, error) { +func XMLUsbTypeReadOne(reader *XMLReader, start *xml.StartElement) (*UsbType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42424,12 +42701,12 @@ func XMLQuotaModeTypeReadOne(reader *XMLReader, start *xml.StartElement) (*Quota if err != nil { return nil, err } - result := new(QuotaModeType) - *result = QuotaModeType(s) + result := new(UsbType) + *result = UsbType(s) return result, nil } -func XMLQuotaModeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]QuotaModeType, error) { +func XMLUsbTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]UsbType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42440,7 +42717,7 @@ func XMLQuotaModeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Quo } start = st } - var results []QuotaModeType + var results []UsbType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42457,7 +42734,7 @@ func XMLQuotaModeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Quo if err != nil { return nil, err } - results = append(results, QuotaModeType(one)) + results = append(results, UsbType(one)) case xml.EndElement: depth-- } @@ -42465,7 +42742,7 @@ func XMLQuotaModeTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]Quo return results, nil } -func XMLWatchdogModelReadOne(reader *XMLReader, start *xml.StartElement) (*WatchdogModel, error) { +func XMLValueTypeReadOne(reader *XMLReader, start *xml.StartElement) (*ValueType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42480,12 +42757,12 @@ func XMLWatchdogModelReadOne(reader *XMLReader, start *xml.StartElement) (*Watch if err != nil { return nil, err } - result := new(WatchdogModel) - *result = WatchdogModel(s) + result := new(ValueType) + *result = ValueType(s) return result, nil } -func XMLWatchdogModelReadMany(reader *XMLReader, start *xml.StartElement) ([]WatchdogModel, error) { +func XMLValueTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]ValueType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42496,7 +42773,7 @@ func XMLWatchdogModelReadMany(reader *XMLReader, start *xml.StartElement) ([]Wat } start = st } - var results []WatchdogModel + var results []ValueType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42513,7 +42790,7 @@ func XMLWatchdogModelReadMany(reader *XMLReader, start *xml.StartElement) ([]Wat if err != nil { return nil, err } - results = append(results, WatchdogModel(one)) + results = append(results, ValueType(one)) case xml.EndElement: depth-- } @@ -42521,7 +42798,7 @@ func XMLWatchdogModelReadMany(reader *XMLReader, start *xml.StartElement) ([]Wat return results, nil } -func XMLPmProxyTypeReadOne(reader *XMLReader, start *xml.StartElement) (*PmProxyType, error) { +func XMLVgpuPlacementReadOne(reader *XMLReader, start *xml.StartElement) (*VgpuPlacement, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42536,12 +42813,12 @@ func XMLPmProxyTypeReadOne(reader *XMLReader, start *xml.StartElement) (*PmProxy if err != nil { return nil, err } - result := new(PmProxyType) - *result = PmProxyType(s) + result := new(VgpuPlacement) + *result = VgpuPlacement(s) return result, nil } -func XMLPmProxyTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PmProxyType, error) { +func XMLVgpuPlacementReadMany(reader *XMLReader, start *xml.StartElement) ([]VgpuPlacement, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42552,7 +42829,7 @@ func XMLPmProxyTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PmPro } start = st } - var results []PmProxyType + var results []VgpuPlacement depth := 1 for depth > 0 { t, err := reader.Next() @@ -42569,7 +42846,7 @@ func XMLPmProxyTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PmPro if err != nil { return nil, err } - results = append(results, PmProxyType(one)) + results = append(results, VgpuPlacement(one)) case xml.EndElement: depth-- } @@ -42577,7 +42854,7 @@ func XMLPmProxyTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]PmPro return results, nil } -func XMLHostStatusReadOne(reader *XMLReader, start *xml.StartElement) (*HostStatus, error) { +func XMLVmAffinityReadOne(reader *XMLReader, start *xml.StartElement) (*VmAffinity, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42592,12 +42869,12 @@ func XMLHostStatusReadOne(reader *XMLReader, start *xml.StartElement) (*HostStat if err != nil { return nil, err } - result := new(HostStatus) - *result = HostStatus(s) + result := new(VmAffinity) + *result = VmAffinity(s) return result, nil } -func XMLHostStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HostStatus, error) { +func XMLVmAffinityReadMany(reader *XMLReader, start *xml.StartElement) ([]VmAffinity, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42608,7 +42885,7 @@ func XMLHostStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HostSt } start = st } - var results []HostStatus + var results []VmAffinity depth := 1 for depth > 0 { t, err := reader.Next() @@ -42625,7 +42902,7 @@ func XMLHostStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HostSt if err != nil { return nil, err } - results = append(results, HostStatus(one)) + results = append(results, VmAffinity(one)) case xml.EndElement: depth-- } @@ -42633,7 +42910,7 @@ func XMLHostStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]HostSt return results, nil } -func XMLLogSeverityReadOne(reader *XMLReader, start *xml.StartElement) (*LogSeverity, error) { +func XMLVmDeviceTypeReadOne(reader *XMLReader, start *xml.StartElement) (*VmDeviceType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42648,12 +42925,12 @@ func XMLLogSeverityReadOne(reader *XMLReader, start *xml.StartElement) (*LogSeve if err != nil { return nil, err } - result := new(LogSeverity) - *result = LogSeverity(s) + result := new(VmDeviceType) + *result = VmDeviceType(s) return result, nil } -func XMLLogSeverityReadMany(reader *XMLReader, start *xml.StartElement) ([]LogSeverity, error) { +func XMLVmDeviceTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmDeviceType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42664,7 +42941,7 @@ func XMLLogSeverityReadMany(reader *XMLReader, start *xml.StartElement) ([]LogSe } start = st } - var results []LogSeverity + var results []VmDeviceType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42681,7 +42958,7 @@ func XMLLogSeverityReadMany(reader *XMLReader, start *xml.StartElement) ([]LogSe if err != nil { return nil, err } - results = append(results, LogSeverity(one)) + results = append(results, VmDeviceType(one)) case xml.EndElement: depth-- } @@ -42689,7 +42966,7 @@ func XMLLogSeverityReadMany(reader *XMLReader, start *xml.StartElement) ([]LogSe return results, nil } -func XMLMigrateOnErrorReadOne(reader *XMLReader, start *xml.StartElement) (*MigrateOnError, error) { +func XMLVmPoolTypeReadOne(reader *XMLReader, start *xml.StartElement) (*VmPoolType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42704,12 +42981,12 @@ func XMLMigrateOnErrorReadOne(reader *XMLReader, start *xml.StartElement) (*Migr if err != nil { return nil, err } - result := new(MigrateOnError) - *result = MigrateOnError(s) + result := new(VmPoolType) + *result = VmPoolType(s) return result, nil } -func XMLMigrateOnErrorReadMany(reader *XMLReader, start *xml.StartElement) ([]MigrateOnError, error) { +func XMLVmPoolTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmPoolType, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42720,7 +42997,7 @@ func XMLMigrateOnErrorReadMany(reader *XMLReader, start *xml.StartElement) ([]Mi } start = st } - var results []MigrateOnError + var results []VmPoolType depth := 1 for depth > 0 { t, err := reader.Next() @@ -42737,7 +43014,7 @@ func XMLMigrateOnErrorReadMany(reader *XMLReader, start *xml.StartElement) ([]Mi if err != nil { return nil, err } - results = append(results, MigrateOnError(one)) + results = append(results, VmPoolType(one)) case xml.EndElement: depth-- } @@ -42801,7 +43078,7 @@ func XMLVmStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]VmStatus return results, nil } -func XMLExternalStatusReadOne(reader *XMLReader, start *xml.StartElement) (*ExternalStatus, error) { +func XMLVmStorageErrorResumeBehaviourReadOne(reader *XMLReader, start *xml.StartElement) (*VmStorageErrorResumeBehaviour, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42816,12 +43093,12 @@ func XMLExternalStatusReadOne(reader *XMLReader, start *xml.StartElement) (*Exte if err != nil { return nil, err } - result := new(ExternalStatus) - *result = ExternalStatus(s) + result := new(VmStorageErrorResumeBehaviour) + *result = VmStorageErrorResumeBehaviour(s) return result, nil } -func XMLExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]ExternalStatus, error) { +func XMLVmStorageErrorResumeBehaviourReadMany(reader *XMLReader, start *xml.StartElement) ([]VmStorageErrorResumeBehaviour, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42832,7 +43109,7 @@ func XMLExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Ex } start = st } - var results []ExternalStatus + var results []VmStorageErrorResumeBehaviour depth := 1 for depth > 0 { t, err := reader.Next() @@ -42849,7 +43126,7 @@ func XMLExternalStatusReadMany(reader *XMLReader, start *xml.StartElement) ([]Ex if err != nil { return nil, err } - results = append(results, ExternalStatus(one)) + results = append(results, VmStorageErrorResumeBehaviour(one)) case xml.EndElement: depth-- } @@ -42913,7 +43190,7 @@ func XMLVmTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]VmType, er return results, nil } -func XMLUsbTypeReadOne(reader *XMLReader, start *xml.StartElement) (*UsbType, error) { +func XMLVnicPassThroughModeReadOne(reader *XMLReader, start *xml.StartElement) (*VnicPassThroughMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42928,12 +43205,12 @@ func XMLUsbTypeReadOne(reader *XMLReader, start *xml.StartElement) (*UsbType, er if err != nil { return nil, err } - result := new(UsbType) - *result = UsbType(s) + result := new(VnicPassThroughMode) + *result = VnicPassThroughMode(s) return result, nil } -func XMLUsbTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]UsbType, error) { +func XMLVnicPassThroughModeReadMany(reader *XMLReader, start *xml.StartElement) ([]VnicPassThroughMode, error) { if start == nil { st, err := reader.FindStartElement() if err != nil { @@ -42944,7 +43221,7 @@ func XMLUsbTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]UsbType, } start = st } - var results []UsbType + var results []VnicPassThroughMode depth := 1 for depth > 0 { t, err := reader.Next() @@ -42961,7 +43238,119 @@ func XMLUsbTypeReadMany(reader *XMLReader, start *xml.StartElement) ([]UsbType, if err != nil { return nil, err } - results = append(results, UsbType(one)) + results = append(results, VnicPassThroughMode(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLWatchdogActionReadOne(reader *XMLReader, start *xml.StartElement) (*WatchdogAction, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(WatchdogAction) + *result = WatchdogAction(s) + return result, nil +} + +func XMLWatchdogActionReadMany(reader *XMLReader, start *xml.StartElement) ([]WatchdogAction, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []WatchdogAction + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, WatchdogAction(one)) + case xml.EndElement: + depth-- + } + } + return results, nil +} + +func XMLWatchdogModelReadOne(reader *XMLReader, start *xml.StartElement) (*WatchdogModel, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + s, err := reader.ReadString(start) + if err != nil { + return nil, err + } + result := new(WatchdogModel) + *result = WatchdogModel(s) + return result, nil +} + +func XMLWatchdogModelReadMany(reader *XMLReader, start *xml.StartElement) ([]WatchdogModel, error) { + if start == nil { + st, err := reader.FindStartElement() + if err != nil { + if err == io.EOF { + return nil, nil + } + return nil, err + } + start = st + } + var results []WatchdogModel + depth := 1 + for depth > 0 { + t, err := reader.Next() + if err != nil { + if err == io.EOF { + break + } + return nil, err + } + t = xml.CopyToken(t) + switch t := t.(type) { + case xml.StartElement: + one, err := reader.ReadString(&t) + if err != nil { + return nil, err + } + results = append(results, WatchdogModel(one)) case xml.EndElement: depth-- } diff --git a/vendor/github.com/ovirt/go-ovirt/services.go b/vendor/github.com/ovirt/go-ovirt/services.go index 8e654f51417..7b03235aea6 100644 --- a/vendor/github.com/ovirt/go-ovirt/services.go +++ b/vendor/github.com/ovirt/go-ovirt/services.go @@ -26,111 +26,119 @@ import ( ) // -// Provides a way for clients to list available files. -// This service is specifically targeted to ISO storage domains, which contain ISO images and virtual floppy disks -// (VFDs) that an administrator uploads. -// The addition of a CD-ROM device to a virtual machine requires an ISO image from the files of an ISO storage domain. +// This annotation is intended to specify what oVirt area is the annotated concept related to. Currently the following +// areas are in use, and they are closely related to the oVirt teams, but not necessarily the same: +// - Infrastructure +// - Network +// - SLA +// - Storage +// - Virtualization +// A concept may be associated to more than one area, or to no area. +// The value of this annotation is intended for reporting only, and it doesn't affect at all the generated code or the +// validity of the model // -type FilesService struct { +type AreaService struct { BaseService } -func NewFilesService(connection *Connection, path string) *FilesService { - var result FilesService +func NewAreaService(connection *Connection, path string) *AreaService { + var result AreaService result.connection = connection result.path = path return &result } // -// Returns the list of ISO images and virtual floppy disks available in the storage domain. The order of -// the returned list is not guaranteed. -// If the `refresh` parameter is `false`, the returned list may not reflect recent changes to the storage domain; -// for example, it may not contain a new ISO file that was recently added. This is because the -// server caches the list of files to improve performance. To get the very latest results, set the `refresh` -// parameter to `true`. -// The default value of the `refresh` parameter is `true`, but it can be changed using the configuration value -// `ForceRefreshDomainFilesByDefault`: -// [source] -// ---- -// # engine-config -s ForceRefreshDomainFilesByDefault=false -// ---- -// IMPORTANT: Setting the value of the `refresh` parameter to `true` has an impact on the performance of the -// server. Use it only if necessary. +// Service locator method, returns individual service on which the URI is dispatched. // -type FilesServiceListRequest struct { - FilesService *FilesService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - refresh *bool - search *string +func (op *AreaService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *FilesServiceListRequest) Header(key, value string) *FilesServiceListRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p +func (op *AreaService) String() string { + return fmt.Sprintf("AreaService:%s", op.path) } -func (p *FilesServiceListRequest) Query(key, value string) *FilesServiceListRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p +// +// +type FollowService struct { + BaseService } -func (p *FilesServiceListRequest) CaseSensitive(caseSensitive bool) *FilesServiceListRequest { - p.caseSensitive = &caseSensitive - return p +func NewFollowService(connection *Connection, path string) *FollowService { + var result FollowService + result.connection = connection + result.path = path + return &result } -func (p *FilesServiceListRequest) Follow(follow string) *FilesServiceListRequest { - p.follow = &follow - return p +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *FollowService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *FilesServiceListRequest) Max(max int64) *FilesServiceListRequest { - p.max = &max - return p +func (op *FollowService) String() string { + return fmt.Sprintf("FollowService:%s", op.path) } -func (p *FilesServiceListRequest) Refresh(refresh bool) *FilesServiceListRequest { - p.refresh = &refresh - return p +// +// This service manages a single host label assigned to an affinity group. +// +type AffinityGroupHostLabelService struct { + BaseService } -func (p *FilesServiceListRequest) Search(search string) *FilesServiceListRequest { - p.search = &search - return p +func NewAffinityGroupHostLabelService(connection *Connection, path string) *AffinityGroupHostLabelService { + var result AffinityGroupHostLabelService + result.connection = connection + result.path = path + return &result } -func (p *FilesServiceListRequest) Send() (*FilesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.FilesService.connection.URL(), p.FilesService.path) - values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } +// +// Remove this label from the affinity group. +// +type AffinityGroupHostLabelServiceRemoveRequest struct { + AffinityGroupHostLabelService *AffinityGroupHostLabelService + header map[string]string + query map[string]string + async *bool +} - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *AffinityGroupHostLabelServiceRemoveRequest) Header(key, value string) *AffinityGroupHostLabelServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) } + p.header[key] = value + return p +} - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} +func (p *AffinityGroupHostLabelServiceRemoveRequest) Query(key, value string) *AffinityGroupHostLabelServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) } + p.query[key] = value + return p +} - if p.refresh != nil { - values["refresh"] = []string{fmt.Sprintf("%v", *p.refresh)} - } +func (p *AffinityGroupHostLabelServiceRemoveRequest) Async(async bool) *AffinityGroupHostLabelServiceRemoveRequest { + p.async = &async + return p +} - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} +func (p *AffinityGroupHostLabelServiceRemoveRequest) Send() (*AffinityGroupHostLabelServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupHostLabelService.connection.URL(), p.AffinityGroupHostLabelService.path) + values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -141,12 +149,12 @@ func (p *FilesServiceListRequest) Send() (*FilesServiceListResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.FilesService.connection.headers { + for hk, hv := range p.AffinityGroupHostLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -161,18 +169,18 @@ func (p *FilesServiceListRequest) Send() (*FilesServiceListResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.FilesService.connection.authenticate() + token, err := p.AffinityGroupHostLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.FilesService.connection.client.Do(req) + resp, err := p.AffinityGroupHostLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.FilesService.connection.logFunc != nil { + if p.AffinityGroupHostLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -181,24 +189,19 @@ func (p *FilesServiceListRequest) Send() (*FilesServiceListResponse, error) { if err != nil { return nil, err } - p.FilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupHostLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLFileReadMany(reader, nil) - if err != nil { - return nil, err - } - return &FilesServiceListResponse{file: result}, nil + return new(AffinityGroupHostLabelServiceRemoveResponse), nil } -func (p *FilesServiceListRequest) MustSend() *FilesServiceListResponse { +func (p *AffinityGroupHostLabelServiceRemoveRequest) MustSend() *AffinityGroupHostLabelServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -207,110 +210,67 @@ func (p *FilesServiceListRequest) MustSend() *FilesServiceListResponse { } // -// Returns the list of ISO images and virtual floppy disks available in the storage domain. The order of -// the returned list is not guaranteed. -// If the `refresh` parameter is `false`, the returned list may not reflect recent changes to the storage domain; -// for example, it may not contain a new ISO file that was recently added. This is because the -// server caches the list of files to improve performance. To get the very latest results, set the `refresh` -// parameter to `true`. -// The default value of the `refresh` parameter is `true`, but it can be changed using the configuration value -// `ForceRefreshDomainFilesByDefault`: -// [source] -// ---- -// # engine-config -s ForceRefreshDomainFilesByDefault=false -// ---- -// IMPORTANT: Setting the value of the `refresh` parameter to `true` has an impact on the performance of the -// server. Use it only if necessary. -// -type FilesServiceListResponse struct { - file *FileSlice -} - -func (p *FilesServiceListResponse) File() (*FileSlice, bool) { - if p.file != nil { - return p.file, true - } - return nil, false -} - -func (p *FilesServiceListResponse) MustFile() *FileSlice { - if p.file == nil { - panic("file in response does not exist") - } - return p.file -} - -// -// Returns the list of ISO images and virtual floppy disks available in the storage domain. The order of -// the returned list is not guaranteed. -// If the `refresh` parameter is `false`, the returned list may not reflect recent changes to the storage domain; -// for example, it may not contain a new ISO file that was recently added. This is because the -// server caches the list of files to improve performance. To get the very latest results, set the `refresh` -// parameter to `true`. -// The default value of the `refresh` parameter is `true`, but it can be changed using the configuration value -// `ForceRefreshDomainFilesByDefault`: -// [source] -// ---- -// # engine-config -s ForceRefreshDomainFilesByDefault=false -// ---- -// IMPORTANT: Setting the value of the `refresh` parameter to `true` has an impact on the performance of the -// server. Use it only if necessary. +// Remove this label from the affinity group. // -func (p *FilesService) List() *FilesServiceListRequest { - return &FilesServiceListRequest{FilesService: p} +type AffinityGroupHostLabelServiceRemoveResponse struct { } // +// Remove this label from the affinity group. // -func (op *FilesService) FileService(id string) *FileService { - return NewFileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *AffinityGroupHostLabelService) Remove() *AffinityGroupHostLabelServiceRemoveRequest { + return &AffinityGroupHostLabelServiceRemoveRequest{AffinityGroupHostLabelService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *FilesService) Service(path string) (Service, error) { +func (op *AffinityGroupHostLabelService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.FileService(path), nil - } - return op.FileService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *FilesService) String() string { - return fmt.Sprintf("FilesService:%s", op.path) +func (op *AffinityGroupHostLabelService) String() string { + return fmt.Sprintf("AffinityGroupHostLabelService:%s", op.path) } // -// This service manages the set of disks attached to a template. Each attached disk is represented by a -// <>. +// This service manages a collection of all host labels assigned to an affinity group. // -type TemplateDiskAttachmentsService struct { +type AffinityGroupHostLabelsService struct { BaseService } -func NewTemplateDiskAttachmentsService(connection *Connection, path string) *TemplateDiskAttachmentsService { - var result TemplateDiskAttachmentsService +func NewAffinityGroupHostLabelsService(connection *Connection, path string) *AffinityGroupHostLabelsService { + var result AffinityGroupHostLabelsService result.connection = connection result.path = path return &result } // -// List the disks that are attached to the template. -// The order of the returned list of attachments isn't guaranteed. +// Adds a host label to the affinity group. +// For example, to add the label `789` to the affinity group `456` of cluster `123`, +// send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/hostlabels +// .... +// With the following body: +// [source,xml] +// ---- +// +// ---- // -type TemplateDiskAttachmentsServiceListRequest struct { - TemplateDiskAttachmentsService *TemplateDiskAttachmentsService +type AffinityGroupHostLabelsServiceAddRequest struct { + AffinityGroupHostLabelsService *AffinityGroupHostLabelsService header map[string]string query map[string]string - follow *string + label *AffinityLabel } -func (p *TemplateDiskAttachmentsServiceListRequest) Header(key, value string) *TemplateDiskAttachmentsServiceListRequest { +func (p *AffinityGroupHostLabelsServiceAddRequest) Header(key, value string) *AffinityGroupHostLabelsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -318,7 +278,7 @@ func (p *TemplateDiskAttachmentsServiceListRequest) Header(key, value string) *T return p } -func (p *TemplateDiskAttachmentsServiceListRequest) Query(key, value string) *TemplateDiskAttachmentsServiceListRequest { +func (p *AffinityGroupHostLabelsServiceAddRequest) Query(key, value string) *AffinityGroupHostLabelsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -326,18 +286,14 @@ func (p *TemplateDiskAttachmentsServiceListRequest) Query(key, value string) *Te return p } -func (p *TemplateDiskAttachmentsServiceListRequest) Follow(follow string) *TemplateDiskAttachmentsServiceListRequest { - p.follow = &follow +func (p *AffinityGroupHostLabelsServiceAddRequest) Label(label *AffinityLabel) *AffinityGroupHostLabelsServiceAddRequest { + p.label = label return p } -func (p *TemplateDiskAttachmentsServiceListRequest) Send() (*TemplateDiskAttachmentsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateDiskAttachmentsService.connection.URL(), p.TemplateDiskAttachmentsService.path) +func (p *AffinityGroupHostLabelsServiceAddRequest) Send() (*AffinityGroupHostLabelsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupHostLabelsService.connection.URL(), p.AffinityGroupHostLabelsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -346,12 +302,19 @@ func (p *TemplateDiskAttachmentsServiceListRequest) Send() (*TemplateDiskAttachm if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLAffinityLabelWriteOne(writer, p.label, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateDiskAttachmentsService.connection.headers { + for hk, hv := range p.AffinityGroupHostLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -366,18 +329,18 @@ func (p *TemplateDiskAttachmentsServiceListRequest) Send() (*TemplateDiskAttachm req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateDiskAttachmentsService.connection.authenticate() + token, err := p.AffinityGroupHostLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateDiskAttachmentsService.connection.client.Do(req) + resp, err := p.AffinityGroupHostLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateDiskAttachmentsService.connection.logFunc != nil { + if p.AffinityGroupHostLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -386,9 +349,9 @@ func (p *TemplateDiskAttachmentsServiceListRequest) Send() (*TemplateDiskAttachm if err != nil { return nil, err } - p.TemplateDiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupHostLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -396,14 +359,14 @@ func (p *TemplateDiskAttachmentsServiceListRequest) Send() (*TemplateDiskAttachm return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskAttachmentReadMany(reader, nil) + result, err := XMLAffinityLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &TemplateDiskAttachmentsServiceListResponse{attachments: result}, nil + return &AffinityGroupHostLabelsServiceAddResponse{label: result}, nil } -func (p *TemplateDiskAttachmentsServiceListRequest) MustSend() *TemplateDiskAttachmentsServiceListResponse { +func (p *AffinityGroupHostLabelsServiceAddRequest) MustSend() *AffinityGroupHostLabelsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -412,83 +375,66 @@ func (p *TemplateDiskAttachmentsServiceListRequest) MustSend() *TemplateDiskAtta } // -// List the disks that are attached to the template. -// The order of the returned list of attachments isn't guaranteed. +// Adds a host label to the affinity group. +// For example, to add the label `789` to the affinity group `456` of cluster `123`, +// send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/hostlabels +// .... +// With the following body: +// [source,xml] +// ---- +// +// ---- // -type TemplateDiskAttachmentsServiceListResponse struct { - attachments *DiskAttachmentSlice +type AffinityGroupHostLabelsServiceAddResponse struct { + label *AffinityLabel } -func (p *TemplateDiskAttachmentsServiceListResponse) Attachments() (*DiskAttachmentSlice, bool) { - if p.attachments != nil { - return p.attachments, true +func (p *AffinityGroupHostLabelsServiceAddResponse) Label() (*AffinityLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *TemplateDiskAttachmentsServiceListResponse) MustAttachments() *DiskAttachmentSlice { - if p.attachments == nil { - panic("attachments in response does not exist") - } - return p.attachments -} - -// -// List the disks that are attached to the template. -// The order of the returned list of attachments isn't guaranteed. -// -func (p *TemplateDiskAttachmentsService) List() *TemplateDiskAttachmentsServiceListRequest { - return &TemplateDiskAttachmentsServiceListRequest{TemplateDiskAttachmentsService: p} -} - -// -// Reference to the service that manages a specific attachment. -// -func (op *TemplateDiskAttachmentsService) AttachmentService(id string) *TemplateDiskAttachmentService { - return NewTemplateDiskAttachmentService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *TemplateDiskAttachmentsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.AttachmentService(path), nil +func (p *AffinityGroupHostLabelsServiceAddResponse) MustLabel() *AffinityLabel { + if p.label == nil { + panic("label in response does not exist") } - return op.AttachmentService(path[:index]).Service(path[index+1:]) -} - -func (op *TemplateDiskAttachmentsService) String() string { - return fmt.Sprintf("TemplateDiskAttachmentsService:%s", op.path) + return p.label } // +// Adds a host label to the affinity group. +// For example, to add the label `789` to the affinity group `456` of cluster `123`, +// send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/hostlabels +// .... +// With the following body: +// [source,xml] +// ---- +// +// ---- // -type TemplateNicService struct { - BaseService -} - -func NewTemplateNicService(connection *Connection, path string) *TemplateNicService { - var result TemplateNicService - result.connection = connection - result.path = path - return &result +func (p *AffinityGroupHostLabelsService) Add() *AffinityGroupHostLabelsServiceAddRequest { + return &AffinityGroupHostLabelsServiceAddRequest{AffinityGroupHostLabelsService: p} } // +// List all host labels assigned to this affinity group. +// The order of the returned labels isn't guaranteed. // -type TemplateNicServiceGetRequest struct { - TemplateNicService *TemplateNicService - header map[string]string - query map[string]string - follow *string +type AffinityGroupHostLabelsServiceListRequest struct { + AffinityGroupHostLabelsService *AffinityGroupHostLabelsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *TemplateNicServiceGetRequest) Header(key, value string) *TemplateNicServiceGetRequest { +func (p *AffinityGroupHostLabelsServiceListRequest) Header(key, value string) *AffinityGroupHostLabelsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -496,7 +442,7 @@ func (p *TemplateNicServiceGetRequest) Header(key, value string) *TemplateNicSer return p } -func (p *TemplateNicServiceGetRequest) Query(key, value string) *TemplateNicServiceGetRequest { +func (p *AffinityGroupHostLabelsServiceListRequest) Query(key, value string) *AffinityGroupHostLabelsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -504,18 +450,27 @@ func (p *TemplateNicServiceGetRequest) Query(key, value string) *TemplateNicServ return p } -func (p *TemplateNicServiceGetRequest) Follow(follow string) *TemplateNicServiceGetRequest { +func (p *AffinityGroupHostLabelsServiceListRequest) Follow(follow string) *AffinityGroupHostLabelsServiceListRequest { p.follow = &follow return p } -func (p *TemplateNicServiceGetRequest) Send() (*TemplateNicServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateNicService.connection.URL(), p.TemplateNicService.path) +func (p *AffinityGroupHostLabelsServiceListRequest) Max(max int64) *AffinityGroupHostLabelsServiceListRequest { + p.max = &max + return p +} + +func (p *AffinityGroupHostLabelsServiceListRequest) Send() (*AffinityGroupHostLabelsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupHostLabelsService.connection.URL(), p.AffinityGroupHostLabelsService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -529,7 +484,7 @@ func (p *TemplateNicServiceGetRequest) Send() (*TemplateNicServiceGetResponse, e return nil, err } - for hk, hv := range p.TemplateNicService.connection.headers { + for hk, hv := range p.AffinityGroupHostLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -544,18 +499,18 @@ func (p *TemplateNicServiceGetRequest) Send() (*TemplateNicServiceGetResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateNicService.connection.authenticate() + token, err := p.AffinityGroupHostLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateNicService.connection.client.Do(req) + resp, err := p.AffinityGroupHostLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateNicService.connection.logFunc != nil { + if p.AffinityGroupHostLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -564,7 +519,7 @@ func (p *TemplateNicServiceGetRequest) Send() (*TemplateNicServiceGetResponse, e if err != nil { return nil, err } - p.TemplateNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupHostLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -574,14 +529,14 @@ func (p *TemplateNicServiceGetRequest) Send() (*TemplateNicServiceGetResponse, e return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadOne(reader, nil, "") + result, err := XMLAffinityLabelReadMany(reader, nil) if err != nil { return nil, err } - return &TemplateNicServiceGetResponse{nic: result}, nil + return &AffinityGroupHostLabelsServiceListResponse{labels: result}, nil } -func (p *TemplateNicServiceGetRequest) MustSend() *TemplateNicServiceGetResponse { +func (p *AffinityGroupHostLabelsServiceListRequest) MustSend() *AffinityGroupHostLabelsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -590,159 +545,85 @@ func (p *TemplateNicServiceGetRequest) MustSend() *TemplateNicServiceGetResponse } // +// List all host labels assigned to this affinity group. +// The order of the returned labels isn't guaranteed. // -type TemplateNicServiceGetResponse struct { - nic *Nic +type AffinityGroupHostLabelsServiceListResponse struct { + labels *AffinityLabelSlice } -func (p *TemplateNicServiceGetResponse) Nic() (*Nic, bool) { - if p.nic != nil { - return p.nic, true +func (p *AffinityGroupHostLabelsServiceListResponse) Labels() (*AffinityLabelSlice, bool) { + if p.labels != nil { + return p.labels, true } return nil, false } -func (p *TemplateNicServiceGetResponse) MustNic() *Nic { - if p.nic == nil { - panic("nic in response does not exist") +func (p *AffinityGroupHostLabelsServiceListResponse) MustLabels() *AffinityLabelSlice { + if p.labels == nil { + panic("labels in response does not exist") } - return p.nic + return p.labels } // +// List all host labels assigned to this affinity group. +// The order of the returned labels isn't guaranteed. // -func (p *TemplateNicService) Get() *TemplateNicServiceGetRequest { - return &TemplateNicServiceGetRequest{TemplateNicService: p} +func (p *AffinityGroupHostLabelsService) List() *AffinityGroupHostLabelsServiceListRequest { + return &AffinityGroupHostLabelsServiceListRequest{AffinityGroupHostLabelsService: p} } // +// Access the service that manages the host label assignment to this affinity group. // -type TemplateNicServiceRemoveRequest struct { - TemplateNicService *TemplateNicService - header map[string]string - query map[string]string - async *bool +func (op *AffinityGroupHostLabelsService) LabelService(id string) *AffinityGroupHostLabelService { + return NewAffinityGroupHostLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *TemplateNicServiceRemoveRequest) Header(key, value string) *TemplateNicServiceRemoveRequest { - if p.header == nil { - p.header = make(map[string]string) +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AffinityGroupHostLabelsService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - p.header[key] = value - return p -} - -func (p *TemplateNicServiceRemoveRequest) Query(key, value string) *TemplateNicServiceRemoveRequest { - if p.query == nil { - p.query = make(map[string]string) + index := strings.Index(path, "/") + if index == -1 { + return op.LabelService(path), nil } - p.query[key] = value - return p + return op.LabelService(path[:index]).Service(path[index+1:]) } -func (p *TemplateNicServiceRemoveRequest) Async(async bool) *TemplateNicServiceRemoveRequest { - p.async = &async - return p -} - -func (p *TemplateNicServiceRemoveRequest) Send() (*TemplateNicServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateNicService.connection.URL(), p.TemplateNicService.path) - values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - req, err := http.NewRequest("DELETE", rawURL, nil) - if err != nil { - return nil, err - } - - for hk, hv := range p.TemplateNicService.connection.headers { - req.Header.Add(hk, hv) - } - - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } - - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.TemplateNicService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.TemplateNicService.connection.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if p.TemplateNicService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.TemplateNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody - } - return new(TemplateNicServiceRemoveResponse), nil -} - -func (p *TemplateNicServiceRemoveRequest) MustSend() *TemplateNicServiceRemoveResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v - } +func (op *AffinityGroupHostLabelsService) String() string { + return fmt.Sprintf("AffinityGroupHostLabelsService:%s", op.path) } // +// This service manages a single host to affinity group assignment. // -type TemplateNicServiceRemoveResponse struct { +type AffinityGroupHostService struct { + BaseService } -// -// -func (p *TemplateNicService) Remove() *TemplateNicServiceRemoveRequest { - return &TemplateNicServiceRemoveRequest{TemplateNicService: p} +func NewAffinityGroupHostService(connection *Connection, path string) *AffinityGroupHostService { + var result AffinityGroupHostService + result.connection = connection + result.path = path + return &result } // -// Update the specified network interface card attached to the template. +// Remove host from the affinity group. // -type TemplateNicServiceUpdateRequest struct { - TemplateNicService *TemplateNicService - header map[string]string - query map[string]string - async *bool - nic *Nic +type AffinityGroupHostServiceRemoveRequest struct { + AffinityGroupHostService *AffinityGroupHostService + header map[string]string + query map[string]string + async *bool } -func (p *TemplateNicServiceUpdateRequest) Header(key, value string) *TemplateNicServiceUpdateRequest { +func (p *AffinityGroupHostServiceRemoveRequest) Header(key, value string) *AffinityGroupHostServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -750,7 +631,7 @@ func (p *TemplateNicServiceUpdateRequest) Header(key, value string) *TemplateNic return p } -func (p *TemplateNicServiceUpdateRequest) Query(key, value string) *TemplateNicServiceUpdateRequest { +func (p *AffinityGroupHostServiceRemoveRequest) Query(key, value string) *AffinityGroupHostServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -758,18 +639,13 @@ func (p *TemplateNicServiceUpdateRequest) Query(key, value string) *TemplateNicS return p } -func (p *TemplateNicServiceUpdateRequest) Async(async bool) *TemplateNicServiceUpdateRequest { +func (p *AffinityGroupHostServiceRemoveRequest) Async(async bool) *AffinityGroupHostServiceRemoveRequest { p.async = &async return p } -func (p *TemplateNicServiceUpdateRequest) Nic(nic *Nic) *TemplateNicServiceUpdateRequest { - p.nic = nic - return p -} - -func (p *TemplateNicServiceUpdateRequest) Send() (*TemplateNicServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateNicService.connection.URL(), p.TemplateNicService.path) +func (p *AffinityGroupHostServiceRemoveRequest) Send() (*AffinityGroupHostServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupHostService.connection.URL(), p.AffinityGroupHostService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -783,19 +659,12 @@ func (p *TemplateNicServiceUpdateRequest) Send() (*TemplateNicServiceUpdateRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLNicWriteOne(writer, p.nic, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.TemplateNicService.connection.headers { + for hk, hv := range p.AffinityGroupHostService.connection.headers { req.Header.Add(hk, hv) } @@ -810,18 +679,18 @@ func (p *TemplateNicServiceUpdateRequest) Send() (*TemplateNicServiceUpdateRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateNicService.connection.authenticate() + token, err := p.AffinityGroupHostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateNicService.connection.client.Do(req) + resp, err := p.AffinityGroupHostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateNicService.connection.logFunc != nil { + if p.AffinityGroupHostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -830,24 +699,19 @@ func (p *TemplateNicServiceUpdateRequest) Send() (*TemplateNicServiceUpdateRespo if err != nil { return nil, err } - p.TemplateNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupHostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadOne(reader, nil, "") - if err != nil { - return nil, err - } - return &TemplateNicServiceUpdateResponse{nic: result}, nil + return new(AffinityGroupHostServiceRemoveResponse), nil } -func (p *TemplateNicServiceUpdateRequest) MustSend() *TemplateNicServiceUpdateResponse { +func (p *AffinityGroupHostServiceRemoveRequest) MustSend() *AffinityGroupHostServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -856,70 +720,67 @@ func (p *TemplateNicServiceUpdateRequest) MustSend() *TemplateNicServiceUpdateRe } // -// Update the specified network interface card attached to the template. +// Remove host from the affinity group. // -type TemplateNicServiceUpdateResponse struct { - nic *Nic -} - -func (p *TemplateNicServiceUpdateResponse) Nic() (*Nic, bool) { - if p.nic != nil { - return p.nic, true - } - return nil, false -} - -func (p *TemplateNicServiceUpdateResponse) MustNic() *Nic { - if p.nic == nil { - panic("nic in response does not exist") - } - return p.nic +type AffinityGroupHostServiceRemoveResponse struct { } // -// Update the specified network interface card attached to the template. +// Remove host from the affinity group. // -func (p *TemplateNicService) Update() *TemplateNicServiceUpdateRequest { - return &TemplateNicServiceUpdateRequest{TemplateNicService: p} +func (p *AffinityGroupHostService) Remove() *AffinityGroupHostServiceRemoveRequest { + return &AffinityGroupHostServiceRemoveRequest{AffinityGroupHostService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *TemplateNicService) Service(path string) (Service, error) { +func (op *AffinityGroupHostService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *TemplateNicService) String() string { - return fmt.Sprintf("TemplateNicService:%s", op.path) +func (op *AffinityGroupHostService) String() string { + return fmt.Sprintf("AffinityGroupHostService:%s", op.path) } // +// This service manages a collection of all hosts assigned to an affinity group. // -type NetworkLabelService struct { +type AffinityGroupHostsService struct { BaseService } -func NewNetworkLabelService(connection *Connection, path string) *NetworkLabelService { - var result NetworkLabelService +func NewAffinityGroupHostsService(connection *Connection, path string) *AffinityGroupHostsService { + var result AffinityGroupHostsService result.connection = connection result.path = path return &result } // +// Adds a host to the affinity group. +// For example, to add the host `789` to the affinity group `456` of cluster `123`, send a request like +// this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/hosts +// .... +// With the following body: +// [source,xml] +// ---- +// +// ---- // -type NetworkLabelServiceGetRequest struct { - NetworkLabelService *NetworkLabelService - header map[string]string - query map[string]string - follow *string +type AffinityGroupHostsServiceAddRequest struct { + AffinityGroupHostsService *AffinityGroupHostsService + header map[string]string + query map[string]string + host *Host } -func (p *NetworkLabelServiceGetRequest) Header(key, value string) *NetworkLabelServiceGetRequest { +func (p *AffinityGroupHostsServiceAddRequest) Header(key, value string) *AffinityGroupHostsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -927,7 +788,7 @@ func (p *NetworkLabelServiceGetRequest) Header(key, value string) *NetworkLabelS return p } -func (p *NetworkLabelServiceGetRequest) Query(key, value string) *NetworkLabelServiceGetRequest { +func (p *AffinityGroupHostsServiceAddRequest) Query(key, value string) *AffinityGroupHostsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -935,18 +796,14 @@ func (p *NetworkLabelServiceGetRequest) Query(key, value string) *NetworkLabelSe return p } -func (p *NetworkLabelServiceGetRequest) Follow(follow string) *NetworkLabelServiceGetRequest { - p.follow = &follow +func (p *AffinityGroupHostsServiceAddRequest) Host(host *Host) *AffinityGroupHostsServiceAddRequest { + p.host = host return p } -func (p *NetworkLabelServiceGetRequest) Send() (*NetworkLabelServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.NetworkLabelService.connection.URL(), p.NetworkLabelService.path) +func (p *AffinityGroupHostsServiceAddRequest) Send() (*AffinityGroupHostsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupHostsService.connection.URL(), p.AffinityGroupHostsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -955,12 +812,19 @@ func (p *NetworkLabelServiceGetRequest) Send() (*NetworkLabelServiceGetResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLHostWriteOne(writer, p.host, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.NetworkLabelService.connection.headers { + for hk, hv := range p.AffinityGroupHostsService.connection.headers { req.Header.Add(hk, hv) } @@ -975,18 +839,18 @@ func (p *NetworkLabelServiceGetRequest) Send() (*NetworkLabelServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.NetworkLabelService.connection.authenticate() + token, err := p.AffinityGroupHostsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.NetworkLabelService.connection.client.Do(req) + resp, err := p.AffinityGroupHostsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.NetworkLabelService.connection.logFunc != nil { + if p.AffinityGroupHostsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -995,9 +859,9 @@ func (p *NetworkLabelServiceGetRequest) Send() (*NetworkLabelServiceGetResponse, if err != nil { return nil, err } - p.NetworkLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupHostsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -1005,14 +869,14 @@ func (p *NetworkLabelServiceGetRequest) Send() (*NetworkLabelServiceGetResponse, return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkLabelReadOne(reader, nil, "") + result, err := XMLHostReadOne(reader, nil, "") if err != nil { return nil, err } - return &NetworkLabelServiceGetResponse{label: result}, nil + return &AffinityGroupHostsServiceAddResponse{host: result}, nil } -func (p *NetworkLabelServiceGetRequest) MustSend() *NetworkLabelServiceGetResponse { +func (p *AffinityGroupHostsServiceAddRequest) MustSend() *AffinityGroupHostsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -1021,47 +885,66 @@ func (p *NetworkLabelServiceGetRequest) MustSend() *NetworkLabelServiceGetRespon } // +// Adds a host to the affinity group. +// For example, to add the host `789` to the affinity group `456` of cluster `123`, send a request like +// this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/hosts +// .... +// With the following body: +// [source,xml] +// ---- +// +// ---- // -type NetworkLabelServiceGetResponse struct { - label *NetworkLabel +type AffinityGroupHostsServiceAddResponse struct { + host *Host } -func (p *NetworkLabelServiceGetResponse) Label() (*NetworkLabel, bool) { - if p.label != nil { - return p.label, true +func (p *AffinityGroupHostsServiceAddResponse) Host() (*Host, bool) { + if p.host != nil { + return p.host, true } return nil, false } -func (p *NetworkLabelServiceGetResponse) MustLabel() *NetworkLabel { - if p.label == nil { - panic("label in response does not exist") +func (p *AffinityGroupHostsServiceAddResponse) MustHost() *Host { + if p.host == nil { + panic("host in response does not exist") } - return p.label + return p.host } // +// Adds a host to the affinity group. +// For example, to add the host `789` to the affinity group `456` of cluster `123`, send a request like +// this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/hosts +// .... +// With the following body: +// [source,xml] +// ---- +// +// ---- // -func (p *NetworkLabelService) Get() *NetworkLabelServiceGetRequest { - return &NetworkLabelServiceGetRequest{NetworkLabelService: p} +func (p *AffinityGroupHostsService) Add() *AffinityGroupHostsServiceAddRequest { + return &AffinityGroupHostsServiceAddRequest{AffinityGroupHostsService: p} } // -// Removes a label from a logical network. -// For example, to remove the label `exemplary` from a logical network having id `123` send the following request: -// [source] -// ---- -// DELETE /ovirt-engine/api/networks/123/networklabels/exemplary -// ---- +// List all hosts assigned to this affinity group. +// The order of the returned hosts isn't guaranteed. // -type NetworkLabelServiceRemoveRequest struct { - NetworkLabelService *NetworkLabelService - header map[string]string - query map[string]string - async *bool +type AffinityGroupHostsServiceListRequest struct { + AffinityGroupHostsService *AffinityGroupHostsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *NetworkLabelServiceRemoveRequest) Header(key, value string) *NetworkLabelServiceRemoveRequest { +func (p *AffinityGroupHostsServiceListRequest) Header(key, value string) *AffinityGroupHostsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -1069,7 +952,7 @@ func (p *NetworkLabelServiceRemoveRequest) Header(key, value string) *NetworkLab return p } -func (p *NetworkLabelServiceRemoveRequest) Query(key, value string) *NetworkLabelServiceRemoveRequest { +func (p *AffinityGroupHostsServiceListRequest) Query(key, value string) *AffinityGroupHostsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -1077,16 +960,25 @@ func (p *NetworkLabelServiceRemoveRequest) Query(key, value string) *NetworkLabe return p } -func (p *NetworkLabelServiceRemoveRequest) Async(async bool) *NetworkLabelServiceRemoveRequest { - p.async = &async +func (p *AffinityGroupHostsServiceListRequest) Follow(follow string) *AffinityGroupHostsServiceListRequest { + p.follow = &follow return p } -func (p *NetworkLabelServiceRemoveRequest) Send() (*NetworkLabelServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.NetworkLabelService.connection.URL(), p.NetworkLabelService.path) +func (p *AffinityGroupHostsServiceListRequest) Max(max int64) *AffinityGroupHostsServiceListRequest { + p.max = &max + return p +} + +func (p *AffinityGroupHostsServiceListRequest) Send() (*AffinityGroupHostsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupHostsService.connection.URL(), p.AffinityGroupHostsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } if p.query != nil { @@ -1097,12 +989,12 @@ func (p *NetworkLabelServiceRemoveRequest) Send() (*NetworkLabelServiceRemoveRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.NetworkLabelService.connection.headers { + for hk, hv := range p.AffinityGroupHostsService.connection.headers { req.Header.Add(hk, hv) } @@ -1117,18 +1009,18 @@ func (p *NetworkLabelServiceRemoveRequest) Send() (*NetworkLabelServiceRemoveRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.NetworkLabelService.connection.authenticate() + token, err := p.AffinityGroupHostsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.NetworkLabelService.connection.client.Do(req) + resp, err := p.AffinityGroupHostsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.NetworkLabelService.connection.logFunc != nil { + if p.AffinityGroupHostsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -1137,19 +1029,24 @@ func (p *NetworkLabelServiceRemoveRequest) Send() (*NetworkLabelServiceRemoveRes if err != nil { return nil, err } - p.NetworkLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupHostsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(NetworkLabelServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLHostReadMany(reader, nil) + if err != nil { + return nil, err + } + return &AffinityGroupHostsServiceListResponse{hosts: result}, nil } -func (p *NetworkLabelServiceRemoveRequest) MustSend() *NetworkLabelServiceRemoveResponse { +func (p *AffinityGroupHostsServiceListRequest) MustSend() *AffinityGroupHostsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -1158,87 +1055,94 @@ func (p *NetworkLabelServiceRemoveRequest) MustSend() *NetworkLabelServiceRemove } // -// Removes a label from a logical network. -// For example, to remove the label `exemplary` from a logical network having id `123` send the following request: -// [source] -// ---- -// DELETE /ovirt-engine/api/networks/123/networklabels/exemplary -// ---- +// List all hosts assigned to this affinity group. +// The order of the returned hosts isn't guaranteed. // -type NetworkLabelServiceRemoveResponse struct { +type AffinityGroupHostsServiceListResponse struct { + hosts *HostSlice +} + +func (p *AffinityGroupHostsServiceListResponse) Hosts() (*HostSlice, bool) { + if p.hosts != nil { + return p.hosts, true + } + return nil, false +} + +func (p *AffinityGroupHostsServiceListResponse) MustHosts() *HostSlice { + if p.hosts == nil { + panic("hosts in response does not exist") + } + return p.hosts } // -// Removes a label from a logical network. -// For example, to remove the label `exemplary` from a logical network having id `123` send the following request: -// [source] -// ---- -// DELETE /ovirt-engine/api/networks/123/networklabels/exemplary -// ---- +// List all hosts assigned to this affinity group. +// The order of the returned hosts isn't guaranteed. // -func (p *NetworkLabelService) Remove() *NetworkLabelServiceRemoveRequest { - return &NetworkLabelServiceRemoveRequest{NetworkLabelService: p} +func (p *AffinityGroupHostsService) List() *AffinityGroupHostsServiceListRequest { + return &AffinityGroupHostsServiceListRequest{AffinityGroupHostsService: p} +} + +// +// Access the service that manages the host assignment to this affinity group. +// +func (op *AffinityGroupHostsService) HostService(id string) *AffinityGroupHostService { + return NewAffinityGroupHostService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *NetworkLabelService) Service(path string) (Service, error) { +func (op *AffinityGroupHostsService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.HostService(path), nil + } + return op.HostService(path[:index]).Service(path[index+1:]) } -func (op *NetworkLabelService) String() string { - return fmt.Sprintf("NetworkLabelService:%s", op.path) +func (op *AffinityGroupHostsService) String() string { + return fmt.Sprintf("AffinityGroupHostsService:%s", op.path) } // -// Represents a service to manage collection of event-subscription of a user. +// This service manages a single affinity group. // -type EventSubscriptionsService struct { +type AffinityGroupService struct { BaseService } -func NewEventSubscriptionsService(connection *Connection, path string) *EventSubscriptionsService { - var result EventSubscriptionsService +func NewAffinityGroupService(connection *Connection, path string) *AffinityGroupService { + var result AffinityGroupService result.connection = connection result.path = path return &result } // -// Add a new event-subscription to the system. -// An event-subscription is always added in the context of a user. For example, to add new -// event-subscription for `host_high_cpu_use` for user `123`, and have the notification -// sent to the e-mail address: `a@b.com`, send a request like this: -// .... -// POST /ovirt-engine/api/users/123/eventsubscriptions -// .... -// With a request body like this: +// Retrieve the affinity group details. // [source,xml] // ---- -// -// host_high_cpu_use -//
a@b.com
-//
+// +// AF_GROUP_001 +// +// true +// true +// // ---- -// The event name will become the ID of the new event-subscription entity: -// GET .../api/users/123/eventsubscriptions/host_high_cpu_use -// Note that no user id is provided in the request body. This is because the user-id (in this case 123) -// is already known to the API from the context. Note also that event-subscription entity contains -// notification-method field, but it is not provided either in the request body. This is because currently -// it's always set to SMTP as SNMP notifications are still unsupported by the API layer. // -type EventSubscriptionsServiceAddRequest struct { - EventSubscriptionsService *EventSubscriptionsService - header map[string]string - query map[string]string - eventSubscription *EventSubscription +type AffinityGroupServiceGetRequest struct { + AffinityGroupService *AffinityGroupService + header map[string]string + query map[string]string + follow *string } -func (p *EventSubscriptionsServiceAddRequest) Header(key, value string) *EventSubscriptionsServiceAddRequest { +func (p *AffinityGroupServiceGetRequest) Header(key, value string) *AffinityGroupServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -1246,7 +1150,7 @@ func (p *EventSubscriptionsServiceAddRequest) Header(key, value string) *EventSu return p } -func (p *EventSubscriptionsServiceAddRequest) Query(key, value string) *EventSubscriptionsServiceAddRequest { +func (p *AffinityGroupServiceGetRequest) Query(key, value string) *AffinityGroupServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -1254,14 +1158,18 @@ func (p *EventSubscriptionsServiceAddRequest) Query(key, value string) *EventSub return p } -func (p *EventSubscriptionsServiceAddRequest) EventSubscription(eventSubscription *EventSubscription) *EventSubscriptionsServiceAddRequest { - p.eventSubscription = eventSubscription +func (p *AffinityGroupServiceGetRequest) Follow(follow string) *AffinityGroupServiceGetRequest { + p.follow = &follow return p } -func (p *EventSubscriptionsServiceAddRequest) Send() (*EventSubscriptionsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.EventSubscriptionsService.connection.URL(), p.EventSubscriptionsService.path) +func (p *AffinityGroupServiceGetRequest) Send() (*AffinityGroupServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupService.connection.URL(), p.AffinityGroupService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -1270,19 +1178,12 @@ func (p *EventSubscriptionsServiceAddRequest) Send() (*EventSubscriptionsService if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLEventSubscriptionWriteOne(writer, p.eventSubscription, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.EventSubscriptionsService.connection.headers { + for hk, hv := range p.AffinityGroupService.connection.headers { req.Header.Add(hk, hv) } @@ -1297,18 +1198,18 @@ func (p *EventSubscriptionsServiceAddRequest) Send() (*EventSubscriptionsService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.EventSubscriptionsService.connection.authenticate() + token, err := p.AffinityGroupService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.EventSubscriptionsService.connection.client.Do(req) + resp, err := p.AffinityGroupService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.EventSubscriptionsService.connection.logFunc != nil { + if p.AffinityGroupService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -1317,9 +1218,9 @@ func (p *EventSubscriptionsServiceAddRequest) Send() (*EventSubscriptionsService if err != nil { return nil, err } - p.EventSubscriptionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -1327,14 +1228,14 @@ func (p *EventSubscriptionsServiceAddRequest) Send() (*EventSubscriptionsService return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLEventSubscriptionReadOne(reader, nil, "") + result, err := XMLAffinityGroupReadOne(reader, nil, "") if err != nil { return nil, err } - return &EventSubscriptionsServiceAddResponse{eventSubscription: result}, nil + return &AffinityGroupServiceGetResponse{group: result}, nil } -func (p *EventSubscriptionsServiceAddRequest) MustSend() *EventSubscriptionsServiceAddResponse { +func (p *AffinityGroupServiceGetRequest) MustSend() *AffinityGroupServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -1343,106 +1244,66 @@ func (p *EventSubscriptionsServiceAddRequest) MustSend() *EventSubscriptionsServ } // -// Add a new event-subscription to the system. -// An event-subscription is always added in the context of a user. For example, to add new -// event-subscription for `host_high_cpu_use` for user `123`, and have the notification -// sent to the e-mail address: `a@b.com`, send a request like this: -// .... -// POST /ovirt-engine/api/users/123/eventsubscriptions -// .... -// With a request body like this: +// Retrieve the affinity group details. // [source,xml] // ---- -// -// host_high_cpu_use -//
a@b.com
-//
+// +// AF_GROUP_001 +// +// true +// true +// // ---- -// The event name will become the ID of the new event-subscription entity: -// GET .../api/users/123/eventsubscriptions/host_high_cpu_use -// Note that no user id is provided in the request body. This is because the user-id (in this case 123) -// is already known to the API from the context. Note also that event-subscription entity contains -// notification-method field, but it is not provided either in the request body. This is because currently -// it's always set to SMTP as SNMP notifications are still unsupported by the API layer. // -type EventSubscriptionsServiceAddResponse struct { - eventSubscription *EventSubscription +type AffinityGroupServiceGetResponse struct { + group *AffinityGroup } -func (p *EventSubscriptionsServiceAddResponse) EventSubscription() (*EventSubscription, bool) { - if p.eventSubscription != nil { - return p.eventSubscription, true +func (p *AffinityGroupServiceGetResponse) Group() (*AffinityGroup, bool) { + if p.group != nil { + return p.group, true } return nil, false } -func (p *EventSubscriptionsServiceAddResponse) MustEventSubscription() *EventSubscription { - if p.eventSubscription == nil { - panic("eventSubscription in response does not exist") +func (p *AffinityGroupServiceGetResponse) MustGroup() *AffinityGroup { + if p.group == nil { + panic("group in response does not exist") } - return p.eventSubscription + return p.group } // -// Add a new event-subscription to the system. -// An event-subscription is always added in the context of a user. For example, to add new -// event-subscription for `host_high_cpu_use` for user `123`, and have the notification -// sent to the e-mail address: `a@b.com`, send a request like this: -// .... -// POST /ovirt-engine/api/users/123/eventsubscriptions -// .... -// With a request body like this: +// Retrieve the affinity group details. // [source,xml] // ---- -// -// host_high_cpu_use -//
a@b.com
-//
+// +// AF_GROUP_001 +// +// true +// true +// // ---- -// The event name will become the ID of the new event-subscription entity: -// GET .../api/users/123/eventsubscriptions/host_high_cpu_use -// Note that no user id is provided in the request body. This is because the user-id (in this case 123) -// is already known to the API from the context. Note also that event-subscription entity contains -// notification-method field, but it is not provided either in the request body. This is because currently -// it's always set to SMTP as SNMP notifications are still unsupported by the API layer. // -func (p *EventSubscriptionsService) Add() *EventSubscriptionsServiceAddRequest { - return &EventSubscriptionsServiceAddRequest{EventSubscriptionsService: p} +func (p *AffinityGroupService) Get() *AffinityGroupServiceGetRequest { + return &AffinityGroupServiceGetRequest{AffinityGroupService: p} } // -// List the event-subscriptions for the provided user. -// For example to list event-subscriptions for user `123`: -// .... -// GET /ovirt-engine/api/users/123/event-subscriptions -// .... -// [source,xml] +// Remove the affinity group. +// [source] // ---- -// -// -// host_install_failed -// smtp -// -//
a@b.com
-//
-// -// vm_paused -// smtp -// -//
a@b.com
-//
-//
+// DELETE /ovirt-engine/api/clusters/000-000/affinitygroups/123-456 // ---- // -type EventSubscriptionsServiceListRequest struct { - EventSubscriptionsService *EventSubscriptionsService - header map[string]string - query map[string]string - follow *string - max *int64 +type AffinityGroupServiceRemoveRequest struct { + AffinityGroupService *AffinityGroupService + header map[string]string + query map[string]string + async *bool } -func (p *EventSubscriptionsServiceListRequest) Header(key, value string) *EventSubscriptionsServiceListRequest { +func (p *AffinityGroupServiceRemoveRequest) Header(key, value string) *AffinityGroupServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -1450,7 +1311,7 @@ func (p *EventSubscriptionsServiceListRequest) Header(key, value string) *EventS return p } -func (p *EventSubscriptionsServiceListRequest) Query(key, value string) *EventSubscriptionsServiceListRequest { +func (p *AffinityGroupServiceRemoveRequest) Query(key, value string) *AffinityGroupServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -1458,25 +1319,16 @@ func (p *EventSubscriptionsServiceListRequest) Query(key, value string) *EventSu return p } -func (p *EventSubscriptionsServiceListRequest) Follow(follow string) *EventSubscriptionsServiceListRequest { - p.follow = &follow - return p -} - -func (p *EventSubscriptionsServiceListRequest) Max(max int64) *EventSubscriptionsServiceListRequest { - p.max = &max +func (p *AffinityGroupServiceRemoveRequest) Async(async bool) *AffinityGroupServiceRemoveRequest { + p.async = &async return p } -func (p *EventSubscriptionsServiceListRequest) Send() (*EventSubscriptionsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.EventSubscriptionsService.connection.URL(), p.EventSubscriptionsService.path) +func (p *AffinityGroupServiceRemoveRequest) Send() (*AffinityGroupServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupService.connection.URL(), p.AffinityGroupService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -1487,12 +1339,12 @@ func (p *EventSubscriptionsServiceListRequest) Send() (*EventSubscriptionsServic if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.EventSubscriptionsService.connection.headers { + for hk, hv := range p.AffinityGroupService.connection.headers { req.Header.Add(hk, hv) } @@ -1507,18 +1359,18 @@ func (p *EventSubscriptionsServiceListRequest) Send() (*EventSubscriptionsServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.EventSubscriptionsService.connection.authenticate() + token, err := p.AffinityGroupService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.EventSubscriptionsService.connection.client.Do(req) + resp, err := p.AffinityGroupService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.EventSubscriptionsService.connection.logFunc != nil { + if p.AffinityGroupService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -1527,24 +1379,19 @@ func (p *EventSubscriptionsServiceListRequest) Send() (*EventSubscriptionsServic if err != nil { return nil, err } - p.EventSubscriptionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLEventSubscriptionReadMany(reader, nil) - if err != nil { - return nil, err - } - return &EventSubscriptionsServiceListResponse{eventSubscriptions: result}, nil + return new(AffinityGroupServiceRemoveResponse), nil } -func (p *EventSubscriptionsServiceListRequest) MustSend() *EventSubscriptionsServiceListResponse { +func (p *AffinityGroupServiceRemoveRequest) MustSend() *AffinityGroupServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -1553,126 +1400,38 @@ func (p *EventSubscriptionsServiceListRequest) MustSend() *EventSubscriptionsSer } // -// List the event-subscriptions for the provided user. -// For example to list event-subscriptions for user `123`: -// .... -// GET /ovirt-engine/api/users/123/event-subscriptions -// .... -// [source,xml] +// Remove the affinity group. +// [source] // ---- -// -// -// host_install_failed -// smtp -// -//
a@b.com
-//
-// -// vm_paused -// smtp -// -//
a@b.com
-//
-//
+// DELETE /ovirt-engine/api/clusters/000-000/affinitygroups/123-456 // ---- // -type EventSubscriptionsServiceListResponse struct { - eventSubscriptions *EventSubscriptionSlice -} - -func (p *EventSubscriptionsServiceListResponse) EventSubscriptions() (*EventSubscriptionSlice, bool) { - if p.eventSubscriptions != nil { - return p.eventSubscriptions, true - } - return nil, false -} - -func (p *EventSubscriptionsServiceListResponse) MustEventSubscriptions() *EventSubscriptionSlice { - if p.eventSubscriptions == nil { - panic("eventSubscriptions in response does not exist") - } - return p.eventSubscriptions +type AffinityGroupServiceRemoveResponse struct { } // -// List the event-subscriptions for the provided user. -// For example to list event-subscriptions for user `123`: -// .... -// GET /ovirt-engine/api/users/123/event-subscriptions -// .... -// [source,xml] +// Remove the affinity group. +// [source] // ---- -// -// -// host_install_failed -// smtp -// -//
a@b.com
-//
-// -// vm_paused -// smtp -// -//
a@b.com
-//
-//
+// DELETE /ovirt-engine/api/clusters/000-000/affinitygroups/123-456 // ---- // -func (p *EventSubscriptionsService) List() *EventSubscriptionsServiceListRequest { - return &EventSubscriptionsServiceListRequest{EventSubscriptionsService: p} -} - -// -// Reference to the service that manages a specific event-subscription. -// -func (op *EventSubscriptionsService) EventSubscriptionService(id string) *EventSubscriptionService { - return NewEventSubscriptionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *EventSubscriptionsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.EventSubscriptionService(path), nil - } - return op.EventSubscriptionService(path[:index]).Service(path[index+1:]) -} - -func (op *EventSubscriptionsService) String() string { - return fmt.Sprintf("EventSubscriptionsService:%s", op.path) -} - -// -// This service represents one label to entity assignment -// when accessed using the entities/affinitylabels subcollection. -// -type AssignedAffinityLabelService struct { - BaseService -} - -func NewAssignedAffinityLabelService(connection *Connection, path string) *AssignedAffinityLabelService { - var result AssignedAffinityLabelService - result.connection = connection - result.path = path - return &result +func (p *AffinityGroupService) Remove() *AffinityGroupServiceRemoveRequest { + return &AffinityGroupServiceRemoveRequest{AffinityGroupService: p} } // -// Retrieves details about the attached label. +// Update the affinity group. // -type AssignedAffinityLabelServiceGetRequest struct { - AssignedAffinityLabelService *AssignedAffinityLabelService - header map[string]string - query map[string]string - follow *string +type AffinityGroupServiceUpdateRequest struct { + AffinityGroupService *AffinityGroupService + header map[string]string + query map[string]string + async *bool + group *AffinityGroup } -func (p *AssignedAffinityLabelServiceGetRequest) Header(key, value string) *AssignedAffinityLabelServiceGetRequest { +func (p *AffinityGroupServiceUpdateRequest) Header(key, value string) *AffinityGroupServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -1680,7 +1439,7 @@ func (p *AssignedAffinityLabelServiceGetRequest) Header(key, value string) *Assi return p } -func (p *AssignedAffinityLabelServiceGetRequest) Query(key, value string) *AssignedAffinityLabelServiceGetRequest { +func (p *AffinityGroupServiceUpdateRequest) Query(key, value string) *AffinityGroupServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -1688,16 +1447,21 @@ func (p *AssignedAffinityLabelServiceGetRequest) Query(key, value string) *Assig return p } -func (p *AssignedAffinityLabelServiceGetRequest) Follow(follow string) *AssignedAffinityLabelServiceGetRequest { - p.follow = &follow +func (p *AffinityGroupServiceUpdateRequest) Async(async bool) *AffinityGroupServiceUpdateRequest { + p.async = &async return p } -func (p *AssignedAffinityLabelServiceGetRequest) Send() (*AssignedAffinityLabelServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelService.connection.URL(), p.AssignedAffinityLabelService.path) +func (p *AffinityGroupServiceUpdateRequest) Group(group *AffinityGroup) *AffinityGroupServiceUpdateRequest { + p.group = group + return p +} + +func (p *AffinityGroupServiceUpdateRequest) Send() (*AffinityGroupServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupService.connection.URL(), p.AffinityGroupService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -1708,12 +1472,19 @@ func (p *AssignedAffinityLabelServiceGetRequest) Send() (*AssignedAffinityLabelS if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLAffinityGroupWriteOne(writer, p.group, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AssignedAffinityLabelService.connection.headers { + for hk, hv := range p.AffinityGroupService.connection.headers { req.Header.Add(hk, hv) } @@ -1728,18 +1499,18 @@ func (p *AssignedAffinityLabelServiceGetRequest) Send() (*AssignedAffinityLabelS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedAffinityLabelService.connection.authenticate() + token, err := p.AffinityGroupService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedAffinityLabelService.connection.client.Do(req) + resp, err := p.AffinityGroupService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedAffinityLabelService.connection.logFunc != nil { + if p.AffinityGroupService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -1748,7 +1519,7 @@ func (p *AssignedAffinityLabelServiceGetRequest) Send() (*AssignedAffinityLabelS if err != nil { return nil, err } - p.AssignedAffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -1758,14 +1529,14 @@ func (p *AssignedAffinityLabelServiceGetRequest) Send() (*AssignedAffinityLabelS return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLAffinityLabelReadOne(reader, nil, "") + result, err := XMLAffinityGroupReadOne(reader, nil, "") if err != nil { return nil, err } - return &AssignedAffinityLabelServiceGetResponse{label: result}, nil + return &AffinityGroupServiceUpdateResponse{group: result}, nil } -func (p *AssignedAffinityLabelServiceGetRequest) MustSend() *AssignedAffinityLabelServiceGetResponse { +func (p *AffinityGroupServiceUpdateRequest) MustSend() *AffinityGroupServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -1774,43 +1545,132 @@ func (p *AssignedAffinityLabelServiceGetRequest) MustSend() *AssignedAffinityLab } // -// Retrieves details about the attached label. +// Update the affinity group. // -type AssignedAffinityLabelServiceGetResponse struct { - label *AffinityLabel +type AffinityGroupServiceUpdateResponse struct { + group *AffinityGroup } -func (p *AssignedAffinityLabelServiceGetResponse) Label() (*AffinityLabel, bool) { - if p.label != nil { - return p.label, true +func (p *AffinityGroupServiceUpdateResponse) Group() (*AffinityGroup, bool) { + if p.group != nil { + return p.group, true } return nil, false } -func (p *AssignedAffinityLabelServiceGetResponse) MustLabel() *AffinityLabel { - if p.label == nil { - panic("label in response does not exist") +func (p *AffinityGroupServiceUpdateResponse) MustGroup() *AffinityGroup { + if p.group == nil { + panic("group in response does not exist") } - return p.label + return p.group } // -// Retrieves details about the attached label. +// Update the affinity group. // -func (p *AssignedAffinityLabelService) Get() *AssignedAffinityLabelServiceGetRequest { - return &AssignedAffinityLabelServiceGetRequest{AssignedAffinityLabelService: p} +func (p *AffinityGroupService) Update() *AffinityGroupServiceUpdateRequest { + return &AffinityGroupServiceUpdateRequest{AffinityGroupService: p} } // -// Removes the label from an entity. Does not touch the label itself. +// Returns a reference to the service that manages the +// list of all host labels attached to this affinity +// group. // -type AssignedAffinityLabelServiceRemoveRequest struct { - AssignedAffinityLabelService *AssignedAffinityLabelService - header map[string]string - query map[string]string +func (op *AffinityGroupService) HostLabelsService() *AffinityGroupHostLabelsService { + return NewAffinityGroupHostLabelsService(op.connection, fmt.Sprintf("%s/hostlabels", op.path)) } -func (p *AssignedAffinityLabelServiceRemoveRequest) Header(key, value string) *AssignedAffinityLabelServiceRemoveRequest { +// +// Returns a reference to the service that manages the +// list of all hosts attached to this affinity +// group. +// +func (op *AffinityGroupService) HostsService() *AffinityGroupHostsService { + return NewAffinityGroupHostsService(op.connection, fmt.Sprintf("%s/hosts", op.path)) +} + +// +// Returns a reference to the service that manages the +// list of all virtual machine labels attached to this affinity +// group. +// +func (op *AffinityGroupService) VmLabelsService() *AffinityGroupVmLabelsService { + return NewAffinityGroupVmLabelsService(op.connection, fmt.Sprintf("%s/vmlabels", op.path)) +} + +// +// Returns a reference to the service that manages the +// list of all virtual machines attached to this affinity +// group. +// +func (op *AffinityGroupService) VmsService() *AffinityGroupVmsService { + return NewAffinityGroupVmsService(op.connection, fmt.Sprintf("%s/vms", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AffinityGroupService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "hostlabels" { + return op.HostLabelsService(), nil + } + if strings.HasPrefix(path, "hostlabels/") { + return op.HostLabelsService().Service(path[11:]) + } + if path == "hosts" { + return op.HostsService(), nil + } + if strings.HasPrefix(path, "hosts/") { + return op.HostsService().Service(path[6:]) + } + if path == "vmlabels" { + return op.VmLabelsService(), nil + } + if strings.HasPrefix(path, "vmlabels/") { + return op.VmLabelsService().Service(path[9:]) + } + if path == "vms" { + return op.VmsService(), nil + } + if strings.HasPrefix(path, "vms/") { + return op.VmsService().Service(path[4:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *AffinityGroupService) String() string { + return fmt.Sprintf("AffinityGroupService:%s", op.path) +} + +// +// This service manages a single virtual machine label assigned to an affinity group. +// +type AffinityGroupVmLabelService struct { + BaseService +} + +func NewAffinityGroupVmLabelService(connection *Connection, path string) *AffinityGroupVmLabelService { + var result AffinityGroupVmLabelService + result.connection = connection + result.path = path + return &result +} + +// +// Remove this label from the affinity group. +// +type AffinityGroupVmLabelServiceRemoveRequest struct { + AffinityGroupVmLabelService *AffinityGroupVmLabelService + header map[string]string + query map[string]string + async *bool +} + +func (p *AffinityGroupVmLabelServiceRemoveRequest) Header(key, value string) *AffinityGroupVmLabelServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -1818,7 +1678,7 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) Header(key, value string) *A return p } -func (p *AssignedAffinityLabelServiceRemoveRequest) Query(key, value string) *AssignedAffinityLabelServiceRemoveRequest { +func (p *AffinityGroupVmLabelServiceRemoveRequest) Query(key, value string) *AffinityGroupVmLabelServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -1826,9 +1686,18 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) Query(key, value string) *As return p } -func (p *AssignedAffinityLabelServiceRemoveRequest) Send() (*AssignedAffinityLabelServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelService.connection.URL(), p.AssignedAffinityLabelService.path) +func (p *AffinityGroupVmLabelServiceRemoveRequest) Async(async bool) *AffinityGroupVmLabelServiceRemoveRequest { + p.async = &async + return p +} + +func (p *AffinityGroupVmLabelServiceRemoveRequest) Send() (*AffinityGroupVmLabelServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupVmLabelService.connection.URL(), p.AffinityGroupVmLabelService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -1842,7 +1711,7 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) Send() (*AssignedAffinityLab return nil, err } - for hk, hv := range p.AssignedAffinityLabelService.connection.headers { + for hk, hv := range p.AffinityGroupVmLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -1857,18 +1726,18 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) Send() (*AssignedAffinityLab req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedAffinityLabelService.connection.authenticate() + token, err := p.AffinityGroupVmLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedAffinityLabelService.connection.client.Do(req) + resp, err := p.AffinityGroupVmLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedAffinityLabelService.connection.logFunc != nil { + if p.AffinityGroupVmLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -1877,7 +1746,7 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) Send() (*AssignedAffinityLab if err != nil { return nil, err } - p.AssignedAffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupVmLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -1886,10 +1755,10 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) Send() (*AssignedAffinityLab if errReadBody != nil { return nil, errReadBody } - return new(AssignedAffinityLabelServiceRemoveResponse), nil + return new(AffinityGroupVmLabelServiceRemoveResponse), nil } -func (p *AssignedAffinityLabelServiceRemoveRequest) MustSend() *AssignedAffinityLabelServiceRemoveResponse { +func (p *AffinityGroupVmLabelServiceRemoveRequest) MustSend() *AffinityGroupVmLabelServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -1898,69 +1767,67 @@ func (p *AssignedAffinityLabelServiceRemoveRequest) MustSend() *AssignedAffinity } // -// Removes the label from an entity. Does not touch the label itself. +// Remove this label from the affinity group. // -type AssignedAffinityLabelServiceRemoveResponse struct { +type AffinityGroupVmLabelServiceRemoveResponse struct { } // -// Removes the label from an entity. Does not touch the label itself. +// Remove this label from the affinity group. // -func (p *AssignedAffinityLabelService) Remove() *AssignedAffinityLabelServiceRemoveRequest { - return &AssignedAffinityLabelServiceRemoveRequest{AssignedAffinityLabelService: p} +func (p *AffinityGroupVmLabelService) Remove() *AffinityGroupVmLabelServiceRemoveRequest { + return &AffinityGroupVmLabelServiceRemoveRequest{AffinityGroupVmLabelService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *AssignedAffinityLabelService) Service(path string) (Service, error) { +func (op *AffinityGroupVmLabelService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *AssignedAffinityLabelService) String() string { - return fmt.Sprintf("AssignedAffinityLabelService:%s", op.path) +func (op *AffinityGroupVmLabelService) String() string { + return fmt.Sprintf("AffinityGroupVmLabelService:%s", op.path) } // -// Manages the ser of labels attached to a network or to a host NIC. +// This service manages a collection of all virtual machine labels assigned to an affinity group. // -type NetworkLabelsService struct { +type AffinityGroupVmLabelsService struct { BaseService } -func NewNetworkLabelsService(connection *Connection, path string) *NetworkLabelsService { - var result NetworkLabelsService +func NewAffinityGroupVmLabelsService(connection *Connection, path string) *AffinityGroupVmLabelsService { + var result AffinityGroupVmLabelsService result.connection = connection result.path = path return &result } // -// Attaches label to logical network. -// You can attach labels to a logical network to automate the association of that logical network with physical host -// network interfaces to which the same label has been attached. -// For example, to attach the label `mylabel` to a logical network having id `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/networks/123/networklabels -// ---- -// With a request body like this: +// Adds a virtual machine label to the affinity group. +// For example, to add the label `789` to the affinity group `456` of cluster `123`, +// send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/vmlabels +// .... +// With the following body: // [source,xml] // ---- -// +// // ---- // -type NetworkLabelsServiceAddRequest struct { - NetworkLabelsService *NetworkLabelsService - header map[string]string - query map[string]string - label *NetworkLabel -} - -func (p *NetworkLabelsServiceAddRequest) Header(key, value string) *NetworkLabelsServiceAddRequest { +type AffinityGroupVmLabelsServiceAddRequest struct { + AffinityGroupVmLabelsService *AffinityGroupVmLabelsService + header map[string]string + query map[string]string + label *AffinityLabel +} + +func (p *AffinityGroupVmLabelsServiceAddRequest) Header(key, value string) *AffinityGroupVmLabelsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -1968,7 +1835,7 @@ func (p *NetworkLabelsServiceAddRequest) Header(key, value string) *NetworkLabel return p } -func (p *NetworkLabelsServiceAddRequest) Query(key, value string) *NetworkLabelsServiceAddRequest { +func (p *AffinityGroupVmLabelsServiceAddRequest) Query(key, value string) *AffinityGroupVmLabelsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -1976,13 +1843,13 @@ func (p *NetworkLabelsServiceAddRequest) Query(key, value string) *NetworkLabels return p } -func (p *NetworkLabelsServiceAddRequest) Label(label *NetworkLabel) *NetworkLabelsServiceAddRequest { +func (p *AffinityGroupVmLabelsServiceAddRequest) Label(label *AffinityLabel) *AffinityGroupVmLabelsServiceAddRequest { p.label = label return p } -func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.NetworkLabelsService.connection.URL(), p.NetworkLabelsService.path) +func (p *AffinityGroupVmLabelsServiceAddRequest) Send() (*AffinityGroupVmLabelsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupVmLabelsService.connection.URL(), p.AffinityGroupVmLabelsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -1994,7 +1861,7 @@ func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddRespons } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLNetworkLabelWriteOne(writer, p.label, "") + err := XMLAffinityLabelWriteOne(writer, p.label, "") if err != nil { return nil, err } @@ -2004,7 +1871,7 @@ func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddRespons return nil, err } - for hk, hv := range p.NetworkLabelsService.connection.headers { + for hk, hv := range p.AffinityGroupVmLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -2019,18 +1886,18 @@ func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.NetworkLabelsService.connection.authenticate() + token, err := p.AffinityGroupVmLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.NetworkLabelsService.connection.client.Do(req) + resp, err := p.AffinityGroupVmLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.NetworkLabelsService.connection.logFunc != nil { + if p.AffinityGroupVmLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -2039,7 +1906,7 @@ func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddRespons if err != nil { return nil, err } - p.NetworkLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupVmLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -2049,14 +1916,14 @@ func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkLabelReadOne(reader, nil, "") + result, err := XMLAffinityLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &NetworkLabelsServiceAddResponse{label: result}, nil + return &AffinityGroupVmLabelsServiceAddResponse{label: result}, nil } -func (p *NetworkLabelsServiceAddRequest) MustSend() *NetworkLabelsServiceAddResponse { +func (p *AffinityGroupVmLabelsServiceAddRequest) MustSend() *AffinityGroupVmLabelsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -2065,32 +1932,30 @@ func (p *NetworkLabelsServiceAddRequest) MustSend() *NetworkLabelsServiceAddResp } // -// Attaches label to logical network. -// You can attach labels to a logical network to automate the association of that logical network with physical host -// network interfaces to which the same label has been attached. -// For example, to attach the label `mylabel` to a logical network having id `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/networks/123/networklabels -// ---- -// With a request body like this: +// Adds a virtual machine label to the affinity group. +// For example, to add the label `789` to the affinity group `456` of cluster `123`, +// send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/vmlabels +// .... +// With the following body: // [source,xml] // ---- -// +// // ---- // -type NetworkLabelsServiceAddResponse struct { - label *NetworkLabel +type AffinityGroupVmLabelsServiceAddResponse struct { + label *AffinityLabel } -func (p *NetworkLabelsServiceAddResponse) Label() (*NetworkLabel, bool) { +func (p *AffinityGroupVmLabelsServiceAddResponse) Label() (*AffinityLabel, bool) { if p.label != nil { return p.label, true } return nil, false } -func (p *NetworkLabelsServiceAddResponse) MustLabel() *NetworkLabel { +func (p *AffinityGroupVmLabelsServiceAddResponse) MustLabel() *AffinityLabel { if p.label == nil { panic("label in response does not exist") } @@ -2098,37 +1963,35 @@ func (p *NetworkLabelsServiceAddResponse) MustLabel() *NetworkLabel { } // -// Attaches label to logical network. -// You can attach labels to a logical network to automate the association of that logical network with physical host -// network interfaces to which the same label has been attached. -// For example, to attach the label `mylabel` to a logical network having id `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/networks/123/networklabels -// ---- -// With a request body like this: +// Adds a virtual machine label to the affinity group. +// For example, to add the label `789` to the affinity group `456` of cluster `123`, +// send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/vmlabels +// .... +// With the following body: // [source,xml] // ---- -// +// // ---- // -func (p *NetworkLabelsService) Add() *NetworkLabelsServiceAddRequest { - return &NetworkLabelsServiceAddRequest{NetworkLabelsService: p} +func (p *AffinityGroupVmLabelsService) Add() *AffinityGroupVmLabelsServiceAddRequest { + return &AffinityGroupVmLabelsServiceAddRequest{AffinityGroupVmLabelsService: p} } // -// Returns the list of labels attached to the network or host NIC. -// The order of the returned list of labels isn't guaranteed. +// List all virtual machine labels assigned to this affinity group. +// The order of the returned labels isn't guaranteed. // -type NetworkLabelsServiceListRequest struct { - NetworkLabelsService *NetworkLabelsService - header map[string]string - query map[string]string - follow *string - max *int64 +type AffinityGroupVmLabelsServiceListRequest struct { + AffinityGroupVmLabelsService *AffinityGroupVmLabelsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *NetworkLabelsServiceListRequest) Header(key, value string) *NetworkLabelsServiceListRequest { +func (p *AffinityGroupVmLabelsServiceListRequest) Header(key, value string) *AffinityGroupVmLabelsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -2136,7 +1999,7 @@ func (p *NetworkLabelsServiceListRequest) Header(key, value string) *NetworkLabe return p } -func (p *NetworkLabelsServiceListRequest) Query(key, value string) *NetworkLabelsServiceListRequest { +func (p *AffinityGroupVmLabelsServiceListRequest) Query(key, value string) *AffinityGroupVmLabelsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -2144,18 +2007,18 @@ func (p *NetworkLabelsServiceListRequest) Query(key, value string) *NetworkLabel return p } -func (p *NetworkLabelsServiceListRequest) Follow(follow string) *NetworkLabelsServiceListRequest { +func (p *AffinityGroupVmLabelsServiceListRequest) Follow(follow string) *AffinityGroupVmLabelsServiceListRequest { p.follow = &follow return p } -func (p *NetworkLabelsServiceListRequest) Max(max int64) *NetworkLabelsServiceListRequest { +func (p *AffinityGroupVmLabelsServiceListRequest) Max(max int64) *AffinityGroupVmLabelsServiceListRequest { p.max = &max return p } -func (p *NetworkLabelsServiceListRequest) Send() (*NetworkLabelsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.NetworkLabelsService.connection.URL(), p.NetworkLabelsService.path) +func (p *AffinityGroupVmLabelsServiceListRequest) Send() (*AffinityGroupVmLabelsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupVmLabelsService.connection.URL(), p.AffinityGroupVmLabelsService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -2178,7 +2041,7 @@ func (p *NetworkLabelsServiceListRequest) Send() (*NetworkLabelsServiceListRespo return nil, err } - for hk, hv := range p.NetworkLabelsService.connection.headers { + for hk, hv := range p.AffinityGroupVmLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -2193,18 +2056,18 @@ func (p *NetworkLabelsServiceListRequest) Send() (*NetworkLabelsServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.NetworkLabelsService.connection.authenticate() + token, err := p.AffinityGroupVmLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.NetworkLabelsService.connection.client.Do(req) + resp, err := p.AffinityGroupVmLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.NetworkLabelsService.connection.logFunc != nil { + if p.AffinityGroupVmLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -2213,7 +2076,7 @@ func (p *NetworkLabelsServiceListRequest) Send() (*NetworkLabelsServiceListRespo if err != nil { return nil, err } - p.NetworkLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupVmLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -2223,14 +2086,14 @@ func (p *NetworkLabelsServiceListRequest) Send() (*NetworkLabelsServiceListRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkLabelReadMany(reader, nil) + result, err := XMLAffinityLabelReadMany(reader, nil) if err != nil { return nil, err } - return &NetworkLabelsServiceListResponse{labels: result}, nil + return &AffinityGroupVmLabelsServiceListResponse{labels: result}, nil } -func (p *NetworkLabelsServiceListRequest) MustSend() *NetworkLabelsServiceListResponse { +func (p *AffinityGroupVmLabelsServiceListRequest) MustSend() *AffinityGroupVmLabelsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -2239,21 +2102,21 @@ func (p *NetworkLabelsServiceListRequest) MustSend() *NetworkLabelsServiceListRe } // -// Returns the list of labels attached to the network or host NIC. -// The order of the returned list of labels isn't guaranteed. +// List all virtual machine labels assigned to this affinity group. +// The order of the returned labels isn't guaranteed. // -type NetworkLabelsServiceListResponse struct { - labels *NetworkLabelSlice +type AffinityGroupVmLabelsServiceListResponse struct { + labels *AffinityLabelSlice } -func (p *NetworkLabelsServiceListResponse) Labels() (*NetworkLabelSlice, bool) { +func (p *AffinityGroupVmLabelsServiceListResponse) Labels() (*AffinityLabelSlice, bool) { if p.labels != nil { return p.labels, true } return nil, false } -func (p *NetworkLabelsServiceListResponse) MustLabels() *NetworkLabelSlice { +func (p *AffinityGroupVmLabelsServiceListResponse) MustLabels() *AffinityLabelSlice { if p.labels == nil { panic("labels in response does not exist") } @@ -2261,23 +2124,24 @@ func (p *NetworkLabelsServiceListResponse) MustLabels() *NetworkLabelSlice { } // -// Returns the list of labels attached to the network or host NIC. -// The order of the returned list of labels isn't guaranteed. +// List all virtual machine labels assigned to this affinity group. +// The order of the returned labels isn't guaranteed. // -func (p *NetworkLabelsService) List() *NetworkLabelsServiceListRequest { - return &NetworkLabelsServiceListRequest{NetworkLabelsService: p} +func (p *AffinityGroupVmLabelsService) List() *AffinityGroupVmLabelsServiceListRequest { + return &AffinityGroupVmLabelsServiceListRequest{AffinityGroupVmLabelsService: p} } // +// Access the service that manages the virtual machine label assignment to this affinity group. // -func (op *NetworkLabelsService) LabelService(id string) *NetworkLabelService { - return NewNetworkLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AffinityGroupVmLabelsService) LabelService(id string) *AffinityGroupVmLabelService { + return NewAffinityGroupVmLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *NetworkLabelsService) Service(path string) (Service, error) { +func (op *AffinityGroupVmLabelsService) Service(path string) (Service, error) { if path == "" { return op, nil } @@ -2288,33 +2152,35 @@ func (op *NetworkLabelsService) Service(path string) (Service, error) { return op.LabelService(path[:index]).Service(path[index+1:]) } -func (op *NetworkLabelsService) String() string { - return fmt.Sprintf("NetworkLabelsService:%s", op.path) +func (op *AffinityGroupVmLabelsService) String() string { + return fmt.Sprintf("AffinityGroupVmLabelsService:%s", op.path) } // +// This service manages a single virtual machine to affinity group assignment. // -type SnapshotDiskService struct { +type AffinityGroupVmService struct { BaseService } -func NewSnapshotDiskService(connection *Connection, path string) *SnapshotDiskService { - var result SnapshotDiskService +func NewAffinityGroupVmService(connection *Connection, path string) *AffinityGroupVmService { + var result AffinityGroupVmService result.connection = connection result.path = path return &result } // +// Remove this virtual machine from the affinity group. // -type SnapshotDiskServiceGetRequest struct { - SnapshotDiskService *SnapshotDiskService - header map[string]string - query map[string]string - follow *string +type AffinityGroupVmServiceRemoveRequest struct { + AffinityGroupVmService *AffinityGroupVmService + header map[string]string + query map[string]string + async *bool } -func (p *SnapshotDiskServiceGetRequest) Header(key, value string) *SnapshotDiskServiceGetRequest { +func (p *AffinityGroupVmServiceRemoveRequest) Header(key, value string) *AffinityGroupVmServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -2322,7 +2188,7 @@ func (p *SnapshotDiskServiceGetRequest) Header(key, value string) *SnapshotDiskS return p } -func (p *SnapshotDiskServiceGetRequest) Query(key, value string) *SnapshotDiskServiceGetRequest { +func (p *AffinityGroupVmServiceRemoveRequest) Query(key, value string) *AffinityGroupVmServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -2330,16 +2196,16 @@ func (p *SnapshotDiskServiceGetRequest) Query(key, value string) *SnapshotDiskSe return p } -func (p *SnapshotDiskServiceGetRequest) Follow(follow string) *SnapshotDiskServiceGetRequest { - p.follow = &follow +func (p *AffinityGroupVmServiceRemoveRequest) Async(async bool) *AffinityGroupVmServiceRemoveRequest { + p.async = &async return p } -func (p *SnapshotDiskServiceGetRequest) Send() (*SnapshotDiskServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SnapshotDiskService.connection.URL(), p.SnapshotDiskService.path) +func (p *AffinityGroupVmServiceRemoveRequest) Send() (*AffinityGroupVmServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupVmService.connection.URL(), p.AffinityGroupVmService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -2350,12 +2216,12 @@ func (p *SnapshotDiskServiceGetRequest) Send() (*SnapshotDiskServiceGetResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SnapshotDiskService.connection.headers { + for hk, hv := range p.AffinityGroupVmService.connection.headers { req.Header.Add(hk, hv) } @@ -2370,18 +2236,18 @@ func (p *SnapshotDiskServiceGetRequest) Send() (*SnapshotDiskServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SnapshotDiskService.connection.authenticate() + token, err := p.AffinityGroupVmService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SnapshotDiskService.connection.client.Do(req) + resp, err := p.AffinityGroupVmService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SnapshotDiskService.connection.logFunc != nil { + if p.AffinityGroupVmService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -2390,24 +2256,19 @@ func (p *SnapshotDiskServiceGetRequest) Send() (*SnapshotDiskServiceGetResponse, if err != nil { return nil, err } - p.SnapshotDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupVmService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") - if err != nil { - return nil, err - } - return &SnapshotDiskServiceGetResponse{disk: result}, nil + return new(AffinityGroupVmServiceRemoveResponse), nil } -func (p *SnapshotDiskServiceGetRequest) MustSend() *SnapshotDiskServiceGetResponse { +func (p *AffinityGroupVmServiceRemoveRequest) MustSend() *AffinityGroupVmServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -2416,90 +2277,67 @@ func (p *SnapshotDiskServiceGetRequest) MustSend() *SnapshotDiskServiceGetRespon } // +// Remove this virtual machine from the affinity group. // -type SnapshotDiskServiceGetResponse struct { - disk *Disk -} - -func (p *SnapshotDiskServiceGetResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true - } - return nil, false -} - -func (p *SnapshotDiskServiceGetResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") - } - return p.disk +type AffinityGroupVmServiceRemoveResponse struct { } // +// Remove this virtual machine from the affinity group. // -func (p *SnapshotDiskService) Get() *SnapshotDiskServiceGetRequest { - return &SnapshotDiskServiceGetRequest{SnapshotDiskService: p} +func (p *AffinityGroupVmService) Remove() *AffinityGroupVmServiceRemoveRequest { + return &AffinityGroupVmServiceRemoveRequest{AffinityGroupVmService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *SnapshotDiskService) Service(path string) (Service, error) { +func (op *AffinityGroupVmService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *SnapshotDiskService) String() string { - return fmt.Sprintf("SnapshotDiskService:%s", op.path) +func (op *AffinityGroupVmService) String() string { + return fmt.Sprintf("AffinityGroupVmService:%s", op.path) } // -// Manages a group of users. Use this service to either get groups details or remove groups. In order -// to add new groups please use <> that manages the collection of groups. +// This service manages a collection of all the virtual machines assigned to an affinity group. // -type GroupService struct { +type AffinityGroupVmsService struct { BaseService } -func NewGroupService(connection *Connection, path string) *GroupService { - var result GroupService +func NewAffinityGroupVmsService(connection *Connection, path string) *AffinityGroupVmsService { + var result AffinityGroupVmsService result.connection = connection result.path = path return &result } // -// Gets the system group information. -// Usage: +// Adds a virtual machine to the affinity group. +// For example, to add the virtual machine `789` to the affinity group `456` of cluster `123`, send a request like +// this: // .... -// GET /ovirt-engine/api/groups/123 +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/vms // .... -// Will return the group information: +// With the following body: // [source,xml] // ---- -// -// mygroup -// -// -// -// 476652557A382F67696B6D2B32762B37796E46476D513D3D -// DC=example,DC=com -// -// myextension-authz -// -// +// // ---- // -type GroupServiceGetRequest struct { - GroupService *GroupService - header map[string]string - query map[string]string - follow *string +type AffinityGroupVmsServiceAddRequest struct { + AffinityGroupVmsService *AffinityGroupVmsService + header map[string]string + query map[string]string + vm *Vm } -func (p *GroupServiceGetRequest) Header(key, value string) *GroupServiceGetRequest { +func (p *AffinityGroupVmsServiceAddRequest) Header(key, value string) *AffinityGroupVmsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -2507,7 +2345,7 @@ func (p *GroupServiceGetRequest) Header(key, value string) *GroupServiceGetReque return p } -func (p *GroupServiceGetRequest) Query(key, value string) *GroupServiceGetRequest { +func (p *AffinityGroupVmsServiceAddRequest) Query(key, value string) *AffinityGroupVmsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -2515,18 +2353,14 @@ func (p *GroupServiceGetRequest) Query(key, value string) *GroupServiceGetReques return p } -func (p *GroupServiceGetRequest) Follow(follow string) *GroupServiceGetRequest { - p.follow = &follow +func (p *AffinityGroupVmsServiceAddRequest) Vm(vm *Vm) *AffinityGroupVmsServiceAddRequest { + p.vm = vm return p } -func (p *GroupServiceGetRequest) Send() (*GroupServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GroupService.connection.URL(), p.GroupService.path) +func (p *AffinityGroupVmsServiceAddRequest) Send() (*AffinityGroupVmsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupVmsService.connection.URL(), p.AffinityGroupVmsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -2535,12 +2369,19 @@ func (p *GroupServiceGetRequest) Send() (*GroupServiceGetResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLVmWriteOne(writer, p.vm, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GroupService.connection.headers { + for hk, hv := range p.AffinityGroupVmsService.connection.headers { req.Header.Add(hk, hv) } @@ -2555,18 +2396,18 @@ func (p *GroupServiceGetRequest) Send() (*GroupServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GroupService.connection.authenticate() + token, err := p.AffinityGroupVmsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GroupService.connection.client.Do(req) + resp, err := p.AffinityGroupVmsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GroupService.connection.logFunc != nil { + if p.AffinityGroupVmsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -2575,9 +2416,9 @@ func (p *GroupServiceGetRequest) Send() (*GroupServiceGetResponse, error) { if err != nil { return nil, err } - p.GroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupVmsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -2585,14 +2426,14 @@ func (p *GroupServiceGetRequest) Send() (*GroupServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGroupReadOne(reader, nil, "") + result, err := XMLVmReadOne(reader, nil, "") if err != nil { return nil, err } - return &GroupServiceGetResponse{get: result}, nil + return &AffinityGroupVmsServiceAddResponse{vm: result}, nil } -func (p *GroupServiceGetRequest) MustSend() *GroupServiceGetResponse { +func (p *AffinityGroupVmsServiceAddRequest) MustSend() *AffinityGroupVmsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -2601,86 +2442,66 @@ func (p *GroupServiceGetRequest) MustSend() *GroupServiceGetResponse { } // -// Gets the system group information. -// Usage: +// Adds a virtual machine to the affinity group. +// For example, to add the virtual machine `789` to the affinity group `456` of cluster `123`, send a request like +// this: // .... -// GET /ovirt-engine/api/groups/123 +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/vms // .... -// Will return the group information: +// With the following body: // [source,xml] // ---- -// -// mygroup -// -// -// -// 476652557A382F67696B6D2B32762B37796E46476D513D3D -// DC=example,DC=com -// -// myextension-authz -// -// +// // ---- // -type GroupServiceGetResponse struct { - get *Group +type AffinityGroupVmsServiceAddResponse struct { + vm *Vm } -func (p *GroupServiceGetResponse) Get() (*Group, bool) { - if p.get != nil { - return p.get, true +func (p *AffinityGroupVmsServiceAddResponse) Vm() (*Vm, bool) { + if p.vm != nil { + return p.vm, true } return nil, false } -func (p *GroupServiceGetResponse) MustGet() *Group { - if p.get == nil { - panic("get in response does not exist") +func (p *AffinityGroupVmsServiceAddResponse) MustVm() *Vm { + if p.vm == nil { + panic("vm in response does not exist") } - return p.get + return p.vm } // -// Gets the system group information. -// Usage: +// Adds a virtual machine to the affinity group. +// For example, to add the virtual machine `789` to the affinity group `456` of cluster `123`, send a request like +// this: // .... -// GET /ovirt-engine/api/groups/123 +// POST /ovirt-engine/api/clusters/123/affinitygroups/456/vms // .... -// Will return the group information: +// With the following body: // [source,xml] // ---- -// -// mygroup -// -// -// -// 476652557A382F67696B6D2B32762B37796E46476D513D3D -// DC=example,DC=com -// -// myextension-authz -// -// +// // ---- // -func (p *GroupService) Get() *GroupServiceGetRequest { - return &GroupServiceGetRequest{GroupService: p} +func (p *AffinityGroupVmsService) Add() *AffinityGroupVmsServiceAddRequest { + return &AffinityGroupVmsServiceAddRequest{AffinityGroupVmsService: p} } // -// Removes the system group. -// Usage: -// .... -// DELETE /ovirt-engine/api/groups/123 -// .... +// List all virtual machines assigned to this affinity group. +// The order of the returned virtual machines isn't guaranteed. // -type GroupServiceRemoveRequest struct { - GroupService *GroupService - header map[string]string - query map[string]string - async *bool +type AffinityGroupVmsServiceListRequest struct { + AffinityGroupVmsService *AffinityGroupVmsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *GroupServiceRemoveRequest) Header(key, value string) *GroupServiceRemoveRequest { +func (p *AffinityGroupVmsServiceListRequest) Header(key, value string) *AffinityGroupVmsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -2688,7 +2509,7 @@ func (p *GroupServiceRemoveRequest) Header(key, value string) *GroupServiceRemov return p } -func (p *GroupServiceRemoveRequest) Query(key, value string) *GroupServiceRemoveRequest { +func (p *AffinityGroupVmsServiceListRequest) Query(key, value string) *AffinityGroupVmsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -2696,16 +2517,25 @@ func (p *GroupServiceRemoveRequest) Query(key, value string) *GroupServiceRemove return p } -func (p *GroupServiceRemoveRequest) Async(async bool) *GroupServiceRemoveRequest { - p.async = &async +func (p *AffinityGroupVmsServiceListRequest) Follow(follow string) *AffinityGroupVmsServiceListRequest { + p.follow = &follow return p } -func (p *GroupServiceRemoveRequest) Send() (*GroupServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GroupService.connection.URL(), p.GroupService.path) +func (p *AffinityGroupVmsServiceListRequest) Max(max int64) *AffinityGroupVmsServiceListRequest { + p.max = &max + return p +} + +func (p *AffinityGroupVmsServiceListRequest) Send() (*AffinityGroupVmsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupVmsService.connection.URL(), p.AffinityGroupVmsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } if p.query != nil { @@ -2716,12 +2546,12 @@ func (p *GroupServiceRemoveRequest) Send() (*GroupServiceRemoveResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GroupService.connection.headers { + for hk, hv := range p.AffinityGroupVmsService.connection.headers { req.Header.Add(hk, hv) } @@ -2736,18 +2566,18 @@ func (p *GroupServiceRemoveRequest) Send() (*GroupServiceRemoveResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GroupService.connection.authenticate() + token, err := p.AffinityGroupVmsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GroupService.connection.client.Do(req) + resp, err := p.AffinityGroupVmsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GroupService.connection.logFunc != nil { + if p.AffinityGroupVmsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -2756,19 +2586,24 @@ func (p *GroupServiceRemoveRequest) Send() (*GroupServiceRemoveResponse, error) if err != nil { return nil, err } - p.GroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupVmsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(GroupServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLVmReadMany(reader, nil) + if err != nil { + return nil, err + } + return &AffinityGroupVmsServiceListResponse{vms: result}, nil } -func (p *GroupServiceRemoveRequest) MustSend() *GroupServiceRemoveResponse { +func (p *AffinityGroupVmsServiceListRequest) MustSend() *AffinityGroupVmsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -2777,123 +2612,104 @@ func (p *GroupServiceRemoveRequest) MustSend() *GroupServiceRemoveResponse { } // -// Removes the system group. -// Usage: -// .... -// DELETE /ovirt-engine/api/groups/123 -// .... +// List all virtual machines assigned to this affinity group. +// The order of the returned virtual machines isn't guaranteed. // -type GroupServiceRemoveResponse struct { +type AffinityGroupVmsServiceListResponse struct { + vms *VmSlice } -// -// Removes the system group. -// Usage: -// .... -// DELETE /ovirt-engine/api/groups/123 -// .... -// -func (p *GroupService) Remove() *GroupServiceRemoveRequest { - return &GroupServiceRemoveRequest{GroupService: p} +func (p *AffinityGroupVmsServiceListResponse) Vms() (*VmSlice, bool) { + if p.vms != nil { + return p.vms, true + } + return nil, false } -// -// Reference to the service that manages the collection of permissions assigned to this system group. -// -func (op *GroupService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +func (p *AffinityGroupVmsServiceListResponse) MustVms() *VmSlice { + if p.vms == nil { + panic("vms in response does not exist") + } + return p.vms } // -// Reference to the service that manages the collection of roles assigned to this system group. +// List all virtual machines assigned to this affinity group. +// The order of the returned virtual machines isn't guaranteed. // -func (op *GroupService) RolesService() *AssignedRolesService { - return NewAssignedRolesService(op.connection, fmt.Sprintf("%s/roles", op.path)) +func (p *AffinityGroupVmsService) List() *AffinityGroupVmsServiceListRequest { + return &AffinityGroupVmsServiceListRequest{AffinityGroupVmsService: p} } // -// Reference to the service that manages the collection of tags assigned to this system group. +// Access the service that manages the virtual machine assignment to this affinity group. // -func (op *GroupService) TagsService() *AssignedTagsService { - return NewAssignedTagsService(op.connection, fmt.Sprintf("%s/tags", op.path)) +func (op *AffinityGroupVmsService) VmService(id string) *AffinityGroupVmService { + return NewAffinityGroupVmService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *GroupService) Service(path string) (Service, error) { +func (op *AffinityGroupVmsService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "permissions" { - return op.PermissionsService(), nil + index := strings.Index(path, "/") + if index == -1 { + return op.VmService(path), nil } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) - } - if path == "roles" { - return op.RolesService(), nil - } - if strings.HasPrefix(path, "roles/") { - return op.RolesService().Service(path[6:]) - } - if path == "tags" { - return op.TagsService(), nil - } - if strings.HasPrefix(path, "tags/") { - return op.TagsService().Service(path[5:]) - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return op.VmService(path[:index]).Service(path[index+1:]) } -func (op *GroupService) String() string { - return fmt.Sprintf("GroupService:%s", op.path) +func (op *AffinityGroupVmsService) String() string { + return fmt.Sprintf("AffinityGroupVmsService:%s", op.path) } // -// A service to list all authentication domains in the system. +// The affinity groups service manages virtual machine relationships and dependencies. // -type DomainsService struct { +type AffinityGroupsService struct { BaseService } -func NewDomainsService(connection *Connection, path string) *DomainsService { - var result DomainsService +func NewAffinityGroupsService(connection *Connection, path string) *AffinityGroupsService { + var result AffinityGroupsService result.connection = connection result.path = path return &result } // -// List all the authentication domains in the system. -// Usage: -// .... -// GET /ovirt-engine/api/domains -// .... -// Will return the list of domains: +// Create a new affinity group. +// Post a request like in the example below to create a new affinity group: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/000-000/affinitygroups +// ---- +// And use the following example in its body: // [source,xml] // ---- -// -// -// internal-authz -// -// -// -// -// -// +// +// AF_GROUP_001 +// +// true +// true +// +// +// false +// +// // ---- -// The order of the returned list of domains isn't guaranteed. // -type DomainsServiceListRequest struct { - DomainsService *DomainsService - header map[string]string - query map[string]string - follow *string - max *int64 +type AffinityGroupsServiceAddRequest struct { + AffinityGroupsService *AffinityGroupsService + header map[string]string + query map[string]string + group *AffinityGroup } -func (p *DomainsServiceListRequest) Header(key, value string) *DomainsServiceListRequest { +func (p *AffinityGroupsServiceAddRequest) Header(key, value string) *AffinityGroupsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -2901,7 +2717,7 @@ func (p *DomainsServiceListRequest) Header(key, value string) *DomainsServiceLis return p } -func (p *DomainsServiceListRequest) Query(key, value string) *DomainsServiceListRequest { +func (p *AffinityGroupsServiceAddRequest) Query(key, value string) *AffinityGroupsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -2909,27 +2725,14 @@ func (p *DomainsServiceListRequest) Query(key, value string) *DomainsServiceList return p } -func (p *DomainsServiceListRequest) Follow(follow string) *DomainsServiceListRequest { - p.follow = &follow - return p -} - -func (p *DomainsServiceListRequest) Max(max int64) *DomainsServiceListRequest { - p.max = &max +func (p *AffinityGroupsServiceAddRequest) Group(group *AffinityGroup) *AffinityGroupsServiceAddRequest { + p.group = group return p } -func (p *DomainsServiceListRequest) Send() (*DomainsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainsService.connection.URL(), p.DomainsService.path) +func (p *AffinityGroupsServiceAddRequest) Send() (*AffinityGroupsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupsService.connection.URL(), p.AffinityGroupsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -2938,12 +2741,19 @@ func (p *DomainsServiceListRequest) Send() (*DomainsServiceListResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLAffinityGroupWriteOne(writer, p.group, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DomainsService.connection.headers { + for hk, hv := range p.AffinityGroupsService.connection.headers { req.Header.Add(hk, hv) } @@ -2958,18 +2768,18 @@ func (p *DomainsServiceListRequest) Send() (*DomainsServiceListResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainsService.connection.authenticate() + token, err := p.AffinityGroupsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainsService.connection.client.Do(req) + resp, err := p.AffinityGroupsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainsService.connection.logFunc != nil { + if p.AffinityGroupsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -2978,9 +2788,9 @@ func (p *DomainsServiceListRequest) Send() (*DomainsServiceListResponse, error) if err != nil { return nil, err } - p.DomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -2988,14 +2798,14 @@ func (p *DomainsServiceListRequest) Send() (*DomainsServiceListResponse, error) return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDomainReadMany(reader, nil) + result, err := XMLAffinityGroupReadOne(reader, nil, "") if err != nil { return nil, err } - return &DomainsServiceListResponse{domains: result}, nil + return &AffinityGroupsServiceAddResponse{group: result}, nil } -func (p *DomainsServiceListRequest) MustSend() *DomainsServiceListResponse { +func (p *AffinityGroupsServiceAddRequest) MustSend() *AffinityGroupsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -3004,117 +2814,84 @@ func (p *DomainsServiceListRequest) MustSend() *DomainsServiceListResponse { } // -// List all the authentication domains in the system. -// Usage: -// .... -// GET /ovirt-engine/api/domains -// .... -// Will return the list of domains: +// Create a new affinity group. +// Post a request like in the example below to create a new affinity group: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/000-000/affinitygroups +// ---- +// And use the following example in its body: // [source,xml] // ---- -// -// -// internal-authz -// -// -// -// -// -// +// +// AF_GROUP_001 +// +// true +// true +// +// +// false +// +// // ---- -// The order of the returned list of domains isn't guaranteed. // -type DomainsServiceListResponse struct { - domains *DomainSlice +type AffinityGroupsServiceAddResponse struct { + group *AffinityGroup } -func (p *DomainsServiceListResponse) Domains() (*DomainSlice, bool) { - if p.domains != nil { - return p.domains, true +func (p *AffinityGroupsServiceAddResponse) Group() (*AffinityGroup, bool) { + if p.group != nil { + return p.group, true } return nil, false } -func (p *DomainsServiceListResponse) MustDomains() *DomainSlice { - if p.domains == nil { - panic("domains in response does not exist") +func (p *AffinityGroupsServiceAddResponse) MustGroup() *AffinityGroup { + if p.group == nil { + panic("group in response does not exist") } - return p.domains + return p.group } // -// List all the authentication domains in the system. -// Usage: -// .... -// GET /ovirt-engine/api/domains -// .... -// Will return the list of domains: +// Create a new affinity group. +// Post a request like in the example below to create a new affinity group: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/000-000/affinitygroups +// ---- +// And use the following example in its body: // [source,xml] // ---- -// -// -// internal-authz -// -// -// -// -// -// +// +// AF_GROUP_001 +// +// true +// true +// +// +// false +// +// // ---- -// The order of the returned list of domains isn't guaranteed. -// -func (p *DomainsService) List() *DomainsServiceListRequest { - return &DomainsServiceListRequest{DomainsService: p} -} - -// -// Reference to a service to view details of a domain. -// -func (op *DomainsService) DomainService(id string) *DomainService { - return NewDomainService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *DomainsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.DomainService(path), nil - } - return op.DomainService(path[:index]).Service(path[index+1:]) -} - -func (op *DomainsService) String() string { - return fmt.Sprintf("DomainsService:%s", op.path) -} - // -// -type SshPublicKeysService struct { - BaseService -} - -func NewSshPublicKeysService(connection *Connection, path string) *SshPublicKeysService { - var result SshPublicKeysService - result.connection = connection - result.path = path - return &result +func (p *AffinityGroupsService) Add() *AffinityGroupsServiceAddRequest { + return &AffinityGroupsServiceAddRequest{AffinityGroupsService: p} } // +// List existing affinity groups. +// The order of the affinity groups results isn't guaranteed. // -type SshPublicKeysServiceAddRequest struct { - SshPublicKeysService *SshPublicKeysService - header map[string]string - query map[string]string - key *SshPublicKey +type AffinityGroupsServiceListRequest struct { + AffinityGroupsService *AffinityGroupsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *SshPublicKeysServiceAddRequest) Header(key, value string) *SshPublicKeysServiceAddRequest { +func (p *AffinityGroupsServiceListRequest) Header(key, value string) *AffinityGroupsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -3122,7 +2899,7 @@ func (p *SshPublicKeysServiceAddRequest) Header(key, value string) *SshPublicKey return p } -func (p *SshPublicKeysServiceAddRequest) Query(key, value string) *SshPublicKeysServiceAddRequest { +func (p *AffinityGroupsServiceListRequest) Query(key, value string) *AffinityGroupsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -3130,14 +2907,27 @@ func (p *SshPublicKeysServiceAddRequest) Query(key, value string) *SshPublicKeys return p } -func (p *SshPublicKeysServiceAddRequest) Key(key *SshPublicKey) *SshPublicKeysServiceAddRequest { - p.key = key +func (p *AffinityGroupsServiceListRequest) Follow(follow string) *AffinityGroupsServiceListRequest { + p.follow = &follow return p } -func (p *SshPublicKeysServiceAddRequest) Send() (*SshPublicKeysServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SshPublicKeysService.connection.URL(), p.SshPublicKeysService.path) +func (p *AffinityGroupsServiceListRequest) Max(max int64) *AffinityGroupsServiceListRequest { + p.max = &max + return p +} + +func (p *AffinityGroupsServiceListRequest) Send() (*AffinityGroupsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityGroupsService.connection.URL(), p.AffinityGroupsService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -3146,19 +2936,12 @@ func (p *SshPublicKeysServiceAddRequest) Send() (*SshPublicKeysServiceAddRespons if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLSshPublicKeyWriteOne(writer, p.key, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SshPublicKeysService.connection.headers { + for hk, hv := range p.AffinityGroupsService.connection.headers { req.Header.Add(hk, hv) } @@ -3173,18 +2956,18 @@ func (p *SshPublicKeysServiceAddRequest) Send() (*SshPublicKeysServiceAddRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SshPublicKeysService.connection.authenticate() + token, err := p.AffinityGroupsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SshPublicKeysService.connection.client.Do(req) + resp, err := p.AffinityGroupsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SshPublicKeysService.connection.logFunc != nil { + if p.AffinityGroupsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -3193,9 +2976,9 @@ func (p *SshPublicKeysServiceAddRequest) Send() (*SshPublicKeysServiceAddRespons if err != nil { return nil, err } - p.SshPublicKeysService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityGroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -3203,14 +2986,14 @@ func (p *SshPublicKeysServiceAddRequest) Send() (*SshPublicKeysServiceAddRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSshPublicKeyReadOne(reader, nil, "") + result, err := XMLAffinityGroupReadMany(reader, nil) if err != nil { return nil, err } - return &SshPublicKeysServiceAddResponse{key: result}, nil + return &AffinityGroupsServiceListResponse{groups: result}, nil } -func (p *SshPublicKeysServiceAddRequest) MustSend() *SshPublicKeysServiceAddResponse { +func (p *AffinityGroupsServiceListRequest) MustSend() *AffinityGroupsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -3219,77 +3002,87 @@ func (p *SshPublicKeysServiceAddRequest) MustSend() *SshPublicKeysServiceAddResp } // +// List existing affinity groups. +// The order of the affinity groups results isn't guaranteed. // -type SshPublicKeysServiceAddResponse struct { - key *SshPublicKey +type AffinityGroupsServiceListResponse struct { + groups *AffinityGroupSlice } -func (p *SshPublicKeysServiceAddResponse) Key() (*SshPublicKey, bool) { - if p.key != nil { - return p.key, true +func (p *AffinityGroupsServiceListResponse) Groups() (*AffinityGroupSlice, bool) { + if p.groups != nil { + return p.groups, true } return nil, false } -func (p *SshPublicKeysServiceAddResponse) MustKey() *SshPublicKey { - if p.key == nil { - panic("key in response does not exist") +func (p *AffinityGroupsServiceListResponse) MustGroups() *AffinityGroupSlice { + if p.groups == nil { + panic("groups in response does not exist") } - return p.key + return p.groups } // +// List existing affinity groups. +// The order of the affinity groups results isn't guaranteed. // -func (p *SshPublicKeysService) Add() *SshPublicKeysServiceAddRequest { - return &SshPublicKeysServiceAddRequest{SshPublicKeysService: p} +func (p *AffinityGroupsService) List() *AffinityGroupsServiceListRequest { + return &AffinityGroupsServiceListRequest{AffinityGroupsService: p} } // -// Returns a list of SSH public keys of the user. -// For example, to retrieve the list of SSH keys of user with identifier `123`, -// send a request like this: -// [source] -// ---- -// GET /ovirt-engine/api/users/123/sshpublickeys -// ---- -// The result will be the following XML document: -// [source,xml] -// ---- -// -// -// ssh-rsa ... -// -// -// -// ---- -// Or the following JSON object -// [source,json] -// ---- -// { -// "ssh_public_key": [ -// { -// "content": "ssh-rsa ...", -// "user": { -// "href": "/ovirt-engine/api/users/123", -// "id": "123" -// }, -// "href": "/ovirt-engine/api/users/123/sshpublickeys/456", -// "id": "456" -// } -// ] -// } -// ---- -// The order of the returned list of keys is not guaranteed. +// Access the affinity group service that manages the affinity group specified by an ID. // -type SshPublicKeysServiceListRequest struct { - SshPublicKeysService *SshPublicKeysService - header map[string]string - query map[string]string - follow *string - max *int64 +func (op *AffinityGroupsService) GroupService(id string) *AffinityGroupService { + return NewAffinityGroupService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *SshPublicKeysServiceListRequest) Header(key, value string) *SshPublicKeysServiceListRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AffinityGroupsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.GroupService(path), nil + } + return op.GroupService(path[:index]).Service(path[index+1:]) +} + +func (op *AffinityGroupsService) String() string { + return fmt.Sprintf("AffinityGroupsService:%s", op.path) +} + +// +// This service represents a host that has a specific +// label when accessed through the affinitylabels/hosts +// subcollection. +// +type AffinityLabelHostService struct { + BaseService +} + +func NewAffinityLabelHostService(connection *Connection, path string) *AffinityLabelHostService { + var result AffinityLabelHostService + result.connection = connection + result.path = path + return &result +} + +// +// Retrieves details about a host that has this label assigned. +// +type AffinityLabelHostServiceGetRequest struct { + AffinityLabelHostService *AffinityLabelHostService + header map[string]string + query map[string]string + follow *string +} + +func (p *AffinityLabelHostServiceGetRequest) Header(key, value string) *AffinityLabelHostServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -3297,7 +3090,7 @@ func (p *SshPublicKeysServiceListRequest) Header(key, value string) *SshPublicKe return p } -func (p *SshPublicKeysServiceListRequest) Query(key, value string) *SshPublicKeysServiceListRequest { +func (p *AffinityLabelHostServiceGetRequest) Query(key, value string) *AffinityLabelHostServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -3305,27 +3098,18 @@ func (p *SshPublicKeysServiceListRequest) Query(key, value string) *SshPublicKey return p } -func (p *SshPublicKeysServiceListRequest) Follow(follow string) *SshPublicKeysServiceListRequest { +func (p *AffinityLabelHostServiceGetRequest) Follow(follow string) *AffinityLabelHostServiceGetRequest { p.follow = &follow return p } -func (p *SshPublicKeysServiceListRequest) Max(max int64) *SshPublicKeysServiceListRequest { - p.max = &max - return p -} - -func (p *SshPublicKeysServiceListRequest) Send() (*SshPublicKeysServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SshPublicKeysService.connection.URL(), p.SshPublicKeysService.path) +func (p *AffinityLabelHostServiceGetRequest) Send() (*AffinityLabelHostServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelHostService.connection.URL(), p.AffinityLabelHostService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -3339,7 +3123,7 @@ func (p *SshPublicKeysServiceListRequest) Send() (*SshPublicKeysServiceListRespo return nil, err } - for hk, hv := range p.SshPublicKeysService.connection.headers { + for hk, hv := range p.AffinityLabelHostService.connection.headers { req.Header.Add(hk, hv) } @@ -3354,18 +3138,18 @@ func (p *SshPublicKeysServiceListRequest) Send() (*SshPublicKeysServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SshPublicKeysService.connection.authenticate() + token, err := p.AffinityLabelHostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SshPublicKeysService.connection.client.Do(req) + resp, err := p.AffinityLabelHostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SshPublicKeysService.connection.logFunc != nil { + if p.AffinityLabelHostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -3374,7 +3158,7 @@ func (p *SshPublicKeysServiceListRequest) Send() (*SshPublicKeysServiceListRespo if err != nil { return nil, err } - p.SshPublicKeysService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelHostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -3384,14 +3168,14 @@ func (p *SshPublicKeysServiceListRequest) Send() (*SshPublicKeysServiceListRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSshPublicKeyReadMany(reader, nil) + result, err := XMLHostReadOne(reader, nil, "") if err != nil { return nil, err } - return &SshPublicKeysServiceListResponse{keys: result}, nil + return &AffinityLabelHostServiceGetResponse{host: result}, nil } -func (p *SshPublicKeysServiceListRequest) MustSend() *SshPublicKeysServiceListResponse { +func (p *AffinityLabelHostServiceGetRequest) MustSend() *AffinityLabelHostServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -3400,168 +3184,43 @@ func (p *SshPublicKeysServiceListRequest) MustSend() *SshPublicKeysServiceListRe } // -// Returns a list of SSH public keys of the user. -// For example, to retrieve the list of SSH keys of user with identifier `123`, -// send a request like this: -// [source] -// ---- -// GET /ovirt-engine/api/users/123/sshpublickeys -// ---- -// The result will be the following XML document: -// [source,xml] -// ---- -// -// -// ssh-rsa ... -// -// -// -// ---- -// Or the following JSON object -// [source,json] -// ---- -// { -// "ssh_public_key": [ -// { -// "content": "ssh-rsa ...", -// "user": { -// "href": "/ovirt-engine/api/users/123", -// "id": "123" -// }, -// "href": "/ovirt-engine/api/users/123/sshpublickeys/456", -// "id": "456" -// } -// ] -// } -// ---- -// The order of the returned list of keys is not guaranteed. +// Retrieves details about a host that has this label assigned. // -type SshPublicKeysServiceListResponse struct { - keys *SshPublicKeySlice +type AffinityLabelHostServiceGetResponse struct { + host *Host } -func (p *SshPublicKeysServiceListResponse) Keys() (*SshPublicKeySlice, bool) { - if p.keys != nil { - return p.keys, true +func (p *AffinityLabelHostServiceGetResponse) Host() (*Host, bool) { + if p.host != nil { + return p.host, true } return nil, false } -func (p *SshPublicKeysServiceListResponse) MustKeys() *SshPublicKeySlice { - if p.keys == nil { - panic("keys in response does not exist") - } - return p.keys -} - -// -// Returns a list of SSH public keys of the user. -// For example, to retrieve the list of SSH keys of user with identifier `123`, -// send a request like this: -// [source] -// ---- -// GET /ovirt-engine/api/users/123/sshpublickeys -// ---- -// The result will be the following XML document: -// [source,xml] -// ---- -// -// -// ssh-rsa ... -// -// -// -// ---- -// Or the following JSON object -// [source,json] -// ---- -// { -// "ssh_public_key": [ -// { -// "content": "ssh-rsa ...", -// "user": { -// "href": "/ovirt-engine/api/users/123", -// "id": "123" -// }, -// "href": "/ovirt-engine/api/users/123/sshpublickeys/456", -// "id": "456" -// } -// ] -// } -// ---- -// The order of the returned list of keys is not guaranteed. -// -func (p *SshPublicKeysService) List() *SshPublicKeysServiceListRequest { - return &SshPublicKeysServiceListRequest{SshPublicKeysService: p} -} - -// -// -func (op *SshPublicKeysService) KeyService(id string) *SshPublicKeyService { - return NewSshPublicKeyService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *SshPublicKeysService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.KeyService(path), nil +func (p *AffinityLabelHostServiceGetResponse) MustHost() *Host { + if p.host == nil { + panic("host in response does not exist") } - return op.KeyService(path[:index]).Service(path[index+1:]) -} - -func (op *SshPublicKeysService) String() string { - return fmt.Sprintf("SshPublicKeysService:%s", op.path) + return p.host } // -// A service to view a domain user in the system. +// Retrieves details about a host that has this label assigned. // -type DomainUserService struct { - BaseService -} - -func NewDomainUserService(connection *Connection, path string) *DomainUserService { - var result DomainUserService - result.connection = connection - result.path = path - return &result +func (p *AffinityLabelHostService) Get() *AffinityLabelHostServiceGetRequest { + return &AffinityLabelHostServiceGetRequest{AffinityLabelHostService: p} } // -// Gets the domain user information. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678/users/1234 -// .... -// Will return the domain user information: -// [source,xml] -// ---- -// -// admin -// * -// admin -// admin@internal-authz -// -// internal-authz -// -// -// -// ---- +// Remove a label from a host. // -type DomainUserServiceGetRequest struct { - DomainUserService *DomainUserService - header map[string]string - query map[string]string - follow *string +type AffinityLabelHostServiceRemoveRequest struct { + AffinityLabelHostService *AffinityLabelHostService + header map[string]string + query map[string]string } -func (p *DomainUserServiceGetRequest) Header(key, value string) *DomainUserServiceGetRequest { +func (p *AffinityLabelHostServiceRemoveRequest) Header(key, value string) *AffinityLabelHostServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -3569,7 +3228,7 @@ func (p *DomainUserServiceGetRequest) Header(key, value string) *DomainUserServi return p } -func (p *DomainUserServiceGetRequest) Query(key, value string) *DomainUserServiceGetRequest { +func (p *AffinityLabelHostServiceRemoveRequest) Query(key, value string) *AffinityLabelHostServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -3577,18 +3236,9 @@ func (p *DomainUserServiceGetRequest) Query(key, value string) *DomainUserServic return p } -func (p *DomainUserServiceGetRequest) Follow(follow string) *DomainUserServiceGetRequest { - p.follow = &follow - return p -} - -func (p *DomainUserServiceGetRequest) Send() (*DomainUserServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainUserService.connection.URL(), p.DomainUserService.path) +func (p *AffinityLabelHostServiceRemoveRequest) Send() (*AffinityLabelHostServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelHostService.connection.URL(), p.AffinityLabelHostService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -3597,12 +3247,12 @@ func (p *DomainUserServiceGetRequest) Send() (*DomainUserServiceGetResponse, err if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DomainUserService.connection.headers { + for hk, hv := range p.AffinityLabelHostService.connection.headers { req.Header.Add(hk, hv) } @@ -3617,18 +3267,18 @@ func (p *DomainUserServiceGetRequest) Send() (*DomainUserServiceGetResponse, err req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainUserService.connection.authenticate() + token, err := p.AffinityLabelHostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainUserService.connection.client.Do(req) + resp, err := p.AffinityLabelHostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainUserService.connection.logFunc != nil { + if p.AffinityLabelHostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -3637,24 +3287,19 @@ func (p *DomainUserServiceGetRequest) Send() (*DomainUserServiceGetResponse, err if err != nil { return nil, err } - p.DomainUserService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelHostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLUserReadOne(reader, nil, "") - if err != nil { - return nil, err - } - return &DomainUserServiceGetResponse{user: result}, nil + return new(AffinityLabelHostServiceRemoveResponse), nil } -func (p *DomainUserServiceGetRequest) MustSend() *DomainUserServiceGetResponse { +func (p *AffinityLabelHostServiceRemoveRequest) MustSend() *AffinityLabelHostServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -3663,111 +3308,59 @@ func (p *DomainUserServiceGetRequest) MustSend() *DomainUserServiceGetResponse { } // -// Gets the domain user information. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678/users/1234 -// .... -// Will return the domain user information: -// [source,xml] -// ---- -// -// admin -// * -// admin -// admin@internal-authz -// -// internal-authz -// -// -// -// ---- +// Remove a label from a host. // -type DomainUserServiceGetResponse struct { - user *User -} - -func (p *DomainUserServiceGetResponse) User() (*User, bool) { - if p.user != nil { - return p.user, true - } - return nil, false -} - -func (p *DomainUserServiceGetResponse) MustUser() *User { - if p.user == nil { - panic("user in response does not exist") - } - return p.user +type AffinityLabelHostServiceRemoveResponse struct { } // -// Gets the domain user information. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678/users/1234 -// .... -// Will return the domain user information: -// [source,xml] -// ---- -// -// admin -// * -// admin -// admin@internal-authz -// -// internal-authz -// -// -// -// ---- +// Remove a label from a host. // -func (p *DomainUserService) Get() *DomainUserServiceGetRequest { - return &DomainUserServiceGetRequest{DomainUserService: p} +func (p *AffinityLabelHostService) Remove() *AffinityLabelHostServiceRemoveRequest { + return &AffinityLabelHostServiceRemoveRequest{AffinityLabelHostService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *DomainUserService) Service(path string) (Service, error) { +func (op *AffinityLabelHostService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *DomainUserService) String() string { - return fmt.Sprintf("DomainUserService:%s", op.path) +func (op *AffinityLabelHostService) String() string { + return fmt.Sprintf("AffinityLabelHostService:%s", op.path) } // +// This service represents list of hosts that have a specific +// label when accessed through the affinitylabels/hosts +// subcollection. // -type DomainGroupsService struct { +type AffinityLabelHostsService struct { BaseService } -func NewDomainGroupsService(connection *Connection, path string) *DomainGroupsService { - var result DomainGroupsService +func NewAffinityLabelHostsService(connection *Connection, path string) *AffinityLabelHostsService { + var result AffinityLabelHostsService result.connection = connection result.path = path return &result } // -// Returns the list of groups. -// The order of the returned list of groups isn't guaranteed. +// Add a label to a host. // -type DomainGroupsServiceListRequest struct { - DomainGroupsService *DomainGroupsService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string +type AffinityLabelHostsServiceAddRequest struct { + AffinityLabelHostsService *AffinityLabelHostsService + header map[string]string + query map[string]string + host *Host } -func (p *DomainGroupsServiceListRequest) Header(key, value string) *DomainGroupsServiceListRequest { +func (p *AffinityLabelHostsServiceAddRequest) Header(key, value string) *AffinityLabelHostsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -3775,7 +3368,7 @@ func (p *DomainGroupsServiceListRequest) Header(key, value string) *DomainGroups return p } -func (p *DomainGroupsServiceListRequest) Query(key, value string) *DomainGroupsServiceListRequest { +func (p *AffinityLabelHostsServiceAddRequest) Query(key, value string) *AffinityLabelHostsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -3783,45 +3376,14 @@ func (p *DomainGroupsServiceListRequest) Query(key, value string) *DomainGroupsS return p } -func (p *DomainGroupsServiceListRequest) CaseSensitive(caseSensitive bool) *DomainGroupsServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *DomainGroupsServiceListRequest) Follow(follow string) *DomainGroupsServiceListRequest { - p.follow = &follow - return p -} - -func (p *DomainGroupsServiceListRequest) Max(max int64) *DomainGroupsServiceListRequest { - p.max = &max - return p -} - -func (p *DomainGroupsServiceListRequest) Search(search string) *DomainGroupsServiceListRequest { - p.search = &search +func (p *AffinityLabelHostsServiceAddRequest) Host(host *Host) *AffinityLabelHostsServiceAddRequest { + p.host = host return p } -func (p *DomainGroupsServiceListRequest) Send() (*DomainGroupsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainGroupsService.connection.URL(), p.DomainGroupsService.path) +func (p *AffinityLabelHostsServiceAddRequest) Send() (*AffinityLabelHostsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelHostsService.connection.URL(), p.AffinityLabelHostsService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -3830,12 +3392,19 @@ func (p *DomainGroupsServiceListRequest) Send() (*DomainGroupsServiceListRespons if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLHostWriteOne(writer, p.host, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DomainGroupsService.connection.headers { + for hk, hv := range p.AffinityLabelHostsService.connection.headers { req.Header.Add(hk, hv) } @@ -3850,18 +3419,18 @@ func (p *DomainGroupsServiceListRequest) Send() (*DomainGroupsServiceListRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainGroupsService.connection.authenticate() + token, err := p.AffinityLabelHostsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainGroupsService.connection.client.Do(req) + resp, err := p.AffinityLabelHostsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainGroupsService.connection.logFunc != nil { + if p.AffinityLabelHostsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -3870,9 +3439,9 @@ func (p *DomainGroupsServiceListRequest) Send() (*DomainGroupsServiceListRespons if err != nil { return nil, err } - p.DomainGroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelHostsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -3880,14 +3449,14 @@ func (p *DomainGroupsServiceListRequest) Send() (*DomainGroupsServiceListRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGroupReadMany(reader, nil) + result, err := XMLHostReadOne(reader, nil, "") if err != nil { return nil, err } - return &DomainGroupsServiceListResponse{groups: result}, nil + return &AffinityLabelHostsServiceAddResponse{host: result}, nil } -func (p *DomainGroupsServiceListRequest) MustSend() *DomainGroupsServiceListResponse { +func (p *AffinityLabelHostsServiceAddRequest) MustSend() *AffinityLabelHostsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -3896,112 +3465,45 @@ func (p *DomainGroupsServiceListRequest) MustSend() *DomainGroupsServiceListResp } // -// Returns the list of groups. -// The order of the returned list of groups isn't guaranteed. +// Add a label to a host. // -type DomainGroupsServiceListResponse struct { - groups *GroupSlice +type AffinityLabelHostsServiceAddResponse struct { + host *Host } -func (p *DomainGroupsServiceListResponse) Groups() (*GroupSlice, bool) { - if p.groups != nil { - return p.groups, true +func (p *AffinityLabelHostsServiceAddResponse) Host() (*Host, bool) { + if p.host != nil { + return p.host, true } return nil, false } -func (p *DomainGroupsServiceListResponse) MustGroups() *GroupSlice { - if p.groups == nil { - panic("groups in response does not exist") - } - return p.groups -} - -// -// Returns the list of groups. -// The order of the returned list of groups isn't guaranteed. -// -func (p *DomainGroupsService) List() *DomainGroupsServiceListRequest { - return &DomainGroupsServiceListRequest{DomainGroupsService: p} -} - -// -// -func (op *DomainGroupsService) GroupService(id string) *DomainGroupService { - return NewDomainGroupService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *DomainGroupsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.GroupService(path), nil +func (p *AffinityLabelHostsServiceAddResponse) MustHost() *Host { + if p.host == nil { + panic("host in response does not exist") } - return op.GroupService(path[:index]).Service(path[index+1:]) -} - -func (op *DomainGroupsService) String() string { - return fmt.Sprintf("DomainGroupsService:%s", op.path) + return p.host } // -// A service to manage a user in the system. -// Use this service to either get users details or remove users. -// In order to add new users please use -// <>. +// Add a label to a host. // -type UserService struct { - BaseService -} - -func NewUserService(connection *Connection, path string) *UserService { - var result UserService - result.connection = connection - result.path = path - return &result +func (p *AffinityLabelHostsService) Add() *AffinityLabelHostsServiceAddRequest { + return &AffinityLabelHostsServiceAddRequest{AffinityLabelHostsService: p} } // -// Gets the system user information. -// Usage: -// .... -// GET /ovirt-engine/api/users/1234 -// .... -// Will return the user information: -// [source,xml] -// ---- -// -// admin -// -// -// -// -// -// 23456 -// user1@domain.com -// Lastname -// * -// user1 -// user1@domain-authz -// -// domain-authz -// -// -// ---- +// List all hosts with the label. +// The order of the returned hosts isn't guaranteed. // -type UserServiceGetRequest struct { - UserService *UserService - header map[string]string - query map[string]string - follow *string +type AffinityLabelHostsServiceListRequest struct { + AffinityLabelHostsService *AffinityLabelHostsService + header map[string]string + query map[string]string + follow *string } -func (p *UserServiceGetRequest) Header(key, value string) *UserServiceGetRequest { +func (p *AffinityLabelHostsServiceListRequest) Header(key, value string) *AffinityLabelHostsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -4009,7 +3511,7 @@ func (p *UserServiceGetRequest) Header(key, value string) *UserServiceGetRequest return p } -func (p *UserServiceGetRequest) Query(key, value string) *UserServiceGetRequest { +func (p *AffinityLabelHostsServiceListRequest) Query(key, value string) *AffinityLabelHostsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -4017,13 +3519,13 @@ func (p *UserServiceGetRequest) Query(key, value string) *UserServiceGetRequest return p } -func (p *UserServiceGetRequest) Follow(follow string) *UserServiceGetRequest { +func (p *AffinityLabelHostsServiceListRequest) Follow(follow string) *AffinityLabelHostsServiceListRequest { p.follow = &follow return p } -func (p *UserServiceGetRequest) Send() (*UserServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UserService.connection.URL(), p.UserService.path) +func (p *AffinityLabelHostsServiceListRequest) Send() (*AffinityLabelHostsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelHostsService.connection.URL(), p.AffinityLabelHostsService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -4042,7 +3544,7 @@ func (p *UserServiceGetRequest) Send() (*UserServiceGetResponse, error) { return nil, err } - for hk, hv := range p.UserService.connection.headers { + for hk, hv := range p.AffinityLabelHostsService.connection.headers { req.Header.Add(hk, hv) } @@ -4057,18 +3559,18 @@ func (p *UserServiceGetRequest) Send() (*UserServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UserService.connection.authenticate() + token, err := p.AffinityLabelHostsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UserService.connection.client.Do(req) + resp, err := p.AffinityLabelHostsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UserService.connection.logFunc != nil { + if p.AffinityLabelHostsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -4077,7 +3579,7 @@ func (p *UserServiceGetRequest) Send() (*UserServiceGetResponse, error) { if err != nil { return nil, err } - p.UserService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelHostsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -4087,14 +3589,14 @@ func (p *UserServiceGetRequest) Send() (*UserServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUserReadOne(reader, nil, "") + result, err := XMLHostReadMany(reader, nil) if err != nil { return nil, err } - return &UserServiceGetResponse{user: result}, nil + return &AffinityLabelHostsServiceListResponse{hosts: result}, nil } -func (p *UserServiceGetRequest) MustSend() *UserServiceGetResponse { +func (p *AffinityLabelHostsServiceListRequest) MustSend() *AffinityLabelHostsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -4103,98 +3605,86 @@ func (p *UserServiceGetRequest) MustSend() *UserServiceGetResponse { } // -// Gets the system user information. -// Usage: -// .... -// GET /ovirt-engine/api/users/1234 -// .... -// Will return the user information: -// [source,xml] -// ---- -// -// admin -// -// -// -// -// -// 23456 -// user1@domain.com -// Lastname -// * -// user1 -// user1@domain-authz -// -// domain-authz -// -// -// ---- +// List all hosts with the label. +// The order of the returned hosts isn't guaranteed. // -type UserServiceGetResponse struct { - user *User +type AffinityLabelHostsServiceListResponse struct { + hosts *HostSlice } -func (p *UserServiceGetResponse) User() (*User, bool) { - if p.user != nil { - return p.user, true +func (p *AffinityLabelHostsServiceListResponse) Hosts() (*HostSlice, bool) { + if p.hosts != nil { + return p.hosts, true } return nil, false } -func (p *UserServiceGetResponse) MustUser() *User { - if p.user == nil { - panic("user in response does not exist") +func (p *AffinityLabelHostsServiceListResponse) MustHosts() *HostSlice { + if p.hosts == nil { + panic("hosts in response does not exist") } - return p.user + return p.hosts } // -// Gets the system user information. -// Usage: -// .... -// GET /ovirt-engine/api/users/1234 -// .... -// Will return the user information: -// [source,xml] -// ---- -// -// admin -// -// -// -// -// -// 23456 -// user1@domain.com -// Lastname -// * -// user1 -// user1@domain-authz -// -// domain-authz -// -// -// ---- +// List all hosts with the label. +// The order of the returned hosts isn't guaranteed. // -func (p *UserService) Get() *UserServiceGetRequest { - return &UserServiceGetRequest{UserService: p} +func (p *AffinityLabelHostsService) List() *AffinityLabelHostsServiceListRequest { + return &AffinityLabelHostsServiceListRequest{AffinityLabelHostsService: p} } // -// Removes the system user. -// Usage: -// .... -// DELETE /ovirt-engine/api/users/1234 -// .... +// A link to the specific label-host assignment to +// allow label removal. // -type UserServiceRemoveRequest struct { - UserService *UserService - header map[string]string - query map[string]string - async *bool +func (op *AffinityLabelHostsService) HostService(id string) *AffinityLabelHostService { + return NewAffinityLabelHostService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *UserServiceRemoveRequest) Header(key, value string) *UserServiceRemoveRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AffinityLabelHostsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.HostService(path), nil + } + return op.HostService(path[:index]).Service(path[index+1:]) +} + +func (op *AffinityLabelHostsService) String() string { + return fmt.Sprintf("AffinityLabelHostsService:%s", op.path) +} + +// +// The details of a single affinity label. +// +type AffinityLabelService struct { + BaseService +} + +func NewAffinityLabelService(connection *Connection, path string) *AffinityLabelService { + var result AffinityLabelService + result.connection = connection + result.path = path + return &result +} + +// +// Retrieves the details of a label. +// +type AffinityLabelServiceGetRequest struct { + AffinityLabelService *AffinityLabelService + header map[string]string + query map[string]string + follow *string +} + +func (p *AffinityLabelServiceGetRequest) Header(key, value string) *AffinityLabelServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -4202,7 +3692,7 @@ func (p *UserServiceRemoveRequest) Header(key, value string) *UserServiceRemoveR return p } -func (p *UserServiceRemoveRequest) Query(key, value string) *UserServiceRemoveRequest { +func (p *AffinityLabelServiceGetRequest) Query(key, value string) *AffinityLabelServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -4210,18 +3700,148 @@ func (p *UserServiceRemoveRequest) Query(key, value string) *UserServiceRemoveRe return p } -func (p *UserServiceRemoveRequest) Async(async bool) *UserServiceRemoveRequest { - p.async = &async +func (p *AffinityLabelServiceGetRequest) Follow(follow string) *AffinityLabelServiceGetRequest { + p.follow = &follow return p } -func (p *UserServiceRemoveRequest) Send() (*UserServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UserService.connection.URL(), p.UserService.path) +func (p *AffinityLabelServiceGetRequest) Send() (*AffinityLabelServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelService.connection.URL(), p.AffinityLabelService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} + } + } + if len(values) > 0 { + rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) + } + req, err := http.NewRequest("GET", rawURL, nil) + if err != nil { + return nil, err + } + + for hk, hv := range p.AffinityLabelService.connection.headers { + req.Header.Add(hk, hv) + } + + if p.header != nil { + for hk, hv := range p.header { + req.Header.Add(hk, hv) + } + } + + req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) + req.Header.Add("Version", "4") + req.Header.Add("Content-Type", "application/xml") + req.Header.Add("Accept", "application/xml") + // get OAuth access token + token, err := p.AffinityLabelService.connection.authenticate() + if err != nil { + return nil, err + } + req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) + // Send the request and wait for the response + resp, err := p.AffinityLabelService.connection.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if p.AffinityLabelService.connection.logFunc != nil { + dumpReq, err := httputil.DumpRequestOut(req, true) + if err != nil { + return nil, err + } + dumpResp, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, err + } + p.AffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + } + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLAffinityLabelReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &AffinityLabelServiceGetResponse{label: result}, nil +} + +func (p *AffinityLabelServiceGetRequest) MustSend() *AffinityLabelServiceGetResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// Retrieves the details of a label. +// +type AffinityLabelServiceGetResponse struct { + label *AffinityLabel +} + +func (p *AffinityLabelServiceGetResponse) Label() (*AffinityLabel, bool) { + if p.label != nil { + return p.label, true + } + return nil, false +} + +func (p *AffinityLabelServiceGetResponse) MustLabel() *AffinityLabel { + if p.label == nil { + panic("label in response does not exist") + } + return p.label +} + +// +// Retrieves the details of a label. +// +func (p *AffinityLabelService) Get() *AffinityLabelServiceGetRequest { + return &AffinityLabelServiceGetRequest{AffinityLabelService: p} +} + +// +// Removes a label from the system and clears all assignments +// of the removed label. +// +type AffinityLabelServiceRemoveRequest struct { + AffinityLabelService *AffinityLabelService + header map[string]string + query map[string]string +} + +func (p *AffinityLabelServiceRemoveRequest) Header(key, value string) *AffinityLabelServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value + return p +} + +func (p *AffinityLabelServiceRemoveRequest) Query(key, value string) *AffinityLabelServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) } + p.query[key] = value + return p +} +func (p *AffinityLabelServiceRemoveRequest) Send() (*AffinityLabelServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelService.connection.URL(), p.AffinityLabelService.path) + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -4235,7 +3855,7 @@ func (p *UserServiceRemoveRequest) Send() (*UserServiceRemoveResponse, error) { return nil, err } - for hk, hv := range p.UserService.connection.headers { + for hk, hv := range p.AffinityLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -4250,18 +3870,18 @@ func (p *UserServiceRemoveRequest) Send() (*UserServiceRemoveResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UserService.connection.authenticate() + token, err := p.AffinityLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UserService.connection.client.Do(req) + resp, err := p.AffinityLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UserService.connection.logFunc != nil { + if p.AffinityLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -4270,7 +3890,7 @@ func (p *UserServiceRemoveRequest) Send() (*UserServiceRemoveResponse, error) { if err != nil { return nil, err } - p.UserService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -4279,10 +3899,10 @@ func (p *UserServiceRemoveRequest) Send() (*UserServiceRemoveResponse, error) { if errReadBody != nil { return nil, errReadBody } - return new(UserServiceRemoveResponse), nil + return new(AffinityLabelServiceRemoveResponse), nil } -func (p *UserServiceRemoveRequest) MustSend() *UserServiceRemoveResponse { +func (p *AffinityLabelServiceRemoveRequest) MustSend() *AffinityLabelServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -4291,55 +3911,32 @@ func (p *UserServiceRemoveRequest) MustSend() *UserServiceRemoveResponse { } // -// Removes the system user. -// Usage: -// .... -// DELETE /ovirt-engine/api/users/1234 -// .... +// Removes a label from the system and clears all assignments +// of the removed label. // -type UserServiceRemoveResponse struct { +type AffinityLabelServiceRemoveResponse struct { } // -// Removes the system user. -// Usage: -// .... -// DELETE /ovirt-engine/api/users/1234 -// .... +// Removes a label from the system and clears all assignments +// of the removed label. // -func (p *UserService) Remove() *UserServiceRemoveRequest { - return &UserServiceRemoveRequest{UserService: p} +func (p *AffinityLabelService) Remove() *AffinityLabelServiceRemoveRequest { + return &AffinityLabelServiceRemoveRequest{AffinityLabelService: p} } // -// Updates information about the user. -// Only the `user_options` field can be updated. -// For example, to update user options: -// [source] -// ---- -// PUT /ovirt-engine/api/users/123 -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// -// test -// test1 -// -// -// -// ---- +// Updates a label. This call will update all metadata, such as the name +// or description. // -type UserServiceUpdateRequest struct { - UserService *UserService - header map[string]string - query map[string]string - user *User +type AffinityLabelServiceUpdateRequest struct { + AffinityLabelService *AffinityLabelService + header map[string]string + query map[string]string + label *AffinityLabel } -func (p *UserServiceUpdateRequest) Header(key, value string) *UserServiceUpdateRequest { +func (p *AffinityLabelServiceUpdateRequest) Header(key, value string) *AffinityLabelServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -4347,7 +3944,7 @@ func (p *UserServiceUpdateRequest) Header(key, value string) *UserServiceUpdateR return p } -func (p *UserServiceUpdateRequest) Query(key, value string) *UserServiceUpdateRequest { +func (p *AffinityLabelServiceUpdateRequest) Query(key, value string) *AffinityLabelServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -4355,13 +3952,13 @@ func (p *UserServiceUpdateRequest) Query(key, value string) *UserServiceUpdateRe return p } -func (p *UserServiceUpdateRequest) User(user *User) *UserServiceUpdateRequest { - p.user = user +func (p *AffinityLabelServiceUpdateRequest) Label(label *AffinityLabel) *AffinityLabelServiceUpdateRequest { + p.label = label return p } -func (p *UserServiceUpdateRequest) Send() (*UserServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UserService.connection.URL(), p.UserService.path) +func (p *AffinityLabelServiceUpdateRequest) Send() (*AffinityLabelServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelService.connection.URL(), p.AffinityLabelService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -4373,7 +3970,7 @@ func (p *UserServiceUpdateRequest) Send() (*UserServiceUpdateResponse, error) { } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLUserWriteOne(writer, p.user, "") + err := XMLAffinityLabelWriteOne(writer, p.label, "") if err != nil { return nil, err } @@ -4383,7 +3980,7 @@ func (p *UserServiceUpdateRequest) Send() (*UserServiceUpdateResponse, error) { return nil, err } - for hk, hv := range p.UserService.connection.headers { + for hk, hv := range p.AffinityLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -4398,18 +3995,18 @@ func (p *UserServiceUpdateRequest) Send() (*UserServiceUpdateResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UserService.connection.authenticate() + token, err := p.AffinityLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UserService.connection.client.Do(req) + resp, err := p.AffinityLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UserService.connection.logFunc != nil { + if p.AffinityLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -4418,7 +4015,7 @@ func (p *UserServiceUpdateRequest) Send() (*UserServiceUpdateResponse, error) { if err != nil { return nil, err } - p.UserService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -4428,14 +4025,14 @@ func (p *UserServiceUpdateRequest) Send() (*UserServiceUpdateResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUserReadOne(reader, nil, "") + result, err := XMLAffinityLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &UserServiceUpdateResponse{user: result}, nil + return &AffinityLabelServiceUpdateResponse{label: result}, nil } -func (p *UserServiceUpdateRequest) MustSend() *UserServiceUpdateResponse { +func (p *AffinityLabelServiceUpdateRequest) MustSend() *AffinityLabelServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -4444,179 +4041,102 @@ func (p *UserServiceUpdateRequest) MustSend() *UserServiceUpdateResponse { } // -// Updates information about the user. -// Only the `user_options` field can be updated. -// For example, to update user options: -// [source] -// ---- -// PUT /ovirt-engine/api/users/123 -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// -// test -// test1 -// -// -// -// ---- +// Updates a label. This call will update all metadata, such as the name +// or description. // -type UserServiceUpdateResponse struct { - user *User +type AffinityLabelServiceUpdateResponse struct { + label *AffinityLabel } -func (p *UserServiceUpdateResponse) User() (*User, bool) { - if p.user != nil { - return p.user, true +func (p *AffinityLabelServiceUpdateResponse) Label() (*AffinityLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *UserServiceUpdateResponse) MustUser() *User { - if p.user == nil { - panic("user in response does not exist") +func (p *AffinityLabelServiceUpdateResponse) MustLabel() *AffinityLabel { + if p.label == nil { + panic("label in response does not exist") } - return p.user -} - -// -// Updates information about the user. -// Only the `user_options` field can be updated. -// For example, to update user options: -// [source] -// ---- -// PUT /ovirt-engine/api/users/123 -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// -// test -// test1 -// -// -// -// ---- -// -func (p *UserService) Update() *UserServiceUpdateRequest { - return &UserServiceUpdateRequest{UserService: p} -} - -// -// List of event-subscriptions for this user. -// -func (op *UserService) EventSubscriptionsService() *EventSubscriptionsService { - return NewEventSubscriptionsService(op.connection, fmt.Sprintf("%s/eventsubscriptions", op.path)) -} - -// -// -func (op *UserService) GroupsService() *DomainUserGroupsService { - return NewDomainUserGroupsService(op.connection, fmt.Sprintf("%s/groups", op.path)) -} - -// -// -func (op *UserService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) + return p.label } // +// Updates a label. This call will update all metadata, such as the name +// or description. // -func (op *UserService) RolesService() *AssignedRolesService { - return NewAssignedRolesService(op.connection, fmt.Sprintf("%s/roles", op.path)) +func (p *AffinityLabelService) Update() *AffinityLabelServiceUpdateRequest { + return &AffinityLabelServiceUpdateRequest{AffinityLabelService: p} } // +// List all hosts with this label. // -func (op *UserService) SshPublicKeysService() *SshPublicKeysService { - return NewSshPublicKeysService(op.connection, fmt.Sprintf("%s/sshpublickeys", op.path)) +func (op *AffinityLabelService) HostsService() *AffinityLabelHostsService { + return NewAffinityLabelHostsService(op.connection, fmt.Sprintf("%s/hosts", op.path)) } // +// List all virtual machines with this label. // -func (op *UserService) TagsService() *AssignedTagsService { - return NewAssignedTagsService(op.connection, fmt.Sprintf("%s/tags", op.path)) +func (op *AffinityLabelService) VmsService() *AffinityLabelVmsService { + return NewAffinityLabelVmsService(op.connection, fmt.Sprintf("%s/vms", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *UserService) Service(path string) (Service, error) { +func (op *AffinityLabelService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "eventsubscriptions" { - return op.EventSubscriptionsService(), nil - } - if strings.HasPrefix(path, "eventsubscriptions/") { - return op.EventSubscriptionsService().Service(path[19:]) - } - if path == "groups" { - return op.GroupsService(), nil - } - if strings.HasPrefix(path, "groups/") { - return op.GroupsService().Service(path[7:]) - } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) - } - if path == "roles" { - return op.RolesService(), nil - } - if strings.HasPrefix(path, "roles/") { - return op.RolesService().Service(path[6:]) - } - if path == "sshpublickeys" { - return op.SshPublicKeysService(), nil + if path == "hosts" { + return op.HostsService(), nil } - if strings.HasPrefix(path, "sshpublickeys/") { - return op.SshPublicKeysService().Service(path[14:]) + if strings.HasPrefix(path, "hosts/") { + return op.HostsService().Service(path[6:]) } - if path == "tags" { - return op.TagsService(), nil + if path == "vms" { + return op.VmsService(), nil } - if strings.HasPrefix(path, "tags/") { - return op.TagsService().Service(path[5:]) + if strings.HasPrefix(path, "vms/") { + return op.VmsService().Service(path[4:]) } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *UserService) String() string { - return fmt.Sprintf("UserService:%s", op.path) +func (op *AffinityLabelService) String() string { + return fmt.Sprintf("AffinityLabelService:%s", op.path) } // +// This service represents a vm that has a specific +// label when accessed through the affinitylabels/vms +// subcollection. // -type DomainGroupService struct { +type AffinityLabelVmService struct { BaseService } -func NewDomainGroupService(connection *Connection, path string) *DomainGroupService { - var result DomainGroupService +func NewAffinityLabelVmService(connection *Connection, path string) *AffinityLabelVmService { + var result AffinityLabelVmService result.connection = connection result.path = path return &result } // +// Retrieves details about a vm that has this label assigned. // -type DomainGroupServiceGetRequest struct { - DomainGroupService *DomainGroupService - header map[string]string - query map[string]string - follow *string +type AffinityLabelVmServiceGetRequest struct { + AffinityLabelVmService *AffinityLabelVmService + header map[string]string + query map[string]string + follow *string } -func (p *DomainGroupServiceGetRequest) Header(key, value string) *DomainGroupServiceGetRequest { +func (p *AffinityLabelVmServiceGetRequest) Header(key, value string) *AffinityLabelVmServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -4624,7 +4144,7 @@ func (p *DomainGroupServiceGetRequest) Header(key, value string) *DomainGroupSer return p } -func (p *DomainGroupServiceGetRequest) Query(key, value string) *DomainGroupServiceGetRequest { +func (p *AffinityLabelVmServiceGetRequest) Query(key, value string) *AffinityLabelVmServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -4632,13 +4152,13 @@ func (p *DomainGroupServiceGetRequest) Query(key, value string) *DomainGroupServ return p } -func (p *DomainGroupServiceGetRequest) Follow(follow string) *DomainGroupServiceGetRequest { +func (p *AffinityLabelVmServiceGetRequest) Follow(follow string) *AffinityLabelVmServiceGetRequest { p.follow = &follow return p } -func (p *DomainGroupServiceGetRequest) Send() (*DomainGroupServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainGroupService.connection.URL(), p.DomainGroupService.path) +func (p *AffinityLabelVmServiceGetRequest) Send() (*AffinityLabelVmServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelVmService.connection.URL(), p.AffinityLabelVmService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -4657,7 +4177,7 @@ func (p *DomainGroupServiceGetRequest) Send() (*DomainGroupServiceGetResponse, e return nil, err } - for hk, hv := range p.DomainGroupService.connection.headers { + for hk, hv := range p.AffinityLabelVmService.connection.headers { req.Header.Add(hk, hv) } @@ -4672,18 +4192,18 @@ func (p *DomainGroupServiceGetRequest) Send() (*DomainGroupServiceGetResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainGroupService.connection.authenticate() + token, err := p.AffinityLabelVmService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainGroupService.connection.client.Do(req) + resp, err := p.AffinityLabelVmService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainGroupService.connection.logFunc != nil { + if p.AffinityLabelVmService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -4692,7 +4212,7 @@ func (p *DomainGroupServiceGetRequest) Send() (*DomainGroupServiceGetResponse, e if err != nil { return nil, err } - p.DomainGroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelVmService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -4702,14 +4222,14 @@ func (p *DomainGroupServiceGetRequest) Send() (*DomainGroupServiceGetResponse, e return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGroupReadOne(reader, nil, "") + result, err := XMLVmReadOne(reader, nil, "") if err != nil { return nil, err } - return &DomainGroupServiceGetResponse{get: result}, nil + return &AffinityLabelVmServiceGetResponse{vm: result}, nil } -func (p *DomainGroupServiceGetRequest) MustSend() *DomainGroupServiceGetResponse { +func (p *AffinityLabelVmServiceGetRequest) MustSend() *AffinityLabelVmServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -4718,85 +4238,43 @@ func (p *DomainGroupServiceGetRequest) MustSend() *DomainGroupServiceGetResponse } // +// Retrieves details about a vm that has this label assigned. // -type DomainGroupServiceGetResponse struct { - get *Group +type AffinityLabelVmServiceGetResponse struct { + vm *Vm } -func (p *DomainGroupServiceGetResponse) Get() (*Group, bool) { - if p.get != nil { - return p.get, true - } - return nil, false -} - -func (p *DomainGroupServiceGetResponse) MustGet() *Group { - if p.get == nil { - panic("get in response does not exist") +func (p *AffinityLabelVmServiceGetResponse) Vm() (*Vm, bool) { + if p.vm != nil { + return p.vm, true } - return p.get -} - -// -// -func (p *DomainGroupService) Get() *DomainGroupServiceGetRequest { - return &DomainGroupServiceGetRequest{DomainGroupService: p} + return nil, false } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *DomainGroupService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *AffinityLabelVmServiceGetResponse) MustVm() *Vm { + if p.vm == nil { + panic("vm in response does not exist") } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *DomainGroupService) String() string { - return fmt.Sprintf("DomainGroupService:%s", op.path) + return p.vm } // -// A service to view details of an authentication domain in the system. +// Retrieves details about a vm that has this label assigned. // -type DomainService struct { - BaseService -} - -func NewDomainService(connection *Connection, path string) *DomainService { - var result DomainService - result.connection = connection - result.path = path - return &result +func (p *AffinityLabelVmService) Get() *AffinityLabelVmServiceGetRequest { + return &AffinityLabelVmServiceGetRequest{AffinityLabelVmService: p} } // -// Gets the authentication domain information. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678 -// .... -// Will return the domain information: -// [source,xml] -// ---- -// -// internal-authz -// -// -// -// -// -// ---- +// Remove a label from a vm. // -type DomainServiceGetRequest struct { - DomainService *DomainService - header map[string]string - query map[string]string - follow *string +type AffinityLabelVmServiceRemoveRequest struct { + AffinityLabelVmService *AffinityLabelVmService + header map[string]string + query map[string]string } -func (p *DomainServiceGetRequest) Header(key, value string) *DomainServiceGetRequest { +func (p *AffinityLabelVmServiceRemoveRequest) Header(key, value string) *AffinityLabelVmServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -4804,7 +4282,7 @@ func (p *DomainServiceGetRequest) Header(key, value string) *DomainServiceGetReq return p } -func (p *DomainServiceGetRequest) Query(key, value string) *DomainServiceGetRequest { +func (p *AffinityLabelVmServiceRemoveRequest) Query(key, value string) *AffinityLabelVmServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -4812,18 +4290,9 @@ func (p *DomainServiceGetRequest) Query(key, value string) *DomainServiceGetRequ return p } -func (p *DomainServiceGetRequest) Follow(follow string) *DomainServiceGetRequest { - p.follow = &follow - return p -} - -func (p *DomainServiceGetRequest) Send() (*DomainServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainService.connection.URL(), p.DomainService.path) +func (p *AffinityLabelVmServiceRemoveRequest) Send() (*AffinityLabelVmServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelVmService.connection.URL(), p.AffinityLabelVmService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -4832,12 +4301,12 @@ func (p *DomainServiceGetRequest) Send() (*DomainServiceGetResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DomainService.connection.headers { + for hk, hv := range p.AffinityLabelVmService.connection.headers { req.Header.Add(hk, hv) } @@ -4852,18 +4321,18 @@ func (p *DomainServiceGetRequest) Send() (*DomainServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainService.connection.authenticate() + token, err := p.AffinityLabelVmService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainService.connection.client.Do(req) + resp, err := p.AffinityLabelVmService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainService.connection.logFunc != nil { + if p.AffinityLabelVmService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -4872,24 +4341,19 @@ func (p *DomainServiceGetRequest) Send() (*DomainServiceGetResponse, error) { if err != nil { return nil, err } - p.DomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelVmService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDomainReadOne(reader, nil, "") - if err != nil { - return nil, err - } - return &DomainServiceGetResponse{domain: result}, nil + return new(AffinityLabelVmServiceRemoveResponse), nil } -func (p *DomainServiceGetRequest) MustSend() *DomainServiceGetResponse { +func (p *AffinityLabelVmServiceRemoveRequest) MustSend() *AffinityLabelVmServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -4898,126 +4362,59 @@ func (p *DomainServiceGetRequest) MustSend() *DomainServiceGetResponse { } // -// Gets the authentication domain information. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678 -// .... -// Will return the domain information: -// [source,xml] -// ---- -// -// internal-authz -// -// -// -// -// -// ---- -// -type DomainServiceGetResponse struct { - domain *Domain -} - -func (p *DomainServiceGetResponse) Domain() (*Domain, bool) { - if p.domain != nil { - return p.domain, true - } - return nil, false -} - -func (p *DomainServiceGetResponse) MustDomain() *Domain { - if p.domain == nil { - panic("domain in response does not exist") - } - return p.domain -} - -// -// Gets the authentication domain information. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678 -// .... -// Will return the domain information: -// [source,xml] -// ---- -// -// internal-authz -// -// -// -// -// -// ---- -// -func (p *DomainService) Get() *DomainServiceGetRequest { - return &DomainServiceGetRequest{DomainService: p} -} - -// -// Reference to a service to manage domain groups. +// Remove a label from a vm. // -func (op *DomainService) GroupsService() *DomainGroupsService { - return NewDomainGroupsService(op.connection, fmt.Sprintf("%s/groups", op.path)) +type AffinityLabelVmServiceRemoveResponse struct { } // -// Reference to a service to manage domain users. +// Remove a label from a vm. // -func (op *DomainService) UsersService() *DomainUsersService { - return NewDomainUsersService(op.connection, fmt.Sprintf("%s/users", op.path)) +func (p *AffinityLabelVmService) Remove() *AffinityLabelVmServiceRemoveRequest { + return &AffinityLabelVmServiceRemoveRequest{AffinityLabelVmService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *DomainService) Service(path string) (Service, error) { +func (op *AffinityLabelVmService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "groups" { - return op.GroupsService(), nil - } - if strings.HasPrefix(path, "groups/") { - return op.GroupsService().Service(path[7:]) - } - if path == "users" { - return op.UsersService(), nil - } - if strings.HasPrefix(path, "users/") { - return op.UsersService().Service(path[6:]) - } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *DomainService) String() string { - return fmt.Sprintf("DomainService:%s", op.path) +func (op *AffinityLabelVmService) String() string { + return fmt.Sprintf("AffinityLabelVmService:%s", op.path) } // +// This service represents list of vms that have a specific +// label when accessed through the affinitylabels/vms +// subcollection. // -type SshPublicKeyService struct { +type AffinityLabelVmsService struct { BaseService } -func NewSshPublicKeyService(connection *Connection, path string) *SshPublicKeyService { - var result SshPublicKeyService +func NewAffinityLabelVmsService(connection *Connection, path string) *AffinityLabelVmsService { + var result AffinityLabelVmsService result.connection = connection result.path = path return &result } // +// Add a label to a vm. // -type SshPublicKeyServiceGetRequest struct { - SshPublicKeyService *SshPublicKeyService - header map[string]string - query map[string]string - follow *string +type AffinityLabelVmsServiceAddRequest struct { + AffinityLabelVmsService *AffinityLabelVmsService + header map[string]string + query map[string]string + vm *Vm } -func (p *SshPublicKeyServiceGetRequest) Header(key, value string) *SshPublicKeyServiceGetRequest { +func (p *AffinityLabelVmsServiceAddRequest) Header(key, value string) *AffinityLabelVmsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -5025,7 +4422,7 @@ func (p *SshPublicKeyServiceGetRequest) Header(key, value string) *SshPublicKeyS return p } -func (p *SshPublicKeyServiceGetRequest) Query(key, value string) *SshPublicKeyServiceGetRequest { +func (p *AffinityLabelVmsServiceAddRequest) Query(key, value string) *AffinityLabelVmsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -5033,18 +4430,14 @@ func (p *SshPublicKeyServiceGetRequest) Query(key, value string) *SshPublicKeySe return p } -func (p *SshPublicKeyServiceGetRequest) Follow(follow string) *SshPublicKeyServiceGetRequest { - p.follow = &follow +func (p *AffinityLabelVmsServiceAddRequest) Vm(vm *Vm) *AffinityLabelVmsServiceAddRequest { + p.vm = vm return p } -func (p *SshPublicKeyServiceGetRequest) Send() (*SshPublicKeyServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SshPublicKeyService.connection.URL(), p.SshPublicKeyService.path) +func (p *AffinityLabelVmsServiceAddRequest) Send() (*AffinityLabelVmsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelVmsService.connection.URL(), p.AffinityLabelVmsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -5053,12 +4446,19 @@ func (p *SshPublicKeyServiceGetRequest) Send() (*SshPublicKeyServiceGetResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLVmWriteOne(writer, p.vm, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SshPublicKeyService.connection.headers { + for hk, hv := range p.AffinityLabelVmsService.connection.headers { req.Header.Add(hk, hv) } @@ -5073,18 +4473,18 @@ func (p *SshPublicKeyServiceGetRequest) Send() (*SshPublicKeyServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SshPublicKeyService.connection.authenticate() + token, err := p.AffinityLabelVmsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SshPublicKeyService.connection.client.Do(req) + resp, err := p.AffinityLabelVmsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SshPublicKeyService.connection.logFunc != nil { + if p.AffinityLabelVmsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -5093,9 +4493,9 @@ func (p *SshPublicKeyServiceGetRequest) Send() (*SshPublicKeyServiceGetResponse, if err != nil { return nil, err } - p.SshPublicKeyService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelVmsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -5103,14 +4503,14 @@ func (p *SshPublicKeyServiceGetRequest) Send() (*SshPublicKeyServiceGetResponse, return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSshPublicKeyReadOne(reader, nil, "") + result, err := XMLVmReadOne(reader, nil, "") if err != nil { return nil, err } - return &SshPublicKeyServiceGetResponse{key: result}, nil + return &AffinityLabelVmsServiceAddResponse{vm: result}, nil } -func (p *SshPublicKeyServiceGetRequest) MustSend() *SshPublicKeyServiceGetResponse { +func (p *AffinityLabelVmsServiceAddRequest) MustSend() *AffinityLabelVmsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -5119,41 +4519,45 @@ func (p *SshPublicKeyServiceGetRequest) MustSend() *SshPublicKeyServiceGetRespon } // +// Add a label to a vm. // -type SshPublicKeyServiceGetResponse struct { - key *SshPublicKey +type AffinityLabelVmsServiceAddResponse struct { + vm *Vm } -func (p *SshPublicKeyServiceGetResponse) Key() (*SshPublicKey, bool) { - if p.key != nil { - return p.key, true +func (p *AffinityLabelVmsServiceAddResponse) Vm() (*Vm, bool) { + if p.vm != nil { + return p.vm, true } return nil, false } -func (p *SshPublicKeyServiceGetResponse) MustKey() *SshPublicKey { - if p.key == nil { - panic("key in response does not exist") +func (p *AffinityLabelVmsServiceAddResponse) MustVm() *Vm { + if p.vm == nil { + panic("vm in response does not exist") } - return p.key + return p.vm } // +// Add a label to a vm. // -func (p *SshPublicKeyService) Get() *SshPublicKeyServiceGetRequest { - return &SshPublicKeyServiceGetRequest{SshPublicKeyService: p} +func (p *AffinityLabelVmsService) Add() *AffinityLabelVmsServiceAddRequest { + return &AffinityLabelVmsServiceAddRequest{AffinityLabelVmsService: p} } // +// List all virtual machines with the label. +// The order of the returned virtual machines isn't guaranteed. // -type SshPublicKeyServiceRemoveRequest struct { - SshPublicKeyService *SshPublicKeyService - header map[string]string - query map[string]string - async *bool +type AffinityLabelVmsServiceListRequest struct { + AffinityLabelVmsService *AffinityLabelVmsService + header map[string]string + query map[string]string + follow *string } -func (p *SshPublicKeyServiceRemoveRequest) Header(key, value string) *SshPublicKeyServiceRemoveRequest { +func (p *AffinityLabelVmsServiceListRequest) Header(key, value string) *AffinityLabelVmsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -5161,7 +4565,7 @@ func (p *SshPublicKeyServiceRemoveRequest) Header(key, value string) *SshPublicK return p } -func (p *SshPublicKeyServiceRemoveRequest) Query(key, value string) *SshPublicKeyServiceRemoveRequest { +func (p *AffinityLabelVmsServiceListRequest) Query(key, value string) *AffinityLabelVmsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -5169,16 +4573,16 @@ func (p *SshPublicKeyServiceRemoveRequest) Query(key, value string) *SshPublicKe return p } -func (p *SshPublicKeyServiceRemoveRequest) Async(async bool) *SshPublicKeyServiceRemoveRequest { - p.async = &async +func (p *AffinityLabelVmsServiceListRequest) Follow(follow string) *AffinityLabelVmsServiceListRequest { + p.follow = &follow return p } -func (p *SshPublicKeyServiceRemoveRequest) Send() (*SshPublicKeyServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SshPublicKeyService.connection.URL(), p.SshPublicKeyService.path) +func (p *AffinityLabelVmsServiceListRequest) Send() (*AffinityLabelVmsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelVmsService.connection.URL(), p.AffinityLabelVmsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -5189,12 +4593,12 @@ func (p *SshPublicKeyServiceRemoveRequest) Send() (*SshPublicKeyServiceRemoveRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SshPublicKeyService.connection.headers { + for hk, hv := range p.AffinityLabelVmsService.connection.headers { req.Header.Add(hk, hv) } @@ -5209,18 +4613,18 @@ func (p *SshPublicKeyServiceRemoveRequest) Send() (*SshPublicKeyServiceRemoveRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SshPublicKeyService.connection.authenticate() + token, err := p.AffinityLabelVmsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SshPublicKeyService.connection.client.Do(req) + resp, err := p.AffinityLabelVmsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SshPublicKeyService.connection.logFunc != nil { + if p.AffinityLabelVmsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -5229,19 +4633,24 @@ func (p *SshPublicKeyServiceRemoveRequest) Send() (*SshPublicKeyServiceRemoveRes if err != nil { return nil, err } - p.SshPublicKeyService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelVmsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(SshPublicKeyServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLVmReadMany(reader, nil) + if err != nil { + return nil, err + } + return &AffinityLabelVmsServiceListResponse{vms: result}, nil } -func (p *SshPublicKeyServiceRemoveRequest) MustSend() *SshPublicKeyServiceRemoveResponse { +func (p *AffinityLabelVmsServiceListRequest) MustSend() *AffinityLabelVmsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -5250,27 +4659,87 @@ func (p *SshPublicKeyServiceRemoveRequest) MustSend() *SshPublicKeyServiceRemove } // +// List all virtual machines with the label. +// The order of the returned virtual machines isn't guaranteed. // -type SshPublicKeyServiceRemoveResponse struct { +type AffinityLabelVmsServiceListResponse struct { + vms *VmSlice +} + +func (p *AffinityLabelVmsServiceListResponse) Vms() (*VmSlice, bool) { + if p.vms != nil { + return p.vms, true + } + return nil, false +} + +func (p *AffinityLabelVmsServiceListResponse) MustVms() *VmSlice { + if p.vms == nil { + panic("vms in response does not exist") + } + return p.vms } // +// List all virtual machines with the label. +// The order of the returned virtual machines isn't guaranteed. // -func (p *SshPublicKeyService) Remove() *SshPublicKeyServiceRemoveRequest { - return &SshPublicKeyServiceRemoveRequest{SshPublicKeyService: p} +func (p *AffinityLabelVmsService) List() *AffinityLabelVmsServiceListRequest { + return &AffinityLabelVmsServiceListRequest{AffinityLabelVmsService: p} } // +// A link to the specific label-vm assignment to +// allow label removal. // -type SshPublicKeyServiceUpdateRequest struct { - SshPublicKeyService *SshPublicKeyService - header map[string]string - query map[string]string - async *bool - key *SshPublicKey +func (op *AffinityLabelVmsService) VmService(id string) *AffinityLabelVmService { + return NewAffinityLabelVmService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *SshPublicKeyServiceUpdateRequest) Header(key, value string) *SshPublicKeyServiceUpdateRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AffinityLabelVmsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.VmService(path), nil + } + return op.VmService(path[:index]).Service(path[index+1:]) +} + +func (op *AffinityLabelVmsService) String() string { + return fmt.Sprintf("AffinityLabelVmsService:%s", op.path) +} + +// +// Manages the affinity labels available in the system. +// +type AffinityLabelsService struct { + BaseService +} + +func NewAffinityLabelsService(connection *Connection, path string) *AffinityLabelsService { + var result AffinityLabelsService + result.connection = connection + result.path = path + return &result +} + +// +// Creates a new label. The label is automatically attached +// to all entities mentioned in the vms or hosts lists. +// +type AffinityLabelsServiceAddRequest struct { + AffinityLabelsService *AffinityLabelsService + header map[string]string + query map[string]string + label *AffinityLabel +} + +func (p *AffinityLabelsServiceAddRequest) Header(key, value string) *AffinityLabelsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -5278,7 +4747,7 @@ func (p *SshPublicKeyServiceUpdateRequest) Header(key, value string) *SshPublicK return p } -func (p *SshPublicKeyServiceUpdateRequest) Query(key, value string) *SshPublicKeyServiceUpdateRequest { +func (p *AffinityLabelsServiceAddRequest) Query(key, value string) *AffinityLabelsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -5286,23 +4755,14 @@ func (p *SshPublicKeyServiceUpdateRequest) Query(key, value string) *SshPublicKe return p } -func (p *SshPublicKeyServiceUpdateRequest) Async(async bool) *SshPublicKeyServiceUpdateRequest { - p.async = &async - return p -} - -func (p *SshPublicKeyServiceUpdateRequest) Key(key *SshPublicKey) *SshPublicKeyServiceUpdateRequest { - p.key = key +func (p *AffinityLabelsServiceAddRequest) Label(label *AffinityLabel) *AffinityLabelsServiceAddRequest { + p.label = label return p } -func (p *SshPublicKeyServiceUpdateRequest) Send() (*SshPublicKeyServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SshPublicKeyService.connection.URL(), p.SshPublicKeyService.path) +func (p *AffinityLabelsServiceAddRequest) Send() (*AffinityLabelsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelsService.connection.URL(), p.AffinityLabelsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -5313,17 +4773,17 @@ func (p *SshPublicKeyServiceUpdateRequest) Send() (*SshPublicKeyServiceUpdateRes } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLSshPublicKeyWriteOne(writer, p.key, "") + err := XMLAffinityLabelWriteOne(writer, p.label, "") if err != nil { return nil, err } writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SshPublicKeyService.connection.headers { + for hk, hv := range p.AffinityLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -5338,18 +4798,18 @@ func (p *SshPublicKeyServiceUpdateRequest) Send() (*SshPublicKeyServiceUpdateRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SshPublicKeyService.connection.authenticate() + token, err := p.AffinityLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SshPublicKeyService.connection.client.Do(req) + resp, err := p.AffinityLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SshPublicKeyService.connection.logFunc != nil { + if p.AffinityLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -5358,9 +4818,9 @@ func (p *SshPublicKeyServiceUpdateRequest) Send() (*SshPublicKeyServiceUpdateRes if err != nil { return nil, err } - p.SshPublicKeyService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -5368,14 +4828,14 @@ func (p *SshPublicKeyServiceUpdateRequest) Send() (*SshPublicKeyServiceUpdateRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSshPublicKeyReadOne(reader, nil, "") + result, err := XMLAffinityLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &SshPublicKeyServiceUpdateResponse{key: result}, nil + return &AffinityLabelsServiceAddResponse{label: result}, nil } -func (p *SshPublicKeyServiceUpdateRequest) MustSend() *SshPublicKeyServiceUpdateResponse { +func (p *AffinityLabelsServiceAddRequest) MustSend() *AffinityLabelsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -5384,97 +4844,84 @@ func (p *SshPublicKeyServiceUpdateRequest) MustSend() *SshPublicKeyServiceUpdate } // +// Creates a new label. The label is automatically attached +// to all entities mentioned in the vms or hosts lists. // -type SshPublicKeyServiceUpdateResponse struct { - key *SshPublicKey +type AffinityLabelsServiceAddResponse struct { + label *AffinityLabel } -func (p *SshPublicKeyServiceUpdateResponse) Key() (*SshPublicKey, bool) { - if p.key != nil { - return p.key, true +func (p *AffinityLabelsServiceAddResponse) Label() (*AffinityLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *SshPublicKeyServiceUpdateResponse) MustKey() *SshPublicKey { - if p.key == nil { - panic("key in response does not exist") +func (p *AffinityLabelsServiceAddResponse) MustLabel() *AffinityLabel { + if p.label == nil { + panic("label in response does not exist") } - return p.key + return p.label } // +// Creates a new label. The label is automatically attached +// to all entities mentioned in the vms or hosts lists. // -func (p *SshPublicKeyService) Update() *SshPublicKeyServiceUpdateRequest { - return &SshPublicKeyServiceUpdateRequest{SshPublicKeyService: p} +func (p *AffinityLabelsService) Add() *AffinityLabelsServiceAddRequest { + return &AffinityLabelsServiceAddRequest{AffinityLabelsService: p} } // -// Service locator method, returns individual service on which the URI is dispatched. +// Lists all labels present in the system. +// The order of the returned labels isn't guaranteed. // -func (op *SshPublicKeyService) Service(path string) (Service, error) { - if path == "" { - return op, nil +type AffinityLabelsServiceListRequest struct { + AffinityLabelsService *AffinityLabelsService + header map[string]string + query map[string]string + follow *string + max *int64 +} + +func (p *AffinityLabelsServiceListRequest) Header(key, value string) *AffinityLabelsServiceListRequest { + if p.header == nil { + p.header = make(map[string]string) } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + p.header[key] = value + return p } -func (op *SshPublicKeyService) String() string { - return fmt.Sprintf("SshPublicKeyService:%s", op.path) +func (p *AffinityLabelsServiceListRequest) Query(key, value string) *AffinityLabelsServiceListRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p } -// -// A service that shows a user's group membership in the AAA extension. -// -type DomainUserGroupsService struct { - BaseService -} - -func NewDomainUserGroupsService(connection *Connection, path string) *DomainUserGroupsService { - var result DomainUserGroupsService - result.connection = connection - result.path = path - return &result -} - -// -// Returns the list of groups that the user is a member of. -// -type DomainUserGroupsServiceListRequest struct { - DomainUserGroupsService *DomainUserGroupsService - header map[string]string - query map[string]string - follow *string -} - -func (p *DomainUserGroupsServiceListRequest) Header(key, value string) *DomainUserGroupsServiceListRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *DomainUserGroupsServiceListRequest) Query(key, value string) *DomainUserGroupsServiceListRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value +func (p *AffinityLabelsServiceListRequest) Follow(follow string) *AffinityLabelsServiceListRequest { + p.follow = &follow return p } -func (p *DomainUserGroupsServiceListRequest) Follow(follow string) *DomainUserGroupsServiceListRequest { - p.follow = &follow +func (p *AffinityLabelsServiceListRequest) Max(max int64) *AffinityLabelsServiceListRequest { + p.max = &max return p } -func (p *DomainUserGroupsServiceListRequest) Send() (*DomainUserGroupsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainUserGroupsService.connection.URL(), p.DomainUserGroupsService.path) +func (p *AffinityLabelsServiceListRequest) Send() (*AffinityLabelsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AffinityLabelsService.connection.URL(), p.AffinityLabelsService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -5488,7 +4935,7 @@ func (p *DomainUserGroupsServiceListRequest) Send() (*DomainUserGroupsServiceLis return nil, err } - for hk, hv := range p.DomainUserGroupsService.connection.headers { + for hk, hv := range p.AffinityLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -5503,18 +4950,18 @@ func (p *DomainUserGroupsServiceListRequest) Send() (*DomainUserGroupsServiceLis req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainUserGroupsService.connection.authenticate() + token, err := p.AffinityLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainUserGroupsService.connection.client.Do(req) + resp, err := p.AffinityLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainUserGroupsService.connection.logFunc != nil { + if p.AffinityLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -5523,7 +4970,7 @@ func (p *DomainUserGroupsServiceListRequest) Send() (*DomainUserGroupsServiceLis if err != nil { return nil, err } - p.DomainUserGroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AffinityLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -5533,14 +4980,14 @@ func (p *DomainUserGroupsServiceListRequest) Send() (*DomainUserGroupsServiceLis return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGroupReadMany(reader, nil) + result, err := XMLAffinityLabelReadMany(reader, nil) if err != nil { return nil, err } - return &DomainUserGroupsServiceListResponse{groups: result}, nil + return &AffinityLabelsServiceListResponse{labels: result}, nil } -func (p *DomainUserGroupsServiceListRequest) MustSend() *DomainUserGroupsServiceListResponse { +func (p *AffinityLabelsServiceListRequest) MustSend() *AffinityLabelsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -5549,88 +4996,86 @@ func (p *DomainUserGroupsServiceListRequest) MustSend() *DomainUserGroupsService } // -// Returns the list of groups that the user is a member of. +// Lists all labels present in the system. +// The order of the returned labels isn't guaranteed. // -type DomainUserGroupsServiceListResponse struct { - groups *GroupSlice +type AffinityLabelsServiceListResponse struct { + labels *AffinityLabelSlice } -func (p *DomainUserGroupsServiceListResponse) Groups() (*GroupSlice, bool) { - if p.groups != nil { - return p.groups, true +func (p *AffinityLabelsServiceListResponse) Labels() (*AffinityLabelSlice, bool) { + if p.labels != nil { + return p.labels, true } return nil, false } -func (p *DomainUserGroupsServiceListResponse) MustGroups() *GroupSlice { - if p.groups == nil { - panic("groups in response does not exist") +func (p *AffinityLabelsServiceListResponse) MustLabels() *AffinityLabelSlice { + if p.labels == nil { + panic("labels in response does not exist") } - return p.groups + return p.labels } // -// Returns the list of groups that the user is a member of. +// Lists all labels present in the system. +// The order of the returned labels isn't guaranteed. // -func (p *DomainUserGroupsService) List() *DomainUserGroupsServiceListRequest { - return &DomainUserGroupsServiceListRequest{DomainUserGroupsService: p} +func (p *AffinityLabelsService) List() *AffinityLabelsServiceListRequest { + return &AffinityLabelsServiceListRequest{AffinityLabelsService: p} +} + +// +// Link to a single label details. +// +func (op *AffinityLabelsService) LabelService(id string) *AffinityLabelService { + return NewAffinityLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *DomainUserGroupsService) Service(path string) (Service, error) { +func (op *AffinityLabelsService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.LabelService(path), nil + } + return op.LabelService(path[:index]).Service(path[index+1:]) } -func (op *DomainUserGroupsService) String() string { - return fmt.Sprintf("DomainUserGroupsService:%s", op.path) +func (op *AffinityLabelsService) String() string { + return fmt.Sprintf("AffinityLabelsService:%s", op.path) } // -// Manages the collection of groups of users. +// This service represents one label to entity assignment +// when accessed using the entities/affinitylabels subcollection. // -type GroupsService struct { +type AssignedAffinityLabelService struct { BaseService } -func NewGroupsService(connection *Connection, path string) *GroupsService { - var result GroupsService +func NewAssignedAffinityLabelService(connection *Connection, path string) *AssignedAffinityLabelService { + var result AssignedAffinityLabelService result.connection = connection result.path = path return &result } // -// Add group from a directory service. Please note that domain name is name of the authorization provider. -// For example, to add the `Developers` group from the `internal-authz` authorization provider send a request -// like this: -// [source] -// ---- -// POST /ovirt-engine/api/groups -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// Developers -// -// internal-authz -// -// -// ---- +// Retrieves details about the attached label. // -type GroupsServiceAddRequest struct { - GroupsService *GroupsService - header map[string]string - query map[string]string - group *Group +type AssignedAffinityLabelServiceGetRequest struct { + AssignedAffinityLabelService *AssignedAffinityLabelService + header map[string]string + query map[string]string + follow *string } -func (p *GroupsServiceAddRequest) Header(key, value string) *GroupsServiceAddRequest { +func (p *AssignedAffinityLabelServiceGetRequest) Header(key, value string) *AssignedAffinityLabelServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -5638,7 +5083,7 @@ func (p *GroupsServiceAddRequest) Header(key, value string) *GroupsServiceAddReq return p } -func (p *GroupsServiceAddRequest) Query(key, value string) *GroupsServiceAddRequest { +func (p *AssignedAffinityLabelServiceGetRequest) Query(key, value string) *AssignedAffinityLabelServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -5646,14 +5091,18 @@ func (p *GroupsServiceAddRequest) Query(key, value string) *GroupsServiceAddRequ return p } -func (p *GroupsServiceAddRequest) Group(group *Group) *GroupsServiceAddRequest { - p.group = group +func (p *AssignedAffinityLabelServiceGetRequest) Follow(follow string) *AssignedAffinityLabelServiceGetRequest { + p.follow = &follow return p } -func (p *GroupsServiceAddRequest) Send() (*GroupsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GroupsService.connection.URL(), p.GroupsService.path) +func (p *AssignedAffinityLabelServiceGetRequest) Send() (*AssignedAffinityLabelServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelService.connection.URL(), p.AssignedAffinityLabelService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -5662,19 +5111,12 @@ func (p *GroupsServiceAddRequest) Send() (*GroupsServiceAddResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLGroupWriteOne(writer, p.group, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GroupsService.connection.headers { + for hk, hv := range p.AssignedAffinityLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -5689,18 +5131,18 @@ func (p *GroupsServiceAddRequest) Send() (*GroupsServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GroupsService.connection.authenticate() + token, err := p.AssignedAffinityLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GroupsService.connection.client.Do(req) + resp, err := p.AssignedAffinityLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GroupsService.connection.logFunc != nil { + if p.AssignedAffinityLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -5709,9 +5151,9 @@ func (p *GroupsServiceAddRequest) Send() (*GroupsServiceAddResponse, error) { if err != nil { return nil, err } - p.GroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedAffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -5719,14 +5161,14 @@ func (p *GroupsServiceAddRequest) Send() (*GroupsServiceAddResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGroupReadOne(reader, nil, "") + result, err := XMLAffinityLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &GroupsServiceAddResponse{group: result}, nil + return &AssignedAffinityLabelServiceGetResponse{label: result}, nil } -func (p *GroupsServiceAddRequest) MustSend() *GroupsServiceAddResponse { +func (p *AssignedAffinityLabelServiceGetRequest) MustSend() *AssignedAffinityLabelServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -5735,102 +5177,43 @@ func (p *GroupsServiceAddRequest) MustSend() *GroupsServiceAddResponse { } // -// Add group from a directory service. Please note that domain name is name of the authorization provider. -// For example, to add the `Developers` group from the `internal-authz` authorization provider send a request -// like this: -// [source] -// ---- -// POST /ovirt-engine/api/groups -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// Developers -// -// internal-authz -// -// -// ---- +// Retrieves details about the attached label. // -type GroupsServiceAddResponse struct { - group *Group +type AssignedAffinityLabelServiceGetResponse struct { + label *AffinityLabel } -func (p *GroupsServiceAddResponse) Group() (*Group, bool) { - if p.group != nil { - return p.group, true +func (p *AssignedAffinityLabelServiceGetResponse) Label() (*AffinityLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *GroupsServiceAddResponse) MustGroup() *Group { - if p.group == nil { - panic("group in response does not exist") +func (p *AssignedAffinityLabelServiceGetResponse) MustLabel() *AffinityLabel { + if p.label == nil { + panic("label in response does not exist") } - return p.group + return p.label } // -// Add group from a directory service. Please note that domain name is name of the authorization provider. -// For example, to add the `Developers` group from the `internal-authz` authorization provider send a request -// like this: -// [source] -// ---- -// POST /ovirt-engine/api/groups -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// Developers -// -// internal-authz -// -// -// ---- +// Retrieves details about the attached label. // -func (p *GroupsService) Add() *GroupsServiceAddRequest { - return &GroupsServiceAddRequest{GroupsService: p} +func (p *AssignedAffinityLabelService) Get() *AssignedAffinityLabelServiceGetRequest { + return &AssignedAffinityLabelServiceGetRequest{AssignedAffinityLabelService: p} } // -// List all the groups in the system. -// Usage: -// .... -// GET /ovirt-engine/api/groups -// .... -// Will return the list of groups: -// [source,xml] -// ---- -// -// -// mygroup -// -// -// -// 476652557A382F67696B6D2B32762B37796E46476D513D3D -// DC=example,DC=com -// -// myextension-authz -// -// -// ... -// -// ---- -// The order of the returned list of groups isn't guaranteed. +// Removes the label from an entity. Does not touch the label itself. // -type GroupsServiceListRequest struct { - GroupsService *GroupsService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string +type AssignedAffinityLabelServiceRemoveRequest struct { + AssignedAffinityLabelService *AssignedAffinityLabelService + header map[string]string + query map[string]string } -func (p *GroupsServiceListRequest) Header(key, value string) *GroupsServiceListRequest { +func (p *AssignedAffinityLabelServiceRemoveRequest) Header(key, value string) *AssignedAffinityLabelServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -5838,7 +5221,7 @@ func (p *GroupsServiceListRequest) Header(key, value string) *GroupsServiceListR return p } -func (p *GroupsServiceListRequest) Query(key, value string) *GroupsServiceListRequest { +func (p *AssignedAffinityLabelServiceRemoveRequest) Query(key, value string) *AssignedAffinityLabelServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -5846,45 +5229,9 @@ func (p *GroupsServiceListRequest) Query(key, value string) *GroupsServiceListRe return p } -func (p *GroupsServiceListRequest) CaseSensitive(caseSensitive bool) *GroupsServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *GroupsServiceListRequest) Follow(follow string) *GroupsServiceListRequest { - p.follow = &follow - return p -} - -func (p *GroupsServiceListRequest) Max(max int64) *GroupsServiceListRequest { - p.max = &max - return p -} - -func (p *GroupsServiceListRequest) Search(search string) *GroupsServiceListRequest { - p.search = &search - return p -} - -func (p *GroupsServiceListRequest) Send() (*GroupsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GroupsService.connection.URL(), p.GroupsService.path) +func (p *AssignedAffinityLabelServiceRemoveRequest) Send() (*AssignedAffinityLabelServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelService.connection.URL(), p.AssignedAffinityLabelService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -5893,12 +5240,12 @@ func (p *GroupsServiceListRequest) Send() (*GroupsServiceListResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GroupsService.connection.headers { + for hk, hv := range p.AssignedAffinityLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -5913,18 +5260,18 @@ func (p *GroupsServiceListRequest) Send() (*GroupsServiceListResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GroupsService.connection.authenticate() + token, err := p.AssignedAffinityLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GroupsService.connection.client.Do(req) + resp, err := p.AssignedAffinityLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GroupsService.connection.logFunc != nil { + if p.AssignedAffinityLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -5933,24 +5280,19 @@ func (p *GroupsServiceListRequest) Send() (*GroupsServiceListResponse, error) { if err != nil { return nil, err } - p.GroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedAffinityLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLGroupReadMany(reader, nil) - if err != nil { - return nil, err - } - return &GroupsServiceListResponse{groups: result}, nil + return new(AssignedAffinityLabelServiceRemoveResponse), nil } -func (p *GroupsServiceListRequest) MustSend() *GroupsServiceListResponse { +func (p *AssignedAffinityLabelServiceRemoveRequest) MustSend() *AssignedAffinityLabelServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -5959,160 +5301,58 @@ func (p *GroupsServiceListRequest) MustSend() *GroupsServiceListResponse { } // -// List all the groups in the system. -// Usage: -// .... -// GET /ovirt-engine/api/groups -// .... -// Will return the list of groups: -// [source,xml] -// ---- -// -// -// mygroup -// -// -// -// 476652557A382F67696B6D2B32762B37796E46476D513D3D -// DC=example,DC=com -// -// myextension-authz -// -// -// ... -// -// ---- -// The order of the returned list of groups isn't guaranteed. -// -type GroupsServiceListResponse struct { - groups *GroupSlice -} - -func (p *GroupsServiceListResponse) Groups() (*GroupSlice, bool) { - if p.groups != nil { - return p.groups, true - } - return nil, false -} - -func (p *GroupsServiceListResponse) MustGroups() *GroupSlice { - if p.groups == nil { - panic("groups in response does not exist") - } - return p.groups -} - -// -// List all the groups in the system. -// Usage: -// .... -// GET /ovirt-engine/api/groups -// .... -// Will return the list of groups: -// [source,xml] -// ---- -// -// -// mygroup -// -// -// -// 476652557A382F67696B6D2B32762B37796E46476D513D3D -// DC=example,DC=com -// -// myextension-authz -// -// -// ... -// -// ---- -// The order of the returned list of groups isn't guaranteed. +// Removes the label from an entity. Does not touch the label itself. // -func (p *GroupsService) List() *GroupsServiceListRequest { - return &GroupsServiceListRequest{GroupsService: p} +type AssignedAffinityLabelServiceRemoveResponse struct { } // -// Reference to the service that manages a specific group. +// Removes the label from an entity. Does not touch the label itself. // -func (op *GroupsService) GroupService(id string) *GroupService { - return NewGroupService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *AssignedAffinityLabelService) Remove() *AssignedAffinityLabelServiceRemoveRequest { + return &AssignedAffinityLabelServiceRemoveRequest{AssignedAffinityLabelService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *GroupsService) Service(path string) (Service, error) { +func (op *AssignedAffinityLabelService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.GroupService(path), nil - } - return op.GroupService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *GroupsService) String() string { - return fmt.Sprintf("GroupsService:%s", op.path) +func (op *AssignedAffinityLabelService) String() string { + return fmt.Sprintf("AssignedAffinityLabelService:%s", op.path) } // -// A service to manage the users in the system. +// This service is used to list and manipulate affinity labels that are +// assigned to supported entities when accessed using entities/affinitylabels. // -type UsersService struct { +type AssignedAffinityLabelsService struct { BaseService } -func NewUsersService(connection *Connection, path string) *UsersService { - var result UsersService +func NewAssignedAffinityLabelsService(connection *Connection, path string) *AssignedAffinityLabelsService { + var result AssignedAffinityLabelsService result.connection = connection result.path = path return &result } // -// Add user from a directory service. -// For example, to add the `myuser` user from the `myextension-authz` authorization provider send a request -// like this: -// [source] -// ---- -// POST /ovirt-engine/api/users -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// myuser@myextension-authz -// -// myextension-authz -// -// -// ---- -// In case you are working with Active Directory you have to pass user principal name (UPN) as `username`, followed -// by authorization provider name. Due to https://bugzilla.redhat.com/1147900[bug 1147900] you need to provide -// also `principal` parameter set to UPN of the user. -// For example, to add the user with UPN `myuser@mysubdomain.mydomain.com` from the `myextension-authz` -// authorization provider send a request body like this: -// [source,xml] -// ---- -// -// myuser@mysubdomain.mydomain.com -// myuser@mysubdomain.mydomain.com@myextension-authz -// -// myextension-authz -// -// -// ---- +// Attaches a label to an entity. // -type UsersServiceAddRequest struct { - UsersService *UsersService - header map[string]string - query map[string]string - user *User +type AssignedAffinityLabelsServiceAddRequest struct { + AssignedAffinityLabelsService *AssignedAffinityLabelsService + header map[string]string + query map[string]string + label *AffinityLabel } -func (p *UsersServiceAddRequest) Header(key, value string) *UsersServiceAddRequest { +func (p *AssignedAffinityLabelsServiceAddRequest) Header(key, value string) *AssignedAffinityLabelsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -6120,7 +5360,7 @@ func (p *UsersServiceAddRequest) Header(key, value string) *UsersServiceAddReque return p } -func (p *UsersServiceAddRequest) Query(key, value string) *UsersServiceAddRequest { +func (p *AssignedAffinityLabelsServiceAddRequest) Query(key, value string) *AssignedAffinityLabelsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -6128,13 +5368,13 @@ func (p *UsersServiceAddRequest) Query(key, value string) *UsersServiceAddReques return p } -func (p *UsersServiceAddRequest) User(user *User) *UsersServiceAddRequest { - p.user = user +func (p *AssignedAffinityLabelsServiceAddRequest) Label(label *AffinityLabel) *AssignedAffinityLabelsServiceAddRequest { + p.label = label return p } -func (p *UsersServiceAddRequest) Send() (*UsersServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UsersService.connection.URL(), p.UsersService.path) +func (p *AssignedAffinityLabelsServiceAddRequest) Send() (*AssignedAffinityLabelsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelsService.connection.URL(), p.AssignedAffinityLabelsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -6146,7 +5386,7 @@ func (p *UsersServiceAddRequest) Send() (*UsersServiceAddResponse, error) { } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLUserWriteOne(writer, p.user, "") + err := XMLAffinityLabelWriteOne(writer, p.label, "") if err != nil { return nil, err } @@ -6156,7 +5396,7 @@ func (p *UsersServiceAddRequest) Send() (*UsersServiceAddResponse, error) { return nil, err } - for hk, hv := range p.UsersService.connection.headers { + for hk, hv := range p.AssignedAffinityLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -6171,18 +5411,18 @@ func (p *UsersServiceAddRequest) Send() (*UsersServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UsersService.connection.authenticate() + token, err := p.AssignedAffinityLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UsersService.connection.client.Do(req) + resp, err := p.AssignedAffinityLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UsersService.connection.logFunc != nil { + if p.AssignedAffinityLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -6191,7 +5431,7 @@ func (p *UsersServiceAddRequest) Send() (*UsersServiceAddResponse, error) { if err != nil { return nil, err } - p.UsersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedAffinityLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -6201,14 +5441,14 @@ func (p *UsersServiceAddRequest) Send() (*UsersServiceAddResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUserReadOne(reader, nil, "") + result, err := XMLAffinityLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &UsersServiceAddResponse{user: result}, nil + return &AssignedAffinityLabelsServiceAddResponse{label: result}, nil } -func (p *UsersServiceAddRequest) MustSend() *UsersServiceAddResponse { +func (p *AssignedAffinityLabelsServiceAddRequest) MustSend() *AssignedAffinityLabelsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -6217,134 +5457,45 @@ func (p *UsersServiceAddRequest) MustSend() *UsersServiceAddResponse { } // -// Add user from a directory service. -// For example, to add the `myuser` user from the `myextension-authz` authorization provider send a request -// like this: -// [source] -// ---- -// POST /ovirt-engine/api/users -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// myuser@myextension-authz -// -// myextension-authz -// -// -// ---- -// In case you are working with Active Directory you have to pass user principal name (UPN) as `username`, followed -// by authorization provider name. Due to https://bugzilla.redhat.com/1147900[bug 1147900] you need to provide -// also `principal` parameter set to UPN of the user. -// For example, to add the user with UPN `myuser@mysubdomain.mydomain.com` from the `myextension-authz` -// authorization provider send a request body like this: -// [source,xml] -// ---- -// -// myuser@mysubdomain.mydomain.com -// myuser@mysubdomain.mydomain.com@myextension-authz -// -// myextension-authz -// -// -// ---- +// Attaches a label to an entity. // -type UsersServiceAddResponse struct { - user *User +type AssignedAffinityLabelsServiceAddResponse struct { + label *AffinityLabel } -func (p *UsersServiceAddResponse) User() (*User, bool) { - if p.user != nil { - return p.user, true +func (p *AssignedAffinityLabelsServiceAddResponse) Label() (*AffinityLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *UsersServiceAddResponse) MustUser() *User { - if p.user == nil { - panic("user in response does not exist") +func (p *AssignedAffinityLabelsServiceAddResponse) MustLabel() *AffinityLabel { + if p.label == nil { + panic("label in response does not exist") } - return p.user + return p.label } // -// Add user from a directory service. -// For example, to add the `myuser` user from the `myextension-authz` authorization provider send a request -// like this: -// [source] -// ---- -// POST /ovirt-engine/api/users -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// myuser@myextension-authz -// -// myextension-authz -// -// -// ---- -// In case you are working with Active Directory you have to pass user principal name (UPN) as `username`, followed -// by authorization provider name. Due to https://bugzilla.redhat.com/1147900[bug 1147900] you need to provide -// also `principal` parameter set to UPN of the user. -// For example, to add the user with UPN `myuser@mysubdomain.mydomain.com` from the `myextension-authz` -// authorization provider send a request body like this: -// [source,xml] -// ---- -// -// myuser@mysubdomain.mydomain.com -// myuser@mysubdomain.mydomain.com@myextension-authz -// -// myextension-authz -// -// -// ---- +// Attaches a label to an entity. // -func (p *UsersService) Add() *UsersServiceAddRequest { - return &UsersServiceAddRequest{UsersService: p} +func (p *AssignedAffinityLabelsService) Add() *AssignedAffinityLabelsServiceAddRequest { + return &AssignedAffinityLabelsServiceAddRequest{AssignedAffinityLabelsService: p} } // -// List all the users in the system. -// Usage: -// .... -// GET /ovirt-engine/api/users -// .... -// Will return the list of users: -// [source,xml] -// ---- -// -// -// admin -// -// -// -// -// 23456 -// * -// user1 -// user1@domain-authz -// -// domain-authz -// -// -// -// ---- -// The order of the returned list of users isn't guaranteed. +// Lists all labels that are attached to an entity. +// The order of the returned entities isn't guaranteed. // -type UsersServiceListRequest struct { - UsersService *UsersService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string +type AssignedAffinityLabelsServiceListRequest struct { + AssignedAffinityLabelsService *AssignedAffinityLabelsService + header map[string]string + query map[string]string + follow *string } -func (p *UsersServiceListRequest) Header(key, value string) *UsersServiceListRequest { +func (p *AssignedAffinityLabelsServiceListRequest) Header(key, value string) *AssignedAffinityLabelsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -6352,7 +5503,7 @@ func (p *UsersServiceListRequest) Header(key, value string) *UsersServiceListReq return p } -func (p *UsersServiceListRequest) Query(key, value string) *UsersServiceListRequest { +func (p *AssignedAffinityLabelsServiceListRequest) Query(key, value string) *AssignedAffinityLabelsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -6360,45 +5511,18 @@ func (p *UsersServiceListRequest) Query(key, value string) *UsersServiceListRequ return p } -func (p *UsersServiceListRequest) CaseSensitive(caseSensitive bool) *UsersServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *UsersServiceListRequest) Follow(follow string) *UsersServiceListRequest { +func (p *AssignedAffinityLabelsServiceListRequest) Follow(follow string) *AssignedAffinityLabelsServiceListRequest { p.follow = &follow return p } -func (p *UsersServiceListRequest) Max(max int64) *UsersServiceListRequest { - p.max = &max - return p -} - -func (p *UsersServiceListRequest) Search(search string) *UsersServiceListRequest { - p.search = &search - return p -} - -func (p *UsersServiceListRequest) Send() (*UsersServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UsersService.connection.URL(), p.UsersService.path) +func (p *AssignedAffinityLabelsServiceListRequest) Send() (*AssignedAffinityLabelsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelsService.connection.URL(), p.AssignedAffinityLabelsService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -6412,7 +5536,7 @@ func (p *UsersServiceListRequest) Send() (*UsersServiceListResponse, error) { return nil, err } - for hk, hv := range p.UsersService.connection.headers { + for hk, hv := range p.AssignedAffinityLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -6427,18 +5551,18 @@ func (p *UsersServiceListRequest) Send() (*UsersServiceListResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UsersService.connection.authenticate() + token, err := p.AssignedAffinityLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UsersService.connection.client.Do(req) + resp, err := p.AssignedAffinityLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UsersService.connection.logFunc != nil { + if p.AssignedAffinityLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -6447,7 +5571,7 @@ func (p *UsersServiceListRequest) Send() (*UsersServiceListResponse, error) { if err != nil { return nil, err } - p.UsersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedAffinityLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -6457,14 +5581,14 @@ func (p *UsersServiceListRequest) Send() (*UsersServiceListResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUserReadMany(reader, nil) + result, err := XMLAffinityLabelReadMany(reader, nil) if err != nil { return nil, err } - return &UsersServiceListResponse{users: result}, nil + return &AssignedAffinityLabelsServiceListResponse{label: result}, nil } -func (p *UsersServiceListRequest) MustSend() *UsersServiceListResponse { +func (p *AssignedAffinityLabelsServiceListRequest) MustSend() *AssignedAffinityLabelsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -6473,156 +5597,84 @@ func (p *UsersServiceListRequest) MustSend() *UsersServiceListResponse { } // -// List all the users in the system. -// Usage: -// .... -// GET /ovirt-engine/api/users -// .... -// Will return the list of users: -// [source,xml] -// ---- -// -// -// admin -// -// -// -// -// 23456 -// * -// user1 -// user1@domain-authz -// -// domain-authz -// -// -// -// ---- -// The order of the returned list of users isn't guaranteed. +// Lists all labels that are attached to an entity. +// The order of the returned entities isn't guaranteed. // -type UsersServiceListResponse struct { - users *UserSlice +type AssignedAffinityLabelsServiceListResponse struct { + label *AffinityLabelSlice } -func (p *UsersServiceListResponse) Users() (*UserSlice, bool) { - if p.users != nil { - return p.users, true +func (p *AssignedAffinityLabelsServiceListResponse) Label() (*AffinityLabelSlice, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *UsersServiceListResponse) MustUsers() *UserSlice { - if p.users == nil { - panic("users in response does not exist") +func (p *AssignedAffinityLabelsServiceListResponse) MustLabel() *AffinityLabelSlice { + if p.label == nil { + panic("label in response does not exist") } - return p.users + return p.label } // -// List all the users in the system. -// Usage: -// .... -// GET /ovirt-engine/api/users -// .... -// Will return the list of users: -// [source,xml] -// ---- -// -// -// admin -// -// -// -// -// 23456 -// * -// user1 -// user1@domain-authz -// -// domain-authz -// -// -// -// ---- -// The order of the returned list of users isn't guaranteed. +// Lists all labels that are attached to an entity. +// The order of the returned entities isn't guaranteed. // -func (p *UsersService) List() *UsersServiceListRequest { - return &UsersServiceListRequest{UsersService: p} +func (p *AssignedAffinityLabelsService) List() *AssignedAffinityLabelsServiceListRequest { + return &AssignedAffinityLabelsServiceListRequest{AssignedAffinityLabelsService: p} } // +// Link to the specific entity-label assignment to allow +// removal. // -func (op *UsersService) UserService(id string) *UserService { - return NewUserService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AssignedAffinityLabelsService) LabelService(id string) *AssignedAffinityLabelService { + return NewAssignedAffinityLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *UsersService) Service(path string) (Service, error) { +func (op *AssignedAffinityLabelsService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.UserService(path), nil + return op.LabelService(path), nil } - return op.UserService(path[:index]).Service(path[index+1:]) + return op.LabelService(path[:index]).Service(path[index+1:]) } -func (op *UsersService) String() string { - return fmt.Sprintf("UsersService:%s", op.path) +func (op *AssignedAffinityLabelsService) String() string { + return fmt.Sprintf("AssignedAffinityLabelsService:%s", op.path) } // -// A service to list all domain users in the system. // -type DomainUsersService struct { +type AssignedCpuProfileService struct { BaseService } -func NewDomainUsersService(connection *Connection, path string) *DomainUsersService { - var result DomainUsersService +func NewAssignedCpuProfileService(connection *Connection, path string) *AssignedCpuProfileService { + var result AssignedCpuProfileService result.connection = connection result.path = path return &result } // -// List all the users in the domain. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678/users -// .... -// Will return the list of users in the domain: -// [source,xml] -// ---- -// -// -// admin -// * -// admin -// admin@internal-authz -// -// internal-authz -// -// -// -// -// ---- -// The order of the returned list of users isn't guaranteed. // -type DomainUsersServiceListRequest struct { - DomainUsersService *DomainUsersService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string +type AssignedCpuProfileServiceGetRequest struct { + AssignedCpuProfileService *AssignedCpuProfileService + header map[string]string + query map[string]string + follow *string } -func (p *DomainUsersServiceListRequest) Header(key, value string) *DomainUsersServiceListRequest { +func (p *AssignedCpuProfileServiceGetRequest) Header(key, value string) *AssignedCpuProfileServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -6630,7 +5682,7 @@ func (p *DomainUsersServiceListRequest) Header(key, value string) *DomainUsersSe return p } -func (p *DomainUsersServiceListRequest) Query(key, value string) *DomainUsersServiceListRequest { +func (p *AssignedCpuProfileServiceGetRequest) Query(key, value string) *AssignedCpuProfileServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -6638,45 +5690,18 @@ func (p *DomainUsersServiceListRequest) Query(key, value string) *DomainUsersSer return p } -func (p *DomainUsersServiceListRequest) CaseSensitive(caseSensitive bool) *DomainUsersServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *DomainUsersServiceListRequest) Follow(follow string) *DomainUsersServiceListRequest { +func (p *AssignedCpuProfileServiceGetRequest) Follow(follow string) *AssignedCpuProfileServiceGetRequest { p.follow = &follow return p } -func (p *DomainUsersServiceListRequest) Max(max int64) *DomainUsersServiceListRequest { - p.max = &max - return p -} - -func (p *DomainUsersServiceListRequest) Search(search string) *DomainUsersServiceListRequest { - p.search = &search - return p -} - -func (p *DomainUsersServiceListRequest) Send() (*DomainUsersServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DomainUsersService.connection.URL(), p.DomainUsersService.path) +func (p *AssignedCpuProfileServiceGetRequest) Send() (*AssignedCpuProfileServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedCpuProfileService.connection.URL(), p.AssignedCpuProfileService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -6690,7 +5715,7 @@ func (p *DomainUsersServiceListRequest) Send() (*DomainUsersServiceListResponse, return nil, err } - for hk, hv := range p.DomainUsersService.connection.headers { + for hk, hv := range p.AssignedCpuProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -6705,18 +5730,18 @@ func (p *DomainUsersServiceListRequest) Send() (*DomainUsersServiceListResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DomainUsersService.connection.authenticate() + token, err := p.AssignedCpuProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DomainUsersService.connection.client.Do(req) + resp, err := p.AssignedCpuProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DomainUsersService.connection.logFunc != nil { + if p.AssignedCpuProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -6725,7 +5750,7 @@ func (p *DomainUsersServiceListRequest) Send() (*DomainUsersServiceListResponse, if err != nil { return nil, err } - p.DomainUsersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedCpuProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -6735,14 +5760,14 @@ func (p *DomainUsersServiceListRequest) Send() (*DomainUsersServiceListResponse, return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUserReadMany(reader, nil) + result, err := XMLCpuProfileReadOne(reader, nil, "") if err != nil { return nil, err } - return &DomainUsersServiceListResponse{users: result}, nil + return &AssignedCpuProfileServiceGetResponse{profile: result}, nil } -func (p *DomainUsersServiceListRequest) MustSend() *DomainUsersServiceListResponse { +func (p *AssignedCpuProfileServiceGetRequest) MustSend() *AssignedCpuProfileServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -6751,176 +5776,67 @@ func (p *DomainUsersServiceListRequest) MustSend() *DomainUsersServiceListRespon } // -// List all the users in the domain. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678/users -// .... -// Will return the list of users in the domain: -// [source,xml] -// ---- -// -// -// admin -// * -// admin -// admin@internal-authz -// -// internal-authz -// -// -// -// -// ---- -// The order of the returned list of users isn't guaranteed. // -type DomainUsersServiceListResponse struct { - users *UserSlice +type AssignedCpuProfileServiceGetResponse struct { + profile *CpuProfile } -func (p *DomainUsersServiceListResponse) Users() (*UserSlice, bool) { - if p.users != nil { - return p.users, true +func (p *AssignedCpuProfileServiceGetResponse) Profile() (*CpuProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *DomainUsersServiceListResponse) MustUsers() *UserSlice { - if p.users == nil { - panic("users in response does not exist") +func (p *AssignedCpuProfileServiceGetResponse) MustProfile() *CpuProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.users + return p.profile } // -// List all the users in the domain. -// Usage: -// .... -// GET /ovirt-engine/api/domains/5678/users -// .... -// Will return the list of users in the domain: -// [source,xml] -// ---- -// -// -// admin -// * -// admin -// admin@internal-authz -// -// internal-authz -// -// -// -// -// ---- -// The order of the returned list of users isn't guaranteed. // -func (p *DomainUsersService) List() *DomainUsersServiceListRequest { - return &DomainUsersServiceListRequest{DomainUsersService: p} +func (p *AssignedCpuProfileService) Get() *AssignedCpuProfileServiceGetRequest { + return &AssignedCpuProfileServiceGetRequest{AssignedCpuProfileService: p} } // -// Reference to a service to view details of a domain user. // -func (op *DomainUsersService) UserService(id string) *DomainUserService { - return NewDomainUserService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +type AssignedCpuProfileServiceRemoveRequest struct { + AssignedCpuProfileService *AssignedCpuProfileService + header map[string]string + query map[string]string + async *bool } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *DomainUsersService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.UserService(path), nil +func (p *AssignedCpuProfileServiceRemoveRequest) Header(key, value string) *AssignedCpuProfileServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) } - return op.UserService(path[:index]).Service(path[index+1:]) + p.header[key] = value + return p } -func (op *DomainUsersService) String() string { - return fmt.Sprintf("DomainUsersService:%s", op.path) +func (p *AssignedCpuProfileServiceRemoveRequest) Query(key, value string) *AssignedCpuProfileServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p } -// -// A service to manage host storages. -// -type HostStorageService struct { - BaseService +func (p *AssignedCpuProfileServiceRemoveRequest) Async(async bool) *AssignedCpuProfileServiceRemoveRequest { + p.async = &async + return p } -func NewHostStorageService(connection *Connection, path string) *HostStorageService { - var result HostStorageService - result.connection = connection - result.path = path - return &result -} - -// -// Get list of storages. -// [source] -// ---- -// GET /ovirt-engine/api/hosts/123/storage -// ---- -// The XML response you get will be like this one: -// [source,xml] -// ---- -// -// -// ... -// -// ... -// -// ---- -// The order of the returned list of storages isn't guaranteed. -// -type HostStorageServiceListRequest struct { - HostStorageService *HostStorageService - header map[string]string - query map[string]string - follow *string - reportStatus *bool -} - -func (p *HostStorageServiceListRequest) Header(key, value string) *HostStorageServiceListRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *HostStorageServiceListRequest) Query(key, value string) *HostStorageServiceListRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *HostStorageServiceListRequest) Follow(follow string) *HostStorageServiceListRequest { - p.follow = &follow - return p -} - -func (p *HostStorageServiceListRequest) ReportStatus(reportStatus bool) *HostStorageServiceListRequest { - p.reportStatus = &reportStatus - return p -} - -func (p *HostStorageServiceListRequest) Send() (*HostStorageServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostStorageService.connection.URL(), p.HostStorageService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.reportStatus != nil { - values["report_status"] = []string{fmt.Sprintf("%v", *p.reportStatus)} - } +func (p *AssignedCpuProfileServiceRemoveRequest) Send() (*AssignedCpuProfileServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedCpuProfileService.connection.URL(), p.AssignedCpuProfileService.path) + values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } if p.query != nil { for k, v := range p.query { @@ -6930,12 +5846,12 @@ func (p *HostStorageServiceListRequest) Send() (*HostStorageServiceListResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostStorageService.connection.headers { + for hk, hv := range p.AssignedCpuProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -6950,18 +5866,18 @@ func (p *HostStorageServiceListRequest) Send() (*HostStorageServiceListResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostStorageService.connection.authenticate() + token, err := p.AssignedCpuProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostStorageService.connection.client.Do(req) + resp, err := p.AssignedCpuProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostStorageService.connection.logFunc != nil { + if p.AssignedCpuProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -6970,24 +5886,19 @@ func (p *HostStorageServiceListRequest) Send() (*HostStorageServiceListResponse, if err != nil { return nil, err } - p.HostStorageService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedCpuProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLHostStorageReadMany(reader, nil) - if err != nil { - return nil, err - } - return &HostStorageServiceListResponse{storages: result}, nil + return new(AssignedCpuProfileServiceRemoveResponse), nil } -func (p *HostStorageServiceListRequest) MustSend() *HostStorageServiceListResponse { +func (p *AssignedCpuProfileServiceRemoveRequest) MustSend() *AssignedCpuProfileServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -6996,111 +5907,54 @@ func (p *HostStorageServiceListRequest) MustSend() *HostStorageServiceListRespon } // -// Get list of storages. -// [source] -// ---- -// GET /ovirt-engine/api/hosts/123/storage -// ---- -// The XML response you get will be like this one: -// [source,xml] -// ---- -// -// -// ... -// -// ... -// -// ---- -// The order of the returned list of storages isn't guaranteed. -// -type HostStorageServiceListResponse struct { - storages *HostStorageSlice -} - -func (p *HostStorageServiceListResponse) Storages() (*HostStorageSlice, bool) { - if p.storages != nil { - return p.storages, true - } - return nil, false -} - -func (p *HostStorageServiceListResponse) MustStorages() *HostStorageSlice { - if p.storages == nil { - panic("storages in response does not exist") - } - return p.storages -} - -// -// Get list of storages. -// [source] -// ---- -// GET /ovirt-engine/api/hosts/123/storage -// ---- -// The XML response you get will be like this one: -// [source,xml] -// ---- -// -// -// ... -// -// ... -// -// ---- -// The order of the returned list of storages isn't guaranteed. // -func (p *HostStorageService) List() *HostStorageServiceListRequest { - return &HostStorageServiceListRequest{HostStorageService: p} +type AssignedCpuProfileServiceRemoveResponse struct { } // -// Reference to a service managing the storage. // -func (op *HostStorageService) StorageService(id string) *StorageService { - return NewStorageService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *AssignedCpuProfileService) Remove() *AssignedCpuProfileServiceRemoveRequest { + return &AssignedCpuProfileServiceRemoveRequest{AssignedCpuProfileService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *HostStorageService) Service(path string) (Service, error) { +func (op *AssignedCpuProfileService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.StorageService(path), nil - } - return op.StorageService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *HostStorageService) String() string { - return fmt.Sprintf("HostStorageService:%s", op.path) +func (op *AssignedCpuProfileService) String() string { + return fmt.Sprintf("AssignedCpuProfileService:%s", op.path) } // // -type DiskProfileService struct { +type AssignedCpuProfilesService struct { BaseService } -func NewDiskProfileService(connection *Connection, path string) *DiskProfileService { - var result DiskProfileService +func NewAssignedCpuProfilesService(connection *Connection, path string) *AssignedCpuProfilesService { + var result AssignedCpuProfilesService result.connection = connection result.path = path return &result } // +// Add a new cpu profile for the cluster. // -type DiskProfileServiceGetRequest struct { - DiskProfileService *DiskProfileService - header map[string]string - query map[string]string - follow *string +type AssignedCpuProfilesServiceAddRequest struct { + AssignedCpuProfilesService *AssignedCpuProfilesService + header map[string]string + query map[string]string + profile *CpuProfile } -func (p *DiskProfileServiceGetRequest) Header(key, value string) *DiskProfileServiceGetRequest { +func (p *AssignedCpuProfilesServiceAddRequest) Header(key, value string) *AssignedCpuProfilesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -7108,7 +5962,7 @@ func (p *DiskProfileServiceGetRequest) Header(key, value string) *DiskProfileSer return p } -func (p *DiskProfileServiceGetRequest) Query(key, value string) *DiskProfileServiceGetRequest { +func (p *AssignedCpuProfilesServiceAddRequest) Query(key, value string) *AssignedCpuProfilesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -7116,18 +5970,14 @@ func (p *DiskProfileServiceGetRequest) Query(key, value string) *DiskProfileServ return p } -func (p *DiskProfileServiceGetRequest) Follow(follow string) *DiskProfileServiceGetRequest { - p.follow = &follow +func (p *AssignedCpuProfilesServiceAddRequest) Profile(profile *CpuProfile) *AssignedCpuProfilesServiceAddRequest { + p.profile = profile return p } -func (p *DiskProfileServiceGetRequest) Send() (*DiskProfileServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DiskProfileService.connection.URL(), p.DiskProfileService.path) +func (p *AssignedCpuProfilesServiceAddRequest) Send() (*AssignedCpuProfilesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedCpuProfilesService.connection.URL(), p.AssignedCpuProfilesService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -7136,12 +5986,19 @@ func (p *DiskProfileServiceGetRequest) Send() (*DiskProfileServiceGetResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLCpuProfileWriteOne(writer, p.profile, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DiskProfileService.connection.headers { + for hk, hv := range p.AssignedCpuProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -7156,18 +6013,18 @@ func (p *DiskProfileServiceGetRequest) Send() (*DiskProfileServiceGetResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskProfileService.connection.authenticate() + token, err := p.AssignedCpuProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskProfileService.connection.client.Do(req) + resp, err := p.AssignedCpuProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskProfileService.connection.logFunc != nil { + if p.AssignedCpuProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -7176,9 +6033,9 @@ func (p *DiskProfileServiceGetRequest) Send() (*DiskProfileServiceGetResponse, e if err != nil { return nil, err } - p.DiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedCpuProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -7186,14 +6043,14 @@ func (p *DiskProfileServiceGetRequest) Send() (*DiskProfileServiceGetResponse, e return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskProfileReadOne(reader, nil, "") + result, err := XMLCpuProfileReadOne(reader, nil, "") if err != nil { return nil, err } - return &DiskProfileServiceGetResponse{profile: result}, nil + return &AssignedCpuProfilesServiceAddResponse{profile: result}, nil } -func (p *DiskProfileServiceGetRequest) MustSend() *DiskProfileServiceGetResponse { +func (p *AssignedCpuProfilesServiceAddRequest) MustSend() *AssignedCpuProfilesServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -7202,19 +6059,20 @@ func (p *DiskProfileServiceGetRequest) MustSend() *DiskProfileServiceGetResponse } // +// Add a new cpu profile for the cluster. // -type DiskProfileServiceGetResponse struct { - profile *DiskProfile +type AssignedCpuProfilesServiceAddResponse struct { + profile *CpuProfile } -func (p *DiskProfileServiceGetResponse) Profile() (*DiskProfile, bool) { +func (p *AssignedCpuProfilesServiceAddResponse) Profile() (*CpuProfile, bool) { if p.profile != nil { return p.profile, true } return nil, false } -func (p *DiskProfileServiceGetResponse) MustProfile() *DiskProfile { +func (p *AssignedCpuProfilesServiceAddResponse) MustProfile() *CpuProfile { if p.profile == nil { panic("profile in response does not exist") } @@ -7222,21 +6080,25 @@ func (p *DiskProfileServiceGetResponse) MustProfile() *DiskProfile { } // +// Add a new cpu profile for the cluster. // -func (p *DiskProfileService) Get() *DiskProfileServiceGetRequest { - return &DiskProfileServiceGetRequest{DiskProfileService: p} +func (p *AssignedCpuProfilesService) Add() *AssignedCpuProfilesServiceAddRequest { + return &AssignedCpuProfilesServiceAddRequest{AssignedCpuProfilesService: p} } // +// List the CPU profiles assigned to the cluster. +// The order of the returned CPU profiles isn't guaranteed. // -type DiskProfileServiceRemoveRequest struct { - DiskProfileService *DiskProfileService - header map[string]string - query map[string]string - async *bool +type AssignedCpuProfilesServiceListRequest struct { + AssignedCpuProfilesService *AssignedCpuProfilesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *DiskProfileServiceRemoveRequest) Header(key, value string) *DiskProfileServiceRemoveRequest { +func (p *AssignedCpuProfilesServiceListRequest) Header(key, value string) *AssignedCpuProfilesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -7244,7 +6106,7 @@ func (p *DiskProfileServiceRemoveRequest) Header(key, value string) *DiskProfile return p } -func (p *DiskProfileServiceRemoveRequest) Query(key, value string) *DiskProfileServiceRemoveRequest { +func (p *AssignedCpuProfilesServiceListRequest) Query(key, value string) *AssignedCpuProfilesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -7252,16 +6114,25 @@ func (p *DiskProfileServiceRemoveRequest) Query(key, value string) *DiskProfileS return p } -func (p *DiskProfileServiceRemoveRequest) Async(async bool) *DiskProfileServiceRemoveRequest { - p.async = &async +func (p *AssignedCpuProfilesServiceListRequest) Follow(follow string) *AssignedCpuProfilesServiceListRequest { + p.follow = &follow return p } -func (p *DiskProfileServiceRemoveRequest) Send() (*DiskProfileServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DiskProfileService.connection.URL(), p.DiskProfileService.path) +func (p *AssignedCpuProfilesServiceListRequest) Max(max int64) *AssignedCpuProfilesServiceListRequest { + p.max = &max + return p +} + +func (p *AssignedCpuProfilesServiceListRequest) Send() (*AssignedCpuProfilesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedCpuProfilesService.connection.URL(), p.AssignedCpuProfilesService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } if p.query != nil { @@ -7272,12 +6143,12 @@ func (p *DiskProfileServiceRemoveRequest) Send() (*DiskProfileServiceRemoveRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DiskProfileService.connection.headers { + for hk, hv := range p.AssignedCpuProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -7292,18 +6163,18 @@ func (p *DiskProfileServiceRemoveRequest) Send() (*DiskProfileServiceRemoveRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskProfileService.connection.authenticate() + token, err := p.AssignedCpuProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskProfileService.connection.client.Do(req) + resp, err := p.AssignedCpuProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskProfileService.connection.logFunc != nil { + if p.AssignedCpuProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -7312,19 +6183,24 @@ func (p *DiskProfileServiceRemoveRequest) Send() (*DiskProfileServiceRemoveRespo if err != nil { return nil, err } - p.DiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedCpuProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(DiskProfileServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLCpuProfileReadMany(reader, nil) + if err != nil { + return nil, err + } + return &AssignedCpuProfilesServiceListResponse{profiles: result}, nil } -func (p *DiskProfileServiceRemoveRequest) MustSend() *DiskProfileServiceRemoveResponse { +func (p *AssignedCpuProfilesServiceListRequest) MustSend() *AssignedCpuProfilesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -7333,28 +6209,82 @@ func (p *DiskProfileServiceRemoveRequest) MustSend() *DiskProfileServiceRemoveRe } // +// List the CPU profiles assigned to the cluster. +// The order of the returned CPU profiles isn't guaranteed. // -type DiskProfileServiceRemoveResponse struct { +type AssignedCpuProfilesServiceListResponse struct { + profiles *CpuProfileSlice +} + +func (p *AssignedCpuProfilesServiceListResponse) Profiles() (*CpuProfileSlice, bool) { + if p.profiles != nil { + return p.profiles, true + } + return nil, false +} + +func (p *AssignedCpuProfilesServiceListResponse) MustProfiles() *CpuProfileSlice { + if p.profiles == nil { + panic("profiles in response does not exist") + } + return p.profiles } // +// List the CPU profiles assigned to the cluster. +// The order of the returned CPU profiles isn't guaranteed. // -func (p *DiskProfileService) Remove() *DiskProfileServiceRemoveRequest { - return &DiskProfileServiceRemoveRequest{DiskProfileService: p} +func (p *AssignedCpuProfilesService) List() *AssignedCpuProfilesServiceListRequest { + return &AssignedCpuProfilesServiceListRequest{AssignedCpuProfilesService: p} } // -// Update the specified disk profile in the system. // -type DiskProfileServiceUpdateRequest struct { - DiskProfileService *DiskProfileService - header map[string]string - query map[string]string - async *bool - profile *DiskProfile +func (op *AssignedCpuProfilesService) ProfileService(id string) *AssignedCpuProfileService { + return NewAssignedCpuProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *DiskProfileServiceUpdateRequest) Header(key, value string) *DiskProfileServiceUpdateRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AssignedCpuProfilesService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.ProfileService(path), nil + } + return op.ProfileService(path[:index]).Service(path[index+1:]) +} + +func (op *AssignedCpuProfilesService) String() string { + return fmt.Sprintf("AssignedCpuProfilesService:%s", op.path) +} + +// +// +type AssignedDiskProfileService struct { + BaseService +} + +func NewAssignedDiskProfileService(connection *Connection, path string) *AssignedDiskProfileService { + var result AssignedDiskProfileService + result.connection = connection + result.path = path + return &result +} + +// +// +type AssignedDiskProfileServiceGetRequest struct { + AssignedDiskProfileService *AssignedDiskProfileService + header map[string]string + query map[string]string + follow *string +} + +func (p *AssignedDiskProfileServiceGetRequest) Header(key, value string) *AssignedDiskProfileServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -7362,7 +6292,7 @@ func (p *DiskProfileServiceUpdateRequest) Header(key, value string) *DiskProfile return p } -func (p *DiskProfileServiceUpdateRequest) Query(key, value string) *DiskProfileServiceUpdateRequest { +func (p *AssignedDiskProfileServiceGetRequest) Query(key, value string) *AssignedDiskProfileServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -7370,21 +6300,16 @@ func (p *DiskProfileServiceUpdateRequest) Query(key, value string) *DiskProfileS return p } -func (p *DiskProfileServiceUpdateRequest) Async(async bool) *DiskProfileServiceUpdateRequest { - p.async = &async - return p -} - -func (p *DiskProfileServiceUpdateRequest) Profile(profile *DiskProfile) *DiskProfileServiceUpdateRequest { - p.profile = profile +func (p *AssignedDiskProfileServiceGetRequest) Follow(follow string) *AssignedDiskProfileServiceGetRequest { + p.follow = &follow return p } -func (p *DiskProfileServiceUpdateRequest) Send() (*DiskProfileServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DiskProfileService.connection.URL(), p.DiskProfileService.path) +func (p *AssignedDiskProfileServiceGetRequest) Send() (*AssignedDiskProfileServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedDiskProfileService.connection.URL(), p.AssignedDiskProfileService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -7395,19 +6320,12 @@ func (p *DiskProfileServiceUpdateRequest) Send() (*DiskProfileServiceUpdateRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLDiskProfileWriteOne(writer, p.profile, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DiskProfileService.connection.headers { + for hk, hv := range p.AssignedDiskProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -7422,18 +6340,18 @@ func (p *DiskProfileServiceUpdateRequest) Send() (*DiskProfileServiceUpdateRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskProfileService.connection.authenticate() + token, err := p.AssignedDiskProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskProfileService.connection.client.Do(req) + resp, err := p.AssignedDiskProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskProfileService.connection.logFunc != nil { + if p.AssignedDiskProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -7442,7 +6360,7 @@ func (p *DiskProfileServiceUpdateRequest) Send() (*DiskProfileServiceUpdateRespo if err != nil { return nil, err } - p.DiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedDiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -7456,10 +6374,10 @@ func (p *DiskProfileServiceUpdateRequest) Send() (*DiskProfileServiceUpdateRespo if err != nil { return nil, err } - return &DiskProfileServiceUpdateResponse{profile: result}, nil + return &AssignedDiskProfileServiceGetResponse{diskProfile: result}, nil } -func (p *DiskProfileServiceUpdateRequest) MustSend() *DiskProfileServiceUpdateResponse { +func (p *AssignedDiskProfileServiceGetRequest) MustSend() *AssignedDiskProfileServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -7468,83 +6386,41 @@ func (p *DiskProfileServiceUpdateRequest) MustSend() *DiskProfileServiceUpdateRe } // -// Update the specified disk profile in the system. // -type DiskProfileServiceUpdateResponse struct { - profile *DiskProfile +type AssignedDiskProfileServiceGetResponse struct { + diskProfile *DiskProfile } -func (p *DiskProfileServiceUpdateResponse) Profile() (*DiskProfile, bool) { - if p.profile != nil { - return p.profile, true +func (p *AssignedDiskProfileServiceGetResponse) DiskProfile() (*DiskProfile, bool) { + if p.diskProfile != nil { + return p.diskProfile, true } return nil, false } -func (p *DiskProfileServiceUpdateResponse) MustProfile() *DiskProfile { - if p.profile == nil { - panic("profile in response does not exist") - } - return p.profile -} - -// -// Update the specified disk profile in the system. -// -func (p *DiskProfileService) Update() *DiskProfileServiceUpdateRequest { - return &DiskProfileServiceUpdateRequest{DiskProfileService: p} -} - -// -// -func (op *DiskProfileService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *DiskProfileService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) +func (p *AssignedDiskProfileServiceGetResponse) MustDiskProfile() *DiskProfile { + if p.diskProfile == nil { + panic("diskProfile in response does not exist") } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *DiskProfileService) String() string { - return fmt.Sprintf("DiskProfileService:%s", op.path) + return p.diskProfile } // // -type WeightsService struct { - BaseService -} - -func NewWeightsService(connection *Connection, path string) *WeightsService { - var result WeightsService - result.connection = connection - result.path = path - return &result +func (p *AssignedDiskProfileService) Get() *AssignedDiskProfileServiceGetRequest { + return &AssignedDiskProfileServiceGetRequest{AssignedDiskProfileService: p} } // -// Add a weight to a specified user defined scheduling policy. // -type WeightsServiceAddRequest struct { - WeightsService *WeightsService - header map[string]string - query map[string]string - weight *Weight +type AssignedDiskProfileServiceRemoveRequest struct { + AssignedDiskProfileService *AssignedDiskProfileService + header map[string]string + query map[string]string + async *bool } -func (p *WeightsServiceAddRequest) Header(key, value string) *WeightsServiceAddRequest { +func (p *AssignedDiskProfileServiceRemoveRequest) Header(key, value string) *AssignedDiskProfileServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -7552,7 +6428,7 @@ func (p *WeightsServiceAddRequest) Header(key, value string) *WeightsServiceAddR return p } -func (p *WeightsServiceAddRequest) Query(key, value string) *WeightsServiceAddRequest { +func (p *AssignedDiskProfileServiceRemoveRequest) Query(key, value string) *AssignedDiskProfileServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -7560,14 +6436,18 @@ func (p *WeightsServiceAddRequest) Query(key, value string) *WeightsServiceAddRe return p } -func (p *WeightsServiceAddRequest) Weight(weight *Weight) *WeightsServiceAddRequest { - p.weight = weight +func (p *AssignedDiskProfileServiceRemoveRequest) Async(async bool) *AssignedDiskProfileServiceRemoveRequest { + p.async = &async return p } -func (p *WeightsServiceAddRequest) Send() (*WeightsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.WeightsService.connection.URL(), p.WeightsService.path) +func (p *AssignedDiskProfileServiceRemoveRequest) Send() (*AssignedDiskProfileServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedDiskProfileService.connection.URL(), p.AssignedDiskProfileService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -7576,19 +6456,12 @@ func (p *WeightsServiceAddRequest) Send() (*WeightsServiceAddResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLWeightWriteOne(writer, p.weight, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.WeightsService.connection.headers { + for hk, hv := range p.AssignedDiskProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -7603,18 +6476,18 @@ func (p *WeightsServiceAddRequest) Send() (*WeightsServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.WeightsService.connection.authenticate() + token, err := p.AssignedDiskProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.WeightsService.connection.client.Do(req) + resp, err := p.AssignedDiskProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.WeightsService.connection.logFunc != nil { + if p.AssignedDiskProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -7623,184 +6496,19 @@ func (p *WeightsServiceAddRequest) Send() (*WeightsServiceAddResponse, error) { if err != nil { return nil, err } - p.WeightsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody - } - reader := NewXMLReader(respBodyBytes) - result, err := XMLWeightReadOne(reader, nil, "") - if err != nil { - return nil, err - } - return &WeightsServiceAddResponse{weight: result}, nil -} - -func (p *WeightsServiceAddRequest) MustSend() *WeightsServiceAddResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v - } -} - -// -// Add a weight to a specified user defined scheduling policy. -// -type WeightsServiceAddResponse struct { - weight *Weight -} - -func (p *WeightsServiceAddResponse) Weight() (*Weight, bool) { - if p.weight != nil { - return p.weight, true - } - return nil, false -} - -func (p *WeightsServiceAddResponse) MustWeight() *Weight { - if p.weight == nil { - panic("weight in response does not exist") - } - return p.weight -} - -// -// Add a weight to a specified user defined scheduling policy. -// -func (p *WeightsService) Add() *WeightsServiceAddRequest { - return &WeightsServiceAddRequest{WeightsService: p} -} - -// -// Returns the list of weights. -// The order of the returned list of weights isn't guaranteed. -// -type WeightsServiceListRequest struct { - WeightsService *WeightsService - header map[string]string - query map[string]string - filter *bool - follow *string - max *int64 -} - -func (p *WeightsServiceListRequest) Header(key, value string) *WeightsServiceListRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *WeightsServiceListRequest) Query(key, value string) *WeightsServiceListRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *WeightsServiceListRequest) Filter(filter bool) *WeightsServiceListRequest { - p.filter = &filter - return p -} - -func (p *WeightsServiceListRequest) Follow(follow string) *WeightsServiceListRequest { - p.follow = &follow - return p -} - -func (p *WeightsServiceListRequest) Max(max int64) *WeightsServiceListRequest { - p.max = &max - return p -} - -func (p *WeightsServiceListRequest) Send() (*WeightsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.WeightsService.connection.URL(), p.WeightsService.path) - values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - req, err := http.NewRequest("GET", rawURL, nil) - if err != nil { - return nil, err - } - - for hk, hv := range p.WeightsService.connection.headers { - req.Header.Add(hk, hv) - } - - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } - - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.WeightsService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.WeightsService.connection.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if p.WeightsService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.WeightsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedDiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLWeightReadMany(reader, nil) - if err != nil { - return nil, err - } - return &WeightsServiceListResponse{weights: result}, nil + return new(AssignedDiskProfileServiceRemoveResponse), nil } -func (p *WeightsServiceListRequest) MustSend() *WeightsServiceListResponse { +func (p *AssignedDiskProfileServiceRemoveRequest) MustSend() *AssignedDiskProfileServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -7809,96 +6517,54 @@ func (p *WeightsServiceListRequest) MustSend() *WeightsServiceListResponse { } // -// Returns the list of weights. -// The order of the returned list of weights isn't guaranteed. -// -type WeightsServiceListResponse struct { - weights *WeightSlice -} - -func (p *WeightsServiceListResponse) Weights() (*WeightSlice, bool) { - if p.weights != nil { - return p.weights, true - } - return nil, false -} - -func (p *WeightsServiceListResponse) MustWeights() *WeightSlice { - if p.weights == nil { - panic("weights in response does not exist") - } - return p.weights -} - -// -// Returns the list of weights. -// The order of the returned list of weights isn't guaranteed. // -func (p *WeightsService) List() *WeightsServiceListRequest { - return &WeightsServiceListRequest{WeightsService: p} +type AssignedDiskProfileServiceRemoveResponse struct { } // // -func (op *WeightsService) WeightService(id string) *WeightService { - return NewWeightService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *AssignedDiskProfileService) Remove() *AssignedDiskProfileServiceRemoveRequest { + return &AssignedDiskProfileServiceRemoveRequest{AssignedDiskProfileService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *WeightsService) Service(path string) (Service, error) { +func (op *AssignedDiskProfileService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.WeightService(path), nil - } - return op.WeightService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *WeightsService) String() string { - return fmt.Sprintf("WeightsService:%s", op.path) +func (op *AssignedDiskProfileService) String() string { + return fmt.Sprintf("AssignedDiskProfileService:%s", op.path) } // -// Manages the set of quotas configured for a data center. // -type QuotasService struct { +type AssignedDiskProfilesService struct { BaseService } -func NewQuotasService(connection *Connection, path string) *QuotasService { - var result QuotasService +func NewAssignedDiskProfilesService(connection *Connection, path string) *AssignedDiskProfilesService { + var result AssignedDiskProfilesService result.connection = connection result.path = path return &result } // -// Creates a new quota. -// An example of creating a new quota: -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/quotas -// ---- -// [source,xml] -// ---- -// -// myquota -// My new quota for virtual machines -// -// ---- +// Add a new disk profile for the storage domain. // -type QuotasServiceAddRequest struct { - QuotasService *QuotasService - header map[string]string - query map[string]string - quota *Quota +type AssignedDiskProfilesServiceAddRequest struct { + AssignedDiskProfilesService *AssignedDiskProfilesService + header map[string]string + query map[string]string + profile *DiskProfile } -func (p *QuotasServiceAddRequest) Header(key, value string) *QuotasServiceAddRequest { +func (p *AssignedDiskProfilesServiceAddRequest) Header(key, value string) *AssignedDiskProfilesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -7906,7 +6572,7 @@ func (p *QuotasServiceAddRequest) Header(key, value string) *QuotasServiceAddReq return p } -func (p *QuotasServiceAddRequest) Query(key, value string) *QuotasServiceAddRequest { +func (p *AssignedDiskProfilesServiceAddRequest) Query(key, value string) *AssignedDiskProfilesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -7914,13 +6580,13 @@ func (p *QuotasServiceAddRequest) Query(key, value string) *QuotasServiceAddRequ return p } -func (p *QuotasServiceAddRequest) Quota(quota *Quota) *QuotasServiceAddRequest { - p.quota = quota +func (p *AssignedDiskProfilesServiceAddRequest) Profile(profile *DiskProfile) *AssignedDiskProfilesServiceAddRequest { + p.profile = profile return p } -func (p *QuotasServiceAddRequest) Send() (*QuotasServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QuotasService.connection.URL(), p.QuotasService.path) +func (p *AssignedDiskProfilesServiceAddRequest) Send() (*AssignedDiskProfilesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedDiskProfilesService.connection.URL(), p.AssignedDiskProfilesService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -7932,7 +6598,7 @@ func (p *QuotasServiceAddRequest) Send() (*QuotasServiceAddResponse, error) { } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLQuotaWriteOne(writer, p.quota, "") + err := XMLDiskProfileWriteOne(writer, p.profile, "") if err != nil { return nil, err } @@ -7942,7 +6608,7 @@ func (p *QuotasServiceAddRequest) Send() (*QuotasServiceAddResponse, error) { return nil, err } - for hk, hv := range p.QuotasService.connection.headers { + for hk, hv := range p.AssignedDiskProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -7957,18 +6623,18 @@ func (p *QuotasServiceAddRequest) Send() (*QuotasServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QuotasService.connection.authenticate() + token, err := p.AssignedDiskProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QuotasService.connection.client.Do(req) + resp, err := p.AssignedDiskProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QuotasService.connection.logFunc != nil { + if p.AssignedDiskProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -7977,7 +6643,7 @@ func (p *QuotasServiceAddRequest) Send() (*QuotasServiceAddResponse, error) { if err != nil { return nil, err } - p.QuotasService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedDiskProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -7987,14 +6653,14 @@ func (p *QuotasServiceAddRequest) Send() (*QuotasServiceAddResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLQuotaReadOne(reader, nil, "") + result, err := XMLDiskProfileReadOne(reader, nil, "") if err != nil { return nil, err } - return &QuotasServiceAddResponse{quota: result}, nil + return &AssignedDiskProfilesServiceAddResponse{profile: result}, nil } -func (p *QuotasServiceAddRequest) MustSend() *QuotasServiceAddResponse { +func (p *AssignedDiskProfilesServiceAddRequest) MustSend() *AssignedDiskProfilesServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -8003,70 +6669,46 @@ func (p *QuotasServiceAddRequest) MustSend() *QuotasServiceAddResponse { } // -// Creates a new quota. -// An example of creating a new quota: -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/quotas -// ---- -// [source,xml] -// ---- -// -// myquota -// My new quota for virtual machines -// -// ---- +// Add a new disk profile for the storage domain. // -type QuotasServiceAddResponse struct { - quota *Quota +type AssignedDiskProfilesServiceAddResponse struct { + profile *DiskProfile } -func (p *QuotasServiceAddResponse) Quota() (*Quota, bool) { - if p.quota != nil { - return p.quota, true +func (p *AssignedDiskProfilesServiceAddResponse) Profile() (*DiskProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *QuotasServiceAddResponse) MustQuota() *Quota { - if p.quota == nil { - panic("quota in response does not exist") +func (p *AssignedDiskProfilesServiceAddResponse) MustProfile() *DiskProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.quota + return p.profile } // -// Creates a new quota. -// An example of creating a new quota: -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/quotas -// ---- -// [source,xml] -// ---- -// -// myquota -// My new quota for virtual machines -// -// ---- +// Add a new disk profile for the storage domain. // -func (p *QuotasService) Add() *QuotasServiceAddRequest { - return &QuotasServiceAddRequest{QuotasService: p} +func (p *AssignedDiskProfilesService) Add() *AssignedDiskProfilesServiceAddRequest { + return &AssignedDiskProfilesServiceAddRequest{AssignedDiskProfilesService: p} } // -// Lists quotas of a data center. -// The order of the returned list of quotas isn't guaranteed. +// Returns the list of disk profiles assigned to the storage domain. +// The order of the returned disk profiles isn't guaranteed. // -type QuotasServiceListRequest struct { - QuotasService *QuotasService - header map[string]string - query map[string]string - follow *string - max *int64 +type AssignedDiskProfilesServiceListRequest struct { + AssignedDiskProfilesService *AssignedDiskProfilesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *QuotasServiceListRequest) Header(key, value string) *QuotasServiceListRequest { +func (p *AssignedDiskProfilesServiceListRequest) Header(key, value string) *AssignedDiskProfilesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -8074,7 +6716,7 @@ func (p *QuotasServiceListRequest) Header(key, value string) *QuotasServiceListR return p } -func (p *QuotasServiceListRequest) Query(key, value string) *QuotasServiceListRequest { +func (p *AssignedDiskProfilesServiceListRequest) Query(key, value string) *AssignedDiskProfilesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -8082,18 +6724,18 @@ func (p *QuotasServiceListRequest) Query(key, value string) *QuotasServiceListRe return p } -func (p *QuotasServiceListRequest) Follow(follow string) *QuotasServiceListRequest { +func (p *AssignedDiskProfilesServiceListRequest) Follow(follow string) *AssignedDiskProfilesServiceListRequest { p.follow = &follow return p } -func (p *QuotasServiceListRequest) Max(max int64) *QuotasServiceListRequest { +func (p *AssignedDiskProfilesServiceListRequest) Max(max int64) *AssignedDiskProfilesServiceListRequest { p.max = &max return p } -func (p *QuotasServiceListRequest) Send() (*QuotasServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QuotasService.connection.URL(), p.QuotasService.path) +func (p *AssignedDiskProfilesServiceListRequest) Send() (*AssignedDiskProfilesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedDiskProfilesService.connection.URL(), p.AssignedDiskProfilesService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -8116,7 +6758,7 @@ func (p *QuotasServiceListRequest) Send() (*QuotasServiceListResponse, error) { return nil, err } - for hk, hv := range p.QuotasService.connection.headers { + for hk, hv := range p.AssignedDiskProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -8131,18 +6773,18 @@ func (p *QuotasServiceListRequest) Send() (*QuotasServiceListResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QuotasService.connection.authenticate() + token, err := p.AssignedDiskProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QuotasService.connection.client.Do(req) + resp, err := p.AssignedDiskProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QuotasService.connection.logFunc != nil { + if p.AssignedDiskProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -8151,7 +6793,7 @@ func (p *QuotasServiceListRequest) Send() (*QuotasServiceListResponse, error) { if err != nil { return nil, err } - p.QuotasService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedDiskProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -8161,14 +6803,14 @@ func (p *QuotasServiceListRequest) Send() (*QuotasServiceListResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLQuotaReadMany(reader, nil) + result, err := XMLDiskProfileReadMany(reader, nil) if err != nil { return nil, err } - return &QuotasServiceListResponse{quotas: result}, nil + return &AssignedDiskProfilesServiceListResponse{profiles: result}, nil } -func (p *QuotasServiceListRequest) MustSend() *QuotasServiceListResponse { +func (p *AssignedDiskProfilesServiceListRequest) MustSend() *AssignedDiskProfilesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -8177,86 +6819,129 @@ func (p *QuotasServiceListRequest) MustSend() *QuotasServiceListResponse { } // -// Lists quotas of a data center. -// The order of the returned list of quotas isn't guaranteed. +// Returns the list of disk profiles assigned to the storage domain. +// The order of the returned disk profiles isn't guaranteed. // -type QuotasServiceListResponse struct { - quotas *QuotaSlice +type AssignedDiskProfilesServiceListResponse struct { + profiles *DiskProfileSlice } -func (p *QuotasServiceListResponse) Quotas() (*QuotaSlice, bool) { - if p.quotas != nil { - return p.quotas, true +func (p *AssignedDiskProfilesServiceListResponse) Profiles() (*DiskProfileSlice, bool) { + if p.profiles != nil { + return p.profiles, true } return nil, false } -func (p *QuotasServiceListResponse) MustQuotas() *QuotaSlice { - if p.quotas == nil { - panic("quotas in response does not exist") +func (p *AssignedDiskProfilesServiceListResponse) MustProfiles() *DiskProfileSlice { + if p.profiles == nil { + panic("profiles in response does not exist") } - return p.quotas + return p.profiles } // -// Lists quotas of a data center. -// The order of the returned list of quotas isn't guaranteed. +// Returns the list of disk profiles assigned to the storage domain. +// The order of the returned disk profiles isn't guaranteed. // -func (p *QuotasService) List() *QuotasServiceListRequest { - return &QuotasServiceListRequest{QuotasService: p} +func (p *AssignedDiskProfilesService) List() *AssignedDiskProfilesServiceListRequest { + return &AssignedDiskProfilesServiceListRequest{AssignedDiskProfilesService: p} } // // -func (op *QuotasService) QuotaService(id string) *QuotaService { - return NewQuotaService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AssignedDiskProfilesService) ProfileService(id string) *AssignedDiskProfileService { + return NewAssignedDiskProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *QuotasService) Service(path string) (Service, error) { +func (op *AssignedDiskProfilesService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.QuotaService(path), nil + return op.ProfileService(path), nil } - return op.QuotaService(path[:index]).Service(path[index+1:]) + return op.ProfileService(path[:index]).Service(path[index+1:]) } -func (op *QuotasService) String() string { - return fmt.Sprintf("QuotasService:%s", op.path) +func (op *AssignedDiskProfilesService) String() string { + return fmt.Sprintf("AssignedDiskProfilesService:%s", op.path) } // -// Manages the set of CD-ROM devices of a virtual machine snapshot. +// Represents a permission sub-collection, scoped by user, group or some entity type. // -type SnapshotCdromsService struct { +type AssignedPermissionsService struct { BaseService } -func NewSnapshotCdromsService(connection *Connection, path string) *SnapshotCdromsService { - var result SnapshotCdromsService +func NewAssignedPermissionsService(connection *Connection, path string) *AssignedPermissionsService { + var result AssignedPermissionsService result.connection = connection result.path = path return &result } // -// Returns the list of CD-ROM devices of the snapshot. -// The order of the returned list of CD-ROM devices isn't guaranteed. +// Assign a new permission to a user or group for specific entity. +// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` +// send a request like this: +// .... +// POST /ovirt-engine/api/vms/123/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// UserVmManager +// +// +// +// ---- +// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: +// .... +// POST /ovirt-engine/api/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// SuperUser +// +// +// +// ---- +// If you want to assign permission to the group instead of the user please replace the `user` element with the +// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with +// id `123` to the group with id `789` send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// UserRole +// +// +// +// ---- // -type SnapshotCdromsServiceListRequest struct { - SnapshotCdromsService *SnapshotCdromsService - header map[string]string - query map[string]string - follow *string - max *int64 +type AssignedPermissionsServiceAddRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *SnapshotCdromsServiceListRequest) Header(key, value string) *SnapshotCdromsServiceListRequest { +func (p *AssignedPermissionsServiceAddRequest) Header(key, value string) *AssignedPermissionsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -8264,7 +6949,7 @@ func (p *SnapshotCdromsServiceListRequest) Header(key, value string) *SnapshotCd return p } -func (p *SnapshotCdromsServiceListRequest) Query(key, value string) *SnapshotCdromsServiceListRequest { +func (p *AssignedPermissionsServiceAddRequest) Query(key, value string) *AssignedPermissionsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -8272,27 +6957,14 @@ func (p *SnapshotCdromsServiceListRequest) Query(key, value string) *SnapshotCdr return p } -func (p *SnapshotCdromsServiceListRequest) Follow(follow string) *SnapshotCdromsServiceListRequest { - p.follow = &follow - return p -} - -func (p *SnapshotCdromsServiceListRequest) Max(max int64) *SnapshotCdromsServiceListRequest { - p.max = &max +func (p *AssignedPermissionsServiceAddRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddRequest { + p.permission = permission return p } -func (p *SnapshotCdromsServiceListRequest) Send() (*SnapshotCdromsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SnapshotCdromsService.connection.URL(), p.SnapshotCdromsService.path) +func (p *AssignedPermissionsServiceAddRequest) Send() (*AssignedPermissionsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -8301,14 +6973,21 @@ func (p *SnapshotCdromsServiceListRequest) Send() (*SnapshotCdromsServiceListRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLPermissionWriteOne(writer, p.permission, "") if err != nil { return nil, err } - - for hk, hv := range p.SnapshotCdromsService.connection.headers { - req.Header.Add(hk, hv) - } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) + if err != nil { + return nil, err + } + + for hk, hv := range p.AssignedPermissionsService.connection.headers { + req.Header.Add(hk, hv) + } if p.header != nil { for hk, hv := range p.header { @@ -8321,18 +7000,18 @@ func (p *SnapshotCdromsServiceListRequest) Send() (*SnapshotCdromsServiceListRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SnapshotCdromsService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SnapshotCdromsService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SnapshotCdromsService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -8341,9 +7020,9 @@ func (p *SnapshotCdromsServiceListRequest) Send() (*SnapshotCdromsServiceListRes if err != nil { return nil, err } - p.SnapshotCdromsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -8351,14 +7030,14 @@ func (p *SnapshotCdromsServiceListRequest) Send() (*SnapshotCdromsServiceListRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLCdromReadMany(reader, nil) + result, err := XMLPermissionReadOne(reader, nil, "") if err != nil { return nil, err } - return &SnapshotCdromsServiceListResponse{cdroms: result}, nil + return &AssignedPermissionsServiceAddResponse{permission: result}, nil } -func (p *SnapshotCdromsServiceListRequest) MustSend() *SnapshotCdromsServiceListResponse { +func (p *AssignedPermissionsServiceAddRequest) MustSend() *AssignedPermissionsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -8367,109 +7046,134 @@ func (p *SnapshotCdromsServiceListRequest) MustSend() *SnapshotCdromsServiceList } // -// Returns the list of CD-ROM devices of the snapshot. -// The order of the returned list of CD-ROM devices isn't guaranteed. +// Assign a new permission to a user or group for specific entity. +// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` +// send a request like this: +// .... +// POST /ovirt-engine/api/vms/123/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// UserVmManager +// +// +// +// ---- +// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: +// .... +// POST /ovirt-engine/api/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// SuperUser +// +// +// +// ---- +// If you want to assign permission to the group instead of the user please replace the `user` element with the +// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with +// id `123` to the group with id `789` send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// UserRole +// +// +// +// ---- // -type SnapshotCdromsServiceListResponse struct { - cdroms *CdromSlice +type AssignedPermissionsServiceAddResponse struct { + permission *Permission } -func (p *SnapshotCdromsServiceListResponse) Cdroms() (*CdromSlice, bool) { - if p.cdroms != nil { - return p.cdroms, true +func (p *AssignedPermissionsServiceAddResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *SnapshotCdromsServiceListResponse) MustCdroms() *CdromSlice { - if p.cdroms == nil { - panic("cdroms in response does not exist") - } - return p.cdroms -} - -// -// Returns the list of CD-ROM devices of the snapshot. -// The order of the returned list of CD-ROM devices isn't guaranteed. -// -func (p *SnapshotCdromsService) List() *SnapshotCdromsServiceListRequest { - return &SnapshotCdromsServiceListRequest{SnapshotCdromsService: p} -} - -// -// -func (op *SnapshotCdromsService) CdromService(id string) *SnapshotCdromService { - return NewSnapshotCdromService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *SnapshotCdromsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.CdromService(path), nil +func (p *AssignedPermissionsServiceAddResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return op.CdromService(path[:index]).Service(path[index+1:]) -} - -func (op *SnapshotCdromsService) String() string { - return fmt.Sprintf("SnapshotCdromsService:%s", op.path) -} - -// -// A service to manage individual host device attached to a virtual machine. -// -type VmHostDeviceService struct { - BaseService -} - -func NewVmHostDeviceService(connection *Connection, path string) *VmHostDeviceService { - var result VmHostDeviceService - result.connection = connection - result.path = path - return &result + return p.permission } // -// Retrieve information about particular host device attached to given virtual machine. -// Example: -// [source] +// Assign a new permission to a user or group for specific entity. +// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` +// send a request like this: +// .... +// POST /ovirt-engine/api/vms/123/permissions +// .... +// With a request body like this: +// [source,xml] // ---- -// GET /ovirt-engine/api/vms/123/hostdevices/456 +// +// +// UserVmManager +// +// +// // ---- +// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: +// .... +// POST /ovirt-engine/api/permissions +// .... +// With a request body like this: // [source,xml] // ---- -// -// pci_0000_04_00_0 -// pci -// 30 -// true -// -// GM107GL [Quadro K2200] -// -// -// NVIDIA Corporation -// -// -// -// pci_0000_00_03_0 -// -// -// +// +// +// SuperUser +// +// +// +// ---- +// If you want to assign permission to the group instead of the user please replace the `user` element with the +// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with +// id `123` to the group with id `789` send a request like this: +// .... +// POST /ovirt-engine/api/clusters/123/permissions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// +// UserRole +// +// +// // ---- // -type VmHostDeviceServiceGetRequest struct { - VmHostDeviceService *VmHostDeviceService - header map[string]string - query map[string]string - follow *string +func (p *AssignedPermissionsService) Add() *AssignedPermissionsServiceAddRequest { + return &AssignedPermissionsServiceAddRequest{AssignedPermissionsService: p} } -func (p *VmHostDeviceServiceGetRequest) Header(key, value string) *VmHostDeviceServiceGetRequest { +// +// Add a new permission on the cluster to the group in the system. +// +type AssignedPermissionsServiceAddClusterPermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission +} + +func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddClusterPermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -8477,7 +7181,7 @@ func (p *VmHostDeviceServiceGetRequest) Header(key, value string) *VmHostDeviceS return p } -func (p *VmHostDeviceServiceGetRequest) Query(key, value string) *VmHostDeviceServiceGetRequest { +func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddClusterPermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -8485,18 +7189,20 @@ func (p *VmHostDeviceServiceGetRequest) Query(key, value string) *VmHostDeviceSe return p } -func (p *VmHostDeviceServiceGetRequest) Follow(follow string) *VmHostDeviceServiceGetRequest { - p.follow = &follow +func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddClusterPermissionRequest { + p.permission = permission return p } -func (p *VmHostDeviceServiceGetRequest) Send() (*VmHostDeviceServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmHostDeviceService.connection.URL(), p.VmHostDeviceService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Send() (*AssignedPermissionsServiceAddClusterPermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/clusterpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -8505,12 +7211,16 @@ func (p *VmHostDeviceServiceGetRequest) Send() (*VmHostDeviceServiceGetResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmHostDeviceService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -8525,18 +7235,18 @@ func (p *VmHostDeviceServiceGetRequest) Send() (*VmHostDeviceServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmHostDeviceService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmHostDeviceService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmHostDeviceService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -8545,24 +7255,17 @@ func (p *VmHostDeviceServiceGetRequest) Send() (*VmHostDeviceServiceGetResponse, if err != nil { return nil, err } - p.VmHostDeviceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLHostDeviceReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VmHostDeviceServiceGetResponse{device: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddClusterPermissionResponse{permission: result}, nil } -func (p *VmHostDeviceServiceGetRequest) MustSend() *VmHostDeviceServiceGetResponse { +func (p *AssignedPermissionsServiceAddClusterPermissionRequest) MustSend() *AssignedPermissionsServiceAddClusterPermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -8571,102 +7274,44 @@ func (p *VmHostDeviceServiceGetRequest) MustSend() *VmHostDeviceServiceGetRespon } // -// Retrieve information about particular host device attached to given virtual machine. -// Example: -// [source] -// ---- -// GET /ovirt-engine/api/vms/123/hostdevices/456 -// ---- -// [source,xml] -// ---- -// -// pci_0000_04_00_0 -// pci -// 30 -// true -// -// GM107GL [Quadro K2200] -// -// -// NVIDIA Corporation -// -// -// -// pci_0000_00_03_0 -// -// -// -// ---- +// Add a new permission on the cluster to the group in the system. // -type VmHostDeviceServiceGetResponse struct { - device *HostDevice +type AssignedPermissionsServiceAddClusterPermissionResponse struct { + permission *Permission } -func (p *VmHostDeviceServiceGetResponse) Device() (*HostDevice, bool) { - if p.device != nil { - return p.device, true +func (p *AssignedPermissionsServiceAddClusterPermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *VmHostDeviceServiceGetResponse) MustDevice() *HostDevice { - if p.device == nil { - panic("device in response does not exist") +func (p *AssignedPermissionsServiceAddClusterPermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return p.device + return p.permission } // -// Retrieve information about particular host device attached to given virtual machine. -// Example: -// [source] -// ---- -// GET /ovirt-engine/api/vms/123/hostdevices/456 -// ---- -// [source,xml] -// ---- -// -// pci_0000_04_00_0 -// pci -// 30 -// true -// -// GM107GL [Quadro K2200] -// -// -// NVIDIA Corporation -// -// -// -// pci_0000_00_03_0 -// -// -// -// ---- +// Add a new permission on the cluster to the group in the system. // -func (p *VmHostDeviceService) Get() *VmHostDeviceServiceGetRequest { - return &VmHostDeviceServiceGetRequest{VmHostDeviceService: p} +func (p *AssignedPermissionsService) AddClusterPermission() *AssignedPermissionsServiceAddClusterPermissionRequest { + return &AssignedPermissionsServiceAddClusterPermissionRequest{AssignedPermissionsService: p} } // -// Remove the attachment of this host device from given virtual machine. -// NOTE: In case this device serves as an IOMMU placeholder, it cannot be removed (remove will result only -// in setting its `placeholder` flag to `true`). Note that all IOMMU placeholder devices will be removed -// automatically as soon as there will be no more non-placeholder devices (all devices from given IOMMU -// group are detached). -// [source] -// ---- -// DELETE /ovirt-engine/api/vms/123/hostdevices/456 -// ---- +// Add a new permission on the data center to the group in the system. // -type VmHostDeviceServiceRemoveRequest struct { - VmHostDeviceService *VmHostDeviceService - header map[string]string - query map[string]string - async *bool +type AssignedPermissionsServiceAddDataCenterPermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *VmHostDeviceServiceRemoveRequest) Header(key, value string) *VmHostDeviceServiceRemoveRequest { +func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddDataCenterPermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -8674,7 +7319,7 @@ func (p *VmHostDeviceServiceRemoveRequest) Header(key, value string) *VmHostDevi return p } -func (p *VmHostDeviceServiceRemoveRequest) Query(key, value string) *VmHostDeviceServiceRemoveRequest { +func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddDataCenterPermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -8682,18 +7327,20 @@ func (p *VmHostDeviceServiceRemoveRequest) Query(key, value string) *VmHostDevic return p } -func (p *VmHostDeviceServiceRemoveRequest) Async(async bool) *VmHostDeviceServiceRemoveRequest { - p.async = &async +func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddDataCenterPermissionRequest { + p.permission = permission return p } -func (p *VmHostDeviceServiceRemoveRequest) Send() (*VmHostDeviceServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmHostDeviceService.connection.URL(), p.VmHostDeviceService.path) - values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} +func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Send() (*AssignedPermissionsServiceAddDataCenterPermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/datacenterpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -8702,12 +7349,16 @@ func (p *VmHostDeviceServiceRemoveRequest) Send() (*VmHostDeviceServiceRemoveRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmHostDeviceService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -8722,18 +7373,18 @@ func (p *VmHostDeviceServiceRemoveRequest) Send() (*VmHostDeviceServiceRemoveRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmHostDeviceService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmHostDeviceService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmHostDeviceService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -8742,19 +7393,17 @@ func (p *VmHostDeviceServiceRemoveRequest) Send() (*VmHostDeviceServiceRemoveRes if err != nil { return nil, err } - p.VmHostDeviceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(VmHostDeviceServiceRemoveResponse), nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddDataCenterPermissionResponse{permission: result}, nil } -func (p *VmHostDeviceServiceRemoveRequest) MustSend() *VmHostDeviceServiceRemoveResponse { +func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) MustSend() *AssignedPermissionsServiceAddDataCenterPermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -8763,74 +7412,44 @@ func (p *VmHostDeviceServiceRemoveRequest) MustSend() *VmHostDeviceServiceRemove } // -// Remove the attachment of this host device from given virtual machine. -// NOTE: In case this device serves as an IOMMU placeholder, it cannot be removed (remove will result only -// in setting its `placeholder` flag to `true`). Note that all IOMMU placeholder devices will be removed -// automatically as soon as there will be no more non-placeholder devices (all devices from given IOMMU -// group are detached). -// [source] -// ---- -// DELETE /ovirt-engine/api/vms/123/hostdevices/456 -// ---- -// -type VmHostDeviceServiceRemoveResponse struct { -} - -// -// Remove the attachment of this host device from given virtual machine. -// NOTE: In case this device serves as an IOMMU placeholder, it cannot be removed (remove will result only -// in setting its `placeholder` flag to `true`). Note that all IOMMU placeholder devices will be removed -// automatically as soon as there will be no more non-placeholder devices (all devices from given IOMMU -// group are detached). -// [source] -// ---- -// DELETE /ovirt-engine/api/vms/123/hostdevices/456 -// ---- +// Add a new permission on the data center to the group in the system. // -func (p *VmHostDeviceService) Remove() *VmHostDeviceServiceRemoveRequest { - return &VmHostDeviceServiceRemoveRequest{VmHostDeviceService: p} +type AssignedPermissionsServiceAddDataCenterPermissionResponse struct { + permission *Permission } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *VmHostDeviceService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *AssignedPermissionsServiceAddDataCenterPermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return nil, false } -func (op *VmHostDeviceService) String() string { - return fmt.Sprintf("VmHostDeviceService:%s", op.path) +func (p *AssignedPermissionsServiceAddDataCenterPermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") + } + return p.permission } // +// Add a new permission on the data center to the group in the system. // -type HostNumaNodesService struct { - BaseService -} - -func NewHostNumaNodesService(connection *Connection, path string) *HostNumaNodesService { - var result HostNumaNodesService - result.connection = connection - result.path = path - return &result +func (p *AssignedPermissionsService) AddDataCenterPermission() *AssignedPermissionsServiceAddDataCenterPermissionRequest { + return &AssignedPermissionsServiceAddDataCenterPermissionRequest{AssignedPermissionsService: p} } // -// Returns the list of NUMA nodes of the host. -// The order of the returned list of NUMA nodes isn't guaranteed. +// Add a new group level permission for a given virtual machine. // -type HostNumaNodesServiceListRequest struct { - HostNumaNodesService *HostNumaNodesService - header map[string]string - query map[string]string - follow *string - max *int64 +type AssignedPermissionsServiceAddGroupLevelRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *HostNumaNodesServiceListRequest) Header(key, value string) *HostNumaNodesServiceListRequest { +func (p *AssignedPermissionsServiceAddGroupLevelRequest) Header(key, value string) *AssignedPermissionsServiceAddGroupLevelRequest { if p.header == nil { p.header = make(map[string]string) } @@ -8838,7 +7457,7 @@ func (p *HostNumaNodesServiceListRequest) Header(key, value string) *HostNumaNod return p } -func (p *HostNumaNodesServiceListRequest) Query(key, value string) *HostNumaNodesServiceListRequest { +func (p *AssignedPermissionsServiceAddGroupLevelRequest) Query(key, value string) *AssignedPermissionsServiceAddGroupLevelRequest { if p.query == nil { p.query = make(map[string]string) } @@ -8846,27 +7465,20 @@ func (p *HostNumaNodesServiceListRequest) Query(key, value string) *HostNumaNode return p } -func (p *HostNumaNodesServiceListRequest) Follow(follow string) *HostNumaNodesServiceListRequest { - p.follow = &follow - return p -} - -func (p *HostNumaNodesServiceListRequest) Max(max int64) *HostNumaNodesServiceListRequest { - p.max = &max +func (p *AssignedPermissionsServiceAddGroupLevelRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddGroupLevelRequest { + p.permission = permission return p } -func (p *HostNumaNodesServiceListRequest) Send() (*HostNumaNodesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostNumaNodesService.connection.URL(), p.HostNumaNodesService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} +func (p *AssignedPermissionsServiceAddGroupLevelRequest) Send() (*AssignedPermissionsServiceAddGroupLevelResponse, error) { + rawURL := fmt.Sprintf("%s%s/grouplevel", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -8875,12 +7487,16 @@ func (p *HostNumaNodesServiceListRequest) Send() (*HostNumaNodesServiceListRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostNumaNodesService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -8895,18 +7511,18 @@ func (p *HostNumaNodesServiceListRequest) Send() (*HostNumaNodesServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostNumaNodesService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostNumaNodesService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostNumaNodesService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -8915,24 +7531,17 @@ func (p *HostNumaNodesServiceListRequest) Send() (*HostNumaNodesServiceListRespo if err != nil { return nil, err } - p.HostNumaNodesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLNumaNodeReadMany(reader, nil) - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &HostNumaNodesServiceListResponse{nodes: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddGroupLevelResponse{permission: result}, nil } -func (p *HostNumaNodesServiceListRequest) MustSend() *HostNumaNodesServiceListResponse { +func (p *AssignedPermissionsServiceAddGroupLevelRequest) MustSend() *AssignedPermissionsServiceAddGroupLevelResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -8941,83 +7550,44 @@ func (p *HostNumaNodesServiceListRequest) MustSend() *HostNumaNodesServiceListRe } // -// Returns the list of NUMA nodes of the host. -// The order of the returned list of NUMA nodes isn't guaranteed. +// Add a new group level permission for a given virtual machine. // -type HostNumaNodesServiceListResponse struct { - nodes *NumaNodeSlice +type AssignedPermissionsServiceAddGroupLevelResponse struct { + permission *Permission } -func (p *HostNumaNodesServiceListResponse) Nodes() (*NumaNodeSlice, bool) { - if p.nodes != nil { - return p.nodes, true +func (p *AssignedPermissionsServiceAddGroupLevelResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *HostNumaNodesServiceListResponse) MustNodes() *NumaNodeSlice { - if p.nodes == nil { - panic("nodes in response does not exist") - } - return p.nodes -} - -// -// Returns the list of NUMA nodes of the host. -// The order of the returned list of NUMA nodes isn't guaranteed. -// -func (p *HostNumaNodesService) List() *HostNumaNodesServiceListRequest { - return &HostNumaNodesServiceListRequest{HostNumaNodesService: p} -} - -// -// -func (op *HostNumaNodesService) NodeService(id string) *HostNumaNodeService { - return NewHostNumaNodeService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *HostNumaNodesService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.NodeService(path), nil +func (p *AssignedPermissionsServiceAddGroupLevelResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return op.NodeService(path[:index]).Service(path[index+1:]) -} - -func (op *HostNumaNodesService) String() string { - return fmt.Sprintf("HostNumaNodesService:%s", op.path) + return p.permission } // +// Add a new group level permission for a given virtual machine. // -type InstanceTypeWatchdogsService struct { - BaseService -} - -func NewInstanceTypeWatchdogsService(connection *Connection, path string) *InstanceTypeWatchdogsService { - var result InstanceTypeWatchdogsService - result.connection = connection - result.path = path - return &result +func (p *AssignedPermissionsService) AddGroupLevel() *AssignedPermissionsServiceAddGroupLevelRequest { + return &AssignedPermissionsServiceAddGroupLevelRequest{AssignedPermissionsService: p} } // -// Add new watchdog to the instance type. +// Add a new permission on the host to the group in the system. // -type InstanceTypeWatchdogsServiceAddRequest struct { - InstanceTypeWatchdogsService *InstanceTypeWatchdogsService - header map[string]string - query map[string]string - watchdog *Watchdog +type AssignedPermissionsServiceAddHostPermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *InstanceTypeWatchdogsServiceAddRequest) Header(key, value string) *InstanceTypeWatchdogsServiceAddRequest { +func (p *AssignedPermissionsServiceAddHostPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddHostPermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -9025,7 +7595,7 @@ func (p *InstanceTypeWatchdogsServiceAddRequest) Header(key, value string) *Inst return p } -func (p *InstanceTypeWatchdogsServiceAddRequest) Query(key, value string) *InstanceTypeWatchdogsServiceAddRequest { +func (p *AssignedPermissionsServiceAddHostPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddHostPermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -9033,13 +7603,19 @@ func (p *InstanceTypeWatchdogsServiceAddRequest) Query(key, value string) *Insta return p } -func (p *InstanceTypeWatchdogsServiceAddRequest) Watchdog(watchdog *Watchdog) *InstanceTypeWatchdogsServiceAddRequest { - p.watchdog = watchdog +func (p *AssignedPermissionsServiceAddHostPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddHostPermissionRequest { + p.permission = permission return p } -func (p *InstanceTypeWatchdogsServiceAddRequest) Send() (*InstanceTypeWatchdogsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.InstanceTypeWatchdogsService.connection.URL(), p.InstanceTypeWatchdogsService.path) +func (p *AssignedPermissionsServiceAddHostPermissionRequest) Send() (*AssignedPermissionsServiceAddHostPermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/hostpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -9051,17 +7627,14 @@ func (p *InstanceTypeWatchdogsServiceAddRequest) Send() (*InstanceTypeWatchdogsS } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLWatchdogWriteOne(writer, p.watchdog, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.InstanceTypeWatchdogsService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -9076,18 +7649,18 @@ func (p *InstanceTypeWatchdogsServiceAddRequest) Send() (*InstanceTypeWatchdogsS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.InstanceTypeWatchdogsService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.InstanceTypeWatchdogsService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.InstanceTypeWatchdogsService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -9096,24 +7669,17 @@ func (p *InstanceTypeWatchdogsServiceAddRequest) Send() (*InstanceTypeWatchdogsS if err != nil { return nil, err } - p.InstanceTypeWatchdogsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLWatchdogReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &InstanceTypeWatchdogsServiceAddResponse{watchdog: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddHostPermissionResponse{permission: result}, nil } -func (p *InstanceTypeWatchdogsServiceAddRequest) MustSend() *InstanceTypeWatchdogsServiceAddResponse { +func (p *AssignedPermissionsServiceAddHostPermissionRequest) MustSend() *AssignedPermissionsServiceAddHostPermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -9122,47 +7688,64 @@ func (p *InstanceTypeWatchdogsServiceAddRequest) MustSend() *InstanceTypeWatchdo } // -// Add new watchdog to the instance type. +// Add a new permission on the host to the group in the system. // -type InstanceTypeWatchdogsServiceAddResponse struct { - watchdog *Watchdog +type AssignedPermissionsServiceAddHostPermissionResponse struct { + permission *Permission } -func (p *InstanceTypeWatchdogsServiceAddResponse) Watchdog() (*Watchdog, bool) { - if p.watchdog != nil { - return p.watchdog, true +func (p *AssignedPermissionsServiceAddHostPermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *InstanceTypeWatchdogsServiceAddResponse) MustWatchdog() *Watchdog { - if p.watchdog == nil { - panic("watchdog in response does not exist") +func (p *AssignedPermissionsServiceAddHostPermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return p.watchdog + return p.permission } // -// Add new watchdog to the instance type. +// Add a new permission on the host to the group in the system. // -func (p *InstanceTypeWatchdogsService) Add() *InstanceTypeWatchdogsServiceAddRequest { - return &InstanceTypeWatchdogsServiceAddRequest{InstanceTypeWatchdogsService: p} +func (p *AssignedPermissionsService) AddHostPermission() *AssignedPermissionsServiceAddHostPermissionRequest { + return &AssignedPermissionsServiceAddHostPermissionRequest{AssignedPermissionsService: p} } // -// Lists all the configured watchdogs of the instance type. -// The order of the returned list of watchdogs isn't guaranteed. +// List all the permissions of the specific entity. +// For example to list all the permissions of the cluster with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/clusters/123/permissions +// .... +// [source,xml] +// ---- +// +// +// +// +// +// +// +// +// +// +// +// +// ---- +// The order of the returned permissions isn't guaranteed. // -type InstanceTypeWatchdogsServiceListRequest struct { - InstanceTypeWatchdogsService *InstanceTypeWatchdogsService - header map[string]string - query map[string]string - follow *string - max *int64 - search *string +type AssignedPermissionsServiceListRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + follow *string } -func (p *InstanceTypeWatchdogsServiceListRequest) Header(key, value string) *InstanceTypeWatchdogsServiceListRequest { +func (p *AssignedPermissionsServiceListRequest) Header(key, value string) *AssignedPermissionsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -9170,7 +7753,7 @@ func (p *InstanceTypeWatchdogsServiceListRequest) Header(key, value string) *Ins return p } -func (p *InstanceTypeWatchdogsServiceListRequest) Query(key, value string) *InstanceTypeWatchdogsServiceListRequest { +func (p *AssignedPermissionsServiceListRequest) Query(key, value string) *AssignedPermissionsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -9178,36 +7761,18 @@ func (p *InstanceTypeWatchdogsServiceListRequest) Query(key, value string) *Inst return p } -func (p *InstanceTypeWatchdogsServiceListRequest) Follow(follow string) *InstanceTypeWatchdogsServiceListRequest { +func (p *AssignedPermissionsServiceListRequest) Follow(follow string) *AssignedPermissionsServiceListRequest { p.follow = &follow return p } -func (p *InstanceTypeWatchdogsServiceListRequest) Max(max int64) *InstanceTypeWatchdogsServiceListRequest { - p.max = &max - return p -} - -func (p *InstanceTypeWatchdogsServiceListRequest) Search(search string) *InstanceTypeWatchdogsServiceListRequest { - p.search = &search - return p -} - -func (p *InstanceTypeWatchdogsServiceListRequest) Send() (*InstanceTypeWatchdogsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.InstanceTypeWatchdogsService.connection.URL(), p.InstanceTypeWatchdogsService.path) +func (p *AssignedPermissionsServiceListRequest) Send() (*AssignedPermissionsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -9221,7 +7786,7 @@ func (p *InstanceTypeWatchdogsServiceListRequest) Send() (*InstanceTypeWatchdogs return nil, err } - for hk, hv := range p.InstanceTypeWatchdogsService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -9236,18 +7801,18 @@ func (p *InstanceTypeWatchdogsServiceListRequest) Send() (*InstanceTypeWatchdogs req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.InstanceTypeWatchdogsService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.InstanceTypeWatchdogsService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.InstanceTypeWatchdogsService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -9256,7 +7821,7 @@ func (p *InstanceTypeWatchdogsServiceListRequest) Send() (*InstanceTypeWatchdogs if err != nil { return nil, err } - p.InstanceTypeWatchdogsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -9266,14 +7831,14 @@ func (p *InstanceTypeWatchdogsServiceListRequest) Send() (*InstanceTypeWatchdogs return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLWatchdogReadMany(reader, nil) + result, err := XMLPermissionReadMany(reader, nil) if err != nil { return nil, err } - return &InstanceTypeWatchdogsServiceListResponse{watchdogs: result}, nil + return &AssignedPermissionsServiceListResponse{permissions: result}, nil } -func (p *InstanceTypeWatchdogsServiceListRequest) MustSend() *InstanceTypeWatchdogsServiceListResponse { +func (p *AssignedPermissionsServiceListRequest) MustSend() *AssignedPermissionsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -9282,82 +7847,84 @@ func (p *InstanceTypeWatchdogsServiceListRequest) MustSend() *InstanceTypeWatchd } // -// Lists all the configured watchdogs of the instance type. -// The order of the returned list of watchdogs isn't guaranteed. +// List all the permissions of the specific entity. +// For example to list all the permissions of the cluster with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/clusters/123/permissions +// .... +// [source,xml] +// ---- +// +// +// +// +// +// +// +// +// +// +// +// +// ---- +// The order of the returned permissions isn't guaranteed. // -type InstanceTypeWatchdogsServiceListResponse struct { - watchdogs *WatchdogSlice +type AssignedPermissionsServiceListResponse struct { + permissions *PermissionSlice } -func (p *InstanceTypeWatchdogsServiceListResponse) Watchdogs() (*WatchdogSlice, bool) { - if p.watchdogs != nil { - return p.watchdogs, true +func (p *AssignedPermissionsServiceListResponse) Permissions() (*PermissionSlice, bool) { + if p.permissions != nil { + return p.permissions, true } return nil, false } -func (p *InstanceTypeWatchdogsServiceListResponse) MustWatchdogs() *WatchdogSlice { - if p.watchdogs == nil { - panic("watchdogs in response does not exist") - } - return p.watchdogs -} - -// -// Lists all the configured watchdogs of the instance type. -// The order of the returned list of watchdogs isn't guaranteed. -// -func (p *InstanceTypeWatchdogsService) List() *InstanceTypeWatchdogsServiceListRequest { - return &InstanceTypeWatchdogsServiceListRequest{InstanceTypeWatchdogsService: p} -} - -// -// -func (op *InstanceTypeWatchdogsService) WatchdogService(id string) *InstanceTypeWatchdogService { - return NewInstanceTypeWatchdogService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *InstanceTypeWatchdogsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.WatchdogService(path), nil +func (p *AssignedPermissionsServiceListResponse) MustPermissions() *PermissionSlice { + if p.permissions == nil { + panic("permissions in response does not exist") } - return op.WatchdogService(path[:index]).Service(path[index+1:]) -} - -func (op *InstanceTypeWatchdogsService) String() string { - return fmt.Sprintf("InstanceTypeWatchdogsService:%s", op.path) + return p.permissions } // +// List all the permissions of the specific entity. +// For example to list all the permissions of the cluster with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/clusters/123/permissions +// .... +// [source,xml] +// ---- +// +// +// +// +// +// +// +// +// +// +// +// +// ---- +// The order of the returned permissions isn't guaranteed. // -type VirtualFunctionAllowedNetworksService struct { - BaseService -} - -func NewVirtualFunctionAllowedNetworksService(connection *Connection, path string) *VirtualFunctionAllowedNetworksService { - var result VirtualFunctionAllowedNetworksService - result.connection = connection - result.path = path - return &result +func (p *AssignedPermissionsService) List() *AssignedPermissionsServiceListRequest { + return &AssignedPermissionsServiceListRequest{AssignedPermissionsService: p} } // +// Add a new permission on the storage domain to the group in the system. // -type VirtualFunctionAllowedNetworksServiceAddRequest struct { - VirtualFunctionAllowedNetworksService *VirtualFunctionAllowedNetworksService - header map[string]string - query map[string]string - network *Network +type AssignedPermissionsServiceAddStorageDomainPermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Header(key, value string) *VirtualFunctionAllowedNetworksServiceAddRequest { +func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddStorageDomainPermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -9365,7 +7932,7 @@ func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Header(key, value stri return p } -func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Query(key, value string) *VirtualFunctionAllowedNetworksServiceAddRequest { +func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddStorageDomainPermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -9373,13 +7940,19 @@ func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Query(key, value strin return p } -func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Network(network *Network) *VirtualFunctionAllowedNetworksServiceAddRequest { - p.network = network +func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddStorageDomainPermissionRequest { + p.permission = permission return p } -func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Send() (*VirtualFunctionAllowedNetworksServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VirtualFunctionAllowedNetworksService.connection.URL(), p.VirtualFunctionAllowedNetworksService.path) +func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Send() (*AssignedPermissionsServiceAddStorageDomainPermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/storagedomainpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -9391,17 +7964,14 @@ func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Send() (*VirtualFuncti } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLNetworkWriteOne(writer, p.network, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VirtualFunctionAllowedNetworksService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -9416,18 +7986,18 @@ func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Send() (*VirtualFuncti req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VirtualFunctionAllowedNetworksService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VirtualFunctionAllowedNetworksService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VirtualFunctionAllowedNetworksService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -9436,24 +8006,17 @@ func (p *VirtualFunctionAllowedNetworksServiceAddRequest) Send() (*VirtualFuncti if err != nil { return nil, err } - p.VirtualFunctionAllowedNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VirtualFunctionAllowedNetworksServiceAddResponse{network: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddStorageDomainPermissionResponse{permission: result}, nil } -func (p *VirtualFunctionAllowedNetworksServiceAddRequest) MustSend() *VirtualFunctionAllowedNetworksServiceAddResponse { +func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) MustSend() *AssignedPermissionsServiceAddStorageDomainPermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -9462,44 +8025,44 @@ func (p *VirtualFunctionAllowedNetworksServiceAddRequest) MustSend() *VirtualFun } // +// Add a new permission on the storage domain to the group in the system. // -type VirtualFunctionAllowedNetworksServiceAddResponse struct { - network *Network +type AssignedPermissionsServiceAddStorageDomainPermissionResponse struct { + permission *Permission } -func (p *VirtualFunctionAllowedNetworksServiceAddResponse) Network() (*Network, bool) { - if p.network != nil { - return p.network, true +func (p *AssignedPermissionsServiceAddStorageDomainPermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *VirtualFunctionAllowedNetworksServiceAddResponse) MustNetwork() *Network { - if p.network == nil { - panic("network in response does not exist") +func (p *AssignedPermissionsServiceAddStorageDomainPermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return p.network + return p.permission } // +// Add a new permission on the storage domain to the group in the system. // -func (p *VirtualFunctionAllowedNetworksService) Add() *VirtualFunctionAllowedNetworksServiceAddRequest { - return &VirtualFunctionAllowedNetworksServiceAddRequest{VirtualFunctionAllowedNetworksService: p} +func (p *AssignedPermissionsService) AddStorageDomainPermission() *AssignedPermissionsServiceAddStorageDomainPermissionRequest { + return &AssignedPermissionsServiceAddStorageDomainPermissionRequest{AssignedPermissionsService: p} } // -// Returns the list of networks. -// The order of the returned list of networks isn't guaranteed. +// Add a new permission on the template to the group in the system. // -type VirtualFunctionAllowedNetworksServiceListRequest struct { - VirtualFunctionAllowedNetworksService *VirtualFunctionAllowedNetworksService - header map[string]string - query map[string]string - follow *string - max *int64 +type AssignedPermissionsServiceAddTemplatePermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *VirtualFunctionAllowedNetworksServiceListRequest) Header(key, value string) *VirtualFunctionAllowedNetworksServiceListRequest { +func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddTemplatePermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -9507,7 +8070,7 @@ func (p *VirtualFunctionAllowedNetworksServiceListRequest) Header(key, value str return p } -func (p *VirtualFunctionAllowedNetworksServiceListRequest) Query(key, value string) *VirtualFunctionAllowedNetworksServiceListRequest { +func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddTemplatePermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -9515,27 +8078,20 @@ func (p *VirtualFunctionAllowedNetworksServiceListRequest) Query(key, value stri return p } -func (p *VirtualFunctionAllowedNetworksServiceListRequest) Follow(follow string) *VirtualFunctionAllowedNetworksServiceListRequest { - p.follow = &follow - return p -} - -func (p *VirtualFunctionAllowedNetworksServiceListRequest) Max(max int64) *VirtualFunctionAllowedNetworksServiceListRequest { - p.max = &max +func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddTemplatePermissionRequest { + p.permission = permission return p } -func (p *VirtualFunctionAllowedNetworksServiceListRequest) Send() (*VirtualFunctionAllowedNetworksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VirtualFunctionAllowedNetworksService.connection.URL(), p.VirtualFunctionAllowedNetworksService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Send() (*AssignedPermissionsServiceAddTemplatePermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/templatepermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -9544,12 +8100,16 @@ func (p *VirtualFunctionAllowedNetworksServiceListRequest) Send() (*VirtualFunct if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VirtualFunctionAllowedNetworksService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -9564,18 +8124,18 @@ func (p *VirtualFunctionAllowedNetworksServiceListRequest) Send() (*VirtualFunct req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VirtualFunctionAllowedNetworksService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VirtualFunctionAllowedNetworksService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VirtualFunctionAllowedNetworksService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -9584,24 +8144,17 @@ func (p *VirtualFunctionAllowedNetworksServiceListRequest) Send() (*VirtualFunct if err != nil { return nil, err } - p.VirtualFunctionAllowedNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkReadMany(reader, nil) - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VirtualFunctionAllowedNetworksServiceListResponse{networks: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddTemplatePermissionResponse{permission: result}, nil } -func (p *VirtualFunctionAllowedNetworksServiceListRequest) MustSend() *VirtualFunctionAllowedNetworksServiceListResponse { +func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) MustSend() *AssignedPermissionsServiceAddTemplatePermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -9610,122 +8163,44 @@ func (p *VirtualFunctionAllowedNetworksServiceListRequest) MustSend() *VirtualFu } // -// Returns the list of networks. -// The order of the returned list of networks isn't guaranteed. +// Add a new permission on the template to the group in the system. // -type VirtualFunctionAllowedNetworksServiceListResponse struct { - networks *NetworkSlice +type AssignedPermissionsServiceAddTemplatePermissionResponse struct { + permission *Permission } -func (p *VirtualFunctionAllowedNetworksServiceListResponse) Networks() (*NetworkSlice, bool) { - if p.networks != nil { - return p.networks, true +func (p *AssignedPermissionsServiceAddTemplatePermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *VirtualFunctionAllowedNetworksServiceListResponse) MustNetworks() *NetworkSlice { - if p.networks == nil { - panic("networks in response does not exist") - } - return p.networks -} - -// -// Returns the list of networks. -// The order of the returned list of networks isn't guaranteed. -// -func (p *VirtualFunctionAllowedNetworksService) List() *VirtualFunctionAllowedNetworksServiceListRequest { - return &VirtualFunctionAllowedNetworksServiceListRequest{VirtualFunctionAllowedNetworksService: p} -} - -// -// -func (op *VirtualFunctionAllowedNetworksService) NetworkService(id string) *VirtualFunctionAllowedNetworkService { - return NewVirtualFunctionAllowedNetworkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *VirtualFunctionAllowedNetworksService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.NetworkService(path), nil +func (p *AssignedPermissionsServiceAddTemplatePermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return op.NetworkService(path[:index]).Service(path[index+1:]) -} - -func (op *VirtualFunctionAllowedNetworksService) String() string { - return fmt.Sprintf("VirtualFunctionAllowedNetworksService:%s", op.path) + return p.permission } // -// This service manages the set of disks attached to a virtual machine. Each attached disk is represented by a -// <>, containing the bootable flag, the disk interface and the reference to -// the disk. +// Add a new permission on the template to the group in the system. // -type DiskAttachmentsService struct { - BaseService -} - -func NewDiskAttachmentsService(connection *Connection, path string) *DiskAttachmentsService { - var result DiskAttachmentsService - result.connection = connection - result.path = path - return &result +func (p *AssignedPermissionsService) AddTemplatePermission() *AssignedPermissionsServiceAddTemplatePermissionRequest { + return &AssignedPermissionsServiceAddTemplatePermissionRequest{AssignedPermissionsService: p} } // -// Adds a new disk attachment to the virtual machine. The `attachment` parameter can contain just a reference, if -// the disk already exists: -// [source,xml] -// ---- -// -// true -// true -// ide -// true -// -// -// ---- -// Or it can contain the complete representation of the disk, if the disk doesn't exist yet: -// [source,xml] -// ---- -// -// true -// true -// ide -// true -// -// mydisk -// 1024 -// ... -// -// -// ---- -// In this case the disk will be created and then attached to the virtual machine. -// In both cases, use the following URL for a virtual machine with an id `345`: -// [source] -// ---- -// POST /ovirt-engine/api/vms/345/diskattachments -// ---- -// IMPORTANT: The server accepts requests that don't contain the `active` attribute, but the effect is -// undefined. In some cases the disk will be automatically activated and in other cases it won't. To -// avoid issues it is strongly recommended to always include the `active` attribute with the desired -// value. +// Add a new user level permission for a given virtual machine. // -type DiskAttachmentsServiceAddRequest struct { - DiskAttachmentsService *DiskAttachmentsService - header map[string]string - query map[string]string - attachment *DiskAttachment +type AssignedPermissionsServiceAddUserLevelRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *DiskAttachmentsServiceAddRequest) Header(key, value string) *DiskAttachmentsServiceAddRequest { +func (p *AssignedPermissionsServiceAddUserLevelRequest) Header(key, value string) *AssignedPermissionsServiceAddUserLevelRequest { if p.header == nil { p.header = make(map[string]string) } @@ -9733,7 +8208,7 @@ func (p *DiskAttachmentsServiceAddRequest) Header(key, value string) *DiskAttach return p } -func (p *DiskAttachmentsServiceAddRequest) Query(key, value string) *DiskAttachmentsServiceAddRequest { +func (p *AssignedPermissionsServiceAddUserLevelRequest) Query(key, value string) *AssignedPermissionsServiceAddUserLevelRequest { if p.query == nil { p.query = make(map[string]string) } @@ -9741,13 +8216,19 @@ func (p *DiskAttachmentsServiceAddRequest) Query(key, value string) *DiskAttachm return p } -func (p *DiskAttachmentsServiceAddRequest) Attachment(attachment *DiskAttachment) *DiskAttachmentsServiceAddRequest { - p.attachment = attachment +func (p *AssignedPermissionsServiceAddUserLevelRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddUserLevelRequest { + p.permission = permission return p } -func (p *DiskAttachmentsServiceAddRequest) Send() (*DiskAttachmentsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) +func (p *AssignedPermissionsServiceAddUserLevelRequest) Send() (*AssignedPermissionsServiceAddUserLevelResponse, error) { + rawURL := fmt.Sprintf("%s%s/userlevel", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -9759,17 +8240,14 @@ func (p *DiskAttachmentsServiceAddRequest) Send() (*DiskAttachmentsServiceAddRes } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLDiskAttachmentWriteOne(writer, p.attachment, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DiskAttachmentsService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -9784,18 +8262,18 @@ func (p *DiskAttachmentsServiceAddRequest) Send() (*DiskAttachmentsServiceAddRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskAttachmentsService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskAttachmentsService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskAttachmentsService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -9804,24 +8282,17 @@ func (p *DiskAttachmentsServiceAddRequest) Send() (*DiskAttachmentsServiceAddRes if err != nil { return nil, err } - p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskAttachmentReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &DiskAttachmentsServiceAddResponse{attachment: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddUserLevelResponse{permission: result}, nil } -func (p *DiskAttachmentsServiceAddRequest) MustSend() *DiskAttachmentsServiceAddResponse { +func (p *AssignedPermissionsServiceAddUserLevelRequest) MustSend() *AssignedPermissionsServiceAddUserLevelResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -9830,117 +8301,44 @@ func (p *DiskAttachmentsServiceAddRequest) MustSend() *DiskAttachmentsServiceAdd } // -// Adds a new disk attachment to the virtual machine. The `attachment` parameter can contain just a reference, if -// the disk already exists: -// [source,xml] -// ---- -// -// true -// true -// ide -// true -// -// -// ---- -// Or it can contain the complete representation of the disk, if the disk doesn't exist yet: -// [source,xml] -// ---- -// -// true -// true -// ide -// true -// -// mydisk -// 1024 -// ... -// -// -// ---- -// In this case the disk will be created and then attached to the virtual machine. -// In both cases, use the following URL for a virtual machine with an id `345`: -// [source] -// ---- -// POST /ovirt-engine/api/vms/345/diskattachments -// ---- -// IMPORTANT: The server accepts requests that don't contain the `active` attribute, but the effect is -// undefined. In some cases the disk will be automatically activated and in other cases it won't. To -// avoid issues it is strongly recommended to always include the `active` attribute with the desired -// value. +// Add a new user level permission for a given virtual machine. // -type DiskAttachmentsServiceAddResponse struct { - attachment *DiskAttachment +type AssignedPermissionsServiceAddUserLevelResponse struct { + permission *Permission } -func (p *DiskAttachmentsServiceAddResponse) Attachment() (*DiskAttachment, bool) { - if p.attachment != nil { - return p.attachment, true +func (p *AssignedPermissionsServiceAddUserLevelResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *DiskAttachmentsServiceAddResponse) MustAttachment() *DiskAttachment { - if p.attachment == nil { - panic("attachment in response does not exist") +func (p *AssignedPermissionsServiceAddUserLevelResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return p.attachment + return p.permission } // -// Adds a new disk attachment to the virtual machine. The `attachment` parameter can contain just a reference, if -// the disk already exists: -// [source,xml] -// ---- -// -// true -// true -// ide -// true -// -// -// ---- -// Or it can contain the complete representation of the disk, if the disk doesn't exist yet: -// [source,xml] -// ---- -// -// true -// true -// ide -// true -// -// mydisk -// 1024 -// ... -// -// -// ---- -// In this case the disk will be created and then attached to the virtual machine. -// In both cases, use the following URL for a virtual machine with an id `345`: -// [source] -// ---- -// POST /ovirt-engine/api/vms/345/diskattachments -// ---- -// IMPORTANT: The server accepts requests that don't contain the `active` attribute, but the effect is -// undefined. In some cases the disk will be automatically activated and in other cases it won't. To -// avoid issues it is strongly recommended to always include the `active` attribute with the desired -// value. +// Add a new user level permission for a given virtual machine. // -func (p *DiskAttachmentsService) Add() *DiskAttachmentsServiceAddRequest { - return &DiskAttachmentsServiceAddRequest{DiskAttachmentsService: p} +func (p *AssignedPermissionsService) AddUserLevel() *AssignedPermissionsServiceAddUserLevelRequest { + return &AssignedPermissionsServiceAddUserLevelRequest{AssignedPermissionsService: p} } // -// List the disk that are attached to the virtual machine. -// The order of the returned list of disks attachments isn't guaranteed. +// Add a new permission on the vm to the group in the system. // -type DiskAttachmentsServiceListRequest struct { - DiskAttachmentsService *DiskAttachmentsService - header map[string]string - query map[string]string - follow *string +type AssignedPermissionsServiceAddVmPermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *DiskAttachmentsServiceListRequest) Header(key, value string) *DiskAttachmentsServiceListRequest { +func (p *AssignedPermissionsServiceAddVmPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddVmPermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -9948,7 +8346,7 @@ func (p *DiskAttachmentsServiceListRequest) Header(key, value string) *DiskAttac return p } -func (p *DiskAttachmentsServiceListRequest) Query(key, value string) *DiskAttachmentsServiceListRequest { +func (p *AssignedPermissionsServiceAddVmPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddVmPermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -9956,18 +8354,20 @@ func (p *DiskAttachmentsServiceListRequest) Query(key, value string) *DiskAttach return p } -func (p *DiskAttachmentsServiceListRequest) Follow(follow string) *DiskAttachmentsServiceListRequest { - p.follow = &follow +func (p *AssignedPermissionsServiceAddVmPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddVmPermissionRequest { + p.permission = permission return p } -func (p *DiskAttachmentsServiceListRequest) Send() (*DiskAttachmentsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *AssignedPermissionsServiceAddVmPermissionRequest) Send() (*AssignedPermissionsServiceAddVmPermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/vmpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Permission(p.permission) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -9976,12 +8376,16 @@ func (p *DiskAttachmentsServiceListRequest) Send() (*DiskAttachmentsServiceListR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DiskAttachmentsService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -9996,18 +8400,18 @@ func (p *DiskAttachmentsServiceListRequest) Send() (*DiskAttachmentsServiceListR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskAttachmentsService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskAttachmentsService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskAttachmentsService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10016,24 +8420,17 @@ func (p *DiskAttachmentsServiceListRequest) Send() (*DiskAttachmentsServiceListR if err != nil { return nil, err } - p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskAttachmentReadMany(reader, nil) - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &DiskAttachmentsServiceListResponse{attachments: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddVmPermissionResponse{permission: result}, nil } -func (p *DiskAttachmentsServiceListRequest) MustSend() *DiskAttachmentsServiceListResponse { +func (p *AssignedPermissionsServiceAddVmPermissionRequest) MustSend() *AssignedPermissionsServiceAddVmPermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -10042,45 +8439,44 @@ func (p *DiskAttachmentsServiceListRequest) MustSend() *DiskAttachmentsServiceLi } // -// List the disk that are attached to the virtual machine. -// The order of the returned list of disks attachments isn't guaranteed. +// Add a new permission on the vm to the group in the system. // -type DiskAttachmentsServiceListResponse struct { - attachments *DiskAttachmentSlice +type AssignedPermissionsServiceAddVmPermissionResponse struct { + permission *Permission } -func (p *DiskAttachmentsServiceListResponse) Attachments() (*DiskAttachmentSlice, bool) { - if p.attachments != nil { - return p.attachments, true +func (p *AssignedPermissionsServiceAddVmPermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *DiskAttachmentsServiceListResponse) MustAttachments() *DiskAttachmentSlice { - if p.attachments == nil { - panic("attachments in response does not exist") +func (p *AssignedPermissionsServiceAddVmPermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return p.attachments + return p.permission } // -// List the disk that are attached to the virtual machine. -// The order of the returned list of disks attachments isn't guaranteed. +// Add a new permission on the vm to the group in the system. // -func (p *DiskAttachmentsService) List() *DiskAttachmentsServiceListRequest { - return &DiskAttachmentsServiceListRequest{DiskAttachmentsService: p} +func (p *AssignedPermissionsService) AddVmPermission() *AssignedPermissionsServiceAddVmPermissionRequest { + return &AssignedPermissionsServiceAddVmPermissionRequest{AssignedPermissionsService: p} } // +// Add a new permission on the vm pool to the group in the system. // -type DiskAttachmentsServiceAddProvidingDiskIdRequest struct { - DiskAttachmentsService *DiskAttachmentsService - header map[string]string - query map[string]string - attachment *DiskAttachment +type AssignedPermissionsServiceAddVmPoolPermissionRequest struct { + AssignedPermissionsService *AssignedPermissionsService + header map[string]string + query map[string]string + permission *Permission } -func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Header(key, value string) *DiskAttachmentsServiceAddProvidingDiskIdRequest { +func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddVmPoolPermissionRequest { if p.header == nil { p.header = make(map[string]string) } @@ -10088,7 +8484,7 @@ func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Header(key, value stri return p } -func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Query(key, value string) *DiskAttachmentsServiceAddProvidingDiskIdRequest { +func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddVmPoolPermissionRequest { if p.query == nil { p.query = make(map[string]string) } @@ -10096,15 +8492,15 @@ func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Query(key, value strin return p } -func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Attachment(attachment *DiskAttachment) *DiskAttachmentsServiceAddProvidingDiskIdRequest { - p.attachment = attachment +func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddVmPoolPermissionRequest { + p.permission = permission return p } -func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Send() (*DiskAttachmentsServiceAddProvidingDiskIdResponse, error) { - rawURL := fmt.Sprintf("%s%s/providingdiskid", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) +func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Send() (*AssignedPermissionsServiceAddVmPoolPermissionResponse, error) { + rawURL := fmt.Sprintf("%s%s/vmpoolpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) actionBuilder := NewActionBuilder() - actionBuilder.Attachment(p.attachment) + actionBuilder.Permission(p.permission) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -10127,7 +8523,7 @@ func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Send() (*DiskAttachmen return nil, err } - for hk, hv := range p.DiskAttachmentsService.connection.headers { + for hk, hv := range p.AssignedPermissionsService.connection.headers { req.Header.Add(hk, hv) } @@ -10142,18 +8538,18 @@ func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Send() (*DiskAttachmen req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskAttachmentsService.connection.authenticate() + token, err := p.AssignedPermissionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskAttachmentsService.connection.client.Do(req) + resp, err := p.AssignedPermissionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskAttachmentsService.connection.logFunc != nil { + if p.AssignedPermissionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10162,17 +8558,17 @@ func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Send() (*DiskAttachmen if err != nil { return nil, err } - p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } action, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustAttachment() - return &DiskAttachmentsServiceAddProvidingDiskIdResponse{attachment: result}, nil + result := action.MustPermission() + return &AssignedPermissionsServiceAddVmPoolPermissionResponse{permission: result}, nil } -func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) MustSend() *DiskAttachmentsServiceAddProvidingDiskIdResponse { +func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) MustSend() *AssignedPermissionsServiceAddVmPoolPermissionResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -10181,70 +8577,122 @@ func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) MustSend() *DiskAttach } // +// Add a new permission on the vm pool to the group in the system. // -type DiskAttachmentsServiceAddProvidingDiskIdResponse struct { - attachment *DiskAttachment +type AssignedPermissionsServiceAddVmPoolPermissionResponse struct { + permission *Permission } -func (p *DiskAttachmentsServiceAddProvidingDiskIdResponse) Attachment() (*DiskAttachment, bool) { - if p.attachment != nil { - return p.attachment, true +func (p *AssignedPermissionsServiceAddVmPoolPermissionResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true } return nil, false } -func (p *DiskAttachmentsServiceAddProvidingDiskIdResponse) MustAttachment() *DiskAttachment { - if p.attachment == nil { - panic("attachment in response does not exist") +func (p *AssignedPermissionsServiceAddVmPoolPermissionResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") } - return p.attachment + return p.permission } // +// Add a new permission on the vm pool to the group in the system. // -func (p *DiskAttachmentsService) AddProvidingDiskId() *DiskAttachmentsServiceAddProvidingDiskIdRequest { - return &DiskAttachmentsServiceAddProvidingDiskIdRequest{DiskAttachmentsService: p} +func (p *AssignedPermissionsService) AddVmPoolPermission() *AssignedPermissionsServiceAddVmPoolPermissionRequest { + return &AssignedPermissionsServiceAddVmPoolPermissionRequest{AssignedPermissionsService: p} } // +// Sub-resource locator method, returns individual permission resource on which the remainder of the URI is +// dispatched. // -type DiskAttachmentsServiceAddSignature1Request struct { - DiskAttachmentsService *DiskAttachmentsService - header map[string]string - query map[string]string - attachment *DiskAttachment +func (op *AssignedPermissionsService) PermissionService(id string) *PermissionService { + return NewPermissionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *DiskAttachmentsServiceAddSignature1Request) Header(key, value string) *DiskAttachmentsServiceAddSignature1Request { - if p.header == nil { - p.header = make(map[string]string) +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AssignedPermissionsService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - p.header[key] = value - return p + index := strings.Index(path, "/") + if index == -1 { + return op.PermissionService(path), nil + } + return op.PermissionService(path[:index]).Service(path[index+1:]) } -func (p *DiskAttachmentsServiceAddSignature1Request) Query(key, value string) *DiskAttachmentsServiceAddSignature1Request { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p +func (op *AssignedPermissionsService) String() string { + return fmt.Sprintf("AssignedPermissionsService:%s", op.path) } -func (p *DiskAttachmentsServiceAddSignature1Request) Attachment(attachment *DiskAttachment) *DiskAttachmentsServiceAddSignature1Request { - p.attachment = attachment - return p +// +// Represents a roles sub-collection, for example scoped by user. +// +type AssignedRolesService struct { + BaseService } -func (p *DiskAttachmentsServiceAddSignature1Request) Send() (*DiskAttachmentsServiceAddSignature1Response, error) { - rawURL := fmt.Sprintf("%s%s/signature1", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Attachment(p.attachment) - action, err := actionBuilder.Build() - if err != nil { - return nil, err +func NewAssignedRolesService(connection *Connection, path string) *AssignedRolesService { + var result AssignedRolesService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the roles assigned to the permission. +// The order of the returned roles isn't guaranteed. +// +type AssignedRolesServiceListRequest struct { + AssignedRolesService *AssignedRolesService + header map[string]string + query map[string]string + follow *string + max *int64 +} + +func (p *AssignedRolesServiceListRequest) Header(key, value string) *AssignedRolesServiceListRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value + return p +} + +func (p *AssignedRolesServiceListRequest) Query(key, value string) *AssignedRolesServiceListRequest { + if p.query == nil { + p.query = make(map[string]string) } + p.query[key] = value + return p +} + +func (p *AssignedRolesServiceListRequest) Follow(follow string) *AssignedRolesServiceListRequest { + p.follow = &follow + return p +} + +func (p *AssignedRolesServiceListRequest) Max(max int64) *AssignedRolesServiceListRequest { + p.max = &max + return p +} + +func (p *AssignedRolesServiceListRequest) Send() (*AssignedRolesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedRolesService.connection.URL(), p.AssignedRolesService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -10253,16 +8701,12 @@ func (p *DiskAttachmentsServiceAddSignature1Request) Send() (*DiskAttachmentsSer if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DiskAttachmentsService.connection.headers { + for hk, hv := range p.AssignedRolesService.connection.headers { req.Header.Add(hk, hv) } @@ -10277,18 +8721,18 @@ func (p *DiskAttachmentsServiceAddSignature1Request) Send() (*DiskAttachmentsSer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DiskAttachmentsService.connection.authenticate() + token, err := p.AssignedRolesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DiskAttachmentsService.connection.client.Do(req) + resp, err := p.AssignedRolesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DiskAttachmentsService.connection.logFunc != nil { + if p.AssignedRolesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10297,17 +8741,24 @@ func (p *DiskAttachmentsServiceAddSignature1Request) Send() (*DiskAttachmentsSer if err != nil { return nil, err } - p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedRolesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustAttachment() - return &DiskAttachmentsServiceAddSignature1Response{attachment: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLRoleReadMany(reader, nil) + if err != nil { + return nil, err + } + return &AssignedRolesServiceListResponse{roles: result}, nil } -func (p *DiskAttachmentsServiceAddSignature1Request) MustSend() *DiskAttachmentsServiceAddSignature1Response { +func (p *AssignedRolesServiceListRequest) MustSend() *AssignedRolesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -10316,79 +8767,98 @@ func (p *DiskAttachmentsServiceAddSignature1Request) MustSend() *DiskAttachments } // +// Returns the roles assigned to the permission. +// The order of the returned roles isn't guaranteed. // -type DiskAttachmentsServiceAddSignature1Response struct { - attachment *DiskAttachment +type AssignedRolesServiceListResponse struct { + roles *RoleSlice } -func (p *DiskAttachmentsServiceAddSignature1Response) Attachment() (*DiskAttachment, bool) { - if p.attachment != nil { - return p.attachment, true +func (p *AssignedRolesServiceListResponse) Roles() (*RoleSlice, bool) { + if p.roles != nil { + return p.roles, true } return nil, false } -func (p *DiskAttachmentsServiceAddSignature1Response) MustAttachment() *DiskAttachment { - if p.attachment == nil { - panic("attachment in response does not exist") +func (p *AssignedRolesServiceListResponse) MustRoles() *RoleSlice { + if p.roles == nil { + panic("roles in response does not exist") } - return p.attachment + return p.roles } // +// Returns the roles assigned to the permission. +// The order of the returned roles isn't guaranteed. // -func (p *DiskAttachmentsService) AddSignature1() *DiskAttachmentsServiceAddSignature1Request { - return &DiskAttachmentsServiceAddSignature1Request{DiskAttachmentsService: p} +func (p *AssignedRolesService) List() *AssignedRolesServiceListRequest { + return &AssignedRolesServiceListRequest{AssignedRolesService: p} } // -// Reference to the service that manages a specific attachment. +// Sub-resource locator method, returns individual role resource on which the remainder of the URI is dispatched. // -func (op *DiskAttachmentsService) AttachmentService(id string) *DiskAttachmentService { - return NewDiskAttachmentService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AssignedRolesService) RoleService(id string) *RoleService { + return NewRoleService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *DiskAttachmentsService) Service(path string) (Service, error) { +func (op *AssignedRolesService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.AttachmentService(path), nil + return op.RoleService(path), nil } - return op.AttachmentService(path[:index]).Service(path[index+1:]) + return op.RoleService(path[:index]).Service(path[index+1:]) } -func (op *DiskAttachmentsService) String() string { - return fmt.Sprintf("DiskAttachmentsService:%s", op.path) +func (op *AssignedRolesService) String() string { + return fmt.Sprintf("AssignedRolesService:%s", op.path) } // +// A service to manage assignment of specific tag to specific entities in system. // -type StorageServerConnectionExtensionService struct { +type AssignedTagService struct { BaseService } -func NewStorageServerConnectionExtensionService(connection *Connection, path string) *StorageServerConnectionExtensionService { - var result StorageServerConnectionExtensionService +func NewAssignedTagService(connection *Connection, path string) *AssignedTagService { + var result AssignedTagService result.connection = connection result.path = path return &result } // +// Gets the information about the assigned tag. +// For example to retrieve the information about the tag with the id `456` which is assigned to virtual machine +// with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/vms/123/tags/456 +// .... +// [source,xml] +// ---- +// +// root +// root +// +// +// ---- // -type StorageServerConnectionExtensionServiceGetRequest struct { - StorageServerConnectionExtensionService *StorageServerConnectionExtensionService - header map[string]string - query map[string]string - follow *string +type AssignedTagServiceGetRequest struct { + AssignedTagService *AssignedTagService + header map[string]string + query map[string]string + follow *string } -func (p *StorageServerConnectionExtensionServiceGetRequest) Header(key, value string) *StorageServerConnectionExtensionServiceGetRequest { +func (p *AssignedTagServiceGetRequest) Header(key, value string) *AssignedTagServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -10396,7 +8866,7 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) Header(key, value st return p } -func (p *StorageServerConnectionExtensionServiceGetRequest) Query(key, value string) *StorageServerConnectionExtensionServiceGetRequest { +func (p *AssignedTagServiceGetRequest) Query(key, value string) *AssignedTagServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -10404,13 +8874,13 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) Query(key, value str return p } -func (p *StorageServerConnectionExtensionServiceGetRequest) Follow(follow string) *StorageServerConnectionExtensionServiceGetRequest { +func (p *AssignedTagServiceGetRequest) Follow(follow string) *AssignedTagServiceGetRequest { p.follow = &follow return p } -func (p *StorageServerConnectionExtensionServiceGetRequest) Send() (*StorageServerConnectionExtensionServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageServerConnectionExtensionService.connection.URL(), p.StorageServerConnectionExtensionService.path) +func (p *AssignedTagServiceGetRequest) Send() (*AssignedTagServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedTagService.connection.URL(), p.AssignedTagService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -10429,7 +8899,7 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) Send() (*StorageServ return nil, err } - for hk, hv := range p.StorageServerConnectionExtensionService.connection.headers { + for hk, hv := range p.AssignedTagService.connection.headers { req.Header.Add(hk, hv) } @@ -10444,18 +8914,18 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) Send() (*StorageServ req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionExtensionService.connection.authenticate() + token, err := p.AssignedTagService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionExtensionService.connection.client.Do(req) + resp, err := p.AssignedTagService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionExtensionService.connection.logFunc != nil { + if p.AssignedTagService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10464,7 +8934,7 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) Send() (*StorageServ if err != nil { return nil, err } - p.StorageServerConnectionExtensionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedTagService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -10474,14 +8944,14 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) Send() (*StorageServ return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionExtensionReadOne(reader, nil, "") + result, err := XMLTagReadOne(reader, nil, "") if err != nil { return nil, err } - return &StorageServerConnectionExtensionServiceGetResponse{extension: result}, nil + return &AssignedTagServiceGetResponse{tag: result}, nil } -func (p *StorageServerConnectionExtensionServiceGetRequest) MustSend() *StorageServerConnectionExtensionServiceGetResponse { +func (p *AssignedTagServiceGetRequest) MustSend() *AssignedTagServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -10490,41 +8960,74 @@ func (p *StorageServerConnectionExtensionServiceGetRequest) MustSend() *StorageS } // +// Gets the information about the assigned tag. +// For example to retrieve the information about the tag with the id `456` which is assigned to virtual machine +// with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/vms/123/tags/456 +// .... +// [source,xml] +// ---- +// +// root +// root +// +// +// ---- // -type StorageServerConnectionExtensionServiceGetResponse struct { - extension *StorageConnectionExtension +type AssignedTagServiceGetResponse struct { + tag *Tag } -func (p *StorageServerConnectionExtensionServiceGetResponse) Extension() (*StorageConnectionExtension, bool) { - if p.extension != nil { - return p.extension, true +func (p *AssignedTagServiceGetResponse) Tag() (*Tag, bool) { + if p.tag != nil { + return p.tag, true } return nil, false } -func (p *StorageServerConnectionExtensionServiceGetResponse) MustExtension() *StorageConnectionExtension { - if p.extension == nil { - panic("extension in response does not exist") +func (p *AssignedTagServiceGetResponse) MustTag() *Tag { + if p.tag == nil { + panic("tag in response does not exist") } - return p.extension + return p.tag } // +// Gets the information about the assigned tag. +// For example to retrieve the information about the tag with the id `456` which is assigned to virtual machine +// with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/vms/123/tags/456 +// .... +// [source,xml] +// ---- +// +// root +// root +// +// +// ---- // -func (p *StorageServerConnectionExtensionService) Get() *StorageServerConnectionExtensionServiceGetRequest { - return &StorageServerConnectionExtensionServiceGetRequest{StorageServerConnectionExtensionService: p} +func (p *AssignedTagService) Get() *AssignedTagServiceGetRequest { + return &AssignedTagServiceGetRequest{AssignedTagService: p} } // +// Unassign tag from specific entity in the system. +// For example to unassign the tag with id `456` from virtual machine with id `123` send a request like this: +// .... +// DELETE /ovirt-engine/api/vms/123/tags/456 +// .... // -type StorageServerConnectionExtensionServiceRemoveRequest struct { - StorageServerConnectionExtensionService *StorageServerConnectionExtensionService - header map[string]string - query map[string]string - async *bool +type AssignedTagServiceRemoveRequest struct { + AssignedTagService *AssignedTagService + header map[string]string + query map[string]string + async *bool } -func (p *StorageServerConnectionExtensionServiceRemoveRequest) Header(key, value string) *StorageServerConnectionExtensionServiceRemoveRequest { +func (p *AssignedTagServiceRemoveRequest) Header(key, value string) *AssignedTagServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -10532,7 +9035,7 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) Header(key, value return p } -func (p *StorageServerConnectionExtensionServiceRemoveRequest) Query(key, value string) *StorageServerConnectionExtensionServiceRemoveRequest { +func (p *AssignedTagServiceRemoveRequest) Query(key, value string) *AssignedTagServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -10540,13 +9043,13 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) Query(key, value return p } -func (p *StorageServerConnectionExtensionServiceRemoveRequest) Async(async bool) *StorageServerConnectionExtensionServiceRemoveRequest { +func (p *AssignedTagServiceRemoveRequest) Async(async bool) *AssignedTagServiceRemoveRequest { p.async = &async return p } -func (p *StorageServerConnectionExtensionServiceRemoveRequest) Send() (*StorageServerConnectionExtensionServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageServerConnectionExtensionService.connection.URL(), p.StorageServerConnectionExtensionService.path) +func (p *AssignedTagServiceRemoveRequest) Send() (*AssignedTagServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedTagService.connection.URL(), p.AssignedTagService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -10565,7 +9068,7 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) Send() (*StorageS return nil, err } - for hk, hv := range p.StorageServerConnectionExtensionService.connection.headers { + for hk, hv := range p.AssignedTagService.connection.headers { req.Header.Add(hk, hv) } @@ -10580,18 +9083,18 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) Send() (*StorageS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionExtensionService.connection.authenticate() + token, err := p.AssignedTagService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionExtensionService.connection.client.Do(req) + resp, err := p.AssignedTagService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionExtensionService.connection.logFunc != nil { + if p.AssignedTagService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10600,7 +9103,7 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) Send() (*StorageS if err != nil { return nil, err } - p.StorageServerConnectionExtensionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedTagService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -10609,10 +9112,10 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) Send() (*StorageS if errReadBody != nil { return nil, errReadBody } - return new(StorageServerConnectionExtensionServiceRemoveResponse), nil + return new(AssignedTagServiceRemoveResponse), nil } -func (p *StorageServerConnectionExtensionServiceRemoveRequest) MustSend() *StorageServerConnectionExtensionServiceRemoveResponse { +func (p *AssignedTagServiceRemoveRequest) MustSend() *AssignedTagServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -10621,42 +9124,76 @@ func (p *StorageServerConnectionExtensionServiceRemoveRequest) MustSend() *Stora } // +// Unassign tag from specific entity in the system. +// For example to unassign the tag with id `456` from virtual machine with id `123` send a request like this: +// .... +// DELETE /ovirt-engine/api/vms/123/tags/456 +// .... +// +type AssignedTagServiceRemoveResponse struct { +} + +// +// Unassign tag from specific entity in the system. +// For example to unassign the tag with id `456` from virtual machine with id `123` send a request like this: +// .... +// DELETE /ovirt-engine/api/vms/123/tags/456 +// .... // -type StorageServerConnectionExtensionServiceRemoveResponse struct { +func (p *AssignedTagService) Remove() *AssignedTagServiceRemoveRequest { + return &AssignedTagServiceRemoveRequest{AssignedTagService: p} } // +// Service locator method, returns individual service on which the URI is dispatched. // -func (p *StorageServerConnectionExtensionService) Remove() *StorageServerConnectionExtensionServiceRemoveRequest { - return &StorageServerConnectionExtensionServiceRemoveRequest{StorageServerConnectionExtensionService: p} +func (op *AssignedTagService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *AssignedTagService) String() string { + return fmt.Sprintf("AssignedTagService:%s", op.path) } // -// Update a storage server connection extension for the given host. -// To update the storage connection `456` of host `123` send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/hosts/123/storageconnectionextensions/456 -// ---- +// A service to manage collection of assignment of tags to specific entities in system. +// +type AssignedTagsService struct { + BaseService +} + +func NewAssignedTagsService(connection *Connection, path string) *AssignedTagsService { + var result AssignedTagsService + result.connection = connection + result.path = path + return &result +} + +// +// Assign tag to specific entity in the system. +// For example to assign tag `mytag` to virtual machine with the id `123` send a request like this: +// .... +// POST /ovirt-engine/api/vms/123/tags +// .... // With a request body like this: // [source,xml] // ---- -// -// iqn.2016-01.com.example:mytarget -// myuser -// mypassword -// +// +// mytag +// // ---- // -type StorageServerConnectionExtensionServiceUpdateRequest struct { - StorageServerConnectionExtensionService *StorageServerConnectionExtensionService - header map[string]string - query map[string]string - async *bool - extension *StorageConnectionExtension +type AssignedTagsServiceAddRequest struct { + AssignedTagsService *AssignedTagsService + header map[string]string + query map[string]string + tag *Tag } -func (p *StorageServerConnectionExtensionServiceUpdateRequest) Header(key, value string) *StorageServerConnectionExtensionServiceUpdateRequest { +func (p *AssignedTagsServiceAddRequest) Header(key, value string) *AssignedTagsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -10664,7 +9201,7 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) Header(key, value return p } -func (p *StorageServerConnectionExtensionServiceUpdateRequest) Query(key, value string) *StorageServerConnectionExtensionServiceUpdateRequest { +func (p *AssignedTagsServiceAddRequest) Query(key, value string) *AssignedTagsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -10672,23 +9209,14 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) Query(key, value return p } -func (p *StorageServerConnectionExtensionServiceUpdateRequest) Async(async bool) *StorageServerConnectionExtensionServiceUpdateRequest { - p.async = &async - return p -} - -func (p *StorageServerConnectionExtensionServiceUpdateRequest) Extension(extension *StorageConnectionExtension) *StorageServerConnectionExtensionServiceUpdateRequest { - p.extension = extension +func (p *AssignedTagsServiceAddRequest) Tag(tag *Tag) *AssignedTagsServiceAddRequest { + p.tag = tag return p } -func (p *StorageServerConnectionExtensionServiceUpdateRequest) Send() (*StorageServerConnectionExtensionServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageServerConnectionExtensionService.connection.URL(), p.StorageServerConnectionExtensionService.path) +func (p *AssignedTagsServiceAddRequest) Send() (*AssignedTagsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedTagsService.connection.URL(), p.AssignedTagsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -10699,17 +9227,17 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) Send() (*StorageS } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLStorageConnectionExtensionWriteOne(writer, p.extension, "") + err := XMLTagWriteOne(writer, p.tag, "") if err != nil { return nil, err } writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionExtensionService.connection.headers { + for hk, hv := range p.AssignedTagsService.connection.headers { req.Header.Add(hk, hv) } @@ -10724,18 +9252,18 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) Send() (*StorageS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionExtensionService.connection.authenticate() + token, err := p.AssignedTagsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionExtensionService.connection.client.Do(req) + resp, err := p.AssignedTagsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionExtensionService.connection.logFunc != nil { + if p.AssignedTagsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10744,9 +9272,9 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) Send() (*StorageS if err != nil { return nil, err } - p.StorageServerConnectionExtensionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedTagsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -10754,14 +9282,14 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) Send() (*StorageS return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionExtensionReadOne(reader, nil, "") + result, err := XMLTagReadOne(reader, nil, "") if err != nil { return nil, err } - return &StorageServerConnectionExtensionServiceUpdateResponse{extension: result}, nil + return &AssignedTagsServiceAddResponse{tag: result}, nil } -func (p *StorageServerConnectionExtensionServiceUpdateRequest) MustSend() *StorageServerConnectionExtensionServiceUpdateResponse { +func (p *AssignedTagsServiceAddRequest) MustSend() *AssignedTagsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -10770,158 +9298,118 @@ func (p *StorageServerConnectionExtensionServiceUpdateRequest) MustSend() *Stora } // -// Update a storage server connection extension for the given host. -// To update the storage connection `456` of host `123` send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/hosts/123/storageconnectionextensions/456 -// ---- +// Assign tag to specific entity in the system. +// For example to assign tag `mytag` to virtual machine with the id `123` send a request like this: +// .... +// POST /ovirt-engine/api/vms/123/tags +// .... // With a request body like this: // [source,xml] // ---- -// -// iqn.2016-01.com.example:mytarget -// myuser -// mypassword -// +// +// mytag +// // ---- // -type StorageServerConnectionExtensionServiceUpdateResponse struct { - extension *StorageConnectionExtension +type AssignedTagsServiceAddResponse struct { + tag *Tag } -func (p *StorageServerConnectionExtensionServiceUpdateResponse) Extension() (*StorageConnectionExtension, bool) { - if p.extension != nil { - return p.extension, true +func (p *AssignedTagsServiceAddResponse) Tag() (*Tag, bool) { + if p.tag != nil { + return p.tag, true } return nil, false } -func (p *StorageServerConnectionExtensionServiceUpdateResponse) MustExtension() *StorageConnectionExtension { - if p.extension == nil { - panic("extension in response does not exist") +func (p *AssignedTagsServiceAddResponse) MustTag() *Tag { + if p.tag == nil { + panic("tag in response does not exist") } - return p.extension + return p.tag } // -// Update a storage server connection extension for the given host. -// To update the storage connection `456` of host `123` send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/hosts/123/storageconnectionextensions/456 -// ---- +// Assign tag to specific entity in the system. +// For example to assign tag `mytag` to virtual machine with the id `123` send a request like this: +// .... +// POST /ovirt-engine/api/vms/123/tags +// .... // With a request body like this: // [source,xml] // ---- -// -// iqn.2016-01.com.example:mytarget -// myuser -// mypassword -// +// +// mytag +// // ---- // -func (p *StorageServerConnectionExtensionService) Update() *StorageServerConnectionExtensionServiceUpdateRequest { - return &StorageServerConnectionExtensionServiceUpdateRequest{StorageServerConnectionExtensionService: p} +func (p *AssignedTagsService) Add() *AssignedTagsServiceAddRequest { + return &AssignedTagsServiceAddRequest{AssignedTagsService: p} } // -// Service locator method, returns individual service on which the URI is dispatched. +// List all tags assigned to the specific entity. +// For example to list all the tags of the virtual machine with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/vms/123/tags +// .... +// [source,xml] +// ---- +// +// +// mytag +// mytag +// +// +// +// ---- +// The order of the returned tags isn't guaranteed. // -func (op *StorageServerConnectionExtensionService) Service(path string) (Service, error) { - if path == "" { - return op, nil +type AssignedTagsServiceListRequest struct { + AssignedTagsService *AssignedTagsService + header map[string]string + query map[string]string + follow *string + max *int64 +} + +func (p *AssignedTagsServiceListRequest) Header(key, value string) *AssignedTagsServiceListRequest { + if p.header == nil { + p.header = make(map[string]string) } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + p.header[key] = value + return p } -func (op *StorageServerConnectionExtensionService) String() string { - return fmt.Sprintf("StorageServerConnectionExtensionService:%s", op.path) +func (p *AssignedTagsServiceListRequest) Query(key, value string) *AssignedTagsServiceListRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p } -// -// This service manages image transfers, for performing Image I/O API in {product-name}. -// Please refer to <> for further -// documentation. -// -type ImageTransfersService struct { - BaseService +func (p *AssignedTagsServiceListRequest) Follow(follow string) *AssignedTagsServiceListRequest { + p.follow = &follow + return p } -func NewImageTransfersService(connection *Connection, path string) *ImageTransfersService { - var result ImageTransfersService - result.connection = connection - result.path = path - return &result -} - -// -// Add a new image transfer. An image, disk or disk snapshot needs to be specified -// in order to make a new transfer. -// IMPORTANT: The `image` attribute is deprecated since version 4.2 of the engine. -// Use the `disk` or `snapshot` attributes instead. -// *Creating a new image transfer for downloading or uploading a `disk`:* -// To create an image transfer to download or upload a disk with id `123`, -// send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/imagetransfers -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// upload|download -// -// ---- -// *Creating a new image transfer for downloading or uploading a `disk_snapshot`:* -// To create an image transfer to download or upload a `disk_snapshot` with id `456`, -// send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/imagetransfers -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// download|upload -// -// ---- -// -type ImageTransfersServiceAddRequest struct { - ImageTransfersService *ImageTransfersService - header map[string]string - query map[string]string - imageTransfer *ImageTransfer -} - -func (p *ImageTransfersServiceAddRequest) Header(key, value string) *ImageTransfersServiceAddRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value +func (p *AssignedTagsServiceListRequest) Max(max int64) *AssignedTagsServiceListRequest { + p.max = &max return p } -func (p *ImageTransfersServiceAddRequest) Query(key, value string) *ImageTransfersServiceAddRequest { - if p.query == nil { - p.query = make(map[string]string) +func (p *AssignedTagsServiceListRequest) Send() (*AssignedTagsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedTagsService.connection.URL(), p.AssignedTagsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - p.query[key] = value - return p -} -func (p *ImageTransfersServiceAddRequest) ImageTransfer(imageTransfer *ImageTransfer) *ImageTransfersServiceAddRequest { - p.imageTransfer = imageTransfer - return p -} + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } -func (p *ImageTransfersServiceAddRequest) Send() (*ImageTransfersServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ImageTransfersService.connection.URL(), p.ImageTransfersService.path) - values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -10930,19 +9418,12 @@ func (p *ImageTransfersServiceAddRequest) Send() (*ImageTransfersServiceAddRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLImageTransferWriteOne(writer, p.imageTransfer, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.ImageTransfersService.connection.headers { + for hk, hv := range p.AssignedTagsService.connection.headers { req.Header.Add(hk, hv) } @@ -10957,18 +9438,18 @@ func (p *ImageTransfersServiceAddRequest) Send() (*ImageTransfersServiceAddRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageTransfersService.connection.authenticate() + token, err := p.AssignedTagsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageTransfersService.connection.client.Do(req) + resp, err := p.AssignedTagsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageTransfersService.connection.logFunc != nil { + if p.AssignedTagsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -10977,9 +9458,9 @@ func (p *ImageTransfersServiceAddRequest) Send() (*ImageTransfersServiceAddRespo if err != nil { return nil, err } - p.ImageTransfersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedTagsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -10987,14 +9468,14 @@ func (p *ImageTransfersServiceAddRequest) Send() (*ImageTransfersServiceAddRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLImageTransferReadOne(reader, nil, "") + result, err := XMLTagReadMany(reader, nil) if err != nil { return nil, err } - return &ImageTransfersServiceAddResponse{imageTransfer: result}, nil + return &AssignedTagsServiceListResponse{tags: result}, nil } -func (p *ImageTransfersServiceAddRequest) MustSend() *ImageTransfersServiceAddResponse { +func (p *AssignedTagsServiceListRequest) MustSend() *AssignedTagsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -11003,109 +9484,111 @@ func (p *ImageTransfersServiceAddRequest) MustSend() *ImageTransfersServiceAddRe } // -// Add a new image transfer. An image, disk or disk snapshot needs to be specified -// in order to make a new transfer. -// IMPORTANT: The `image` attribute is deprecated since version 4.2 of the engine. -// Use the `disk` or `snapshot` attributes instead. -// *Creating a new image transfer for downloading or uploading a `disk`:* -// To create an image transfer to download or upload a disk with id `123`, -// send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/imagetransfers -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// upload|download -// -// ---- -// *Creating a new image transfer for downloading or uploading a `disk_snapshot`:* -// To create an image transfer to download or upload a `disk_snapshot` with id `456`, -// send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/imagetransfers -// ---- -// With a request body like this: +// List all tags assigned to the specific entity. +// For example to list all the tags of the virtual machine with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/vms/123/tags +// .... // [source,xml] // ---- -// -// -// download|upload -// +// +// +// mytag +// mytag +// +// +// // ---- +// The order of the returned tags isn't guaranteed. // -type ImageTransfersServiceAddResponse struct { - imageTransfer *ImageTransfer +type AssignedTagsServiceListResponse struct { + tags *TagSlice } -func (p *ImageTransfersServiceAddResponse) ImageTransfer() (*ImageTransfer, bool) { - if p.imageTransfer != nil { - return p.imageTransfer, true +func (p *AssignedTagsServiceListResponse) Tags() (*TagSlice, bool) { + if p.tags != nil { + return p.tags, true } return nil, false } -func (p *ImageTransfersServiceAddResponse) MustImageTransfer() *ImageTransfer { - if p.imageTransfer == nil { - panic("imageTransfer in response does not exist") +func (p *AssignedTagsServiceListResponse) MustTags() *TagSlice { + if p.tags == nil { + panic("tags in response does not exist") } - return p.imageTransfer + return p.tags } // -// Add a new image transfer. An image, disk or disk snapshot needs to be specified -// in order to make a new transfer. -// IMPORTANT: The `image` attribute is deprecated since version 4.2 of the engine. -// Use the `disk` or `snapshot` attributes instead. -// *Creating a new image transfer for downloading or uploading a `disk`:* -// To create an image transfer to download or upload a disk with id `123`, -// send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/imagetransfers -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// upload|download -// -// ---- -// *Creating a new image transfer for downloading or uploading a `disk_snapshot`:* -// To create an image transfer to download or upload a `disk_snapshot` with id `456`, -// send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/imagetransfers -// ---- -// With a request body like this: +// List all tags assigned to the specific entity. +// For example to list all the tags of the virtual machine with id `123` send a request like this: +// .... +// GET /ovirt-engine/api/vms/123/tags +// .... // [source,xml] // ---- -// -// -// download|upload -// +// +// +// mytag +// mytag +// +// +// // ---- +// The order of the returned tags isn't guaranteed. // -func (p *ImageTransfersService) Add() *ImageTransfersServiceAddRequest { - return &ImageTransfersServiceAddRequest{ImageTransfersService: p} +func (p *AssignedTagsService) List() *AssignedTagsServiceListRequest { + return &AssignedTagsServiceListRequest{AssignedTagsService: p} } // +// Reference to the service that manages assignment of specific tag. // -type ImageTransfersServiceAddForDiskRequest struct { - ImageTransfersService *ImageTransfersService - header map[string]string - query map[string]string - imageTransfer *ImageTransfer +func (op *AssignedTagsService) TagService(id string) *AssignedTagService { + return NewAssignedTagService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *ImageTransfersServiceAddForDiskRequest) Header(key, value string) *ImageTransfersServiceAddForDiskRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AssignedTagsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.TagService(path), nil + } + return op.TagService(path[:index]).Service(path[index+1:]) +} + +func (op *AssignedTagsService) String() string { + return fmt.Sprintf("AssignedTagsService:%s", op.path) +} + +// +// +type AssignedVnicProfileService struct { + BaseService +} + +func NewAssignedVnicProfileService(connection *Connection, path string) *AssignedVnicProfileService { + var result AssignedVnicProfileService + result.connection = connection + result.path = path + return &result +} + +// +// +type AssignedVnicProfileServiceGetRequest struct { + AssignedVnicProfileService *AssignedVnicProfileService + header map[string]string + query map[string]string + follow *string +} + +func (p *AssignedVnicProfileServiceGetRequest) Header(key, value string) *AssignedVnicProfileServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -11113,7 +9596,7 @@ func (p *ImageTransfersServiceAddForDiskRequest) Header(key, value string) *Imag return p } -func (p *ImageTransfersServiceAddForDiskRequest) Query(key, value string) *ImageTransfersServiceAddForDiskRequest { +func (p *AssignedVnicProfileServiceGetRequest) Query(key, value string) *AssignedVnicProfileServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -11121,20 +9604,18 @@ func (p *ImageTransfersServiceAddForDiskRequest) Query(key, value string) *Image return p } -func (p *ImageTransfersServiceAddForDiskRequest) ImageTransfer(imageTransfer *ImageTransfer) *ImageTransfersServiceAddForDiskRequest { - p.imageTransfer = imageTransfer +func (p *AssignedVnicProfileServiceGetRequest) Follow(follow string) *AssignedVnicProfileServiceGetRequest { + p.follow = &follow return p } -func (p *ImageTransfersServiceAddForDiskRequest) Send() (*ImageTransfersServiceAddForDiskResponse, error) { - rawURL := fmt.Sprintf("%s%s/fordisk", p.ImageTransfersService.connection.URL(), p.ImageTransfersService.path) - actionBuilder := NewActionBuilder() - actionBuilder.ImageTransfer(p.imageTransfer) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *AssignedVnicProfileServiceGetRequest) Send() (*AssignedVnicProfileServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedVnicProfileService.connection.URL(), p.AssignedVnicProfileService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -11143,16 +9624,12 @@ func (p *ImageTransfersServiceAddForDiskRequest) Send() (*ImageTransfersServiceA if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.ImageTransfersService.connection.headers { + for hk, hv := range p.AssignedVnicProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -11167,18 +9644,18 @@ func (p *ImageTransfersServiceAddForDiskRequest) Send() (*ImageTransfersServiceA req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageTransfersService.connection.authenticate() + token, err := p.AssignedVnicProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageTransfersService.connection.client.Do(req) + resp, err := p.AssignedVnicProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageTransfersService.connection.logFunc != nil { + if p.AssignedVnicProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -11187,17 +9664,24 @@ func (p *ImageTransfersServiceAddForDiskRequest) Send() (*ImageTransfersServiceA if err != nil { return nil, err } - p.ImageTransfersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedVnicProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustImageTransfer() - return &ImageTransfersServiceAddForDiskResponse{imageTransfer: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLVnicProfileReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &AssignedVnicProfileServiceGetResponse{profile: result}, nil } -func (p *ImageTransfersServiceAddForDiskRequest) MustSend() *ImageTransfersServiceAddForDiskResponse { +func (p *AssignedVnicProfileServiceGetRequest) MustSend() *AssignedVnicProfileServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -11207,40 +9691,40 @@ func (p *ImageTransfersServiceAddForDiskRequest) MustSend() *ImageTransfersServi // // -type ImageTransfersServiceAddForDiskResponse struct { - imageTransfer *ImageTransfer +type AssignedVnicProfileServiceGetResponse struct { + profile *VnicProfile } -func (p *ImageTransfersServiceAddForDiskResponse) ImageTransfer() (*ImageTransfer, bool) { - if p.imageTransfer != nil { - return p.imageTransfer, true +func (p *AssignedVnicProfileServiceGetResponse) Profile() (*VnicProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *ImageTransfersServiceAddForDiskResponse) MustImageTransfer() *ImageTransfer { - if p.imageTransfer == nil { - panic("imageTransfer in response does not exist") +func (p *AssignedVnicProfileServiceGetResponse) MustProfile() *VnicProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.imageTransfer + return p.profile } // // -func (p *ImageTransfersService) AddForDisk() *ImageTransfersServiceAddForDiskRequest { - return &ImageTransfersServiceAddForDiskRequest{ImageTransfersService: p} +func (p *AssignedVnicProfileService) Get() *AssignedVnicProfileServiceGetRequest { + return &AssignedVnicProfileServiceGetRequest{AssignedVnicProfileService: p} } // // -type ImageTransfersServiceAddForImageRequest struct { - ImageTransfersService *ImageTransfersService - header map[string]string - query map[string]string - imageTransfer *ImageTransfer +type AssignedVnicProfileServiceRemoveRequest struct { + AssignedVnicProfileService *AssignedVnicProfileService + header map[string]string + query map[string]string + async *bool } -func (p *ImageTransfersServiceAddForImageRequest) Header(key, value string) *ImageTransfersServiceAddForImageRequest { +func (p *AssignedVnicProfileServiceRemoveRequest) Header(key, value string) *AssignedVnicProfileServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -11248,7 +9732,7 @@ func (p *ImageTransfersServiceAddForImageRequest) Header(key, value string) *Ima return p } -func (p *ImageTransfersServiceAddForImageRequest) Query(key, value string) *ImageTransfersServiceAddForImageRequest { +func (p *AssignedVnicProfileServiceRemoveRequest) Query(key, value string) *AssignedVnicProfileServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -11256,20 +9740,18 @@ func (p *ImageTransfersServiceAddForImageRequest) Query(key, value string) *Imag return p } -func (p *ImageTransfersServiceAddForImageRequest) ImageTransfer(imageTransfer *ImageTransfer) *ImageTransfersServiceAddForImageRequest { - p.imageTransfer = imageTransfer +func (p *AssignedVnicProfileServiceRemoveRequest) Async(async bool) *AssignedVnicProfileServiceRemoveRequest { + p.async = &async return p } -func (p *ImageTransfersServiceAddForImageRequest) Send() (*ImageTransfersServiceAddForImageResponse, error) { - rawURL := fmt.Sprintf("%s%s/forimage", p.ImageTransfersService.connection.URL(), p.ImageTransfersService.path) - actionBuilder := NewActionBuilder() - actionBuilder.ImageTransfer(p.imageTransfer) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *AssignedVnicProfileServiceRemoveRequest) Send() (*AssignedVnicProfileServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedVnicProfileService.connection.URL(), p.AssignedVnicProfileService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -11278,16 +9760,12 @@ func (p *ImageTransfersServiceAddForImageRequest) Send() (*ImageTransfersService if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.ImageTransfersService.connection.headers { + for hk, hv := range p.AssignedVnicProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -11302,18 +9780,18 @@ func (p *ImageTransfersServiceAddForImageRequest) Send() (*ImageTransfersService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageTransfersService.connection.authenticate() + token, err := p.AssignedVnicProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageTransfersService.connection.client.Do(req) + resp, err := p.AssignedVnicProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageTransfersService.connection.logFunc != nil { + if p.AssignedVnicProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -11322,17 +9800,19 @@ func (p *ImageTransfersServiceAddForImageRequest) Send() (*ImageTransfersService if err != nil { return nil, err } - p.ImageTransfersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedVnicProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustImageTransfer() - return &ImageTransfersServiceAddForImageResponse{imageTransfer: result}, nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(AssignedVnicProfileServiceRemoveResponse), nil } -func (p *ImageTransfersServiceAddForImageRequest) MustSend() *ImageTransfersServiceAddForImageResponse { +func (p *AssignedVnicProfileServiceRemoveRequest) MustSend() *AssignedVnicProfileServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -11342,40 +9822,65 @@ func (p *ImageTransfersServiceAddForImageRequest) MustSend() *ImageTransfersServ // // -type ImageTransfersServiceAddForImageResponse struct { - imageTransfer *ImageTransfer +type AssignedVnicProfileServiceRemoveResponse struct { } -func (p *ImageTransfersServiceAddForImageResponse) ImageTransfer() (*ImageTransfer, bool) { - if p.imageTransfer != nil { - return p.imageTransfer, true - } - return nil, false +// +// +func (p *AssignedVnicProfileService) Remove() *AssignedVnicProfileServiceRemoveRequest { + return &AssignedVnicProfileServiceRemoveRequest{AssignedVnicProfileService: p} } -func (p *ImageTransfersServiceAddForImageResponse) MustImageTransfer() *ImageTransfer { - if p.imageTransfer == nil { - panic("imageTransfer in response does not exist") +// +// +func (op *AssignedVnicProfileService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AssignedVnicProfileService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - return p.imageTransfer + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *AssignedVnicProfileService) String() string { + return fmt.Sprintf("AssignedVnicProfileService:%s", op.path) } // // -func (p *ImageTransfersService) AddForImage() *ImageTransfersServiceAddForImageRequest { - return &ImageTransfersServiceAddForImageRequest{ImageTransfersService: p} +type AssignedVnicProfilesService struct { + BaseService +} + +func NewAssignedVnicProfilesService(connection *Connection, path string) *AssignedVnicProfilesService { + var result AssignedVnicProfilesService + result.connection = connection + result.path = path + return &result } // +// Add a new virtual network interface card profile for the network. // -type ImageTransfersServiceAddForSnapshotRequest struct { - ImageTransfersService *ImageTransfersService - header map[string]string - query map[string]string - imageTransfer *ImageTransfer +type AssignedVnicProfilesServiceAddRequest struct { + AssignedVnicProfilesService *AssignedVnicProfilesService + header map[string]string + query map[string]string + profile *VnicProfile } -func (p *ImageTransfersServiceAddForSnapshotRequest) Header(key, value string) *ImageTransfersServiceAddForSnapshotRequest { +func (p *AssignedVnicProfilesServiceAddRequest) Header(key, value string) *AssignedVnicProfilesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -11383,7 +9888,7 @@ func (p *ImageTransfersServiceAddForSnapshotRequest) Header(key, value string) * return p } -func (p *ImageTransfersServiceAddForSnapshotRequest) Query(key, value string) *ImageTransfersServiceAddForSnapshotRequest { +func (p *AssignedVnicProfilesServiceAddRequest) Query(key, value string) *AssignedVnicProfilesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -11391,19 +9896,13 @@ func (p *ImageTransfersServiceAddForSnapshotRequest) Query(key, value string) *I return p } -func (p *ImageTransfersServiceAddForSnapshotRequest) ImageTransfer(imageTransfer *ImageTransfer) *ImageTransfersServiceAddForSnapshotRequest { - p.imageTransfer = imageTransfer +func (p *AssignedVnicProfilesServiceAddRequest) Profile(profile *VnicProfile) *AssignedVnicProfilesServiceAddRequest { + p.profile = profile return p } -func (p *ImageTransfersServiceAddForSnapshotRequest) Send() (*ImageTransfersServiceAddForSnapshotResponse, error) { - rawURL := fmt.Sprintf("%s%s/forsnapshot", p.ImageTransfersService.connection.URL(), p.ImageTransfersService.path) - actionBuilder := NewActionBuilder() - actionBuilder.ImageTransfer(p.imageTransfer) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedVnicProfilesService.connection.URL(), p.AssignedVnicProfilesService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -11415,14 +9914,17 @@ func (p *ImageTransfersServiceAddForSnapshotRequest) Send() (*ImageTransfersServ } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLVnicProfileWriteOne(writer, p.profile, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ImageTransfersService.connection.headers { + for hk, hv := range p.AssignedVnicProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -11437,18 +9939,18 @@ func (p *ImageTransfersServiceAddForSnapshotRequest) Send() (*ImageTransfersServ req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageTransfersService.connection.authenticate() + token, err := p.AssignedVnicProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageTransfersService.connection.client.Do(req) + resp, err := p.AssignedVnicProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageTransfersService.connection.logFunc != nil { + if p.AssignedVnicProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -11457,63 +9959,72 @@ func (p *ImageTransfersServiceAddForSnapshotRequest) Send() (*ImageTransfersServ if err != nil { return nil, err } - p.ImageTransfersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedVnicProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - result := action.MustImageTransfer() - return &ImageTransfersServiceAddForSnapshotResponse{imageTransfer: result}, nil -} - -func (p *ImageTransfersServiceAddForSnapshotRequest) MustSend() *ImageTransfersServiceAddForSnapshotResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLVnicProfileReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &AssignedVnicProfilesServiceAddResponse{profile: result}, nil +} + +func (p *AssignedVnicProfilesServiceAddRequest) MustSend() *AssignedVnicProfilesServiceAddResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v } } // +// Add a new virtual network interface card profile for the network. // -type ImageTransfersServiceAddForSnapshotResponse struct { - imageTransfer *ImageTransfer +type AssignedVnicProfilesServiceAddResponse struct { + profile *VnicProfile } -func (p *ImageTransfersServiceAddForSnapshotResponse) ImageTransfer() (*ImageTransfer, bool) { - if p.imageTransfer != nil { - return p.imageTransfer, true +func (p *AssignedVnicProfilesServiceAddResponse) Profile() (*VnicProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *ImageTransfersServiceAddForSnapshotResponse) MustImageTransfer() *ImageTransfer { - if p.imageTransfer == nil { - panic("imageTransfer in response does not exist") +func (p *AssignedVnicProfilesServiceAddResponse) MustProfile() *VnicProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.imageTransfer + return p.profile } // +// Add a new virtual network interface card profile for the network. // -func (p *ImageTransfersService) AddForSnapshot() *ImageTransfersServiceAddForSnapshotRequest { - return &ImageTransfersServiceAddForSnapshotRequest{ImageTransfersService: p} +func (p *AssignedVnicProfilesService) Add() *AssignedVnicProfilesServiceAddRequest { + return &AssignedVnicProfilesServiceAddRequest{AssignedVnicProfilesService: p} } // -// Retrieves the list of image transfers that are currently -// being performed. -// The order of the returned list of image transfers is not guaranteed. +// Returns the list of VNIC profiles assifned to the network. +// The order of the returned VNIC profiles isn't guaranteed. // -type ImageTransfersServiceListRequest struct { - ImageTransfersService *ImageTransfersService - header map[string]string - query map[string]string - follow *string +type AssignedVnicProfilesServiceListRequest struct { + AssignedVnicProfilesService *AssignedVnicProfilesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *ImageTransfersServiceListRequest) Header(key, value string) *ImageTransfersServiceListRequest { +func (p *AssignedVnicProfilesServiceListRequest) Header(key, value string) *AssignedVnicProfilesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -11521,7 +10032,7 @@ func (p *ImageTransfersServiceListRequest) Header(key, value string) *ImageTrans return p } -func (p *ImageTransfersServiceListRequest) Query(key, value string) *ImageTransfersServiceListRequest { +func (p *AssignedVnicProfilesServiceListRequest) Query(key, value string) *AssignedVnicProfilesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -11529,18 +10040,27 @@ func (p *ImageTransfersServiceListRequest) Query(key, value string) *ImageTransf return p } -func (p *ImageTransfersServiceListRequest) Follow(follow string) *ImageTransfersServiceListRequest { +func (p *AssignedVnicProfilesServiceListRequest) Follow(follow string) *AssignedVnicProfilesServiceListRequest { p.follow = &follow return p } -func (p *ImageTransfersServiceListRequest) Send() (*ImageTransfersServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ImageTransfersService.connection.URL(), p.ImageTransfersService.path) +func (p *AssignedVnicProfilesServiceListRequest) Max(max int64) *AssignedVnicProfilesServiceListRequest { + p.max = &max + return p +} + +func (p *AssignedVnicProfilesServiceListRequest) Send() (*AssignedVnicProfilesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AssignedVnicProfilesService.connection.URL(), p.AssignedVnicProfilesService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -11554,7 +10074,7 @@ func (p *ImageTransfersServiceListRequest) Send() (*ImageTransfersServiceListRes return nil, err } - for hk, hv := range p.ImageTransfersService.connection.headers { + for hk, hv := range p.AssignedVnicProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -11569,18 +10089,18 @@ func (p *ImageTransfersServiceListRequest) Send() (*ImageTransfersServiceListRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageTransfersService.connection.authenticate() + token, err := p.AssignedVnicProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageTransfersService.connection.client.Do(req) + resp, err := p.AssignedVnicProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageTransfersService.connection.logFunc != nil { + if p.AssignedVnicProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -11589,7 +10109,7 @@ func (p *ImageTransfersServiceListRequest) Send() (*ImageTransfersServiceListRes if err != nil { return nil, err } - p.ImageTransfersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AssignedVnicProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -11599,14 +10119,14 @@ func (p *ImageTransfersServiceListRequest) Send() (*ImageTransfersServiceListRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLImageTransferReadMany(reader, nil) + result, err := XMLVnicProfileReadMany(reader, nil) if err != nil { return nil, err } - return &ImageTransfersServiceListResponse{imageTransfer: result}, nil + return &AssignedVnicProfilesServiceListResponse{profiles: result}, nil } -func (p *ImageTransfersServiceListRequest) MustSend() *ImageTransfersServiceListResponse { +func (p *AssignedVnicProfilesServiceListRequest) MustSend() *AssignedVnicProfilesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -11615,101 +10135,92 @@ func (p *ImageTransfersServiceListRequest) MustSend() *ImageTransfersServiceList } // -// Retrieves the list of image transfers that are currently -// being performed. -// The order of the returned list of image transfers is not guaranteed. +// Returns the list of VNIC profiles assifned to the network. +// The order of the returned VNIC profiles isn't guaranteed. // -type ImageTransfersServiceListResponse struct { - imageTransfer *ImageTransferSlice +type AssignedVnicProfilesServiceListResponse struct { + profiles *VnicProfileSlice } -func (p *ImageTransfersServiceListResponse) ImageTransfer() (*ImageTransferSlice, bool) { - if p.imageTransfer != nil { - return p.imageTransfer, true +func (p *AssignedVnicProfilesServiceListResponse) Profiles() (*VnicProfileSlice, bool) { + if p.profiles != nil { + return p.profiles, true } return nil, false } -func (p *ImageTransfersServiceListResponse) MustImageTransfer() *ImageTransferSlice { - if p.imageTransfer == nil { - panic("imageTransfer in response does not exist") +func (p *AssignedVnicProfilesServiceListResponse) MustProfiles() *VnicProfileSlice { + if p.profiles == nil { + panic("profiles in response does not exist") } - return p.imageTransfer + return p.profiles } // -// Retrieves the list of image transfers that are currently -// being performed. -// The order of the returned list of image transfers is not guaranteed. +// Returns the list of VNIC profiles assifned to the network. +// The order of the returned VNIC profiles isn't guaranteed. // -func (p *ImageTransfersService) List() *ImageTransfersServiceListRequest { - return &ImageTransfersServiceListRequest{ImageTransfersService: p} +func (p *AssignedVnicProfilesService) List() *AssignedVnicProfilesServiceListRequest { + return &AssignedVnicProfilesServiceListRequest{AssignedVnicProfilesService: p} } // -// Returns a reference to the service that manages an -// specific image transfer. // -func (op *ImageTransfersService) ImageTransferService(id string) *ImageTransferService { - return NewImageTransferService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AssignedVnicProfilesService) ProfileService(id string) *AssignedVnicProfileService { + return NewAssignedVnicProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ImageTransfersService) Service(path string) (Service, error) { +func (op *AssignedVnicProfilesService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.ImageTransferService(path), nil + return op.ProfileService(path), nil } - return op.ImageTransferService(path[:index]).Service(path[index+1:]) + return op.ProfileService(path[:index]).Service(path[index+1:]) } -func (op *ImageTransfersService) String() string { - return fmt.Sprintf("ImageTransfersService:%s", op.path) +func (op *AssignedVnicProfilesService) String() string { + return fmt.Sprintf("AssignedVnicProfilesService:%s", op.path) } // -// A service to manage a specific permit of the role. +// Manages a single disk available in a storage domain attached to a data center. +// IMPORTANT: Since version 4.2 of the engine this service is intended only to list disks available in the storage +// domain, and to register unregistered disks. All the other operations, like copying a disk, moving a disk, etc, have +// been deprecated and will be removed in the future. To perform those operations use the <>, or the <>. // -type PermitService struct { +type AttachedStorageDomainDiskService struct { BaseService } -func NewPermitService(connection *Connection, path string) *PermitService { - var result PermitService +func NewAttachedStorageDomainDiskService(connection *Connection, path string) *AttachedStorageDomainDiskService { + var result AttachedStorageDomainDiskService result.connection = connection result.path = path return &result } // -// Gets the information about the permit of the role. -// For example to retrieve the information about the permit with the id `456` of the role with the id `123` -// send a request like this: -// .... -// GET /ovirt-engine/api/roles/123/permits/456 -// .... -// [source,xml] -// ---- -// -// change_vm_cd -// false -// -// -// ---- +// Copies a disk to the specified storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To copy a disk use the <> +// operation of the service that manages that disk. // -type PermitServiceGetRequest struct { - PermitService *PermitService - header map[string]string - query map[string]string - follow *string +type AttachedStorageDomainDiskServiceCopyRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string + disk *Disk + storageDomain *StorageDomain } -func (p *PermitServiceGetRequest) Header(key, value string) *PermitServiceGetRequest { +func (p *AttachedStorageDomainDiskServiceCopyRequest) Header(key, value string) *AttachedStorageDomainDiskServiceCopyRequest { if p.header == nil { p.header = make(map[string]string) } @@ -11717,7 +10228,7 @@ func (p *PermitServiceGetRequest) Header(key, value string) *PermitServiceGetReq return p } -func (p *PermitServiceGetRequest) Query(key, value string) *PermitServiceGetRequest { +func (p *AttachedStorageDomainDiskServiceCopyRequest) Query(key, value string) *AttachedStorageDomainDiskServiceCopyRequest { if p.query == nil { p.query = make(map[string]string) } @@ -11725,18 +10236,26 @@ func (p *PermitServiceGetRequest) Query(key, value string) *PermitServiceGetRequ return p } -func (p *PermitServiceGetRequest) Follow(follow string) *PermitServiceGetRequest { - p.follow = &follow +func (p *AttachedStorageDomainDiskServiceCopyRequest) Disk(disk *Disk) *AttachedStorageDomainDiskServiceCopyRequest { + p.disk = disk return p } -func (p *PermitServiceGetRequest) Send() (*PermitServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.PermitService.connection.URL(), p.PermitService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *AttachedStorageDomainDiskServiceCopyRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainDiskServiceCopyRequest { + p.storageDomain = storageDomain + return p +} +func (p *AttachedStorageDomainDiskServiceCopyRequest) Send() (*AttachedStorageDomainDiskServiceCopyResponse, error) { + rawURL := fmt.Sprintf("%s%s/copy", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Disk(p.disk) + actionBuilder.StorageDomain(p.storageDomain) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -11745,12 +10264,16 @@ func (p *PermitServiceGetRequest) Send() (*PermitServiceGetResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.PermitService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -11765,18 +10288,18 @@ func (p *PermitServiceGetRequest) Send() (*PermitServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.PermitService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.PermitService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.PermitService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -11785,24 +10308,16 @@ func (p *PermitServiceGetRequest) Send() (*PermitServiceGetResponse, error) { if err != nil { return nil, err } - p.PermitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLPermitReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &PermitServiceGetResponse{permit: result}, nil + return new(AttachedStorageDomainDiskServiceCopyResponse), nil } -func (p *PermitServiceGetRequest) MustSend() *PermitServiceGetResponse { +func (p *AttachedStorageDomainDiskServiceCopyRequest) MustSend() *AttachedStorageDomainDiskServiceCopyResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -11811,74 +10326,38 @@ func (p *PermitServiceGetRequest) MustSend() *PermitServiceGetResponse { } // -// Gets the information about the permit of the role. -// For example to retrieve the information about the permit with the id `456` of the role with the id `123` -// send a request like this: -// .... -// GET /ovirt-engine/api/roles/123/permits/456 -// .... -// [source,xml] -// ---- -// -// change_vm_cd -// false -// -// -// ---- +// Copies a disk to the specified storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To copy a disk use the <> +// operation of the service that manages that disk. // -type PermitServiceGetResponse struct { - permit *Permit -} - -func (p *PermitServiceGetResponse) Permit() (*Permit, bool) { - if p.permit != nil { - return p.permit, true - } - return nil, false -} - -func (p *PermitServiceGetResponse) MustPermit() *Permit { - if p.permit == nil { - panic("permit in response does not exist") - } - return p.permit +type AttachedStorageDomainDiskServiceCopyResponse struct { } // -// Gets the information about the permit of the role. -// For example to retrieve the information about the permit with the id `456` of the role with the id `123` -// send a request like this: -// .... -// GET /ovirt-engine/api/roles/123/permits/456 -// .... -// [source,xml] -// ---- -// -// change_vm_cd -// false -// -// -// ---- +// Copies a disk to the specified storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To copy a disk use the <> +// operation of the service that manages that disk. // -func (p *PermitService) Get() *PermitServiceGetRequest { - return &PermitServiceGetRequest{PermitService: p} +func (p *AttachedStorageDomainDiskService) Copy() *AttachedStorageDomainDiskServiceCopyRequest { + return &AttachedStorageDomainDiskServiceCopyRequest{AttachedStorageDomainDiskService: p} } // -// Removes the permit from the role. -// For example to remove the permit with id `456` from the role with id `123` send a request like this: -// .... -// DELETE /ovirt-engine/api/roles/123/permits/456 -// .... +// Exports a disk to an export storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To export a disk use the <> +// operation of the service that manages that disk. // -type PermitServiceRemoveRequest struct { - PermitService *PermitService - header map[string]string - query map[string]string - async *bool +type AttachedStorageDomainDiskServiceExportRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string + storageDomain *StorageDomain } -func (p *PermitServiceRemoveRequest) Header(key, value string) *PermitServiceRemoveRequest { +func (p *AttachedStorageDomainDiskServiceExportRequest) Header(key, value string) *AttachedStorageDomainDiskServiceExportRequest { if p.header == nil { p.header = make(map[string]string) } @@ -11886,7 +10365,7 @@ func (p *PermitServiceRemoveRequest) Header(key, value string) *PermitServiceRem return p } -func (p *PermitServiceRemoveRequest) Query(key, value string) *PermitServiceRemoveRequest { +func (p *AttachedStorageDomainDiskServiceExportRequest) Query(key, value string) *AttachedStorageDomainDiskServiceExportRequest { if p.query == nil { p.query = make(map[string]string) } @@ -11894,18 +10373,20 @@ func (p *PermitServiceRemoveRequest) Query(key, value string) *PermitServiceRemo return p } -func (p *PermitServiceRemoveRequest) Async(async bool) *PermitServiceRemoveRequest { - p.async = &async +func (p *AttachedStorageDomainDiskServiceExportRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainDiskServiceExportRequest { + p.storageDomain = storageDomain return p } -func (p *PermitServiceRemoveRequest) Send() (*PermitServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.PermitService.connection.URL(), p.PermitService.path) - values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} +func (p *AttachedStorageDomainDiskServiceExportRequest) Send() (*AttachedStorageDomainDiskServiceExportResponse, error) { + rawURL := fmt.Sprintf("%s%s/export", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) + actionBuilder := NewActionBuilder() + actionBuilder.StorageDomain(p.storageDomain) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -11914,12 +10395,16 @@ func (p *PermitServiceRemoveRequest) Send() (*PermitServiceRemoveResponse, error if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.PermitService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -11934,18 +10419,18 @@ func (p *PermitServiceRemoveRequest) Send() (*PermitServiceRemoveResponse, error req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.PermitService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.PermitService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.PermitService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -11954,19 +10439,16 @@ func (p *PermitServiceRemoveRequest) Send() (*PermitServiceRemoveResponse, error if err != nil { return nil, err } - p.PermitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(PermitServiceRemoveResponse), nil + return new(AttachedStorageDomainDiskServiceExportResponse), nil } -func (p *PermitServiceRemoveRequest) MustSend() *PermitServiceRemoveResponse { +func (p *AttachedStorageDomainDiskServiceExportRequest) MustSend() *AttachedStorageDomainDiskServiceExportResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -11975,64 +10457,35 @@ func (p *PermitServiceRemoveRequest) MustSend() *PermitServiceRemoveResponse { } // -// Removes the permit from the role. -// For example to remove the permit with id `456` from the role with id `123` send a request like this: -// .... -// DELETE /ovirt-engine/api/roles/123/permits/456 -// .... -// -type PermitServiceRemoveResponse struct { -} - -// -// Removes the permit from the role. -// For example to remove the permit with id `456` from the role with id `123` send a request like this: -// .... -// DELETE /ovirt-engine/api/roles/123/permits/456 -// .... -// -func (p *PermitService) Remove() *PermitServiceRemoveRequest { - return &PermitServiceRemoveRequest{PermitService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Exports a disk to an export storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To export a disk use the <> +// operation of the service that manages that disk. // -func (op *PermitService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *PermitService) String() string { - return fmt.Sprintf("PermitService:%s", op.path) +type AttachedStorageDomainDiskServiceExportResponse struct { } // +// Exports a disk to an export storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To export a disk use the <> +// operation of the service that manages that disk. // -type AssignedDiskProfilesService struct { - BaseService -} - -func NewAssignedDiskProfilesService(connection *Connection, path string) *AssignedDiskProfilesService { - var result AssignedDiskProfilesService - result.connection = connection - result.path = path - return &result +func (p *AttachedStorageDomainDiskService) Export() *AttachedStorageDomainDiskServiceExportRequest { + return &AttachedStorageDomainDiskServiceExportRequest{AttachedStorageDomainDiskService: p} } // -// Add a new disk profile for the storage domain. +// Retrieves the description of the disk. // -type AssignedDiskProfilesServiceAddRequest struct { - AssignedDiskProfilesService *AssignedDiskProfilesService - header map[string]string - query map[string]string - profile *DiskProfile +type AttachedStorageDomainDiskServiceGetRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string + follow *string } -func (p *AssignedDiskProfilesServiceAddRequest) Header(key, value string) *AssignedDiskProfilesServiceAddRequest { +func (p *AttachedStorageDomainDiskServiceGetRequest) Header(key, value string) *AttachedStorageDomainDiskServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -12040,7 +10493,7 @@ func (p *AssignedDiskProfilesServiceAddRequest) Header(key, value string) *Assig return p } -func (p *AssignedDiskProfilesServiceAddRequest) Query(key, value string) *AssignedDiskProfilesServiceAddRequest { +func (p *AttachedStorageDomainDiskServiceGetRequest) Query(key, value string) *AttachedStorageDomainDiskServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -12048,14 +10501,18 @@ func (p *AssignedDiskProfilesServiceAddRequest) Query(key, value string) *Assign return p } -func (p *AssignedDiskProfilesServiceAddRequest) Profile(profile *DiskProfile) *AssignedDiskProfilesServiceAddRequest { - p.profile = profile +func (p *AttachedStorageDomainDiskServiceGetRequest) Follow(follow string) *AttachedStorageDomainDiskServiceGetRequest { + p.follow = &follow return p } -func (p *AssignedDiskProfilesServiceAddRequest) Send() (*AssignedDiskProfilesServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedDiskProfilesService.connection.URL(), p.AssignedDiskProfilesService.path) +func (p *AttachedStorageDomainDiskServiceGetRequest) Send() (*AttachedStorageDomainDiskServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -12064,19 +10521,12 @@ func (p *AssignedDiskProfilesServiceAddRequest) Send() (*AssignedDiskProfilesSer if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLDiskProfileWriteOne(writer, p.profile, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.AssignedDiskProfilesService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -12091,18 +10541,18 @@ func (p *AssignedDiskProfilesServiceAddRequest) Send() (*AssignedDiskProfilesSer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedDiskProfilesService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedDiskProfilesService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedDiskProfilesService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12111,9 +10561,9 @@ func (p *AssignedDiskProfilesServiceAddRequest) Send() (*AssignedDiskProfilesSer if err != nil { return nil, err } - p.AssignedDiskProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -12121,14 +10571,14 @@ func (p *AssignedDiskProfilesServiceAddRequest) Send() (*AssignedDiskProfilesSer return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskProfileReadOne(reader, nil, "") + result, err := XMLDiskReadOne(reader, nil, "") if err != nil { return nil, err } - return &AssignedDiskProfilesServiceAddResponse{profile: result}, nil + return &AttachedStorageDomainDiskServiceGetResponse{disk: result}, nil } -func (p *AssignedDiskProfilesServiceAddRequest) MustSend() *AssignedDiskProfilesServiceAddResponse { +func (p *AttachedStorageDomainDiskServiceGetRequest) MustSend() *AttachedStorageDomainDiskServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12137,46 +10587,49 @@ func (p *AssignedDiskProfilesServiceAddRequest) MustSend() *AssignedDiskProfiles } // -// Add a new disk profile for the storage domain. +// Retrieves the description of the disk. // -type AssignedDiskProfilesServiceAddResponse struct { - profile *DiskProfile +type AttachedStorageDomainDiskServiceGetResponse struct { + disk *Disk } -func (p *AssignedDiskProfilesServiceAddResponse) Profile() (*DiskProfile, bool) { - if p.profile != nil { - return p.profile, true +func (p *AttachedStorageDomainDiskServiceGetResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true } return nil, false } -func (p *AssignedDiskProfilesServiceAddResponse) MustProfile() *DiskProfile { - if p.profile == nil { - panic("profile in response does not exist") +func (p *AttachedStorageDomainDiskServiceGetResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") } - return p.profile + return p.disk } // -// Add a new disk profile for the storage domain. +// Retrieves the description of the disk. // -func (p *AssignedDiskProfilesService) Add() *AssignedDiskProfilesServiceAddRequest { - return &AssignedDiskProfilesServiceAddRequest{AssignedDiskProfilesService: p} +func (p *AttachedStorageDomainDiskService) Get() *AttachedStorageDomainDiskServiceGetRequest { + return &AttachedStorageDomainDiskServiceGetRequest{AttachedStorageDomainDiskService: p} } // -// Returns the list of disk profiles assigned to the storage domain. -// The order of the returned disk profiles isn't guaranteed. +// Moves a disk to another storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To move a disk use the <> +// operation of the service that manages that disk. // -type AssignedDiskProfilesServiceListRequest struct { - AssignedDiskProfilesService *AssignedDiskProfilesService - header map[string]string - query map[string]string - follow *string - max *int64 +type AttachedStorageDomainDiskServiceMoveRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string + async *bool + filter *bool + storageDomain *StorageDomain } -func (p *AssignedDiskProfilesServiceListRequest) Header(key, value string) *AssignedDiskProfilesServiceListRequest { +func (p *AttachedStorageDomainDiskServiceMoveRequest) Header(key, value string) *AttachedStorageDomainDiskServiceMoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -12184,7 +10637,7 @@ func (p *AssignedDiskProfilesServiceListRequest) Header(key, value string) *Assi return p } -func (p *AssignedDiskProfilesServiceListRequest) Query(key, value string) *AssignedDiskProfilesServiceListRequest { +func (p *AttachedStorageDomainDiskServiceMoveRequest) Query(key, value string) *AttachedStorageDomainDiskServiceMoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -12192,27 +10645,36 @@ func (p *AssignedDiskProfilesServiceListRequest) Query(key, value string) *Assig return p } -func (p *AssignedDiskProfilesServiceListRequest) Follow(follow string) *AssignedDiskProfilesServiceListRequest { - p.follow = &follow +func (p *AttachedStorageDomainDiskServiceMoveRequest) Async(async bool) *AttachedStorageDomainDiskServiceMoveRequest { + p.async = &async return p } -func (p *AssignedDiskProfilesServiceListRequest) Max(max int64) *AssignedDiskProfilesServiceListRequest { - p.max = &max +func (p *AttachedStorageDomainDiskServiceMoveRequest) Filter(filter bool) *AttachedStorageDomainDiskServiceMoveRequest { + p.filter = &filter return p } -func (p *AssignedDiskProfilesServiceListRequest) Send() (*AssignedDiskProfilesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedDiskProfilesService.connection.URL(), p.AssignedDiskProfilesService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *AttachedStorageDomainDiskServiceMoveRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainDiskServiceMoveRequest { + p.storageDomain = storageDomain + return p +} - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} +func (p *AttachedStorageDomainDiskServiceMoveRequest) Send() (*AttachedStorageDomainDiskServiceMoveResponse, error) { + rawURL := fmt.Sprintf("%s%s/move", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - + if p.filter != nil { + actionBuilder.Filter(*p.filter) + } + actionBuilder.StorageDomain(p.storageDomain) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -12221,12 +10683,16 @@ func (p *AssignedDiskProfilesServiceListRequest) Send() (*AssignedDiskProfilesSe if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AssignedDiskProfilesService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -12241,18 +10707,18 @@ func (p *AssignedDiskProfilesServiceListRequest) Send() (*AssignedDiskProfilesSe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedDiskProfilesService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedDiskProfilesService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedDiskProfilesService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12261,24 +10727,16 @@ func (p *AssignedDiskProfilesServiceListRequest) Send() (*AssignedDiskProfilesSe if err != nil { return nil, err } - p.AssignedDiskProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskProfileReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &AssignedDiskProfilesServiceListResponse{profiles: result}, nil + return new(AttachedStorageDomainDiskServiceMoveResponse), nil } -func (p *AssignedDiskProfilesServiceListRequest) MustSend() *AssignedDiskProfilesServiceListResponse { +func (p *AttachedStorageDomainDiskServiceMoveRequest) MustSend() *AttachedStorageDomainDiskServiceMoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12287,84 +10745,34 @@ func (p *AssignedDiskProfilesServiceListRequest) MustSend() *AssignedDiskProfile } // -// Returns the list of disk profiles assigned to the storage domain. -// The order of the returned disk profiles isn't guaranteed. -// -type AssignedDiskProfilesServiceListResponse struct { - profiles *DiskProfileSlice -} - -func (p *AssignedDiskProfilesServiceListResponse) Profiles() (*DiskProfileSlice, bool) { - if p.profiles != nil { - return p.profiles, true - } - return nil, false -} - -func (p *AssignedDiskProfilesServiceListResponse) MustProfiles() *DiskProfileSlice { - if p.profiles == nil { - panic("profiles in response does not exist") - } - return p.profiles -} - -// -// Returns the list of disk profiles assigned to the storage domain. -// The order of the returned disk profiles isn't guaranteed. -// -func (p *AssignedDiskProfilesService) List() *AssignedDiskProfilesServiceListRequest { - return &AssignedDiskProfilesServiceListRequest{AssignedDiskProfilesService: p} -} - -// -// -func (op *AssignedDiskProfilesService) ProfileService(id string) *AssignedDiskProfileService { - return NewAssignedDiskProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Moves a disk to another storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To move a disk use the <> +// operation of the service that manages that disk. // -func (op *AssignedDiskProfilesService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.ProfileService(path), nil - } - return op.ProfileService(path[:index]).Service(path[index+1:]) -} - -func (op *AssignedDiskProfilesService) String() string { - return fmt.Sprintf("AssignedDiskProfilesService:%s", op.path) +type AttachedStorageDomainDiskServiceMoveResponse struct { } // +// Moves a disk to another storage domain. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To move a disk use the <> +// operation of the service that manages that disk. // -type GlusterHookService struct { - BaseService -} - -func NewGlusterHookService(connection *Connection, path string) *GlusterHookService { - var result GlusterHookService - result.connection = connection - result.path = path - return &result +func (p *AttachedStorageDomainDiskService) Move() *AttachedStorageDomainDiskServiceMoveRequest { + return &AttachedStorageDomainDiskServiceMoveRequest{AttachedStorageDomainDiskService: p} } // -// Resolves status conflict of hook among servers in cluster by disabling Gluster hook in all servers of the -// cluster. This updates the hook status to `DISABLED` in database. +// Registers an unregistered disk. // -type GlusterHookServiceDisableRequest struct { - GlusterHookService *GlusterHookService - header map[string]string - query map[string]string - async *bool +type AttachedStorageDomainDiskServiceRegisterRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string } -func (p *GlusterHookServiceDisableRequest) Header(key, value string) *GlusterHookServiceDisableRequest { +func (p *AttachedStorageDomainDiskServiceRegisterRequest) Header(key, value string) *AttachedStorageDomainDiskServiceRegisterRequest { if p.header == nil { p.header = make(map[string]string) } @@ -12372,7 +10780,7 @@ func (p *GlusterHookServiceDisableRequest) Header(key, value string) *GlusterHoo return p } -func (p *GlusterHookServiceDisableRequest) Query(key, value string) *GlusterHookServiceDisableRequest { +func (p *AttachedStorageDomainDiskServiceRegisterRequest) Query(key, value string) *AttachedStorageDomainDiskServiceRegisterRequest { if p.query == nil { p.query = make(map[string]string) } @@ -12380,17 +10788,9 @@ func (p *GlusterHookServiceDisableRequest) Query(key, value string) *GlusterHook return p } -func (p *GlusterHookServiceDisableRequest) Async(async bool) *GlusterHookServiceDisableRequest { - p.async = &async - return p -} - -func (p *GlusterHookServiceDisableRequest) Send() (*GlusterHookServiceDisableResponse, error) { - rawURL := fmt.Sprintf("%s%s/disable", p.GlusterHookService.connection.URL(), p.GlusterHookService.path) +func (p *AttachedStorageDomainDiskServiceRegisterRequest) Send() (*AttachedStorageDomainDiskServiceRegisterResponse, error) { + rawURL := fmt.Sprintf("%s%s/register", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } action, err := actionBuilder.Build() if err != nil { return nil, err @@ -12413,7 +10813,7 @@ func (p *GlusterHookServiceDisableRequest) Send() (*GlusterHookServiceDisableRes return nil, err } - for hk, hv := range p.GlusterHookService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -12428,18 +10828,18 @@ func (p *GlusterHookServiceDisableRequest) Send() (*GlusterHookServiceDisableRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterHookService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterHookService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterHookService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12448,16 +10848,16 @@ func (p *GlusterHookServiceDisableRequest) Send() (*GlusterHookServiceDisableRes if err != nil { return nil, err } - p.GlusterHookService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(GlusterHookServiceDisableResponse), nil + return new(AttachedStorageDomainDiskServiceRegisterResponse), nil } -func (p *GlusterHookServiceDisableRequest) MustSend() *GlusterHookServiceDisableResponse { +func (p *AttachedStorageDomainDiskServiceRegisterRequest) MustSend() *AttachedStorageDomainDiskServiceRegisterResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12466,32 +10866,31 @@ func (p *GlusterHookServiceDisableRequest) MustSend() *GlusterHookServiceDisable } // -// Resolves status conflict of hook among servers in cluster by disabling Gluster hook in all servers of the -// cluster. This updates the hook status to `DISABLED` in database. +// Registers an unregistered disk. // -type GlusterHookServiceDisableResponse struct { +type AttachedStorageDomainDiskServiceRegisterResponse struct { } // -// Resolves status conflict of hook among servers in cluster by disabling Gluster hook in all servers of the -// cluster. This updates the hook status to `DISABLED` in database. +// Registers an unregistered disk. // -func (p *GlusterHookService) Disable() *GlusterHookServiceDisableRequest { - return &GlusterHookServiceDisableRequest{GlusterHookService: p} +func (p *AttachedStorageDomainDiskService) Register() *AttachedStorageDomainDiskServiceRegisterRequest { + return &AttachedStorageDomainDiskServiceRegisterRequest{AttachedStorageDomainDiskService: p} } // -// Resolves status conflict of hook among servers in cluster by disabling Gluster hook in all servers of the -// cluster. This updates the hook status to `DISABLED` in database. +// Removes a disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To remove a disk use the <> +// operation of the service that manages that disk. // -type GlusterHookServiceEnableRequest struct { - GlusterHookService *GlusterHookService - header map[string]string - query map[string]string - async *bool +type AttachedStorageDomainDiskServiceRemoveRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string } -func (p *GlusterHookServiceEnableRequest) Header(key, value string) *GlusterHookServiceEnableRequest { +func (p *AttachedStorageDomainDiskServiceRemoveRequest) Header(key, value string) *AttachedStorageDomainDiskServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -12499,7 +10898,7 @@ func (p *GlusterHookServiceEnableRequest) Header(key, value string) *GlusterHook return p } -func (p *GlusterHookServiceEnableRequest) Query(key, value string) *GlusterHookServiceEnableRequest { +func (p *AttachedStorageDomainDiskServiceRemoveRequest) Query(key, value string) *AttachedStorageDomainDiskServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -12507,21 +10906,8 @@ func (p *GlusterHookServiceEnableRequest) Query(key, value string) *GlusterHookS return p } -func (p *GlusterHookServiceEnableRequest) Async(async bool) *GlusterHookServiceEnableRequest { - p.async = &async - return p -} - -func (p *GlusterHookServiceEnableRequest) Send() (*GlusterHookServiceEnableResponse, error) { - rawURL := fmt.Sprintf("%s%s/enable", p.GlusterHookService.connection.URL(), p.GlusterHookService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *AttachedStorageDomainDiskServiceRemoveRequest) Send() (*AttachedStorageDomainDiskServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -12531,16 +10917,12 @@ func (p *GlusterHookServiceEnableRequest) Send() (*GlusterHookServiceEnableRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterHookService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -12555,18 +10937,18 @@ func (p *GlusterHookServiceEnableRequest) Send() (*GlusterHookServiceEnableRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterHookService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterHookService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterHookService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12575,16 +10957,19 @@ func (p *GlusterHookServiceEnableRequest) Send() (*GlusterHookServiceEnableRespo if err != nil { return nil, err } - p.GlusterHookService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterHookServiceEnableResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(AttachedStorageDomainDiskServiceRemoveResponse), nil } -func (p *GlusterHookServiceEnableRequest) MustSend() *GlusterHookServiceEnableResponse { +func (p *AttachedStorageDomainDiskServiceRemoveRequest) MustSend() *AttachedStorageDomainDiskServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12593,30 +10978,37 @@ func (p *GlusterHookServiceEnableRequest) MustSend() *GlusterHookServiceEnableRe } // -// Resolves status conflict of hook among servers in cluster by disabling Gluster hook in all servers of the -// cluster. This updates the hook status to `DISABLED` in database. +// Removes a disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To remove a disk use the <> +// operation of the service that manages that disk. // -type GlusterHookServiceEnableResponse struct { +type AttachedStorageDomainDiskServiceRemoveResponse struct { } // -// Resolves status conflict of hook among servers in cluster by disabling Gluster hook in all servers of the -// cluster. This updates the hook status to `DISABLED` in database. +// Removes a disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To remove a disk use the <> +// operation of the service that manages that disk. // -func (p *GlusterHookService) Enable() *GlusterHookServiceEnableRequest { - return &GlusterHookServiceEnableRequest{GlusterHookService: p} +func (p *AttachedStorageDomainDiskService) Remove() *AttachedStorageDomainDiskServiceRemoveRequest { + return &AttachedStorageDomainDiskServiceRemoveRequest{AttachedStorageDomainDiskService: p} } // +// Sparsify the disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To remove a disk use the <> +// operation of the service that manages that disk. // -type GlusterHookServiceGetRequest struct { - GlusterHookService *GlusterHookService - header map[string]string - query map[string]string - follow *string +type AttachedStorageDomainDiskServiceSparsifyRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string } -func (p *GlusterHookServiceGetRequest) Header(key, value string) *GlusterHookServiceGetRequest { +func (p *AttachedStorageDomainDiskServiceSparsifyRequest) Header(key, value string) *AttachedStorageDomainDiskServiceSparsifyRequest { if p.header == nil { p.header = make(map[string]string) } @@ -12624,7 +11016,7 @@ func (p *GlusterHookServiceGetRequest) Header(key, value string) *GlusterHookSer return p } -func (p *GlusterHookServiceGetRequest) Query(key, value string) *GlusterHookServiceGetRequest { +func (p *AttachedStorageDomainDiskServiceSparsifyRequest) Query(key, value string) *AttachedStorageDomainDiskServiceSparsifyRequest { if p.query == nil { p.query = make(map[string]string) } @@ -12632,18 +11024,14 @@ func (p *GlusterHookServiceGetRequest) Query(key, value string) *GlusterHookServ return p } -func (p *GlusterHookServiceGetRequest) Follow(follow string) *GlusterHookServiceGetRequest { - p.follow = &follow - return p -} - -func (p *GlusterHookServiceGetRequest) Send() (*GlusterHookServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterHookService.connection.URL(), p.GlusterHookService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *AttachedStorageDomainDiskServiceSparsifyRequest) Send() (*AttachedStorageDomainDiskServiceSparsifyResponse, error) { + rawURL := fmt.Sprintf("%s%s/sparsify", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) + actionBuilder := NewActionBuilder() + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -12652,12 +11040,16 @@ func (p *GlusterHookServiceGetRequest) Send() (*GlusterHookServiceGetResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterHookService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -12672,18 +11064,18 @@ func (p *GlusterHookServiceGetRequest) Send() (*GlusterHookServiceGetResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterHookService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterHookService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterHookService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12692,24 +11084,16 @@ func (p *GlusterHookServiceGetRequest) Send() (*GlusterHookServiceGetResponse, e if err != nil { return nil, err } - p.GlusterHookService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterHookReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &GlusterHookServiceGetResponse{hook: result}, nil + return new(AttachedStorageDomainDiskServiceSparsifyResponse), nil } -func (p *GlusterHookServiceGetRequest) MustSend() *GlusterHookServiceGetResponse { +func (p *AttachedStorageDomainDiskServiceSparsifyRequest) MustSend() *AttachedStorageDomainDiskServiceSparsifyResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12718,42 +11102,38 @@ func (p *GlusterHookServiceGetRequest) MustSend() *GlusterHookServiceGetResponse } // +// Sparsify the disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To remove a disk use the <> +// operation of the service that manages that disk. // -type GlusterHookServiceGetResponse struct { - hook *GlusterHook -} - -func (p *GlusterHookServiceGetResponse) Hook() (*GlusterHook, bool) { - if p.hook != nil { - return p.hook, true - } - return nil, false -} - -func (p *GlusterHookServiceGetResponse) MustHook() *GlusterHook { - if p.hook == nil { - panic("hook in response does not exist") - } - return p.hook +type AttachedStorageDomainDiskServiceSparsifyResponse struct { } // +// Sparsify the disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To remove a disk use the <> +// operation of the service that manages that disk. // -func (p *GlusterHookService) Get() *GlusterHookServiceGetRequest { - return &GlusterHookServiceGetRequest{GlusterHookService: p} +func (p *AttachedStorageDomainDiskService) Sparsify() *AttachedStorageDomainDiskServiceSparsifyRequest { + return &AttachedStorageDomainDiskServiceSparsifyRequest{AttachedStorageDomainDiskService: p} } // -// Removes the this Gluster hook from all servers in cluster and deletes it from the database. +// Updates the disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To update a disk use the +// <> operation of the service that manages that disk. // -type GlusterHookServiceRemoveRequest struct { - GlusterHookService *GlusterHookService - header map[string]string - query map[string]string - async *bool +type AttachedStorageDomainDiskServiceUpdateRequest struct { + AttachedStorageDomainDiskService *AttachedStorageDomainDiskService + header map[string]string + query map[string]string + disk *Disk } -func (p *GlusterHookServiceRemoveRequest) Header(key, value string) *GlusterHookServiceRemoveRequest { +func (p *AttachedStorageDomainDiskServiceUpdateRequest) Header(key, value string) *AttachedStorageDomainDiskServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -12761,7 +11141,7 @@ func (p *GlusterHookServiceRemoveRequest) Header(key, value string) *GlusterHook return p } -func (p *GlusterHookServiceRemoveRequest) Query(key, value string) *GlusterHookServiceRemoveRequest { +func (p *AttachedStorageDomainDiskServiceUpdateRequest) Query(key, value string) *AttachedStorageDomainDiskServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -12769,18 +11149,14 @@ func (p *GlusterHookServiceRemoveRequest) Query(key, value string) *GlusterHookS return p } -func (p *GlusterHookServiceRemoveRequest) Async(async bool) *GlusterHookServiceRemoveRequest { - p.async = &async +func (p *AttachedStorageDomainDiskServiceUpdateRequest) Disk(disk *Disk) *AttachedStorageDomainDiskServiceUpdateRequest { + p.disk = disk return p } -func (p *GlusterHookServiceRemoveRequest) Send() (*GlusterHookServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterHookService.connection.URL(), p.GlusterHookService.path) +func (p *AttachedStorageDomainDiskServiceUpdateRequest) Send() (*AttachedStorageDomainDiskServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -12789,12 +11165,19 @@ func (p *GlusterHookServiceRemoveRequest) Send() (*GlusterHookServiceRemoveRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLDiskWriteOne(writer, p.disk, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterHookService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { req.Header.Add(hk, hv) } @@ -12809,18 +11192,18 @@ func (p *GlusterHookServiceRemoveRequest) Send() (*GlusterHookServiceRemoveRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterHookService.connection.authenticate() + token, err := p.AttachedStorageDomainDiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterHookService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterHookService.connection.logFunc != nil { + if p.AttachedStorageDomainDiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12829,19 +11212,24 @@ func (p *GlusterHookServiceRemoveRequest) Send() (*GlusterHookServiceRemoveRespo if err != nil { return nil, err } - p.GlusterHookService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(GlusterHookServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &AttachedStorageDomainDiskServiceUpdateResponse{disk: result}, nil } -func (p *GlusterHookServiceRemoveRequest) MustSend() *GlusterHookServiceRemoveResponse { +func (p *AttachedStorageDomainDiskServiceUpdateRequest) MustSend() *AttachedStorageDomainDiskServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12850,82 +11238,141 @@ func (p *GlusterHookServiceRemoveRequest) MustSend() *GlusterHookServiceRemoveRe } // -// Removes the this Gluster hook from all servers in cluster and deletes it from the database. +// Updates the disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To update a disk use the +// <> operation of the service that manages that disk. // -type GlusterHookServiceRemoveResponse struct { +type AttachedStorageDomainDiskServiceUpdateResponse struct { + disk *Disk +} + +func (p *AttachedStorageDomainDiskServiceUpdateResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true + } + return nil, false +} + +func (p *AttachedStorageDomainDiskServiceUpdateResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") + } + return p.disk } // -// Removes the this Gluster hook from all servers in cluster and deletes it from the database. +// Updates the disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To update a disk use the +// <> operation of the service that manages that disk. // -func (p *GlusterHookService) Remove() *GlusterHookServiceRemoveRequest { - return &GlusterHookServiceRemoveRequest{GlusterHookService: p} +func (p *AttachedStorageDomainDiskService) Update() *AttachedStorageDomainDiskServiceUpdateRequest { + return &AttachedStorageDomainDiskServiceUpdateRequest{AttachedStorageDomainDiskService: p} } // -// Resolves missing hook conflict depending on the resolution type. -// For `ADD` resolves by copying hook stored in engine database to all servers where the hook is missing. The -// engine maintains a list of all servers where hook is missing. -// For `COPY` resolves conflict in hook content by copying hook stored in engine database to all servers where -// the hook is missing. The engine maintains a list of all servers where the content is conflicting. If a host -// id is passed as parameter, the hook content from the server is used as the master to copy to other servers -// in cluster. +// Reference to the service that manages the permissions assigned to the disk. // -type GlusterHookServiceResolveRequest struct { - GlusterHookService *GlusterHookService - header map[string]string - query map[string]string - async *bool - host *Host - resolutionType *string +func (op *AttachedStorageDomainDiskService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) } -func (p *GlusterHookServiceResolveRequest) Header(key, value string) *GlusterHookServiceResolveRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p +// +// +func (op *AttachedStorageDomainDiskService) StatisticsService() *StatisticsService { + return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) } -func (p *GlusterHookServiceResolveRequest) Query(key, value string) *GlusterHookServiceResolveRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *AttachedStorageDomainDiskService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + if path == "statistics" { + return op.StatisticsService(), nil + } + if strings.HasPrefix(path, "statistics/") { + return op.StatisticsService().Service(path[11:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *GlusterHookServiceResolveRequest) Async(async bool) *GlusterHookServiceResolveRequest { - p.async = &async +func (op *AttachedStorageDomainDiskService) String() string { + return fmt.Sprintf("AttachedStorageDomainDiskService:%s", op.path) +} + +// +// Manages the collection of disks available inside an storage domain that is attached to a data center. +// +type AttachedStorageDomainDisksService struct { + BaseService +} + +func NewAttachedStorageDomainDisksService(connection *Connection, path string) *AttachedStorageDomainDisksService { + var result AttachedStorageDomainDisksService + result.connection = connection + result.path = path + return &result +} + +// +// Adds or registers a disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To add a new disk use the <> +// operation of the service that manages the disks of the system. To register an unregistered disk use the +// <> operation of the service that manages +// that disk. +// +type AttachedStorageDomainDisksServiceAddRequest struct { + AttachedStorageDomainDisksService *AttachedStorageDomainDisksService + header map[string]string + query map[string]string + disk *Disk + unregistered *bool +} + +func (p *AttachedStorageDomainDisksServiceAddRequest) Header(key, value string) *AttachedStorageDomainDisksServiceAddRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value return p } -func (p *GlusterHookServiceResolveRequest) Host(host *Host) *GlusterHookServiceResolveRequest { - p.host = host +func (p *AttachedStorageDomainDisksServiceAddRequest) Query(key, value string) *AttachedStorageDomainDisksServiceAddRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value return p } -func (p *GlusterHookServiceResolveRequest) ResolutionType(resolutionType string) *GlusterHookServiceResolveRequest { - p.resolutionType = &resolutionType +func (p *AttachedStorageDomainDisksServiceAddRequest) Disk(disk *Disk) *AttachedStorageDomainDisksServiceAddRequest { + p.disk = disk return p } -func (p *GlusterHookServiceResolveRequest) Send() (*GlusterHookServiceResolveResponse, error) { - rawURL := fmt.Sprintf("%s%s/resolve", p.GlusterHookService.connection.URL(), p.GlusterHookService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Host(p.host) - if p.resolutionType != nil { - actionBuilder.ResolutionType(*p.resolutionType) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *AttachedStorageDomainDisksServiceAddRequest) Unregistered(unregistered bool) *AttachedStorageDomainDisksServiceAddRequest { + p.unregistered = &unregistered + return p +} + +func (p *AttachedStorageDomainDisksServiceAddRequest) Send() (*AttachedStorageDomainDisksServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDisksService.connection.URL(), p.AttachedStorageDomainDisksService.path) values := make(url.Values) + if p.unregistered != nil { + values["unregistered"] = []string{fmt.Sprintf("%v", *p.unregistered)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -12936,14 +11383,17 @@ func (p *GlusterHookServiceResolveRequest) Send() (*GlusterHookServiceResolveRes } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLDiskWriteOne(writer, p.disk, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterHookService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDisksService.connection.headers { req.Header.Add(hk, hv) } @@ -12958,18 +11408,18 @@ func (p *GlusterHookServiceResolveRequest) Send() (*GlusterHookServiceResolveRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterHookService.connection.authenticate() + token, err := p.AttachedStorageDomainDisksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterHookService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDisksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterHookService.connection.logFunc != nil { + if p.AttachedStorageDomainDisksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -12978,16 +11428,24 @@ func (p *GlusterHookServiceResolveRequest) Send() (*GlusterHookServiceResolveRes if err != nil { return nil, err } - p.GlusterHookService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainDisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(GlusterHookServiceResolveResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &AttachedStorageDomainDisksServiceAddResponse{disk: result}, nil } -func (p *GlusterHookServiceResolveRequest) MustSend() *GlusterHookServiceResolveResponse { +func (p *AttachedStorageDomainDisksServiceAddRequest) MustSend() *AttachedStorageDomainDisksServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -12996,70 +11454,55 @@ func (p *GlusterHookServiceResolveRequest) MustSend() *GlusterHookServiceResolve } // -// Resolves missing hook conflict depending on the resolution type. -// For `ADD` resolves by copying hook stored in engine database to all servers where the hook is missing. The -// engine maintains a list of all servers where hook is missing. -// For `COPY` resolves conflict in hook content by copying hook stored in engine database to all servers where -// the hook is missing. The engine maintains a list of all servers where the content is conflicting. If a host -// id is passed as parameter, the hook content from the server is used as the master to copy to other servers -// in cluster. -// -type GlusterHookServiceResolveResponse struct { -} - -// -// Resolves missing hook conflict depending on the resolution type. -// For `ADD` resolves by copying hook stored in engine database to all servers where the hook is missing. The -// engine maintains a list of all servers where hook is missing. -// For `COPY` resolves conflict in hook content by copying hook stored in engine database to all servers where -// the hook is missing. The engine maintains a list of all servers where the content is conflicting. If a host -// id is passed as parameter, the hook content from the server is used as the master to copy to other servers -// in cluster. +// Adds or registers a disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To add a new disk use the <> +// operation of the service that manages the disks of the system. To register an unregistered disk use the +// <> operation of the service that manages +// that disk. // -func (p *GlusterHookService) Resolve() *GlusterHookServiceResolveRequest { - return &GlusterHookServiceResolveRequest{GlusterHookService: p} +type AttachedStorageDomainDisksServiceAddResponse struct { + disk *Disk } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *GlusterHookService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *AttachedStorageDomainDisksServiceAddResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return nil, false } -func (op *GlusterHookService) String() string { - return fmt.Sprintf("GlusterHookService:%s", op.path) +func (p *AttachedStorageDomainDisksServiceAddResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") + } + return p.disk } // +// Adds or registers a disk. +// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards +// compatibility. It will be removed in the future. To add a new disk use the <> +// operation of the service that manages the disks of the system. To register an unregistered disk use the +// <> operation of the service that manages +// that disk. // -type GlusterHooksService struct { - BaseService -} - -func NewGlusterHooksService(connection *Connection, path string) *GlusterHooksService { - var result GlusterHooksService - result.connection = connection - result.path = path - return &result +func (p *AttachedStorageDomainDisksService) Add() *AttachedStorageDomainDisksServiceAddRequest { + return &AttachedStorageDomainDisksServiceAddRequest{AttachedStorageDomainDisksService: p} } // -// Returns the list of hooks. -// The order of the returned list of hooks isn't guaranteed. +// Retrieve the list of disks that are available in the storage domain. // -type GlusterHooksServiceListRequest struct { - GlusterHooksService *GlusterHooksService - header map[string]string - query map[string]string - follow *string - max *int64 +type AttachedStorageDomainDisksServiceListRequest struct { + AttachedStorageDomainDisksService *AttachedStorageDomainDisksService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *GlusterHooksServiceListRequest) Header(key, value string) *GlusterHooksServiceListRequest { +func (p *AttachedStorageDomainDisksServiceListRequest) Header(key, value string) *AttachedStorageDomainDisksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -13067,7 +11510,7 @@ func (p *GlusterHooksServiceListRequest) Header(key, value string) *GlusterHooks return p } -func (p *GlusterHooksServiceListRequest) Query(key, value string) *GlusterHooksServiceListRequest { +func (p *AttachedStorageDomainDisksServiceListRequest) Query(key, value string) *AttachedStorageDomainDisksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -13075,18 +11518,18 @@ func (p *GlusterHooksServiceListRequest) Query(key, value string) *GlusterHooksS return p } -func (p *GlusterHooksServiceListRequest) Follow(follow string) *GlusterHooksServiceListRequest { +func (p *AttachedStorageDomainDisksServiceListRequest) Follow(follow string) *AttachedStorageDomainDisksServiceListRequest { p.follow = &follow return p } -func (p *GlusterHooksServiceListRequest) Max(max int64) *GlusterHooksServiceListRequest { +func (p *AttachedStorageDomainDisksServiceListRequest) Max(max int64) *AttachedStorageDomainDisksServiceListRequest { p.max = &max return p } -func (p *GlusterHooksServiceListRequest) Send() (*GlusterHooksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterHooksService.connection.URL(), p.GlusterHooksService.path) +func (p *AttachedStorageDomainDisksServiceListRequest) Send() (*AttachedStorageDomainDisksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDisksService.connection.URL(), p.AttachedStorageDomainDisksService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -13109,7 +11552,7 @@ func (p *GlusterHooksServiceListRequest) Send() (*GlusterHooksServiceListRespons return nil, err } - for hk, hv := range p.GlusterHooksService.connection.headers { + for hk, hv := range p.AttachedStorageDomainDisksService.connection.headers { req.Header.Add(hk, hv) } @@ -13124,18 +11567,18 @@ func (p *GlusterHooksServiceListRequest) Send() (*GlusterHooksServiceListRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterHooksService.connection.authenticate() + token, err := p.AttachedStorageDomainDisksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterHooksService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainDisksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterHooksService.connection.logFunc != nil { + if p.AttachedStorageDomainDisksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -13144,7 +11587,7 @@ func (p *GlusterHooksServiceListRequest) Send() (*GlusterHooksServiceListRespons if err != nil { return nil, err } - p.GlusterHooksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainDisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -13154,14 +11597,14 @@ func (p *GlusterHooksServiceListRequest) Send() (*GlusterHooksServiceListRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterHookReadMany(reader, nil) + result, err := XMLDiskReadMany(reader, nil) if err != nil { return nil, err } - return &GlusterHooksServiceListResponse{hooks: result}, nil + return &AttachedStorageDomainDisksServiceListResponse{disks: result}, nil } -func (p *GlusterHooksServiceListRequest) MustSend() *GlusterHooksServiceListResponse { +func (p *AttachedStorageDomainDisksServiceListRequest) MustSend() *AttachedStorageDomainDisksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -13170,126 +11613,93 @@ func (p *GlusterHooksServiceListRequest) MustSend() *GlusterHooksServiceListResp } // -// Returns the list of hooks. -// The order of the returned list of hooks isn't guaranteed. +// Retrieve the list of disks that are available in the storage domain. // -type GlusterHooksServiceListResponse struct { - hooks *GlusterHookSlice +type AttachedStorageDomainDisksServiceListResponse struct { + disks *DiskSlice } -func (p *GlusterHooksServiceListResponse) Hooks() (*GlusterHookSlice, bool) { - if p.hooks != nil { - return p.hooks, true +func (p *AttachedStorageDomainDisksServiceListResponse) Disks() (*DiskSlice, bool) { + if p.disks != nil { + return p.disks, true } return nil, false } -func (p *GlusterHooksServiceListResponse) MustHooks() *GlusterHookSlice { - if p.hooks == nil { - panic("hooks in response does not exist") +func (p *AttachedStorageDomainDisksServiceListResponse) MustDisks() *DiskSlice { + if p.disks == nil { + panic("disks in response does not exist") } - return p.hooks + return p.disks } // -// Returns the list of hooks. -// The order of the returned list of hooks isn't guaranteed. +// Retrieve the list of disks that are available in the storage domain. // -func (p *GlusterHooksService) List() *GlusterHooksServiceListRequest { - return &GlusterHooksServiceListRequest{GlusterHooksService: p} +func (p *AttachedStorageDomainDisksService) List() *AttachedStorageDomainDisksServiceListRequest { + return &AttachedStorageDomainDisksServiceListRequest{AttachedStorageDomainDisksService: p} } // +// Reference to the service that manages a specific disk. // -func (op *GlusterHooksService) HookService(id string) *GlusterHookService { - return NewGlusterHookService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AttachedStorageDomainDisksService) DiskService(id string) *AttachedStorageDomainDiskService { + return NewAttachedStorageDomainDiskService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *GlusterHooksService) Service(path string) (Service, error) { +func (op *AttachedStorageDomainDisksService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.HookService(path), nil + return op.DiskService(path), nil } - return op.HookService(path[:index]).Service(path[index+1:]) + return op.DiskService(path[:index]).Service(path[index+1:]) } -func (op *GlusterHooksService) String() string { - return fmt.Sprintf("GlusterHooksService:%s", op.path) +func (op *AttachedStorageDomainDisksService) String() string { + return fmt.Sprintf("AttachedStorageDomainDisksService:%s", op.path) } // -// This service manages a single gluster brick. // -type GlusterBrickService struct { +type AttachedStorageDomainService struct { BaseService } -func NewGlusterBrickService(connection *Connection, path string) *GlusterBrickService { - var result GlusterBrickService +func NewAttachedStorageDomainService(connection *Connection, path string) *AttachedStorageDomainService { + var result AttachedStorageDomainService result.connection = connection result.path = path return &result } // -// Get details of a brick. -// Retrieves status details of brick from underlying gluster volume with header `All-Content` set to `true`. This is -// the equivalent of running `gluster volume status detail`. -// For example, to get the details of brick `234` of gluster volume `123`, send a request like this: +// This operation activates an attached storage domain. +// Once the storage domain is activated it is ready for use with the data center. // [source] // ---- -// GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234 +// POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate // ---- -// Which will return a response body like this: +// The activate action does not take any action specific parameters, +// so the request body should contain an empty `action`: // [source,xml] // ---- -// -// host1:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 111 -// up -// /dev/mapper/RHGS_vg1-lv_vmaddldisks -// xfs -// -// -// 2818417648 -// 1384694844 -// 1011 -// client2 -// -// -// -// -// data-server:fd_t -// 1626348 -// 1020 -// 4 -// 23 -// 0 -// 140 -// 0 -// -// -// rw,seclabel,noatime,nodiratime,attr2,inode64,sunit=512,swidth=2048,noquota -// 25589 -// 49155 -// +// // ---- // -type GlusterBrickServiceGetRequest struct { - GlusterBrickService *GlusterBrickService - header map[string]string - query map[string]string - follow *string +type AttachedStorageDomainServiceActivateRequest struct { + AttachedStorageDomainService *AttachedStorageDomainService + header map[string]string + query map[string]string + async *bool } -func (p *GlusterBrickServiceGetRequest) Header(key, value string) *GlusterBrickServiceGetRequest { +func (p *AttachedStorageDomainServiceActivateRequest) Header(key, value string) *AttachedStorageDomainServiceActivateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -13297,7 +11707,7 @@ func (p *GlusterBrickServiceGetRequest) Header(key, value string) *GlusterBrickS return p } -func (p *GlusterBrickServiceGetRequest) Query(key, value string) *GlusterBrickServiceGetRequest { +func (p *AttachedStorageDomainServiceActivateRequest) Query(key, value string) *AttachedStorageDomainServiceActivateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -13305,18 +11715,22 @@ func (p *GlusterBrickServiceGetRequest) Query(key, value string) *GlusterBrickSe return p } -func (p *GlusterBrickServiceGetRequest) Follow(follow string) *GlusterBrickServiceGetRequest { - p.follow = &follow +func (p *AttachedStorageDomainServiceActivateRequest) Async(async bool) *AttachedStorageDomainServiceActivateRequest { + p.async = &async return p } -func (p *GlusterBrickServiceGetRequest) Send() (*GlusterBrickServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterBrickService.connection.URL(), p.GlusterBrickService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *AttachedStorageDomainServiceActivateRequest) Send() (*AttachedStorageDomainServiceActivateResponse, error) { + rawURL := fmt.Sprintf("%s%s/activate", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -13325,12 +11739,16 @@ func (p *GlusterBrickServiceGetRequest) Send() (*GlusterBrickServiceGetResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterBrickService.connection.headers { + for hk, hv := range p.AttachedStorageDomainService.connection.headers { req.Header.Add(hk, hv) } @@ -13345,18 +11763,18 @@ func (p *GlusterBrickServiceGetRequest) Send() (*GlusterBrickServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBrickService.connection.authenticate() + token, err := p.AttachedStorageDomainService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBrickService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBrickService.connection.logFunc != nil { + if p.AttachedStorageDomainService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -13365,24 +11783,16 @@ func (p *GlusterBrickServiceGetRequest) Send() (*GlusterBrickServiceGetResponse, if err != nil { return nil, err } - p.GlusterBrickService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterBrickReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &GlusterBrickServiceGetResponse{brick: result}, nil + return new(AttachedStorageDomainServiceActivateResponse), nil } -func (p *GlusterBrickServiceGetRequest) MustSend() *GlusterBrickServiceGetResponse { +func (p *AttachedStorageDomainServiceActivateRequest) MustSend() *AttachedStorageDomainServiceActivateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -13391,136 +11801,66 @@ func (p *GlusterBrickServiceGetRequest) MustSend() *GlusterBrickServiceGetRespon } // -// Get details of a brick. -// Retrieves status details of brick from underlying gluster volume with header `All-Content` set to `true`. This is -// the equivalent of running `gluster volume status detail`. -// For example, to get the details of brick `234` of gluster volume `123`, send a request like this: +// This operation activates an attached storage domain. +// Once the storage domain is activated it is ready for use with the data center. // [source] // ---- -// GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234 +// POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate // ---- -// Which will return a response body like this: +// The activate action does not take any action specific parameters, +// so the request body should contain an empty `action`: // [source,xml] // ---- -// -// host1:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 111 -// up -// /dev/mapper/RHGS_vg1-lv_vmaddldisks -// xfs -// -// -// 2818417648 -// 1384694844 -// 1011 -// client2 -// -// -// -// -// data-server:fd_t -// 1626348 -// 1020 -// 4 -// 23 -// 0 -// 140 -// 0 -// -// -// rw,seclabel,noatime,nodiratime,attr2,inode64,sunit=512,swidth=2048,noquota -// 25589 -// 49155 -// +// // ---- // -type GlusterBrickServiceGetResponse struct { - brick *GlusterBrick -} - -func (p *GlusterBrickServiceGetResponse) Brick() (*GlusterBrick, bool) { - if p.brick != nil { - return p.brick, true - } - return nil, false -} - -func (p *GlusterBrickServiceGetResponse) MustBrick() *GlusterBrick { - if p.brick == nil { - panic("brick in response does not exist") - } - return p.brick +type AttachedStorageDomainServiceActivateResponse struct { } // -// Get details of a brick. -// Retrieves status details of brick from underlying gluster volume with header `All-Content` set to `true`. This is -// the equivalent of running `gluster volume status detail`. -// For example, to get the details of brick `234` of gluster volume `123`, send a request like this: +// This operation activates an attached storage domain. +// Once the storage domain is activated it is ready for use with the data center. // [source] // ---- -// GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234 +// POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate // ---- -// Which will return a response body like this: +// The activate action does not take any action specific parameters, +// so the request body should contain an empty `action`: // [source,xml] // ---- -// -// host1:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 111 -// up -// /dev/mapper/RHGS_vg1-lv_vmaddldisks -// xfs -// -// -// 2818417648 -// 1384694844 -// 1011 -// client2 -// -// -// -// -// data-server:fd_t -// 1626348 -// 1020 -// 4 -// 23 -// 0 -// 140 -// 0 -// -// -// rw,seclabel,noatime,nodiratime,attr2,inode64,sunit=512,swidth=2048,noquota -// 25589 -// 49155 -// +// // ---- // -func (p *GlusterBrickService) Get() *GlusterBrickServiceGetRequest { - return &GlusterBrickServiceGetRequest{GlusterBrickService: p} +func (p *AttachedStorageDomainService) Activate() *AttachedStorageDomainServiceActivateRequest { + return &AttachedStorageDomainServiceActivateRequest{AttachedStorageDomainService: p} } // -// Removes a brick. -// Removes a brick from the underlying gluster volume and deletes entries from database. This can be used only when -// removing a single brick without data migration. To remove multiple bricks and with data migration, use -// <> instead. -// For example, to delete brick `234` from gluster volume `123`, send a request like this: -// [source] -// ---- -// DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234 +// This operation deactivates an attached storage domain. +// Once the storage domain is deactivated it will not be used with the data center. +// For example, to deactivate storage domain `456`, send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate +// ---- +// With a request body like this: +// [source,xml] +// ---- +// // ---- +// If the `force` parameter is `true` then the operation will succeed, even if the OVF update which takes place +// before the deactivation of the storage domain failed. If the `force` parameter is `false` and the OVF update failed, +// the deactivation of the storage domain will also fail. // -type GlusterBrickServiceRemoveRequest struct { - GlusterBrickService *GlusterBrickService - header map[string]string - query map[string]string - async *bool +type AttachedStorageDomainServiceDeactivateRequest struct { + AttachedStorageDomainService *AttachedStorageDomainService + header map[string]string + query map[string]string + async *bool + force *bool } -func (p *GlusterBrickServiceRemoveRequest) Header(key, value string) *GlusterBrickServiceRemoveRequest { +func (p *AttachedStorageDomainServiceDeactivateRequest) Header(key, value string) *AttachedStorageDomainServiceDeactivateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -13528,7 +11868,7 @@ func (p *GlusterBrickServiceRemoveRequest) Header(key, value string) *GlusterBri return p } -func (p *GlusterBrickServiceRemoveRequest) Query(key, value string) *GlusterBrickServiceRemoveRequest { +func (p *AttachedStorageDomainServiceDeactivateRequest) Query(key, value string) *AttachedStorageDomainServiceDeactivateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -13536,18 +11876,30 @@ func (p *GlusterBrickServiceRemoveRequest) Query(key, value string) *GlusterBric return p } -func (p *GlusterBrickServiceRemoveRequest) Async(async bool) *GlusterBrickServiceRemoveRequest { +func (p *AttachedStorageDomainServiceDeactivateRequest) Async(async bool) *AttachedStorageDomainServiceDeactivateRequest { p.async = &async return p } -func (p *GlusterBrickServiceRemoveRequest) Send() (*GlusterBrickServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterBrickService.connection.URL(), p.GlusterBrickService.path) - values := make(url.Values) +func (p *AttachedStorageDomainServiceDeactivateRequest) Force(force bool) *AttachedStorageDomainServiceDeactivateRequest { + p.force = &force + return p +} + +func (p *AttachedStorageDomainServiceDeactivateRequest) Send() (*AttachedStorageDomainServiceDeactivateResponse, error) { + rawURL := fmt.Sprintf("%s%s/deactivate", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) + actionBuilder := NewActionBuilder() if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + actionBuilder.Async(*p.async) } - + if p.force != nil { + actionBuilder.Force(*p.force) + } + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -13556,12 +11908,16 @@ func (p *GlusterBrickServiceRemoveRequest) Send() (*GlusterBrickServiceRemoveRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterBrickService.connection.headers { + for hk, hv := range p.AttachedStorageDomainService.connection.headers { req.Header.Add(hk, hv) } @@ -13576,18 +11932,18 @@ func (p *GlusterBrickServiceRemoveRequest) Send() (*GlusterBrickServiceRemoveRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBrickService.connection.authenticate() + token, err := p.AttachedStorageDomainService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBrickService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBrickService.connection.logFunc != nil { + if p.AttachedStorageDomainService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -13596,19 +11952,16 @@ func (p *GlusterBrickServiceRemoveRequest) Send() (*GlusterBrickServiceRemoveRes if err != nil { return nil, err } - p.GlusterBrickService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(GlusterBrickServiceRemoveResponse), nil + return new(AttachedStorageDomainServiceDeactivateResponse), nil } -func (p *GlusterBrickServiceRemoveRequest) MustSend() *GlusterBrickServiceRemoveResponse { +func (p *AttachedStorageDomainServiceDeactivateRequest) MustSend() *AttachedStorageDomainServiceDeactivateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -13617,49 +11970,56 @@ func (p *GlusterBrickServiceRemoveRequest) MustSend() *GlusterBrickServiceRemove } // -// Removes a brick. -// Removes a brick from the underlying gluster volume and deletes entries from database. This can be used only when -// removing a single brick without data migration. To remove multiple bricks and with data migration, use -// <> instead. -// For example, to delete brick `234` from gluster volume `123`, send a request like this: +// This operation deactivates an attached storage domain. +// Once the storage domain is deactivated it will not be used with the data center. +// For example, to deactivate storage domain `456`, send the following request: // [source] // ---- -// DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234 +// POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate +// ---- +// With a request body like this: +// [source,xml] // ---- +// +// ---- +// If the `force` parameter is `true` then the operation will succeed, even if the OVF update which takes place +// before the deactivation of the storage domain failed. If the `force` parameter is `false` and the OVF update failed, +// the deactivation of the storage domain will also fail. // -type GlusterBrickServiceRemoveResponse struct { +type AttachedStorageDomainServiceDeactivateResponse struct { } // -// Removes a brick. -// Removes a brick from the underlying gluster volume and deletes entries from database. This can be used only when -// removing a single brick without data migration. To remove multiple bricks and with data migration, use -// <> instead. -// For example, to delete brick `234` from gluster volume `123`, send a request like this: +// This operation deactivates an attached storage domain. +// Once the storage domain is deactivated it will not be used with the data center. +// For example, to deactivate storage domain `456`, send the following request: // [source] // ---- -// DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/234 +// POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate +// ---- +// With a request body like this: +// [source,xml] // ---- +// +// ---- +// If the `force` parameter is `true` then the operation will succeed, even if the OVF update which takes place +// before the deactivation of the storage domain failed. If the `force` parameter is `false` and the OVF update failed, +// the deactivation of the storage domain will also fail. // -func (p *GlusterBrickService) Remove() *GlusterBrickServiceRemoveRequest { - return &GlusterBrickServiceRemoveRequest{GlusterBrickService: p} +func (p *AttachedStorageDomainService) Deactivate() *AttachedStorageDomainServiceDeactivateRequest { + return &AttachedStorageDomainServiceDeactivateRequest{AttachedStorageDomainService: p} } // -// Replaces this brick with a new one. -// IMPORTANT: This operation has been deprecated since version 3.5 of the engine and will be removed in the future. -// Use <> and -// <> instead. // -type GlusterBrickServiceReplaceRequest struct { - GlusterBrickService *GlusterBrickService - header map[string]string - query map[string]string - async *bool - force *bool +type AttachedStorageDomainServiceGetRequest struct { + AttachedStorageDomainService *AttachedStorageDomainService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterBrickServiceReplaceRequest) Header(key, value string) *GlusterBrickServiceReplaceRequest { +func (p *AttachedStorageDomainServiceGetRequest) Header(key, value string) *AttachedStorageDomainServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -13667,7 +12027,7 @@ func (p *GlusterBrickServiceReplaceRequest) Header(key, value string) *GlusterBr return p } -func (p *GlusterBrickServiceReplaceRequest) Query(key, value string) *GlusterBrickServiceReplaceRequest { +func (p *AttachedStorageDomainServiceGetRequest) Query(key, value string) *AttachedStorageDomainServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -13675,30 +12035,154 @@ func (p *GlusterBrickServiceReplaceRequest) Query(key, value string) *GlusterBri return p } -func (p *GlusterBrickServiceReplaceRequest) Async(async bool) *GlusterBrickServiceReplaceRequest { - p.async = &async +func (p *AttachedStorageDomainServiceGetRequest) Follow(follow string) *AttachedStorageDomainServiceGetRequest { + p.follow = &follow return p } -func (p *GlusterBrickServiceReplaceRequest) Force(force bool) *GlusterBrickServiceReplaceRequest { - p.force = &force - return p -} +func (p *AttachedStorageDomainServiceGetRequest) Send() (*AttachedStorageDomainServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } -func (p *GlusterBrickServiceReplaceRequest) Send() (*GlusterBrickServiceReplaceResponse, error) { - rawURL := fmt.Sprintf("%s%s/replace", p.GlusterBrickService.connection.URL(), p.GlusterBrickService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} + } } - if p.force != nil { - actionBuilder.Force(*p.force) + if len(values) > 0 { + rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - action, err := actionBuilder.Build() + req, err := http.NewRequest("GET", rawURL, nil) + if err != nil { + return nil, err + } + + for hk, hv := range p.AttachedStorageDomainService.connection.headers { + req.Header.Add(hk, hv) + } + + if p.header != nil { + for hk, hv := range p.header { + req.Header.Add(hk, hv) + } + } + + req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) + req.Header.Add("Version", "4") + req.Header.Add("Content-Type", "application/xml") + req.Header.Add("Accept", "application/xml") + // get OAuth access token + token, err := p.AttachedStorageDomainService.connection.authenticate() + if err != nil { + return nil, err + } + req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) + // Send the request and wait for the response + resp, err := p.AttachedStorageDomainService.connection.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if p.AttachedStorageDomainService.connection.logFunc != nil { + dumpReq, err := httputil.DumpRequestOut(req, true) + if err != nil { + return nil, err + } + dumpResp, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, err + } + p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + } + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLStorageDomainReadOne(reader, nil, "") if err != nil { return nil, err } + return &AttachedStorageDomainServiceGetResponse{storageDomain: result}, nil +} + +func (p *AttachedStorageDomainServiceGetRequest) MustSend() *AttachedStorageDomainServiceGetResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// +type AttachedStorageDomainServiceGetResponse struct { + storageDomain *StorageDomain +} + +func (p *AttachedStorageDomainServiceGetResponse) StorageDomain() (*StorageDomain, bool) { + if p.storageDomain != nil { + return p.storageDomain, true + } + return nil, false +} + +func (p *AttachedStorageDomainServiceGetResponse) MustStorageDomain() *StorageDomain { + if p.storageDomain == nil { + panic("storageDomain in response does not exist") + } + return p.storageDomain +} + +// +// +func (p *AttachedStorageDomainService) Get() *AttachedStorageDomainServiceGetRequest { + return &AttachedStorageDomainServiceGetRequest{AttachedStorageDomainService: p} +} + +// +// +type AttachedStorageDomainServiceRemoveRequest struct { + AttachedStorageDomainService *AttachedStorageDomainService + header map[string]string + query map[string]string + async *bool +} + +func (p *AttachedStorageDomainServiceRemoveRequest) Header(key, value string) *AttachedStorageDomainServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value + return p +} + +func (p *AttachedStorageDomainServiceRemoveRequest) Query(key, value string) *AttachedStorageDomainServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p +} + +func (p *AttachedStorageDomainServiceRemoveRequest) Async(async bool) *AttachedStorageDomainServiceRemoveRequest { + p.async = &async + return p +} + +func (p *AttachedStorageDomainServiceRemoveRequest) Send() (*AttachedStorageDomainServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -13707,16 +12191,12 @@ func (p *GlusterBrickServiceReplaceRequest) Send() (*GlusterBrickServiceReplaceR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterBrickService.connection.headers { + for hk, hv := range p.AttachedStorageDomainService.connection.headers { req.Header.Add(hk, hv) } @@ -13731,18 +12211,18 @@ func (p *GlusterBrickServiceReplaceRequest) Send() (*GlusterBrickServiceReplaceR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBrickService.connection.authenticate() + token, err := p.AttachedStorageDomainService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBrickService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBrickService.connection.logFunc != nil { + if p.AttachedStorageDomainService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -13751,16 +12231,19 @@ func (p *GlusterBrickServiceReplaceRequest) Send() (*GlusterBrickServiceReplaceR if err != nil { return nil, err } - p.GlusterBrickService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterBrickServiceReplaceResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(AttachedStorageDomainServiceRemoveResponse), nil } -func (p *GlusterBrickServiceReplaceRequest) MustSend() *GlusterBrickServiceReplaceResponse { +func (p *AttachedStorageDomainServiceRemoveRequest) MustSend() *AttachedStorageDomainServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -13769,105 +12252,67 @@ func (p *GlusterBrickServiceReplaceRequest) MustSend() *GlusterBrickServiceRepla } // -// Replaces this brick with a new one. -// IMPORTANT: This operation has been deprecated since version 3.5 of the engine and will be removed in the future. -// Use <> and -// <> instead. // -type GlusterBrickServiceReplaceResponse struct { +type AttachedStorageDomainServiceRemoveResponse struct { } // -// Replaces this brick with a new one. -// IMPORTANT: This operation has been deprecated since version 3.5 of the engine and will be removed in the future. -// Use <> and -// <> instead. // -func (p *GlusterBrickService) Replace() *GlusterBrickServiceReplaceRequest { - return &GlusterBrickServiceReplaceRequest{GlusterBrickService: p} +func (p *AttachedStorageDomainService) Remove() *AttachedStorageDomainServiceRemoveRequest { + return &AttachedStorageDomainServiceRemoveRequest{AttachedStorageDomainService: p} } // // -func (op *GlusterBrickService) StatisticsService() *StatisticsService { - return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) +func (op *AttachedStorageDomainService) DisksService() *AttachedStorageDomainDisksService { + return NewAttachedStorageDomainDisksService(op.connection, fmt.Sprintf("%s/disks", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *GlusterBrickService) Service(path string) (Service, error) { +func (op *AttachedStorageDomainService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "statistics" { - return op.StatisticsService(), nil + if path == "disks" { + return op.DisksService(), nil } - if strings.HasPrefix(path, "statistics/") { - return op.StatisticsService().Service(path[11:]) + if strings.HasPrefix(path, "disks/") { + return op.DisksService().Service(path[6:]) } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *GlusterBrickService) String() string { - return fmt.Sprintf("GlusterBrickService:%s", op.path) +func (op *AttachedStorageDomainService) String() string { + return fmt.Sprintf("AttachedStorageDomainService:%s", op.path) } // -// This service manages a collection of gluster volumes available in a cluster. +// Manages the storage domains attached to a data center. // -type GlusterVolumesService struct { +type AttachedStorageDomainsService struct { BaseService } -func NewGlusterVolumesService(connection *Connection, path string) *GlusterVolumesService { - var result GlusterVolumesService +func NewAttachedStorageDomainsService(connection *Connection, path string) *AttachedStorageDomainsService { + var result AttachedStorageDomainsService result.connection = connection result.path = path return &result } // -// Creates a new gluster volume. -// The volume is created based on properties of the `volume` parameter. The properties `name`, `volume_type` and -// `bricks` are required. -// For example, to add a volume with name `myvolume` to the cluster `123`, send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/123/glustervolumes -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// myvolume -// replicate -// 3 -// -// -// server1 -// /exp1 -// -// -// server2 -// /exp1 -// -// -// server3 -// /exp1 -// -// -// -// ---- +// Attaches an existing storage domain to the data center. // -type GlusterVolumesServiceAddRequest struct { - GlusterVolumesService *GlusterVolumesService - header map[string]string - query map[string]string - volume *GlusterVolume +type AttachedStorageDomainsServiceAddRequest struct { + AttachedStorageDomainsService *AttachedStorageDomainsService + header map[string]string + query map[string]string + storageDomain *StorageDomain } -func (p *GlusterVolumesServiceAddRequest) Header(key, value string) *GlusterVolumesServiceAddRequest { +func (p *AttachedStorageDomainsServiceAddRequest) Header(key, value string) *AttachedStorageDomainsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -13875,7 +12320,7 @@ func (p *GlusterVolumesServiceAddRequest) Header(key, value string) *GlusterVolu return p } -func (p *GlusterVolumesServiceAddRequest) Query(key, value string) *GlusterVolumesServiceAddRequest { +func (p *AttachedStorageDomainsServiceAddRequest) Query(key, value string) *AttachedStorageDomainsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -13883,13 +12328,13 @@ func (p *GlusterVolumesServiceAddRequest) Query(key, value string) *GlusterVolum return p } -func (p *GlusterVolumesServiceAddRequest) Volume(volume *GlusterVolume) *GlusterVolumesServiceAddRequest { - p.volume = volume +func (p *AttachedStorageDomainsServiceAddRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainsServiceAddRequest { + p.storageDomain = storageDomain return p } -func (p *GlusterVolumesServiceAddRequest) Send() (*GlusterVolumesServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterVolumesService.connection.URL(), p.GlusterVolumesService.path) +func (p *AttachedStorageDomainsServiceAddRequest) Send() (*AttachedStorageDomainsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainsService.connection.URL(), p.AttachedStorageDomainsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -13901,7 +12346,7 @@ func (p *GlusterVolumesServiceAddRequest) Send() (*GlusterVolumesServiceAddRespo } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLGlusterVolumeWriteOne(writer, p.volume, "") + err := XMLStorageDomainWriteOne(writer, p.storageDomain, "") if err != nil { return nil, err } @@ -13911,7 +12356,7 @@ func (p *GlusterVolumesServiceAddRequest) Send() (*GlusterVolumesServiceAddRespo return nil, err } - for hk, hv := range p.GlusterVolumesService.connection.headers { + for hk, hv := range p.AttachedStorageDomainsService.connection.headers { req.Header.Add(hk, hv) } @@ -13926,18 +12371,18 @@ func (p *GlusterVolumesServiceAddRequest) Send() (*GlusterVolumesServiceAddRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumesService.connection.authenticate() + token, err := p.AttachedStorageDomainsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumesService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumesService.connection.logFunc != nil { + if p.AttachedStorageDomainsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -13946,7 +12391,7 @@ func (p *GlusterVolumesServiceAddRequest) Send() (*GlusterVolumesServiceAddRespo if err != nil { return nil, err } - p.GlusterVolumesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -13956,14 +12401,14 @@ func (p *GlusterVolumesServiceAddRequest) Send() (*GlusterVolumesServiceAddRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterVolumeReadOne(reader, nil, "") + result, err := XMLStorageDomainReadOne(reader, nil, "") if err != nil { return nil, err } - return &GlusterVolumesServiceAddResponse{volume: result}, nil + return &AttachedStorageDomainsServiceAddResponse{storageDomain: result}, nil } -func (p *GlusterVolumesServiceAddRequest) MustSend() *GlusterVolumesServiceAddResponse { +func (p *AttachedStorageDomainsServiceAddRequest) MustSend() *AttachedStorageDomainsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -13972,114 +12417,46 @@ func (p *GlusterVolumesServiceAddRequest) MustSend() *GlusterVolumesServiceAddRe } // -// Creates a new gluster volume. -// The volume is created based on properties of the `volume` parameter. The properties `name`, `volume_type` and -// `bricks` are required. -// For example, to add a volume with name `myvolume` to the cluster `123`, send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/123/glustervolumes -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// myvolume -// replicate -// 3 -// -// -// server1 -// /exp1 -// -// -// server2 -// /exp1 -// -// -// server3 -// /exp1 -// -// -// -// ---- +// Attaches an existing storage domain to the data center. // -type GlusterVolumesServiceAddResponse struct { - volume *GlusterVolume +type AttachedStorageDomainsServiceAddResponse struct { + storageDomain *StorageDomain } -func (p *GlusterVolumesServiceAddResponse) Volume() (*GlusterVolume, bool) { - if p.volume != nil { - return p.volume, true +func (p *AttachedStorageDomainsServiceAddResponse) StorageDomain() (*StorageDomain, bool) { + if p.storageDomain != nil { + return p.storageDomain, true } return nil, false } -func (p *GlusterVolumesServiceAddResponse) MustVolume() *GlusterVolume { - if p.volume == nil { - panic("volume in response does not exist") +func (p *AttachedStorageDomainsServiceAddResponse) MustStorageDomain() *StorageDomain { + if p.storageDomain == nil { + panic("storageDomain in response does not exist") } - return p.volume + return p.storageDomain } // -// Creates a new gluster volume. -// The volume is created based on properties of the `volume` parameter. The properties `name`, `volume_type` and -// `bricks` are required. -// For example, to add a volume with name `myvolume` to the cluster `123`, send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/123/glustervolumes -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// myvolume -// replicate -// 3 -// -// -// server1 -// /exp1 -// -// -// server2 -// /exp1 -// -// -// server3 -// /exp1 -// -// -// -// ---- +// Attaches an existing storage domain to the data center. // -func (p *GlusterVolumesService) Add() *GlusterVolumesServiceAddRequest { - return &GlusterVolumesServiceAddRequest{GlusterVolumesService: p} +func (p *AttachedStorageDomainsService) Add() *AttachedStorageDomainsServiceAddRequest { + return &AttachedStorageDomainsServiceAddRequest{AttachedStorageDomainsService: p} } // -// Lists all gluster volumes in the cluster. -// For example, to list all Gluster Volumes in cluster `456`, send a request like -// this: -// [source] -// ---- -// GET /ovirt-engine/api/clusters/456/glustervolumes -// ---- -// The order of the returned list of volumes isn't guaranteed. +// Returns the list of storage domains attached to the data center. +// The order of the returned storage domains isn't guaranteed. // -type GlusterVolumesServiceListRequest struct { - GlusterVolumesService *GlusterVolumesService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string +type AttachedStorageDomainsServiceListRequest struct { + AttachedStorageDomainsService *AttachedStorageDomainsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *GlusterVolumesServiceListRequest) Header(key, value string) *GlusterVolumesServiceListRequest { +func (p *AttachedStorageDomainsServiceListRequest) Header(key, value string) *AttachedStorageDomainsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -14087,7 +12464,7 @@ func (p *GlusterVolumesServiceListRequest) Header(key, value string) *GlusterVol return p } -func (p *GlusterVolumesServiceListRequest) Query(key, value string) *GlusterVolumesServiceListRequest { +func (p *AttachedStorageDomainsServiceListRequest) Query(key, value string) *AttachedStorageDomainsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -14095,33 +12472,19 @@ func (p *GlusterVolumesServiceListRequest) Query(key, value string) *GlusterVolu return p } -func (p *GlusterVolumesServiceListRequest) CaseSensitive(caseSensitive bool) *GlusterVolumesServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *GlusterVolumesServiceListRequest) Follow(follow string) *GlusterVolumesServiceListRequest { +func (p *AttachedStorageDomainsServiceListRequest) Follow(follow string) *AttachedStorageDomainsServiceListRequest { p.follow = &follow return p } -func (p *GlusterVolumesServiceListRequest) Max(max int64) *GlusterVolumesServiceListRequest { +func (p *AttachedStorageDomainsServiceListRequest) Max(max int64) *AttachedStorageDomainsServiceListRequest { p.max = &max return p } -func (p *GlusterVolumesServiceListRequest) Search(search string) *GlusterVolumesServiceListRequest { - p.search = &search - return p -} - -func (p *GlusterVolumesServiceListRequest) Send() (*GlusterVolumesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterVolumesService.connection.URL(), p.GlusterVolumesService.path) +func (p *AttachedStorageDomainsServiceListRequest) Send() (*AttachedStorageDomainsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainsService.connection.URL(), p.AttachedStorageDomainsService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } @@ -14130,10 +12493,6 @@ func (p *GlusterVolumesServiceListRequest) Send() (*GlusterVolumesServiceListRes values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -14147,7 +12506,7 @@ func (p *GlusterVolumesServiceListRequest) Send() (*GlusterVolumesServiceListRes return nil, err } - for hk, hv := range p.GlusterVolumesService.connection.headers { + for hk, hv := range p.AttachedStorageDomainsService.connection.headers { req.Header.Add(hk, hv) } @@ -14162,18 +12521,18 @@ func (p *GlusterVolumesServiceListRequest) Send() (*GlusterVolumesServiceListRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumesService.connection.authenticate() + token, err := p.AttachedStorageDomainsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumesService.connection.client.Do(req) + resp, err := p.AttachedStorageDomainsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumesService.connection.logFunc != nil { + if p.AttachedStorageDomainsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -14182,7 +12541,7 @@ func (p *GlusterVolumesServiceListRequest) Send() (*GlusterVolumesServiceListRes if err != nil { return nil, err } - p.GlusterVolumesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.AttachedStorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -14192,14 +12551,14 @@ func (p *GlusterVolumesServiceListRequest) Send() (*GlusterVolumesServiceListRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterVolumeReadMany(reader, nil) + result, err := XMLStorageDomainReadMany(reader, nil) if err != nil { return nil, err } - return &GlusterVolumesServiceListResponse{volumes: result}, nil + return &AttachedStorageDomainsServiceListResponse{storageDomains: result}, nil } -func (p *GlusterVolumesServiceListRequest) MustSend() *GlusterVolumesServiceListResponse { +func (p *AttachedStorageDomainsServiceListRequest) MustSend() *AttachedStorageDomainsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -14208,133 +12567,83 @@ func (p *GlusterVolumesServiceListRequest) MustSend() *GlusterVolumesServiceList } // -// Lists all gluster volumes in the cluster. -// For example, to list all Gluster Volumes in cluster `456`, send a request like -// this: -// [source] -// ---- -// GET /ovirt-engine/api/clusters/456/glustervolumes -// ---- -// The order of the returned list of volumes isn't guaranteed. +// Returns the list of storage domains attached to the data center. +// The order of the returned storage domains isn't guaranteed. // -type GlusterVolumesServiceListResponse struct { - volumes *GlusterVolumeSlice +type AttachedStorageDomainsServiceListResponse struct { + storageDomains *StorageDomainSlice } -func (p *GlusterVolumesServiceListResponse) Volumes() (*GlusterVolumeSlice, bool) { - if p.volumes != nil { - return p.volumes, true +func (p *AttachedStorageDomainsServiceListResponse) StorageDomains() (*StorageDomainSlice, bool) { + if p.storageDomains != nil { + return p.storageDomains, true } return nil, false } -func (p *GlusterVolumesServiceListResponse) MustVolumes() *GlusterVolumeSlice { - if p.volumes == nil { - panic("volumes in response does not exist") +func (p *AttachedStorageDomainsServiceListResponse) MustStorageDomains() *StorageDomainSlice { + if p.storageDomains == nil { + panic("storageDomains in response does not exist") } - return p.volumes + return p.storageDomains } // -// Lists all gluster volumes in the cluster. -// For example, to list all Gluster Volumes in cluster `456`, send a request like -// this: -// [source] -// ---- -// GET /ovirt-engine/api/clusters/456/glustervolumes -// ---- -// The order of the returned list of volumes isn't guaranteed. +// Returns the list of storage domains attached to the data center. +// The order of the returned storage domains isn't guaranteed. // -func (p *GlusterVolumesService) List() *GlusterVolumesServiceListRequest { - return &GlusterVolumesServiceListRequest{GlusterVolumesService: p} +func (p *AttachedStorageDomainsService) List() *AttachedStorageDomainsServiceListRequest { + return &AttachedStorageDomainsServiceListRequest{AttachedStorageDomainsService: p} } // -// Reference to a service managing gluster volume. // -func (op *GlusterVolumesService) VolumeService(id string) *GlusterVolumeService { - return NewGlusterVolumeService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *AttachedStorageDomainsService) StorageDomainService(id string) *AttachedStorageDomainService { + return NewAttachedStorageDomainService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *GlusterVolumesService) Service(path string) (Service, error) { +func (op *AttachedStorageDomainsService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.VolumeService(path), nil + return op.StorageDomainService(path), nil } - return op.VolumeService(path[:index]).Service(path[index+1:]) + return op.StorageDomainService(path[:index]).Service(path[index+1:]) } -func (op *GlusterVolumesService) String() string { - return fmt.Sprintf("GlusterVolumesService:%s", op.path) +func (op *AttachedStorageDomainsService) String() string { + return fmt.Sprintf("AttachedStorageDomainsService:%s", op.path) } // -// This service manages a single gluster volume. // -type GlusterVolumeService struct { +type BalanceService struct { BaseService } -func NewGlusterVolumeService(connection *Connection, path string) *GlusterVolumeService { - var result GlusterVolumeService +func NewBalanceService(connection *Connection, path string) *BalanceService { + var result BalanceService result.connection = connection result.path = path return &result } // -// Get the gluster volume details. -// For example, to get details of a gluster volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// GET /ovirt-engine/api/clusters/456/glustervolumes/123 -// ---- -// This GET request will return the following output: -// [source,xml] -// ---- -// -// data -// -// 0 -// -// -// -// -// -// 0 -// 3 -// up -// 0 -// -// tcp -// -// replicate -// -// ---- // -type GlusterVolumeServiceGetRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - follow *string +type BalanceServiceGetRequest struct { + BalanceService *BalanceService + header map[string]string + query map[string]string + filter *bool + follow *string } -func (p *GlusterVolumeServiceGetRequest) Header(key, value string) *GlusterVolumeServiceGetRequest { +func (p *BalanceServiceGetRequest) Header(key, value string) *BalanceServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -14342,7 +12651,7 @@ func (p *GlusterVolumeServiceGetRequest) Header(key, value string) *GlusterVolum return p } -func (p *GlusterVolumeServiceGetRequest) Query(key, value string) *GlusterVolumeServiceGetRequest { +func (p *BalanceServiceGetRequest) Query(key, value string) *BalanceServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -14350,14 +12659,23 @@ func (p *GlusterVolumeServiceGetRequest) Query(key, value string) *GlusterVolume return p } -func (p *GlusterVolumeServiceGetRequest) Follow(follow string) *GlusterVolumeServiceGetRequest { +func (p *BalanceServiceGetRequest) Filter(filter bool) *BalanceServiceGetRequest { + p.filter = &filter + return p +} + +func (p *BalanceServiceGetRequest) Follow(follow string) *BalanceServiceGetRequest { p.follow = &follow return p } -func (p *GlusterVolumeServiceGetRequest) Send() (*GlusterVolumeServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) +func (p *BalanceServiceGetRequest) Send() (*BalanceServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BalanceService.connection.URL(), p.BalanceService.path) values := make(url.Values) + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } @@ -14375,7 +12693,7 @@ func (p *GlusterVolumeServiceGetRequest) Send() (*GlusterVolumeServiceGetRespons return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BalanceService.connection.headers { req.Header.Add(hk, hv) } @@ -14390,18 +12708,18 @@ func (p *GlusterVolumeServiceGetRequest) Send() (*GlusterVolumeServiceGetRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BalanceService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BalanceService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BalanceService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -14410,7 +12728,7 @@ func (p *GlusterVolumeServiceGetRequest) Send() (*GlusterVolumeServiceGetRespons if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BalanceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -14420,14 +12738,14 @@ func (p *GlusterVolumeServiceGetRequest) Send() (*GlusterVolumeServiceGetRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterVolumeReadOne(reader, nil, "") + result, err := XMLBalanceReadOne(reader, nil, "") if err != nil { return nil, err } - return &GlusterVolumeServiceGetResponse{volume: result}, nil + return &BalanceServiceGetResponse{balance: result}, nil } -func (p *GlusterVolumeServiceGetRequest) MustSend() *GlusterVolumeServiceGetResponse { +func (p *BalanceServiceGetRequest) MustSend() *BalanceServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -14436,121 +12754,41 @@ func (p *GlusterVolumeServiceGetRequest) MustSend() *GlusterVolumeServiceGetResp } // -// Get the gluster volume details. -// For example, to get details of a gluster volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// GET /ovirt-engine/api/clusters/456/glustervolumes/123 -// ---- -// This GET request will return the following output: -// [source,xml] -// ---- -// -// data -// -// 0 -// -// -// -// -// -// 0 -// 3 -// up -// 0 -// -// tcp -// -// replicate -// -// ---- // -type GlusterVolumeServiceGetResponse struct { - volume *GlusterVolume +type BalanceServiceGetResponse struct { + balance *Balance } -func (p *GlusterVolumeServiceGetResponse) Volume() (*GlusterVolume, bool) { - if p.volume != nil { - return p.volume, true +func (p *BalanceServiceGetResponse) Balance() (*Balance, bool) { + if p.balance != nil { + return p.balance, true } return nil, false } -func (p *GlusterVolumeServiceGetResponse) MustVolume() *GlusterVolume { - if p.volume == nil { - panic("volume in response does not exist") +func (p *BalanceServiceGetResponse) MustBalance() *Balance { + if p.balance == nil { + panic("balance in response does not exist") } - return p.volume + return p.balance } // -// Get the gluster volume details. -// For example, to get details of a gluster volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// GET /ovirt-engine/api/clusters/456/glustervolumes/123 -// ---- -// This GET request will return the following output: -// [source,xml] -// ---- -// -// data -// -// 0 -// -// -// -// -// -// 0 -// 3 -// up -// 0 -// -// tcp -// -// replicate -// -// ---- // -func (p *GlusterVolumeService) Get() *GlusterVolumeServiceGetRequest { - return &GlusterVolumeServiceGetRequest{GlusterVolumeService: p} +func (p *BalanceService) Get() *BalanceServiceGetRequest { + return &BalanceServiceGetRequest{BalanceService: p} } // -// Get gluster volume profile statistics. -// For example, to get profile statistics for a gluster volume with identifier `123` in cluster `456`, send a -// request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/getprofilestatistics -// ---- // -type GlusterVolumeServiceGetProfileStatisticsRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string +type BalanceServiceRemoveRequest struct { + BalanceService *BalanceService + header map[string]string + query map[string]string + async *bool } -func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Header(key, value string) *GlusterVolumeServiceGetProfileStatisticsRequest { +func (p *BalanceServiceRemoveRequest) Header(key, value string) *BalanceServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -14558,7 +12796,7 @@ func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Header(key, value stri return p } -func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Query(key, value string) *GlusterVolumeServiceGetProfileStatisticsRequest { +func (p *BalanceServiceRemoveRequest) Query(key, value string) *BalanceServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -14566,14 +12804,18 @@ func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Query(key, value strin return p } -func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Send() (*GlusterVolumeServiceGetProfileStatisticsResponse, error) { - rawURL := fmt.Sprintf("%s%s/getprofilestatistics", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *BalanceServiceRemoveRequest) Async(async bool) *BalanceServiceRemoveRequest { + p.async = &async + return p +} + +func (p *BalanceServiceRemoveRequest) Send() (*BalanceServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BalanceService.connection.URL(), p.BalanceService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -14582,16 +12824,12 @@ func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Send() (*GlusterVolume if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BalanceService.connection.headers { req.Header.Add(hk, hv) } @@ -14606,18 +12844,18 @@ func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Send() (*GlusterVolume req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BalanceService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BalanceService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BalanceService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -14626,17 +12864,19 @@ func (p *GlusterVolumeServiceGetProfileStatisticsRequest) Send() (*GlusterVolume if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BalanceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustDetails() - return &GlusterVolumeServiceGetProfileStatisticsResponse{details: result}, nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(BalanceServiceRemoveResponse), nil } -func (p *GlusterVolumeServiceGetProfileStatisticsRequest) MustSend() *GlusterVolumeServiceGetProfileStatisticsResponse { +func (p *BalanceServiceRemoveRequest) MustSend() *BalanceServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -14645,67 +12885,54 @@ func (p *GlusterVolumeServiceGetProfileStatisticsRequest) MustSend() *GlusterVol } // -// Get gluster volume profile statistics. -// For example, to get profile statistics for a gluster volume with identifier `123` in cluster `456`, send a -// request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/getprofilestatistics -// ---- // -type GlusterVolumeServiceGetProfileStatisticsResponse struct { - details *GlusterVolumeProfileDetails +type BalanceServiceRemoveResponse struct { } -func (p *GlusterVolumeServiceGetProfileStatisticsResponse) Details() (*GlusterVolumeProfileDetails, bool) { - if p.details != nil { - return p.details, true - } - return nil, false +// +// +func (p *BalanceService) Remove() *BalanceServiceRemoveRequest { + return &BalanceServiceRemoveRequest{BalanceService: p} } -func (p *GlusterVolumeServiceGetProfileStatisticsResponse) MustDetails() *GlusterVolumeProfileDetails { - if p.details == nil { - panic("details in response does not exist") +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *BalanceService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - return p.details + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *BalanceService) String() string { + return fmt.Sprintf("BalanceService:%s", op.path) } // -// Get gluster volume profile statistics. -// For example, to get profile statistics for a gluster volume with identifier `123` in cluster `456`, send a -// request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/getprofilestatistics -// ---- // -func (p *GlusterVolumeService) GetProfileStatistics() *GlusterVolumeServiceGetProfileStatisticsRequest { - return &GlusterVolumeServiceGetProfileStatisticsRequest{GlusterVolumeService: p} +type BalancesService struct { + BaseService +} + +func NewBalancesService(connection *Connection, path string) *BalancesService { + var result BalancesService + result.connection = connection + result.path = path + return &result } // -// Rebalance the gluster volume. -// Rebalancing a gluster volume helps to distribute the data evenly across all the bricks. After expanding or -// shrinking a gluster volume (without migrating data), we need to rebalance the data among the bricks. In a -// non-replicated volume, all bricks should be online to perform the rebalance operation. In a replicated volume, at -// least one of the bricks in the replica should be online. -// For example, to rebalance a gluster volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/rebalance -// ---- +// Add a balance module to a specified user defined scheduling policy. // -type GlusterVolumeServiceRebalanceRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool - fixLayout *bool - force *bool +type BalancesServiceAddRequest struct { + BalancesService *BalancesService + header map[string]string + query map[string]string + balance *Balance } -func (p *GlusterVolumeServiceRebalanceRequest) Header(key, value string) *GlusterVolumeServiceRebalanceRequest { +func (p *BalancesServiceAddRequest) Header(key, value string) *BalancesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -14713,7 +12940,7 @@ func (p *GlusterVolumeServiceRebalanceRequest) Header(key, value string) *Gluste return p } -func (p *GlusterVolumeServiceRebalanceRequest) Query(key, value string) *GlusterVolumeServiceRebalanceRequest { +func (p *BalancesServiceAddRequest) Query(key, value string) *BalancesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -14721,37 +12948,13 @@ func (p *GlusterVolumeServiceRebalanceRequest) Query(key, value string) *Gluster return p } -func (p *GlusterVolumeServiceRebalanceRequest) Async(async bool) *GlusterVolumeServiceRebalanceRequest { - p.async = &async - return p -} - -func (p *GlusterVolumeServiceRebalanceRequest) FixLayout(fixLayout bool) *GlusterVolumeServiceRebalanceRequest { - p.fixLayout = &fixLayout - return p -} - -func (p *GlusterVolumeServiceRebalanceRequest) Force(force bool) *GlusterVolumeServiceRebalanceRequest { - p.force = &force +func (p *BalancesServiceAddRequest) Balance(balance *Balance) *BalancesServiceAddRequest { + p.balance = balance return p } -func (p *GlusterVolumeServiceRebalanceRequest) Send() (*GlusterVolumeServiceRebalanceResponse, error) { - rawURL := fmt.Sprintf("%s%s/rebalance", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.fixLayout != nil { - actionBuilder.FixLayout(*p.fixLayout) - } - if p.force != nil { - actionBuilder.Force(*p.force) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *BalancesServiceAddRequest) Send() (*BalancesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BalancesService.connection.URL(), p.BalancesService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -14763,14 +12966,17 @@ func (p *GlusterVolumeServiceRebalanceRequest) Send() (*GlusterVolumeServiceReba } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLBalanceWriteOne(writer, p.balance, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BalancesService.connection.headers { req.Header.Add(hk, hv) } @@ -14785,18 +12991,18 @@ func (p *GlusterVolumeServiceRebalanceRequest) Send() (*GlusterVolumeServiceReba req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BalancesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BalancesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BalancesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -14805,16 +13011,24 @@ func (p *GlusterVolumeServiceRebalanceRequest) Send() (*GlusterVolumeServiceReba if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BalancesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceRebalanceResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLBalanceReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &BalancesServiceAddResponse{balance: result}, nil } -func (p *GlusterVolumeServiceRebalanceRequest) MustSend() *GlusterVolumeServiceRebalanceResponse { +func (p *BalancesServiceAddRequest) MustSend() *BalancesServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -14823,52 +13037,47 @@ func (p *GlusterVolumeServiceRebalanceRequest) MustSend() *GlusterVolumeServiceR } // -// Rebalance the gluster volume. -// Rebalancing a gluster volume helps to distribute the data evenly across all the bricks. After expanding or -// shrinking a gluster volume (without migrating data), we need to rebalance the data among the bricks. In a -// non-replicated volume, all bricks should be online to perform the rebalance operation. In a replicated volume, at -// least one of the bricks in the replica should be online. -// For example, to rebalance a gluster volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/rebalance -// ---- +// Add a balance module to a specified user defined scheduling policy. // -type GlusterVolumeServiceRebalanceResponse struct { +type BalancesServiceAddResponse struct { + balance *Balance +} + +func (p *BalancesServiceAddResponse) Balance() (*Balance, bool) { + if p.balance != nil { + return p.balance, true + } + return nil, false +} + +func (p *BalancesServiceAddResponse) MustBalance() *Balance { + if p.balance == nil { + panic("balance in response does not exist") + } + return p.balance } // -// Rebalance the gluster volume. -// Rebalancing a gluster volume helps to distribute the data evenly across all the bricks. After expanding or -// shrinking a gluster volume (without migrating data), we need to rebalance the data among the bricks. In a -// non-replicated volume, all bricks should be online to perform the rebalance operation. In a replicated volume, at -// least one of the bricks in the replica should be online. -// For example, to rebalance a gluster volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/rebalance -// ---- +// Add a balance module to a specified user defined scheduling policy. // -func (p *GlusterVolumeService) Rebalance() *GlusterVolumeServiceRebalanceRequest { - return &GlusterVolumeServiceRebalanceRequest{GlusterVolumeService: p} +func (p *BalancesService) Add() *BalancesServiceAddRequest { + return &BalancesServiceAddRequest{BalancesService: p} } // -// Removes the gluster volume. -// For example, to remove a volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// DELETE /ovirt-engine/api/clusters/456/glustervolumes/123 -// ---- +// Returns the list of balance modules used by the scheduling policy. +// The order of the returned balance modules isn't guaranteed. // -type GlusterVolumeServiceRemoveRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool +type BalancesServiceListRequest struct { + BalancesService *BalancesService + header map[string]string + query map[string]string + filter *bool + follow *string + max *int64 } -func (p *GlusterVolumeServiceRemoveRequest) Header(key, value string) *GlusterVolumeServiceRemoveRequest { +func (p *BalancesServiceListRequest) Header(key, value string) *BalancesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -14876,7 +13085,7 @@ func (p *GlusterVolumeServiceRemoveRequest) Header(key, value string) *GlusterVo return p } -func (p *GlusterVolumeServiceRemoveRequest) Query(key, value string) *GlusterVolumeServiceRemoveRequest { +func (p *BalancesServiceListRequest) Query(key, value string) *BalancesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -14884,16 +13093,34 @@ func (p *GlusterVolumeServiceRemoveRequest) Query(key, value string) *GlusterVol return p } -func (p *GlusterVolumeServiceRemoveRequest) Async(async bool) *GlusterVolumeServiceRemoveRequest { - p.async = &async +func (p *BalancesServiceListRequest) Filter(filter bool) *BalancesServiceListRequest { + p.filter = &filter return p } -func (p *GlusterVolumeServiceRemoveRequest) Send() (*GlusterVolumeServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) +func (p *BalancesServiceListRequest) Follow(follow string) *BalancesServiceListRequest { + p.follow = &follow + return p +} + +func (p *BalancesServiceListRequest) Max(max int64) *BalancesServiceListRequest { + p.max = &max + return p +} + +func (p *BalancesServiceListRequest) Send() (*BalancesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BalancesService.connection.URL(), p.BalancesService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } if p.query != nil { @@ -14904,12 +13131,12 @@ func (p *GlusterVolumeServiceRemoveRequest) Send() (*GlusterVolumeServiceRemoveR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BalancesService.connection.headers { req.Header.Add(hk, hv) } @@ -14924,18 +13151,18 @@ func (p *GlusterVolumeServiceRemoveRequest) Send() (*GlusterVolumeServiceRemoveR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BalancesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BalancesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BalancesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -14944,19 +13171,24 @@ func (p *GlusterVolumeServiceRemoveRequest) Send() (*GlusterVolumeServiceRemoveR if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BalancesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(GlusterVolumeServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLBalanceReadMany(reader, nil) + if err != nil { + return nil, err + } + return &BalancesServiceListResponse{balances: result}, nil } -func (p *GlusterVolumeServiceRemoveRequest) MustSend() *GlusterVolumeServiceRemoveResponse { +func (p *BalancesServiceListRequest) MustSend() *BalancesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -14965,45 +13197,96 @@ func (p *GlusterVolumeServiceRemoveRequest) MustSend() *GlusterVolumeServiceRemo } // -// Removes the gluster volume. -// For example, to remove a volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// DELETE /ovirt-engine/api/clusters/456/glustervolumes/123 -// ---- +// Returns the list of balance modules used by the scheduling policy. +// The order of the returned balance modules isn't guaranteed. // -type GlusterVolumeServiceRemoveResponse struct { +type BalancesServiceListResponse struct { + balances *BalanceSlice +} + +func (p *BalancesServiceListResponse) Balances() (*BalanceSlice, bool) { + if p.balances != nil { + return p.balances, true + } + return nil, false +} + +func (p *BalancesServiceListResponse) MustBalances() *BalanceSlice { + if p.balances == nil { + panic("balances in response does not exist") + } + return p.balances } // -// Removes the gluster volume. -// For example, to remove a volume with identifier `123` in cluster `456`, send a request like this: -// [source] -// ---- -// DELETE /ovirt-engine/api/clusters/456/glustervolumes/123 -// ---- +// Returns the list of balance modules used by the scheduling policy. +// The order of the returned balance modules isn't guaranteed. // -func (p *GlusterVolumeService) Remove() *GlusterVolumeServiceRemoveRequest { - return &GlusterVolumeServiceRemoveRequest{GlusterVolumeService: p} +func (p *BalancesService) List() *BalancesServiceListRequest { + return &BalancesServiceListRequest{BalancesService: p} } // -// Resets all the options set in the gluster volume. -// For example, to reset all options in a gluster volume with identifier `123` in cluster `456`, send a request like -// this: +// +func (op *BalancesService) BalanceService(id string) *BalanceService { + return NewBalanceService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *BalancesService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.BalanceService(path), nil + } + return op.BalanceService(path[:index]).Service(path[index+1:]) +} + +func (op *BalancesService) String() string { + return fmt.Sprintf("BalancesService:%s", op.path) +} + +// +// A service to manage a bookmark. +// +type BookmarkService struct { + BaseService +} + +func NewBookmarkService(connection *Connection, path string) *BookmarkService { + var result BookmarkService + result.connection = connection + result.path = path + return &result +} + +// +// Get a bookmark. +// An example for getting a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetalloptions +// GET /ovirt-engine/api/bookmarks/123 +// ---- +// [source,xml] +// ---- +// +// example_vm +// vm: name=example* +// // ---- // -type GlusterVolumeServiceResetAllOptionsRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool +type BookmarkServiceGetRequest struct { + BookmarkService *BookmarkService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterVolumeServiceResetAllOptionsRequest) Header(key, value string) *GlusterVolumeServiceResetAllOptionsRequest { +func (p *BookmarkServiceGetRequest) Header(key, value string) *BookmarkServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15011,7 +13294,7 @@ func (p *GlusterVolumeServiceResetAllOptionsRequest) Header(key, value string) * return p } -func (p *GlusterVolumeServiceResetAllOptionsRequest) Query(key, value string) *GlusterVolumeServiceResetAllOptionsRequest { +func (p *BookmarkServiceGetRequest) Query(key, value string) *BookmarkServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15019,22 +13302,18 @@ func (p *GlusterVolumeServiceResetAllOptionsRequest) Query(key, value string) *G return p } -func (p *GlusterVolumeServiceResetAllOptionsRequest) Async(async bool) *GlusterVolumeServiceResetAllOptionsRequest { - p.async = &async +func (p *BookmarkServiceGetRequest) Follow(follow string) *BookmarkServiceGetRequest { + p.follow = &follow return p } -func (p *GlusterVolumeServiceResetAllOptionsRequest) Send() (*GlusterVolumeServiceResetAllOptionsResponse, error) { - rawURL := fmt.Sprintf("%s%s/resetalloptions", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *BookmarkServiceGetRequest) Send() (*BookmarkServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BookmarkService.connection.URL(), p.BookmarkService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -15043,16 +13322,12 @@ func (p *GlusterVolumeServiceResetAllOptionsRequest) Send() (*GlusterVolumeServi if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BookmarkService.connection.headers { req.Header.Add(hk, hv) } @@ -15067,18 +13342,18 @@ func (p *GlusterVolumeServiceResetAllOptionsRequest) Send() (*GlusterVolumeServi req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BookmarkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BookmarkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BookmarkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -15087,16 +13362,24 @@ func (p *GlusterVolumeServiceResetAllOptionsRequest) Send() (*GlusterVolumeServi if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BookmarkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceResetAllOptionsResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLBookmarkReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &BookmarkServiceGetResponse{bookmark: result}, nil } -func (p *GlusterVolumeServiceResetAllOptionsRequest) MustSend() *GlusterVolumeServiceResetAllOptionsResponse { +func (p *BookmarkServiceGetRequest) MustSend() *BookmarkServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -15105,56 +13388,73 @@ func (p *GlusterVolumeServiceResetAllOptionsRequest) MustSend() *GlusterVolumeSe } // -// Resets all the options set in the gluster volume. -// For example, to reset all options in a gluster volume with identifier `123` in cluster `456`, send a request like -// this: +// Get a bookmark. +// An example for getting a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetalloptions +// GET /ovirt-engine/api/bookmarks/123 +// ---- +// [source,xml] +// ---- +// +// example_vm +// vm: name=example* +// // ---- // -type GlusterVolumeServiceResetAllOptionsResponse struct { +type BookmarkServiceGetResponse struct { + bookmark *Bookmark +} + +func (p *BookmarkServiceGetResponse) Bookmark() (*Bookmark, bool) { + if p.bookmark != nil { + return p.bookmark, true + } + return nil, false +} + +func (p *BookmarkServiceGetResponse) MustBookmark() *Bookmark { + if p.bookmark == nil { + panic("bookmark in response does not exist") + } + return p.bookmark } // -// Resets all the options set in the gluster volume. -// For example, to reset all options in a gluster volume with identifier `123` in cluster `456`, send a request like -// this: +// Get a bookmark. +// An example for getting a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetalloptions +// GET /ovirt-engine/api/bookmarks/123 +// ---- +// [source,xml] +// ---- +// +// example_vm +// vm: name=example* +// // ---- // -func (p *GlusterVolumeService) ResetAllOptions() *GlusterVolumeServiceResetAllOptionsRequest { - return &GlusterVolumeServiceResetAllOptionsRequest{GlusterVolumeService: p} +func (p *BookmarkService) Get() *BookmarkServiceGetRequest { + return &BookmarkServiceGetRequest{BookmarkService: p} } // -// Resets a particular option in the gluster volume. -// For example, to reset a particular option `option1` in a gluster volume with identifier `123` in cluster `456`, -// send a request like this: +// Remove a bookmark. +// An example for removing a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetoption -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// +// DELETE /ovirt-engine/api/bookmarks/123 // ---- // -type GlusterVolumeServiceResetOptionRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool - force *bool - option *Option +type BookmarkServiceRemoveRequest struct { + BookmarkService *BookmarkService + header map[string]string + query map[string]string + async *bool } -func (p *GlusterVolumeServiceResetOptionRequest) Header(key, value string) *GlusterVolumeServiceResetOptionRequest { +func (p *BookmarkServiceRemoveRequest) Header(key, value string) *BookmarkServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15162,7 +13462,7 @@ func (p *GlusterVolumeServiceResetOptionRequest) Header(key, value string) *Glus return p } -func (p *GlusterVolumeServiceResetOptionRequest) Query(key, value string) *GlusterVolumeServiceResetOptionRequest { +func (p *BookmarkServiceRemoveRequest) Query(key, value string) *BookmarkServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15170,36 +13470,18 @@ func (p *GlusterVolumeServiceResetOptionRequest) Query(key, value string) *Glust return p } -func (p *GlusterVolumeServiceResetOptionRequest) Async(async bool) *GlusterVolumeServiceResetOptionRequest { +func (p *BookmarkServiceRemoveRequest) Async(async bool) *BookmarkServiceRemoveRequest { p.async = &async return p } -func (p *GlusterVolumeServiceResetOptionRequest) Force(force bool) *GlusterVolumeServiceResetOptionRequest { - p.force = &force - return p -} - -func (p *GlusterVolumeServiceResetOptionRequest) Option(option *Option) *GlusterVolumeServiceResetOptionRequest { - p.option = option - return p -} - -func (p *GlusterVolumeServiceResetOptionRequest) Send() (*GlusterVolumeServiceResetOptionResponse, error) { - rawURL := fmt.Sprintf("%s%s/resetoption", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() +func (p *BookmarkServiceRemoveRequest) Send() (*BookmarkServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BookmarkService.connection.URL(), p.BookmarkService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.force != nil { - actionBuilder.Force(*p.force) - } - actionBuilder.Option(p.option) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -15208,16 +13490,12 @@ func (p *GlusterVolumeServiceResetOptionRequest) Send() (*GlusterVolumeServiceRe if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BookmarkService.connection.headers { req.Header.Add(hk, hv) } @@ -15232,18 +13510,18 @@ func (p *GlusterVolumeServiceResetOptionRequest) Send() (*GlusterVolumeServiceRe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BookmarkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BookmarkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BookmarkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -15252,16 +13530,19 @@ func (p *GlusterVolumeServiceResetOptionRequest) Send() (*GlusterVolumeServiceRe if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BookmarkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceResetOptionResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(BookmarkServiceRemoveResponse), nil } -func (p *GlusterVolumeServiceResetOptionRequest) MustSend() *GlusterVolumeServiceResetOptionResponse { +func (p *BookmarkServiceRemoveRequest) MustSend() *BookmarkServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -15270,69 +13551,53 @@ func (p *GlusterVolumeServiceResetOptionRequest) MustSend() *GlusterVolumeServic } // -// Resets a particular option in the gluster volume. -// For example, to reset a particular option `option1` in a gluster volume with identifier `123` in cluster `456`, -// send a request like this: +// Remove a bookmark. +// An example for removing a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetoption -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// +// DELETE /ovirt-engine/api/bookmarks/123 // ---- // -type GlusterVolumeServiceResetOptionResponse struct { +type BookmarkServiceRemoveResponse struct { } // -// Resets a particular option in the gluster volume. -// For example, to reset a particular option `option1` in a gluster volume with identifier `123` in cluster `456`, -// send a request like this: +// Remove a bookmark. +// An example for removing a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/resetoption -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// +// DELETE /ovirt-engine/api/bookmarks/123 // ---- // -func (p *GlusterVolumeService) ResetOption() *GlusterVolumeServiceResetOptionRequest { - return &GlusterVolumeServiceResetOptionRequest{GlusterVolumeService: p} +func (p *BookmarkService) Remove() *BookmarkServiceRemoveRequest { + return &BookmarkServiceRemoveRequest{BookmarkService: p} } // -// Sets a particular option in the gluster volume. -// For example, to set `option1` with value `value1` in a gluster volume with identifier `123` in cluster `456`, -// send a request like this: +// Update a bookmark. +// An example for updating a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/setoption +// PUT /ovirt-engine/api/bookmarks/123 // ---- -// With the following request body: +// With the request body: // [source,xml] // ---- -// -// +// +// new_example_vm +// vm: name=new_example* +// // ---- // -type GlusterVolumeServiceSetOptionRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool - option *Option +type BookmarkServiceUpdateRequest struct { + BookmarkService *BookmarkService + header map[string]string + query map[string]string + async *bool + bookmark *Bookmark } -func (p *GlusterVolumeServiceSetOptionRequest) Header(key, value string) *GlusterVolumeServiceSetOptionRequest { +func (p *BookmarkServiceUpdateRequest) Header(key, value string) *BookmarkServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15340,7 +13605,7 @@ func (p *GlusterVolumeServiceSetOptionRequest) Header(key, value string) *Gluste return p } -func (p *GlusterVolumeServiceSetOptionRequest) Query(key, value string) *GlusterVolumeServiceSetOptionRequest { +func (p *BookmarkServiceUpdateRequest) Query(key, value string) *BookmarkServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15348,28 +13613,23 @@ func (p *GlusterVolumeServiceSetOptionRequest) Query(key, value string) *Gluster return p } -func (p *GlusterVolumeServiceSetOptionRequest) Async(async bool) *GlusterVolumeServiceSetOptionRequest { +func (p *BookmarkServiceUpdateRequest) Async(async bool) *BookmarkServiceUpdateRequest { p.async = &async return p } -func (p *GlusterVolumeServiceSetOptionRequest) Option(option *Option) *GlusterVolumeServiceSetOptionRequest { - p.option = option +func (p *BookmarkServiceUpdateRequest) Bookmark(bookmark *Bookmark) *BookmarkServiceUpdateRequest { + p.bookmark = bookmark return p } -func (p *GlusterVolumeServiceSetOptionRequest) Send() (*GlusterVolumeServiceSetOptionResponse, error) { - rawURL := fmt.Sprintf("%s%s/setoption", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() +func (p *BookmarkServiceUpdateRequest) Send() (*BookmarkServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BookmarkService.connection.URL(), p.BookmarkService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Option(p.option) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -15380,14 +13640,17 @@ func (p *GlusterVolumeServiceSetOptionRequest) Send() (*GlusterVolumeServiceSetO } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLBookmarkWriteOne(writer, p.bookmark, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BookmarkService.connection.headers { req.Header.Add(hk, hv) } @@ -15402,18 +13665,18 @@ func (p *GlusterVolumeServiceSetOptionRequest) Send() (*GlusterVolumeServiceSetO req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BookmarkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BookmarkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BookmarkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -15422,16 +13685,24 @@ func (p *GlusterVolumeServiceSetOptionRequest) Send() (*GlusterVolumeServiceSetO if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BookmarkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceSetOptionResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLBookmarkReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &BookmarkServiceUpdateResponse{bookmark: result}, nil } -func (p *GlusterVolumeServiceSetOptionRequest) MustSend() *GlusterVolumeServiceSetOptionResponse { +func (p *BookmarkServiceUpdateRequest) MustSend() *BookmarkServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -15440,62 +13711,110 @@ func (p *GlusterVolumeServiceSetOptionRequest) MustSend() *GlusterVolumeServiceS } // -// Sets a particular option in the gluster volume. -// For example, to set `option1` with value `value1` in a gluster volume with identifier `123` in cluster `456`, -// send a request like this: +// Update a bookmark. +// An example for updating a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/setoption +// PUT /ovirt-engine/api/bookmarks/123 // ---- -// With the following request body: +// With the request body: // [source,xml] // ---- -// -// +// +// new_example_vm +// vm: name=new_example* +// // ---- // -type GlusterVolumeServiceSetOptionResponse struct { +type BookmarkServiceUpdateResponse struct { + bookmark *Bookmark +} + +func (p *BookmarkServiceUpdateResponse) Bookmark() (*Bookmark, bool) { + if p.bookmark != nil { + return p.bookmark, true + } + return nil, false +} + +func (p *BookmarkServiceUpdateResponse) MustBookmark() *Bookmark { + if p.bookmark == nil { + panic("bookmark in response does not exist") + } + return p.bookmark } // -// Sets a particular option in the gluster volume. -// For example, to set `option1` with value `value1` in a gluster volume with identifier `123` in cluster `456`, -// send a request like this: +// Update a bookmark. +// An example for updating a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/setoption +// PUT /ovirt-engine/api/bookmarks/123 // ---- -// With the following request body: +// With the request body: // [source,xml] // ---- -// -// +// +// new_example_vm +// vm: name=new_example* +// // ---- // -func (p *GlusterVolumeService) SetOption() *GlusterVolumeServiceSetOptionRequest { - return &GlusterVolumeServiceSetOptionRequest{GlusterVolumeService: p} +func (p *BookmarkService) Update() *BookmarkServiceUpdateRequest { + return &BookmarkServiceUpdateRequest{BookmarkService: p} } // -// Starts the gluster volume. -// A Gluster Volume should be started to read/write data. For example, to start a gluster volume with identifier -// `123` in cluster `456`, send a request like this: +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *BookmarkService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *BookmarkService) String() string { + return fmt.Sprintf("BookmarkService:%s", op.path) +} + +// +// A service to manage bookmarks. +// +type BookmarksService struct { + BaseService +} + +func NewBookmarksService(connection *Connection, path string) *BookmarksService { + var result BookmarksService + result.connection = connection + result.path = path + return &result +} + +// +// Adding a new bookmark. +// Example of adding a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/start +// POST /ovirt-engine/api/bookmarks +// ---- +// [source,xml] +// ---- +// +// new_example_vm +// vm: name=new_example* +// // ---- // -type GlusterVolumeServiceStartRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool - force *bool +type BookmarksServiceAddRequest struct { + BookmarksService *BookmarksService + header map[string]string + query map[string]string + bookmark *Bookmark } -func (p *GlusterVolumeServiceStartRequest) Header(key, value string) *GlusterVolumeServiceStartRequest { +func (p *BookmarksServiceAddRequest) Header(key, value string) *BookmarksServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15503,7 +13822,7 @@ func (p *GlusterVolumeServiceStartRequest) Header(key, value string) *GlusterVol return p } -func (p *GlusterVolumeServiceStartRequest) Query(key, value string) *GlusterVolumeServiceStartRequest { +func (p *BookmarksServiceAddRequest) Query(key, value string) *BookmarksServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15511,29 +13830,13 @@ func (p *GlusterVolumeServiceStartRequest) Query(key, value string) *GlusterVolu return p } -func (p *GlusterVolumeServiceStartRequest) Async(async bool) *GlusterVolumeServiceStartRequest { - p.async = &async - return p -} - -func (p *GlusterVolumeServiceStartRequest) Force(force bool) *GlusterVolumeServiceStartRequest { - p.force = &force +func (p *BookmarksServiceAddRequest) Bookmark(bookmark *Bookmark) *BookmarksServiceAddRequest { + p.bookmark = bookmark return p } -func (p *GlusterVolumeServiceStartRequest) Send() (*GlusterVolumeServiceStartResponse, error) { - rawURL := fmt.Sprintf("%s%s/start", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.force != nil { - actionBuilder.Force(*p.force) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *BookmarksServiceAddRequest) Send() (*BookmarksServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BookmarksService.connection.URL(), p.BookmarksService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -15545,14 +13848,17 @@ func (p *GlusterVolumeServiceStartRequest) Send() (*GlusterVolumeServiceStartRes } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLBookmarkWriteOne(writer, p.bookmark, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BookmarksService.connection.headers { req.Header.Add(hk, hv) } @@ -15567,18 +13873,18 @@ func (p *GlusterVolumeServiceStartRequest) Send() (*GlusterVolumeServiceStartRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BookmarksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BookmarksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BookmarksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -15587,16 +13893,24 @@ func (p *GlusterVolumeServiceStartRequest) Send() (*GlusterVolumeServiceStartRes if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BookmarksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceStartResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLBookmarkReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &BookmarksServiceAddResponse{bookmark: result}, nil } -func (p *GlusterVolumeServiceStartRequest) MustSend() *GlusterVolumeServiceStartResponse { +func (p *BookmarksServiceAddRequest) MustSend() *BookmarksServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -15605,46 +13919,88 @@ func (p *GlusterVolumeServiceStartRequest) MustSend() *GlusterVolumeServiceStart } // -// Starts the gluster volume. -// A Gluster Volume should be started to read/write data. For example, to start a gluster volume with identifier -// `123` in cluster `456`, send a request like this: +// Adding a new bookmark. +// Example of adding a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/start +// POST /ovirt-engine/api/bookmarks +// ---- +// [source,xml] +// ---- +// +// new_example_vm +// vm: name=new_example* +// // ---- // -type GlusterVolumeServiceStartResponse struct { +type BookmarksServiceAddResponse struct { + bookmark *Bookmark +} + +func (p *BookmarksServiceAddResponse) Bookmark() (*Bookmark, bool) { + if p.bookmark != nil { + return p.bookmark, true + } + return nil, false +} + +func (p *BookmarksServiceAddResponse) MustBookmark() *Bookmark { + if p.bookmark == nil { + panic("bookmark in response does not exist") + } + return p.bookmark } // -// Starts the gluster volume. -// A Gluster Volume should be started to read/write data. For example, to start a gluster volume with identifier -// `123` in cluster `456`, send a request like this: +// Adding a new bookmark. +// Example of adding a bookmark: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/start +// POST /ovirt-engine/api/bookmarks +// ---- +// [source,xml] +// ---- +// +// new_example_vm +// vm: name=new_example* +// // ---- // -func (p *GlusterVolumeService) Start() *GlusterVolumeServiceStartRequest { - return &GlusterVolumeServiceStartRequest{GlusterVolumeService: p} +func (p *BookmarksService) Add() *BookmarksServiceAddRequest { + return &BookmarksServiceAddRequest{BookmarksService: p} } // -// Start profiling the gluster volume. -// For example, to start profiling a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Listing all the available bookmarks. +// Example of listing bookmarks: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/startprofile +// GET /ovirt-engine/api/bookmarks +// ---- +// [source,xml] +// ---- +// +// +// database +// vm: name=database* +// +// +// example +// vm: name=example* +// +// // ---- +// The order of the returned bookmarks isn't guaranteed. // -type GlusterVolumeServiceStartProfileRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool +type BookmarksServiceListRequest struct { + BookmarksService *BookmarksService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *GlusterVolumeServiceStartProfileRequest) Header(key, value string) *GlusterVolumeServiceStartProfileRequest { +func (p *BookmarksServiceListRequest) Header(key, value string) *BookmarksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15652,7 +14008,7 @@ func (p *GlusterVolumeServiceStartProfileRequest) Header(key, value string) *Glu return p } -func (p *GlusterVolumeServiceStartProfileRequest) Query(key, value string) *GlusterVolumeServiceStartProfileRequest { +func (p *BookmarksServiceListRequest) Query(key, value string) *BookmarksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15660,22 +14016,27 @@ func (p *GlusterVolumeServiceStartProfileRequest) Query(key, value string) *Glus return p } -func (p *GlusterVolumeServiceStartProfileRequest) Async(async bool) *GlusterVolumeServiceStartProfileRequest { - p.async = &async +func (p *BookmarksServiceListRequest) Follow(follow string) *BookmarksServiceListRequest { + p.follow = &follow return p } -func (p *GlusterVolumeServiceStartProfileRequest) Send() (*GlusterVolumeServiceStartProfileResponse, error) { - rawURL := fmt.Sprintf("%s%s/startprofile", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *BookmarksServiceListRequest) Max(max int64) *BookmarksServiceListRequest { + p.max = &max + return p +} + +func (p *BookmarksServiceListRequest) Send() (*BookmarksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.BookmarksService.connection.URL(), p.BookmarksService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -15684,16 +14045,12 @@ func (p *GlusterVolumeServiceStartProfileRequest) Send() (*GlusterVolumeServiceS if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.BookmarksService.connection.headers { req.Header.Add(hk, hv) } @@ -15708,18 +14065,18 @@ func (p *GlusterVolumeServiceStartProfileRequest) Send() (*GlusterVolumeServiceS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.BookmarksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.BookmarksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.BookmarksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -15728,16 +14085,24 @@ func (p *GlusterVolumeServiceStartProfileRequest) Send() (*GlusterVolumeServiceS if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.BookmarksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceStartProfileResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLBookmarkReadMany(reader, nil) + if err != nil { + return nil, err + } + return &BookmarksServiceListResponse{bookmarks: result}, nil } -func (p *GlusterVolumeServiceStartProfileRequest) MustSend() *GlusterVolumeServiceStartProfileResponse { +func (p *BookmarksServiceListRequest) MustSend() *BookmarksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -15746,46 +14111,133 @@ func (p *GlusterVolumeServiceStartProfileRequest) MustSend() *GlusterVolumeServi } // -// Start profiling the gluster volume. -// For example, to start profiling a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Listing all the available bookmarks. +// Example of listing bookmarks: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/startprofile +// GET /ovirt-engine/api/bookmarks +// ---- +// [source,xml] +// ---- +// +// +// database +// vm: name=database* +// +// +// example +// vm: name=example* +// +// // ---- +// The order of the returned bookmarks isn't guaranteed. // -type GlusterVolumeServiceStartProfileResponse struct { +type BookmarksServiceListResponse struct { + bookmarks *BookmarkSlice +} + +func (p *BookmarksServiceListResponse) Bookmarks() (*BookmarkSlice, bool) { + if p.bookmarks != nil { + return p.bookmarks, true + } + return nil, false +} + +func (p *BookmarksServiceListResponse) MustBookmarks() *BookmarkSlice { + if p.bookmarks == nil { + panic("bookmarks in response does not exist") + } + return p.bookmarks } // -// Start profiling the gluster volume. -// For example, to start profiling a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Listing all the available bookmarks. +// Example of listing bookmarks: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/startprofile +// GET /ovirt-engine/api/bookmarks +// ---- +// [source,xml] +// ---- +// +// +// database +// vm: name=database* +// +// +// example +// vm: name=example* +// +// // ---- +// The order of the returned bookmarks isn't guaranteed. // -func (p *GlusterVolumeService) StartProfile() *GlusterVolumeServiceStartProfileRequest { - return &GlusterVolumeServiceStartProfileRequest{GlusterVolumeService: p} +func (p *BookmarksService) List() *BookmarksServiceListRequest { + return &BookmarksServiceListRequest{BookmarksService: p} } // -// Stops the gluster volume. -// Stopping a volume will make its data inaccessible. -// For example, to stop a gluster volume with identifier `123` in cluster `456`, send a request like this: +// A reference to the service managing a specific bookmark. +// +func (op *BookmarksService) BookmarkService(id string) *BookmarkService { + return NewBookmarkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *BookmarksService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.BookmarkService(path), nil + } + return op.BookmarkService(path[:index]).Service(path[index+1:]) +} + +func (op *BookmarksService) String() string { + return fmt.Sprintf("BookmarksService:%s", op.path) +} + +// +// Represents a feature enabled for the cluster. +// +type ClusterEnabledFeatureService struct { + BaseService +} + +func NewClusterEnabledFeatureService(connection *Connection, path string) *ClusterEnabledFeatureService { + var result ClusterEnabledFeatureService + result.connection = connection + result.path = path + return &result +} + +// +// Provides the information about the cluster feature enabled. +// For example, to find details of the enabled feature `456` for cluster `123`, send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stop +// GET /ovirt-engine/api/clusters/123/enabledfeatures/456 +// ---- +// That will return a <> object containing the name: +// [source,xml] +// ---- +// +// libgfapi_supported +// // ---- // -type GlusterVolumeServiceStopRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool - force *bool +type ClusterEnabledFeatureServiceGetRequest struct { + ClusterEnabledFeatureService *ClusterEnabledFeatureService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterVolumeServiceStopRequest) Header(key, value string) *GlusterVolumeServiceStopRequest { +func (p *ClusterEnabledFeatureServiceGetRequest) Header(key, value string) *ClusterEnabledFeatureServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15793,7 +14245,7 @@ func (p *GlusterVolumeServiceStopRequest) Header(key, value string) *GlusterVolu return p } -func (p *GlusterVolumeServiceStopRequest) Query(key, value string) *GlusterVolumeServiceStopRequest { +func (p *ClusterEnabledFeatureServiceGetRequest) Query(key, value string) *ClusterEnabledFeatureServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15801,30 +14253,18 @@ func (p *GlusterVolumeServiceStopRequest) Query(key, value string) *GlusterVolum return p } -func (p *GlusterVolumeServiceStopRequest) Async(async bool) *GlusterVolumeServiceStopRequest { - p.async = &async - return p -} - -func (p *GlusterVolumeServiceStopRequest) Force(force bool) *GlusterVolumeServiceStopRequest { - p.force = &force +func (p *ClusterEnabledFeatureServiceGetRequest) Follow(follow string) *ClusterEnabledFeatureServiceGetRequest { + p.follow = &follow return p } -func (p *GlusterVolumeServiceStopRequest) Send() (*GlusterVolumeServiceStopResponse, error) { - rawURL := fmt.Sprintf("%s%s/stop", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.force != nil { - actionBuilder.Force(*p.force) +func (p *ClusterEnabledFeatureServiceGetRequest) Send() (*ClusterEnabledFeatureServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterEnabledFeatureService.connection.URL(), p.ClusterEnabledFeatureService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -15833,16 +14273,12 @@ func (p *GlusterVolumeServiceStopRequest) Send() (*GlusterVolumeServiceStopRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.ClusterEnabledFeatureService.connection.headers { req.Header.Add(hk, hv) } @@ -15857,18 +14293,18 @@ func (p *GlusterVolumeServiceStopRequest) Send() (*GlusterVolumeServiceStopRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.ClusterEnabledFeatureService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.ClusterEnabledFeatureService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.ClusterEnabledFeatureService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -15877,16 +14313,24 @@ func (p *GlusterVolumeServiceStopRequest) Send() (*GlusterVolumeServiceStopRespo if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterEnabledFeatureService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceStopResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterFeatureReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &ClusterEnabledFeatureServiceGetResponse{feature: result}, nil } -func (p *GlusterVolumeServiceStopRequest) MustSend() *GlusterVolumeServiceStopResponse { +func (p *ClusterEnabledFeatureServiceGetRequest) MustSend() *ClusterEnabledFeatureServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -15895,46 +14339,72 @@ func (p *GlusterVolumeServiceStopRequest) MustSend() *GlusterVolumeServiceStopRe } // -// Stops the gluster volume. -// Stopping a volume will make its data inaccessible. -// For example, to stop a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Provides the information about the cluster feature enabled. +// For example, to find details of the enabled feature `456` for cluster `123`, send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stop +// GET /ovirt-engine/api/clusters/123/enabledfeatures/456 +// ---- +// That will return a <> object containing the name: +// [source,xml] +// ---- +// +// libgfapi_supported +// // ---- // -type GlusterVolumeServiceStopResponse struct { +type ClusterEnabledFeatureServiceGetResponse struct { + feature *ClusterFeature +} + +func (p *ClusterEnabledFeatureServiceGetResponse) Feature() (*ClusterFeature, bool) { + if p.feature != nil { + return p.feature, true + } + return nil, false +} + +func (p *ClusterEnabledFeatureServiceGetResponse) MustFeature() *ClusterFeature { + if p.feature == nil { + panic("feature in response does not exist") + } + return p.feature } // -// Stops the gluster volume. -// Stopping a volume will make its data inaccessible. -// For example, to stop a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Provides the information about the cluster feature enabled. +// For example, to find details of the enabled feature `456` for cluster `123`, send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stop +// GET /ovirt-engine/api/clusters/123/enabledfeatures/456 +// ---- +// That will return a <> object containing the name: +// [source,xml] +// ---- +// +// libgfapi_supported +// // ---- // -func (p *GlusterVolumeService) Stop() *GlusterVolumeServiceStopRequest { - return &GlusterVolumeServiceStopRequest{GlusterVolumeService: p} +func (p *ClusterEnabledFeatureService) Get() *ClusterEnabledFeatureServiceGetRequest { + return &ClusterEnabledFeatureServiceGetRequest{ClusterEnabledFeatureService: p} } // -// Stop profiling the gluster volume. -// For example, to stop profiling a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Disables a cluster feature. +// For example, to disable the feature `456` of cluster `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stopprofile +// DELETE /ovirt-engine/api/clusters/123/enabledfeatures/456 // ---- // -type GlusterVolumeServiceStopProfileRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool +type ClusterEnabledFeatureServiceRemoveRequest struct { + ClusterEnabledFeatureService *ClusterEnabledFeatureService + header map[string]string + query map[string]string } -func (p *GlusterVolumeServiceStopProfileRequest) Header(key, value string) *GlusterVolumeServiceStopProfileRequest { +func (p *ClusterEnabledFeatureServiceRemoveRequest) Header(key, value string) *ClusterEnabledFeatureServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -15942,7 +14412,7 @@ func (p *GlusterVolumeServiceStopProfileRequest) Header(key, value string) *Glus return p } -func (p *GlusterVolumeServiceStopProfileRequest) Query(key, value string) *GlusterVolumeServiceStopProfileRequest { +func (p *ClusterEnabledFeatureServiceRemoveRequest) Query(key, value string) *ClusterEnabledFeatureServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -15950,21 +14420,8 @@ func (p *GlusterVolumeServiceStopProfileRequest) Query(key, value string) *Glust return p } -func (p *GlusterVolumeServiceStopProfileRequest) Async(async bool) *GlusterVolumeServiceStopProfileRequest { - p.async = &async - return p -} - -func (p *GlusterVolumeServiceStopProfileRequest) Send() (*GlusterVolumeServiceStopProfileResponse, error) { - rawURL := fmt.Sprintf("%s%s/stopprofile", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *ClusterEnabledFeatureServiceRemoveRequest) Send() (*ClusterEnabledFeatureServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterEnabledFeatureService.connection.URL(), p.ClusterEnabledFeatureService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -15974,16 +14431,12 @@ func (p *GlusterVolumeServiceStopProfileRequest) Send() (*GlusterVolumeServiceSt if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.ClusterEnabledFeatureService.connection.headers { req.Header.Add(hk, hv) } @@ -15998,18 +14451,18 @@ func (p *GlusterVolumeServiceStopProfileRequest) Send() (*GlusterVolumeServiceSt req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.ClusterEnabledFeatureService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.ClusterEnabledFeatureService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.ClusterEnabledFeatureService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -16018,16 +14471,19 @@ func (p *GlusterVolumeServiceStopProfileRequest) Send() (*GlusterVolumeServiceSt if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterEnabledFeatureService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceStopProfileResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(ClusterEnabledFeatureServiceRemoveResponse), nil } -func (p *GlusterVolumeServiceStopProfileRequest) MustSend() *GlusterVolumeServiceStopProfileResponse { +func (p *ClusterEnabledFeatureServiceRemoveRequest) MustSend() *ClusterEnabledFeatureServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -16036,45 +14492,78 @@ func (p *GlusterVolumeServiceStopProfileRequest) MustSend() *GlusterVolumeServic } // -// Stop profiling the gluster volume. -// For example, to stop profiling a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Disables a cluster feature. +// For example, to disable the feature `456` of cluster `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stopprofile +// DELETE /ovirt-engine/api/clusters/123/enabledfeatures/456 // ---- // -type GlusterVolumeServiceStopProfileResponse struct { +type ClusterEnabledFeatureServiceRemoveResponse struct { } // -// Stop profiling the gluster volume. -// For example, to stop profiling a gluster volume with identifier `123` in cluster `456`, send a request like this: +// Disables a cluster feature. +// For example, to disable the feature `456` of cluster `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stopprofile +// DELETE /ovirt-engine/api/clusters/123/enabledfeatures/456 // ---- // -func (p *GlusterVolumeService) StopProfile() *GlusterVolumeServiceStopProfileRequest { - return &GlusterVolumeServiceStopProfileRequest{GlusterVolumeService: p} +func (p *ClusterEnabledFeatureService) Remove() *ClusterEnabledFeatureServiceRemoveRequest { + return &ClusterEnabledFeatureServiceRemoveRequest{ClusterEnabledFeatureService: p} } // -// Stop rebalancing the gluster volume. -// For example, to stop rebalancing a gluster volume with identifier `123` in cluster `456`, send a request like -// this: +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterEnabledFeatureService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *ClusterEnabledFeatureService) String() string { + return fmt.Sprintf("ClusterEnabledFeatureService:%s", op.path) +} + +// +// Provides information about the additional features that are enabled for this cluster. +// The features that are enabled are the available features for the cluster level +// +type ClusterEnabledFeaturesService struct { + BaseService +} + +func NewClusterEnabledFeaturesService(connection *Connection, path string) *ClusterEnabledFeaturesService { + var result ClusterEnabledFeaturesService + result.connection = connection + result.path = path + return &result +} + +// +// Enable an additional feature for a cluster. +// For example, to enable a feature `456` on cluster `123`, send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stoprebalance +// POST /ovirt-engine/api/clusters/123/enabledfeatures +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// // ---- // -type GlusterVolumeServiceStopRebalanceRequest struct { - GlusterVolumeService *GlusterVolumeService - header map[string]string - query map[string]string - async *bool +type ClusterEnabledFeaturesServiceAddRequest struct { + ClusterEnabledFeaturesService *ClusterEnabledFeaturesService + header map[string]string + query map[string]string + feature *ClusterFeature } -func (p *GlusterVolumeServiceStopRebalanceRequest) Header(key, value string) *GlusterVolumeServiceStopRebalanceRequest { +func (p *ClusterEnabledFeaturesServiceAddRequest) Header(key, value string) *ClusterEnabledFeaturesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -16082,7 +14571,7 @@ func (p *GlusterVolumeServiceStopRebalanceRequest) Header(key, value string) *Gl return p } -func (p *GlusterVolumeServiceStopRebalanceRequest) Query(key, value string) *GlusterVolumeServiceStopRebalanceRequest { +func (p *ClusterEnabledFeaturesServiceAddRequest) Query(key, value string) *ClusterEnabledFeaturesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -16090,21 +14579,13 @@ func (p *GlusterVolumeServiceStopRebalanceRequest) Query(key, value string) *Glu return p } -func (p *GlusterVolumeServiceStopRebalanceRequest) Async(async bool) *GlusterVolumeServiceStopRebalanceRequest { - p.async = &async +func (p *ClusterEnabledFeaturesServiceAddRequest) Feature(feature *ClusterFeature) *ClusterEnabledFeaturesServiceAddRequest { + p.feature = feature return p } -func (p *GlusterVolumeServiceStopRebalanceRequest) Send() (*GlusterVolumeServiceStopRebalanceResponse, error) { - rawURL := fmt.Sprintf("%s%s/stoprebalance", p.GlusterVolumeService.connection.URL(), p.GlusterVolumeService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *ClusterEnabledFeaturesServiceAddRequest) Send() (*ClusterEnabledFeaturesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterEnabledFeaturesService.connection.URL(), p.ClusterEnabledFeaturesService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -16116,14 +14597,17 @@ func (p *GlusterVolumeServiceStopRebalanceRequest) Send() (*GlusterVolumeService } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLClusterFeatureWriteOne(writer, p.feature, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.GlusterVolumeService.connection.headers { + for hk, hv := range p.ClusterEnabledFeaturesService.connection.headers { req.Header.Add(hk, hv) } @@ -16138,18 +14622,18 @@ func (p *GlusterVolumeServiceStopRebalanceRequest) Send() (*GlusterVolumeService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterVolumeService.connection.authenticate() + token, err := p.ClusterEnabledFeaturesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterVolumeService.connection.client.Do(req) + resp, err := p.ClusterEnabledFeaturesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterVolumeService.connection.logFunc != nil { + if p.ClusterEnabledFeaturesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -16158,16 +14642,24 @@ func (p *GlusterVolumeServiceStopRebalanceRequest) Send() (*GlusterVolumeService if err != nil { return nil, err } - p.GlusterVolumeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterEnabledFeaturesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(GlusterVolumeServiceStopRebalanceResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterFeatureReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &ClusterEnabledFeaturesServiceAddResponse{feature: result}, nil } -func (p *GlusterVolumeServiceStopRebalanceRequest) MustSend() *GlusterVolumeServiceStopRebalanceResponse { +func (p *ClusterEnabledFeaturesServiceAddRequest) MustSend() *ClusterEnabledFeaturesServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -16176,114 +14668,79 @@ func (p *GlusterVolumeServiceStopRebalanceRequest) MustSend() *GlusterVolumeServ } // -// Stop rebalancing the gluster volume. -// For example, to stop rebalancing a gluster volume with identifier `123` in cluster `456`, send a request like -// this: +// Enable an additional feature for a cluster. +// For example, to enable a feature `456` on cluster `123`, send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stoprebalance +// POST /ovirt-engine/api/clusters/123/enabledfeatures // ---- -// -type GlusterVolumeServiceStopRebalanceResponse struct { -} - -// -// Stop rebalancing the gluster volume. -// For example, to stop rebalancing a gluster volume with identifier `123` in cluster `456`, send a request like -// this: -// [source] +// The request body should look like this: +// [source,xml] // ---- -// POST /ovirt-engine/api/clusters/456/glustervolumes/123/stoprebalance +// // ---- // -func (p *GlusterVolumeService) StopRebalance() *GlusterVolumeServiceStopRebalanceRequest { - return &GlusterVolumeServiceStopRebalanceRequest{GlusterVolumeService: p} -} - -// -// Reference to a service managing gluster bricks. -// -func (op *GlusterVolumeService) GlusterBricksService() *GlusterBricksService { - return NewGlusterBricksService(op.connection, fmt.Sprintf("%s/glusterbricks", op.path)) -} - -// -// -func (op *GlusterVolumeService) StatisticsService() *StatisticsService { - return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) +type ClusterEnabledFeaturesServiceAddResponse struct { + feature *ClusterFeature } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *GlusterVolumeService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - if path == "glusterbricks" { - return op.GlusterBricksService(), nil - } - if strings.HasPrefix(path, "glusterbricks/") { - return op.GlusterBricksService().Service(path[14:]) - } - if path == "statistics" { - return op.StatisticsService(), nil - } - if strings.HasPrefix(path, "statistics/") { - return op.StatisticsService().Service(path[11:]) +func (p *ClusterEnabledFeaturesServiceAddResponse) Feature() (*ClusterFeature, bool) { + if p.feature != nil { + return p.feature, true } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return nil, false } -func (op *GlusterVolumeService) String() string { - return fmt.Sprintf("GlusterVolumeService:%s", op.path) +func (p *ClusterEnabledFeaturesServiceAddResponse) MustFeature() *ClusterFeature { + if p.feature == nil { + panic("feature in response does not exist") + } + return p.feature } // -// This service manages the gluster bricks in a gluster volume +// Enable an additional feature for a cluster. +// For example, to enable a feature `456` on cluster `123`, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/enabledfeatures +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// ---- // -type GlusterBricksService struct { - BaseService -} - -func NewGlusterBricksService(connection *Connection, path string) *GlusterBricksService { - var result GlusterBricksService - result.connection = connection - result.path = path - return &result +func (p *ClusterEnabledFeaturesService) Add() *ClusterEnabledFeaturesServiceAddRequest { + return &ClusterEnabledFeaturesServiceAddRequest{ClusterEnabledFeaturesService: p} } // -// Activate the bricks post data migration of remove brick operation. -// Used to activate brick(s) once the data migration from bricks is complete but user no longer wishes to remove -// bricks. The bricks that were previously marked for removal will now be used as normal bricks. -// For example, to retain the bricks that on glustervolume `123` from which data was migrated, send a request like -// this: +// Lists the additional features enabled for the cluster. +// For example, to get the features enabled for cluster `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/activate +// GET /ovirt-engine/api/clusters/123/enabledfeatures // ---- -// With a request body like this: +// This will return a list of features: // [source,xml] // ---- -// -// -// -// host1:/rhgs/brick1 -// -// -// +// +// +// test_feature +// +// ... +// // ---- // -type GlusterBricksServiceActivateRequest struct { - GlusterBricksService *GlusterBricksService - header map[string]string - query map[string]string - async *bool - bricks *GlusterBrickSlice +type ClusterEnabledFeaturesServiceListRequest struct { + ClusterEnabledFeaturesService *ClusterEnabledFeaturesService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterBricksServiceActivateRequest) Header(key, value string) *GlusterBricksServiceActivateRequest { +func (p *ClusterEnabledFeaturesServiceListRequest) Header(key, value string) *ClusterEnabledFeaturesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -16291,7 +14748,7 @@ func (p *GlusterBricksServiceActivateRequest) Header(key, value string) *Gluster return p } -func (p *GlusterBricksServiceActivateRequest) Query(key, value string) *GlusterBricksServiceActivateRequest { +func (p *ClusterEnabledFeaturesServiceListRequest) Query(key, value string) *ClusterEnabledFeaturesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -16299,36 +14756,18 @@ func (p *GlusterBricksServiceActivateRequest) Query(key, value string) *GlusterB return p } -func (p *GlusterBricksServiceActivateRequest) Async(async bool) *GlusterBricksServiceActivateRequest { - p.async = &async - return p -} - -func (p *GlusterBricksServiceActivateRequest) Bricks(bricks *GlusterBrickSlice) *GlusterBricksServiceActivateRequest { - p.bricks = bricks +func (p *ClusterEnabledFeaturesServiceListRequest) Follow(follow string) *ClusterEnabledFeaturesServiceListRequest { + p.follow = &follow return p } -func (p *GlusterBricksServiceActivateRequest) BricksOfAny(anys ...*GlusterBrick) *GlusterBricksServiceActivateRequest { - if p.bricks == nil { - p.bricks = new(GlusterBrickSlice) +func (p *ClusterEnabledFeaturesServiceListRequest) Send() (*ClusterEnabledFeaturesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterEnabledFeaturesService.connection.URL(), p.ClusterEnabledFeaturesService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - p.bricks.slice = append(p.bricks.slice, anys...) - return p -} -func (p *GlusterBricksServiceActivateRequest) Send() (*GlusterBricksServiceActivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/activate", p.GlusterBricksService.connection.URL(), p.GlusterBricksService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Bricks(p.bricks) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -16337,16 +14776,12 @@ func (p *GlusterBricksServiceActivateRequest) Send() (*GlusterBricksServiceActiv if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterBricksService.connection.headers { + for hk, hv := range p.ClusterEnabledFeaturesService.connection.headers { req.Header.Add(hk, hv) } @@ -16361,18 +14796,18 @@ func (p *GlusterBricksServiceActivateRequest) Send() (*GlusterBricksServiceActiv req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBricksService.connection.authenticate() + token, err := p.ClusterEnabledFeaturesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBricksService.connection.client.Do(req) + resp, err := p.ClusterEnabledFeaturesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBricksService.connection.logFunc != nil { + if p.ClusterEnabledFeaturesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -16381,16 +14816,24 @@ func (p *GlusterBricksServiceActivateRequest) Send() (*GlusterBricksServiceActiv if err != nil { return nil, err } - p.GlusterBricksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterEnabledFeaturesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterBricksServiceActivateResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterFeatureReadMany(reader, nil) + if err != nil { + return nil, err + } + return &ClusterEnabledFeaturesServiceListResponse{features: result}, nil } -func (p *GlusterBricksServiceActivateRequest) MustSend() *GlusterBricksServiceActivateResponse { +func (p *ClusterEnabledFeaturesServiceListRequest) MustSend() *ClusterEnabledFeaturesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -16399,134 +14842,140 @@ func (p *GlusterBricksServiceActivateRequest) MustSend() *GlusterBricksServiceAc } // -// Activate the bricks post data migration of remove brick operation. -// Used to activate brick(s) once the data migration from bricks is complete but user no longer wishes to remove -// bricks. The bricks that were previously marked for removal will now be used as normal bricks. -// For example, to retain the bricks that on glustervolume `123` from which data was migrated, send a request like -// this: +// Lists the additional features enabled for the cluster. +// For example, to get the features enabled for cluster `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/activate +// GET /ovirt-engine/api/clusters/123/enabledfeatures // ---- -// With a request body like this: +// This will return a list of features: // [source,xml] // ---- -// -// -// -// host1:/rhgs/brick1 -// -// -// +// +// +// test_feature +// +// ... +// // ---- // -type GlusterBricksServiceActivateResponse struct { +type ClusterEnabledFeaturesServiceListResponse struct { + features *ClusterFeatureSlice +} + +func (p *ClusterEnabledFeaturesServiceListResponse) Features() (*ClusterFeatureSlice, bool) { + if p.features != nil { + return p.features, true + } + return nil, false +} + +func (p *ClusterEnabledFeaturesServiceListResponse) MustFeatures() *ClusterFeatureSlice { + if p.features == nil { + panic("features in response does not exist") + } + return p.features } // -// Activate the bricks post data migration of remove brick operation. -// Used to activate brick(s) once the data migration from bricks is complete but user no longer wishes to remove -// bricks. The bricks that were previously marked for removal will now be used as normal bricks. -// For example, to retain the bricks that on glustervolume `123` from which data was migrated, send a request like -// this: +// Lists the additional features enabled for the cluster. +// For example, to get the features enabled for cluster `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/activate +// GET /ovirt-engine/api/clusters/123/enabledfeatures // ---- -// With a request body like this: +// This will return a list of features: // [source,xml] // ---- -// -// -// -// host1:/rhgs/brick1 -// -// -// +// +// +// test_feature +// +// ... +// // ---- // -func (p *GlusterBricksService) Activate() *GlusterBricksServiceActivateRequest { - return &GlusterBricksServiceActivateRequest{GlusterBricksService: p} +func (p *ClusterEnabledFeaturesService) List() *ClusterEnabledFeaturesServiceListRequest { + return &ClusterEnabledFeaturesServiceListRequest{ClusterEnabledFeaturesService: p} } // -// Adds a list of bricks to gluster volume. -// Used to expand a gluster volume by adding bricks. For replicated volume types, the parameter `replica_count` -// needs to be passed. In case the replica count is being increased, then the number of bricks needs to be -// equivalent to the number of replica sets. -// For example, to add bricks to gluster volume `123`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// 111 -// /export/data/brick3 -// -// -// ---- +// A reference to the service that provides information about a specific +// feature enabled for the cluster. // -type GlusterBricksServiceAddRequest struct { - GlusterBricksService *GlusterBricksService - header map[string]string - query map[string]string - bricks *GlusterBrickSlice - replicaCount *int64 - stripeCount *int64 +func (op *ClusterEnabledFeaturesService) FeatureService(id string) *ClusterEnabledFeatureService { + return NewClusterEnabledFeatureService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *GlusterBricksServiceAddRequest) Header(key, value string) *GlusterBricksServiceAddRequest { - if p.header == nil { - p.header = make(map[string]string) +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterEnabledFeaturesService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - p.header[key] = value - return p + index := strings.Index(path, "/") + if index == -1 { + return op.FeatureService(path), nil + } + return op.FeatureService(path[:index]).Service(path[index+1:]) } -func (p *GlusterBricksServiceAddRequest) Query(key, value string) *GlusterBricksServiceAddRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p +func (op *ClusterEnabledFeaturesService) String() string { + return fmt.Sprintf("ClusterEnabledFeaturesService:%s", op.path) } -func (p *GlusterBricksServiceAddRequest) Bricks(bricks *GlusterBrickSlice) *GlusterBricksServiceAddRequest { - p.bricks = bricks - return p +// +// This service lists external providers. +// +type ClusterExternalProvidersService struct { + BaseService } -func (p *GlusterBricksServiceAddRequest) BricksOfAny(anys ...*GlusterBrick) *GlusterBricksServiceAddRequest { - if p.bricks == nil { - p.bricks = new(GlusterBrickSlice) +func NewClusterExternalProvidersService(connection *Connection, path string) *ClusterExternalProvidersService { + var result ClusterExternalProvidersService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the list of external providers. +// The order of the returned list of providers is not guaranteed. +// +type ClusterExternalProvidersServiceListRequest struct { + ClusterExternalProvidersService *ClusterExternalProvidersService + header map[string]string + query map[string]string + follow *string +} + +func (p *ClusterExternalProvidersServiceListRequest) Header(key, value string) *ClusterExternalProvidersServiceListRequest { + if p.header == nil { + p.header = make(map[string]string) } - p.bricks.slice = append(p.bricks.slice, anys...) + p.header[key] = value return p } -func (p *GlusterBricksServiceAddRequest) ReplicaCount(replicaCount int64) *GlusterBricksServiceAddRequest { - p.replicaCount = &replicaCount +func (p *ClusterExternalProvidersServiceListRequest) Query(key, value string) *ClusterExternalProvidersServiceListRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value return p } -func (p *GlusterBricksServiceAddRequest) StripeCount(stripeCount int64) *GlusterBricksServiceAddRequest { - p.stripeCount = &stripeCount +func (p *ClusterExternalProvidersServiceListRequest) Follow(follow string) *ClusterExternalProvidersServiceListRequest { + p.follow = &follow return p } -func (p *GlusterBricksServiceAddRequest) Send() (*GlusterBricksServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterBricksService.connection.URL(), p.GlusterBricksService.path) +func (p *ClusterExternalProvidersServiceListRequest) Send() (*ClusterExternalProvidersServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterExternalProvidersService.connection.URL(), p.ClusterExternalProvidersService.path) values := make(url.Values) - if p.replicaCount != nil { - values["replica_count"] = []string{fmt.Sprintf("%v", *p.replicaCount)} - } - - if p.stripeCount != nil { - values["stripe_count"] = []string{fmt.Sprintf("%v", *p.stripeCount)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -16537,19 +14986,12 @@ func (p *GlusterBricksServiceAddRequest) Send() (*GlusterBricksServiceAddRespons if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLGlusterBrickWriteMany(writer, p.bricks, "", "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterBricksService.connection.headers { + for hk, hv := range p.ClusterExternalProvidersService.connection.headers { req.Header.Add(hk, hv) } @@ -16564,18 +15006,18 @@ func (p *GlusterBricksServiceAddRequest) Send() (*GlusterBricksServiceAddRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBricksService.connection.authenticate() + token, err := p.ClusterExternalProvidersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBricksService.connection.client.Do(req) + resp, err := p.ClusterExternalProvidersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBricksService.connection.logFunc != nil { + if p.ClusterExternalProvidersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -16584,9 +15026,9 @@ func (p *GlusterBricksServiceAddRequest) Send() (*GlusterBricksServiceAddRespons if err != nil { return nil, err } - p.GlusterBricksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterExternalProvidersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -16594,14 +15036,14 @@ func (p *GlusterBricksServiceAddRequest) Send() (*GlusterBricksServiceAddRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterBrickReadMany(reader, nil) + result, err := XMLExternalProviderReadMany(reader, nil) if err != nil { return nil, err } - return &GlusterBricksServiceAddResponse{bricks: result}, nil + return &ClusterExternalProvidersServiceListResponse{providers: result}, nil } -func (p *GlusterBricksServiceAddRequest) MustSend() *GlusterBricksServiceAddResponse { +func (p *ClusterExternalProvidersServiceListRequest) MustSend() *ClusterExternalProvidersServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -16610,105 +15052,86 @@ func (p *GlusterBricksServiceAddRequest) MustSend() *GlusterBricksServiceAddResp } // -// Adds a list of bricks to gluster volume. -// Used to expand a gluster volume by adding bricks. For replicated volume types, the parameter `replica_count` -// needs to be passed. In case the replica count is being increased, then the number of bricks needs to be -// equivalent to the number of replica sets. -// For example, to add bricks to gluster volume `123`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// 111 -// /export/data/brick3 -// -// -// ---- +// Returns the list of external providers. +// The order of the returned list of providers is not guaranteed. // -type GlusterBricksServiceAddResponse struct { - bricks *GlusterBrickSlice +type ClusterExternalProvidersServiceListResponse struct { + providers *ExternalProviderSlice } -func (p *GlusterBricksServiceAddResponse) Bricks() (*GlusterBrickSlice, bool) { - if p.bricks != nil { - return p.bricks, true +func (p *ClusterExternalProvidersServiceListResponse) Providers() (*ExternalProviderSlice, bool) { + if p.providers != nil { + return p.providers, true } return nil, false } -func (p *GlusterBricksServiceAddResponse) MustBricks() *GlusterBrickSlice { - if p.bricks == nil { - panic("bricks in response does not exist") +func (p *ClusterExternalProvidersServiceListResponse) MustProviders() *ExternalProviderSlice { + if p.providers == nil { + panic("providers in response does not exist") } - return p.bricks + return p.providers } // -// Adds a list of bricks to gluster volume. -// Used to expand a gluster volume by adding bricks. For replicated volume types, the parameter `replica_count` -// needs to be passed. In case the replica count is being increased, then the number of bricks needs to be -// equivalent to the number of replica sets. -// For example, to add bricks to gluster volume `123`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// 111 -// /export/data/brick3 -// -// -// ---- +// Returns the list of external providers. +// The order of the returned list of providers is not guaranteed. // -func (p *GlusterBricksService) Add() *GlusterBricksServiceAddRequest { - return &GlusterBricksServiceAddRequest{GlusterBricksService: p} +func (p *ClusterExternalProvidersService) List() *ClusterExternalProvidersServiceListRequest { + return &ClusterExternalProvidersServiceListRequest{ClusterExternalProvidersService: p} } // -// Lists the bricks of a gluster volume. -// For example, to list bricks of gluster volume `123`, send a request like this: +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterExternalProvidersService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *ClusterExternalProvidersService) String() string { + return fmt.Sprintf("ClusterExternalProvidersService:%s", op.path) +} + +// +// Represents a feature enabled for the cluster level +// +type ClusterFeatureService struct { + BaseService +} + +func NewClusterFeatureService(connection *Connection, path string) *ClusterFeatureService { + var result ClusterFeatureService + result.connection = connection + result.path = path + return &result +} + +// +// Provides the information about the a cluster feature supported by a cluster level. +// For example, to find details of the cluster feature `456` for cluster level 4.1, send a request like this: // [source] // ---- -// GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks +// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures/456 // ---- -// Provides an output as below: +// That will return a <> object containing the name: // [source,xml] // ---- -// -// -// host1:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 111 -// up -// -// -// host2:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 222 -// up -// -// +// +// libgfapi_supported +// // ---- -// The order of the returned list is based on the brick order provided at gluster volume creation. // -type GlusterBricksServiceListRequest struct { - GlusterBricksService *GlusterBricksService - header map[string]string - query map[string]string - follow *string - max *int64 +type ClusterFeatureServiceGetRequest struct { + ClusterFeatureService *ClusterFeatureService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterBricksServiceListRequest) Header(key, value string) *GlusterBricksServiceListRequest { +func (p *ClusterFeatureServiceGetRequest) Header(key, value string) *ClusterFeatureServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -16716,7 +15139,7 @@ func (p *GlusterBricksServiceListRequest) Header(key, value string) *GlusterBric return p } -func (p *GlusterBricksServiceListRequest) Query(key, value string) *GlusterBricksServiceListRequest { +func (p *ClusterFeatureServiceGetRequest) Query(key, value string) *ClusterFeatureServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -16724,27 +15147,18 @@ func (p *GlusterBricksServiceListRequest) Query(key, value string) *GlusterBrick return p } -func (p *GlusterBricksServiceListRequest) Follow(follow string) *GlusterBricksServiceListRequest { +func (p *ClusterFeatureServiceGetRequest) Follow(follow string) *ClusterFeatureServiceGetRequest { p.follow = &follow return p } -func (p *GlusterBricksServiceListRequest) Max(max int64) *GlusterBricksServiceListRequest { - p.max = &max - return p -} - -func (p *GlusterBricksServiceListRequest) Send() (*GlusterBricksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterBricksService.connection.URL(), p.GlusterBricksService.path) +func (p *ClusterFeatureServiceGetRequest) Send() (*ClusterFeatureServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterFeatureService.connection.URL(), p.ClusterFeatureService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -16758,7 +15172,7 @@ func (p *GlusterBricksServiceListRequest) Send() (*GlusterBricksServiceListRespo return nil, err } - for hk, hv := range p.GlusterBricksService.connection.headers { + for hk, hv := range p.ClusterFeatureService.connection.headers { req.Header.Add(hk, hv) } @@ -16773,18 +15187,18 @@ func (p *GlusterBricksServiceListRequest) Send() (*GlusterBricksServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBricksService.connection.authenticate() + token, err := p.ClusterFeatureService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBricksService.connection.client.Do(req) + resp, err := p.ClusterFeatureService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBricksService.connection.logFunc != nil { + if p.ClusterFeatureService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -16793,7 +15207,7 @@ func (p *GlusterBricksServiceListRequest) Send() (*GlusterBricksServiceListRespo if err != nil { return nil, err } - p.GlusterBricksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterFeatureService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -16803,14 +15217,14 @@ func (p *GlusterBricksServiceListRequest) Send() (*GlusterBricksServiceListRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGlusterBrickReadMany(reader, nil) + result, err := XMLClusterFeatureReadOne(reader, nil, "") if err != nil { return nil, err } - return &GlusterBricksServiceListResponse{bricks: result}, nil + return &ClusterFeatureServiceGetResponse{feature: result}, nil } -func (p *GlusterBricksServiceListRequest) MustSend() *GlusterBricksServiceListResponse { +func (p *ClusterFeatureServiceGetRequest) MustSend() *ClusterFeatureServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -16819,115 +15233,110 @@ func (p *GlusterBricksServiceListRequest) MustSend() *GlusterBricksServiceListRe } // -// Lists the bricks of a gluster volume. -// For example, to list bricks of gluster volume `123`, send a request like this: +// Provides the information about the a cluster feature supported by a cluster level. +// For example, to find details of the cluster feature `456` for cluster level 4.1, send a request like this: // [source] // ---- -// GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks +// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures/456 // ---- -// Provides an output as below: +// That will return a <> object containing the name: // [source,xml] // ---- -// -// -// host1:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 111 -// up -// -// -// host2:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 222 -// up -// -// +// +// libgfapi_supported +// // ---- -// The order of the returned list is based on the brick order provided at gluster volume creation. // -type GlusterBricksServiceListResponse struct { - bricks *GlusterBrickSlice +type ClusterFeatureServiceGetResponse struct { + feature *ClusterFeature } -func (p *GlusterBricksServiceListResponse) Bricks() (*GlusterBrickSlice, bool) { - if p.bricks != nil { - return p.bricks, true +func (p *ClusterFeatureServiceGetResponse) Feature() (*ClusterFeature, bool) { + if p.feature != nil { + return p.feature, true } return nil, false } -func (p *GlusterBricksServiceListResponse) MustBricks() *GlusterBrickSlice { - if p.bricks == nil { - panic("bricks in response does not exist") +func (p *ClusterFeatureServiceGetResponse) MustFeature() *ClusterFeature { + if p.feature == nil { + panic("feature in response does not exist") } - return p.bricks + return p.feature } // -// Lists the bricks of a gluster volume. -// For example, to list bricks of gluster volume `123`, send a request like this: +// Provides the information about the a cluster feature supported by a cluster level. +// For example, to find details of the cluster feature `456` for cluster level 4.1, send a request like this: // [source] // ---- -// GET /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks +// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures/456 // ---- -// Provides an output as below: +// That will return a <> object containing the name: // [source,xml] // ---- -// -// -// host1:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 111 -// up -// -// -// host2:/rhgs/data/brick1 -// /rhgs/data/brick1 -// 222 -// up -// -// +// +// libgfapi_supported +// // ---- -// The order of the returned list is based on the brick order provided at gluster volume creation. // -func (p *GlusterBricksService) List() *GlusterBricksServiceListRequest { - return &GlusterBricksServiceListRequest{GlusterBricksService: p} +func (p *ClusterFeatureService) Get() *ClusterFeatureServiceGetRequest { + return &ClusterFeatureServiceGetRequest{ClusterFeatureService: p} } // -// Start migration of data prior to removing bricks. -// Removing bricks is a two-step process, where the data on bricks to be removed, is first migrated to remaining -// bricks. Once migration is completed the removal of bricks is confirmed via the API -// <>. If at any point, the action needs to be cancelled -// <> has to be called. -// For instance, to delete a brick from a gluster volume with id `123`, send a request: +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterFeatureService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *ClusterFeatureService) String() string { + return fmt.Sprintf("ClusterFeatureService:%s", op.path) +} + +// +// Provides information about the cluster features that are supported by a cluster level. +// +type ClusterFeaturesService struct { + BaseService +} + +func NewClusterFeaturesService(connection *Connection, path string) *ClusterFeaturesService { + var result ClusterFeaturesService + result.connection = connection + result.path = path + return &result +} + +// +// Lists the cluster features supported by the cluster level. // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/migrate +// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures // ---- -// With a request body like this: +// This will return a list of cluster features supported by the cluster level: // [source,xml] // ---- -// -// -// -// host1:/rhgs/brick1 -// -// -// +// +// +// test_feature +// +// ... +// // ---- -// The migration process can be tracked from the job id returned from the API using -// <> and steps in job using <> // -type GlusterBricksServiceMigrateRequest struct { - GlusterBricksService *GlusterBricksService - header map[string]string - query map[string]string - async *bool - bricks *GlusterBrickSlice +type ClusterFeaturesServiceListRequest struct { + ClusterFeaturesService *ClusterFeaturesService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterBricksServiceMigrateRequest) Header(key, value string) *GlusterBricksServiceMigrateRequest { +func (p *ClusterFeaturesServiceListRequest) Header(key, value string) *ClusterFeaturesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -16935,7 +15344,7 @@ func (p *GlusterBricksServiceMigrateRequest) Header(key, value string) *GlusterB return p } -func (p *GlusterBricksServiceMigrateRequest) Query(key, value string) *GlusterBricksServiceMigrateRequest { +func (p *ClusterFeaturesServiceListRequest) Query(key, value string) *ClusterFeaturesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -16943,36 +15352,18 @@ func (p *GlusterBricksServiceMigrateRequest) Query(key, value string) *GlusterBr return p } -func (p *GlusterBricksServiceMigrateRequest) Async(async bool) *GlusterBricksServiceMigrateRequest { - p.async = &async - return p -} - -func (p *GlusterBricksServiceMigrateRequest) Bricks(bricks *GlusterBrickSlice) *GlusterBricksServiceMigrateRequest { - p.bricks = bricks +func (p *ClusterFeaturesServiceListRequest) Follow(follow string) *ClusterFeaturesServiceListRequest { + p.follow = &follow return p } -func (p *GlusterBricksServiceMigrateRequest) BricksOfAny(anys ...*GlusterBrick) *GlusterBricksServiceMigrateRequest { - if p.bricks == nil { - p.bricks = new(GlusterBrickSlice) +func (p *ClusterFeaturesServiceListRequest) Send() (*ClusterFeaturesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterFeaturesService.connection.URL(), p.ClusterFeaturesService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - p.bricks.slice = append(p.bricks.slice, anys...) - return p -} -func (p *GlusterBricksServiceMigrateRequest) Send() (*GlusterBricksServiceMigrateResponse, error) { - rawURL := fmt.Sprintf("%s%s/migrate", p.GlusterBricksService.connection.URL(), p.GlusterBricksService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Bricks(p.bricks) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -16981,16 +15372,12 @@ func (p *GlusterBricksServiceMigrateRequest) Send() (*GlusterBricksServiceMigrat if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterBricksService.connection.headers { + for hk, hv := range p.ClusterFeaturesService.connection.headers { req.Header.Add(hk, hv) } @@ -17005,18 +15392,18 @@ func (p *GlusterBricksServiceMigrateRequest) Send() (*GlusterBricksServiceMigrat req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBricksService.connection.authenticate() + token, err := p.ClusterFeaturesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBricksService.connection.client.Do(req) + resp, err := p.ClusterFeaturesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBricksService.connection.logFunc != nil { + if p.ClusterFeaturesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -17025,16 +15412,24 @@ func (p *GlusterBricksServiceMigrateRequest) Send() (*GlusterBricksServiceMigrat if err != nil { return nil, err } - p.GlusterBricksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterFeaturesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterBricksServiceMigrateResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterFeatureReadMany(reader, nil) + if err != nil { + return nil, err + } + return &ClusterFeaturesServiceListResponse{features: result}, nil } -func (p *GlusterBricksServiceMigrateRequest) MustSend() *GlusterBricksServiceMigrateResponse { +func (p *ClusterFeaturesServiceListRequest) MustSend() *ClusterFeaturesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -17043,92 +15438,139 @@ func (p *GlusterBricksServiceMigrateRequest) MustSend() *GlusterBricksServiceMig } // -// Start migration of data prior to removing bricks. -// Removing bricks is a two-step process, where the data on bricks to be removed, is first migrated to remaining -// bricks. Once migration is completed the removal of bricks is confirmed via the API -// <>. If at any point, the action needs to be cancelled -// <> has to be called. -// For instance, to delete a brick from a gluster volume with id `123`, send a request: +// Lists the cluster features supported by the cluster level. // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/migrate +// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures // ---- -// With a request body like this: +// This will return a list of cluster features supported by the cluster level: // [source,xml] // ---- -// -// -// -// host1:/rhgs/brick1 -// -// -// +// +// +// test_feature +// +// ... +// // ---- -// The migration process can be tracked from the job id returned from the API using -// <> and steps in job using <> // -type GlusterBricksServiceMigrateResponse struct { +type ClusterFeaturesServiceListResponse struct { + features *ClusterFeatureSlice +} + +func (p *ClusterFeaturesServiceListResponse) Features() (*ClusterFeatureSlice, bool) { + if p.features != nil { + return p.features, true + } + return nil, false +} + +func (p *ClusterFeaturesServiceListResponse) MustFeatures() *ClusterFeatureSlice { + if p.features == nil { + panic("features in response does not exist") + } + return p.features } // -// Start migration of data prior to removing bricks. -// Removing bricks is a two-step process, where the data on bricks to be removed, is first migrated to remaining -// bricks. Once migration is completed the removal of bricks is confirmed via the API -// <>. If at any point, the action needs to be cancelled -// <> has to be called. -// For instance, to delete a brick from a gluster volume with id `123`, send a request: +// Lists the cluster features supported by the cluster level. // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/migrate +// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures // ---- -// With a request body like this: +// This will return a list of cluster features supported by the cluster level: // [source,xml] // ---- -// -// -// -// host1:/rhgs/brick1 -// -// -// +// +// +// test_feature +// +// ... +// // ---- -// The migration process can be tracked from the job id returned from the API using -// <> and steps in job using <> // -func (p *GlusterBricksService) Migrate() *GlusterBricksServiceMigrateRequest { - return &GlusterBricksServiceMigrateRequest{GlusterBricksService: p} +func (p *ClusterFeaturesService) List() *ClusterFeaturesServiceListRequest { + return &ClusterFeaturesServiceListRequest{ClusterFeaturesService: p} } // -// Removes bricks from gluster volume. -// The recommended way to remove bricks without data loss is to first migrate the data using -// <> and then removing them. If migrate was not called on -// bricks prior to remove, the bricks are removed without data migration which may lead to data loss. -// For example, to delete the bricks from gluster volume `123`, send a request like this: +// Reference to the service that provides information about a specific feature. +// +func (op *ClusterFeaturesService) FeatureService(id string) *ClusterFeatureService { + return NewClusterFeatureService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterFeaturesService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.FeatureService(path), nil + } + return op.FeatureService(path[:index]).Service(path[index+1:]) +} + +func (op *ClusterFeaturesService) String() string { + return fmt.Sprintf("ClusterFeaturesService:%s", op.path) +} + +// +// Provides information about a specific cluster level. See the <> service for +// more information. +// +type ClusterLevelService struct { + BaseService +} + +func NewClusterLevelService(connection *Connection, path string) *ClusterLevelService { + var result ClusterLevelService + result.connection = connection + result.path = path + return &result +} + +// +// Provides the information about the capabilities of the specific cluster level managed by this service. +// For example, to find what CPU types are supported by level 3.6 you can send a request like this: // [source] // ---- -// DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks +// GET /ovirt-engine/api/clusterlevels/3.6 // ---- -// With a request body like this: +// That will return a <> object containing the supported CPU types, and other +// information which describes the cluster level: // [source,xml] // ---- -// -// -// host:brick_directory -// -// +// +// +// +// Intel Nehalem Family +// 3 +// x86_64 +// +// ... +// +// +// +// create_vm +// false +// +// ... +// +// // ---- // -type GlusterBricksServiceRemoveRequest struct { - GlusterBricksService *GlusterBricksService - header map[string]string - query map[string]string - async *bool - bricks *GlusterBrickSlice - replicaCount *int64 +type ClusterLevelServiceGetRequest struct { + ClusterLevelService *ClusterLevelService + header map[string]string + query map[string]string + follow *string } -func (p *GlusterBricksServiceRemoveRequest) Header(key, value string) *GlusterBricksServiceRemoveRequest { +func (p *ClusterLevelServiceGetRequest) Header(key, value string) *ClusterLevelServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -17136,7 +15578,7 @@ func (p *GlusterBricksServiceRemoveRequest) Header(key, value string) *GlusterBr return p } -func (p *GlusterBricksServiceRemoveRequest) Query(key, value string) *GlusterBricksServiceRemoveRequest { +func (p *ClusterLevelServiceGetRequest) Query(key, value string) *ClusterLevelServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -17144,38 +15586,16 @@ func (p *GlusterBricksServiceRemoveRequest) Query(key, value string) *GlusterBri return p } -func (p *GlusterBricksServiceRemoveRequest) Async(async bool) *GlusterBricksServiceRemoveRequest { - p.async = &async - return p -} - -func (p *GlusterBricksServiceRemoveRequest) Bricks(bricks *GlusterBrickSlice) *GlusterBricksServiceRemoveRequest { - p.bricks = bricks - return p -} - -func (p *GlusterBricksServiceRemoveRequest) BricksOfAny(anys ...*GlusterBrick) *GlusterBricksServiceRemoveRequest { - if p.bricks == nil { - p.bricks = new(GlusterBrickSlice) - } - p.bricks.slice = append(p.bricks.slice, anys...) - return p -} - -func (p *GlusterBricksServiceRemoveRequest) ReplicaCount(replicaCount int64) *GlusterBricksServiceRemoveRequest { - p.replicaCount = &replicaCount +func (p *ClusterLevelServiceGetRequest) Follow(follow string) *ClusterLevelServiceGetRequest { + p.follow = &follow return p } -func (p *GlusterBricksServiceRemoveRequest) Send() (*GlusterBricksServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.GlusterBricksService.connection.URL(), p.GlusterBricksService.path) +func (p *ClusterLevelServiceGetRequest) Send() (*ClusterLevelServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterLevelService.connection.URL(), p.ClusterLevelService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - - if p.replicaCount != nil { - values["replica_count"] = []string{fmt.Sprintf("%v", *p.replicaCount)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -17186,12 +15606,12 @@ func (p *GlusterBricksServiceRemoveRequest) Send() (*GlusterBricksServiceRemoveR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterBricksService.connection.headers { + for hk, hv := range p.ClusterLevelService.connection.headers { req.Header.Add(hk, hv) } @@ -17206,18 +15626,18 @@ func (p *GlusterBricksServiceRemoveRequest) Send() (*GlusterBricksServiceRemoveR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBricksService.connection.authenticate() + token, err := p.ClusterLevelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBricksService.connection.client.Do(req) + resp, err := p.ClusterLevelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBricksService.connection.logFunc != nil { + if p.ClusterLevelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -17226,19 +15646,24 @@ func (p *GlusterBricksServiceRemoveRequest) Send() (*GlusterBricksServiceRemoveR if err != nil { return nil, err } - p.GlusterBricksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterLevelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(GlusterBricksServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterLevelReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &ClusterLevelServiceGetResponse{level: result}, nil } -func (p *GlusterBricksServiceRemoveRequest) MustSend() *GlusterBricksServiceRemoveResponse { +func (p *ClusterLevelServiceGetRequest) MustSend() *ClusterLevelServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -17247,81 +15672,156 @@ func (p *GlusterBricksServiceRemoveRequest) MustSend() *GlusterBricksServiceRemo } // -// Removes bricks from gluster volume. -// The recommended way to remove bricks without data loss is to first migrate the data using -// <> and then removing them. If migrate was not called on -// bricks prior to remove, the bricks are removed without data migration which may lead to data loss. -// For example, to delete the bricks from gluster volume `123`, send a request like this: +// Provides the information about the capabilities of the specific cluster level managed by this service. +// For example, to find what CPU types are supported by level 3.6 you can send a request like this: // [source] // ---- -// DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks +// GET /ovirt-engine/api/clusterlevels/3.6 // ---- -// With a request body like this: +// That will return a <> object containing the supported CPU types, and other +// information which describes the cluster level: // [source,xml] // ---- -// -// -// host:brick_directory -// -// +// +// +// +// Intel Nehalem Family +// 3 +// x86_64 +// +// ... +// +// +// +// create_vm +// false +// +// ... +// +// // ---- // -type GlusterBricksServiceRemoveResponse struct { +type ClusterLevelServiceGetResponse struct { + level *ClusterLevel +} + +func (p *ClusterLevelServiceGetResponse) Level() (*ClusterLevel, bool) { + if p.level != nil { + return p.level, true + } + return nil, false +} + +func (p *ClusterLevelServiceGetResponse) MustLevel() *ClusterLevel { + if p.level == nil { + panic("level in response does not exist") + } + return p.level } // -// Removes bricks from gluster volume. -// The recommended way to remove bricks without data loss is to first migrate the data using -// <> and then removing them. If migrate was not called on -// bricks prior to remove, the bricks are removed without data migration which may lead to data loss. -// For example, to delete the bricks from gluster volume `123`, send a request like this: +// Provides the information about the capabilities of the specific cluster level managed by this service. +// For example, to find what CPU types are supported by level 3.6 you can send a request like this: // [source] // ---- -// DELETE /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks +// GET /ovirt-engine/api/clusterlevels/3.6 // ---- -// With a request body like this: +// That will return a <> object containing the supported CPU types, and other +// information which describes the cluster level: // [source,xml] // ---- -// -// -// host:brick_directory -// -// +// +// +// +// Intel Nehalem Family +// 3 +// x86_64 +// +// ... +// +// +// +// create_vm +// false +// +// ... +// +// // ---- // -func (p *GlusterBricksService) Remove() *GlusterBricksServiceRemoveRequest { - return &GlusterBricksServiceRemoveRequest{GlusterBricksService: p} +func (p *ClusterLevelService) Get() *ClusterLevelServiceGetRequest { + return &ClusterLevelServiceGetRequest{ClusterLevelService: p} } // -// Stops migration of data from bricks for a remove brick operation. -// To cancel data migration that was started as part of the 2-step remove brick process in case the user wishes to -// continue using the bricks. The bricks that were marked for removal will function as normal bricks post this -// operation. -// For example, to stop migration of data from the bricks of gluster volume `123`, send a request like this: +// Reference to the service that manages the collection of supported features for this cluster level. +// +func (op *ClusterLevelService) ClusterFeaturesService() *ClusterFeaturesService { + return NewClusterFeaturesService(op.connection, fmt.Sprintf("%s/clusterfeatures", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterLevelService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "clusterfeatures" { + return op.ClusterFeaturesService(), nil + } + if strings.HasPrefix(path, "clusterfeatures/") { + return op.ClusterFeaturesService().Service(path[16:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *ClusterLevelService) String() string { + return fmt.Sprintf("ClusterLevelService:%s", op.path) +} + +// +// Provides information about the capabilities of different cluster levels supported by the engine. Version 4.0 of the +// engine supports levels 4.0 and 3.6. Each of these levels support different sets of CPU types, for example. This +// service provides that information. +// +type ClusterLevelsService struct { + BaseService +} + +func NewClusterLevelsService(connection *Connection, path string) *ClusterLevelsService { + var result ClusterLevelsService + result.connection = connection + result.path = path + return &result +} + +// +// Lists the cluster levels supported by the system. // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/stopmigrate +// GET /ovirt-engine/api/clusterlevels // ---- -// With a request body like this: +// This will return a list of available cluster levels. // [source,xml] // ---- -// -// -// host:brick_directory -// -// +// +// +// ... +// +// ... +// // ---- +// The order of the returned cluster levels isn't guaranteed. // -type GlusterBricksServiceStopMigrateRequest struct { - GlusterBricksService *GlusterBricksService +type ClusterLevelsServiceListRequest struct { + ClusterLevelsService *ClusterLevelsService header map[string]string query map[string]string - async *bool - bricks *GlusterBrickSlice + follow *string } -func (p *GlusterBricksServiceStopMigrateRequest) Header(key, value string) *GlusterBricksServiceStopMigrateRequest { +func (p *ClusterLevelsServiceListRequest) Header(key, value string) *ClusterLevelsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -17329,7 +15829,7 @@ func (p *GlusterBricksServiceStopMigrateRequest) Header(key, value string) *Glus return p } -func (p *GlusterBricksServiceStopMigrateRequest) Query(key, value string) *GlusterBricksServiceStopMigrateRequest { +func (p *ClusterLevelsServiceListRequest) Query(key, value string) *ClusterLevelsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -17337,36 +15837,18 @@ func (p *GlusterBricksServiceStopMigrateRequest) Query(key, value string) *Glust return p } -func (p *GlusterBricksServiceStopMigrateRequest) Async(async bool) *GlusterBricksServiceStopMigrateRequest { - p.async = &async - return p -} - -func (p *GlusterBricksServiceStopMigrateRequest) Bricks(bricks *GlusterBrickSlice) *GlusterBricksServiceStopMigrateRequest { - p.bricks = bricks +func (p *ClusterLevelsServiceListRequest) Follow(follow string) *ClusterLevelsServiceListRequest { + p.follow = &follow return p } -func (p *GlusterBricksServiceStopMigrateRequest) BricksOfAny(anys ...*GlusterBrick) *GlusterBricksServiceStopMigrateRequest { - if p.bricks == nil { - p.bricks = new(GlusterBrickSlice) +func (p *ClusterLevelsServiceListRequest) Send() (*ClusterLevelsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterLevelsService.connection.URL(), p.ClusterLevelsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - p.bricks.slice = append(p.bricks.slice, anys...) - return p -} -func (p *GlusterBricksServiceStopMigrateRequest) Send() (*GlusterBricksServiceStopMigrateResponse, error) { - rawURL := fmt.Sprintf("%s%s/stopmigrate", p.GlusterBricksService.connection.URL(), p.GlusterBricksService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Bricks(p.bricks) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -17375,16 +15857,12 @@ func (p *GlusterBricksServiceStopMigrateRequest) Send() (*GlusterBricksServiceSt if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.GlusterBricksService.connection.headers { + for hk, hv := range p.ClusterLevelsService.connection.headers { req.Header.Add(hk, hv) } @@ -17399,18 +15877,18 @@ func (p *GlusterBricksServiceStopMigrateRequest) Send() (*GlusterBricksServiceSt req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.GlusterBricksService.connection.authenticate() + token, err := p.ClusterLevelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.GlusterBricksService.connection.client.Do(req) + resp, err := p.ClusterLevelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.GlusterBricksService.connection.logFunc != nil { + if p.ClusterLevelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -17419,16 +15897,24 @@ func (p *GlusterBricksServiceStopMigrateRequest) Send() (*GlusterBricksServiceSt if err != nil { return nil, err } - p.GlusterBricksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterLevelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(GlusterBricksServiceStopMigrateResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterLevelReadMany(reader, nil) + if err != nil { + return nil, err + } + return &ClusterLevelsServiceListResponse{levels: result}, nil } -func (p *GlusterBricksServiceStopMigrateRequest) MustSend() *GlusterBricksServiceStopMigrateResponse { +func (p *ClusterLevelsServiceListRequest) MustSend() *ClusterLevelsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -17437,151 +15923,113 @@ func (p *GlusterBricksServiceStopMigrateRequest) MustSend() *GlusterBricksServic } // -// Stops migration of data from bricks for a remove brick operation. -// To cancel data migration that was started as part of the 2-step remove brick process in case the user wishes to -// continue using the bricks. The bricks that were marked for removal will function as normal bricks post this -// operation. -// For example, to stop migration of data from the bricks of gluster volume `123`, send a request like this: +// Lists the cluster levels supported by the system. // [source] // ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/stopmigrate +// GET /ovirt-engine/api/clusterlevels // ---- -// With a request body like this: +// This will return a list of available cluster levels. // [source,xml] // ---- -// -// -// host:brick_directory -// -// +// +// +// ... +// +// ... +// // ---- +// The order of the returned cluster levels isn't guaranteed. // -type GlusterBricksServiceStopMigrateResponse struct { +type ClusterLevelsServiceListResponse struct { + levels *ClusterLevelSlice } -// -// Stops migration of data from bricks for a remove brick operation. -// To cancel data migration that was started as part of the 2-step remove brick process in case the user wishes to -// continue using the bricks. The bricks that were marked for removal will function as normal bricks post this -// operation. -// For example, to stop migration of data from the bricks of gluster volume `123`, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/clusters/567/glustervolumes/123/glusterbricks/stopmigrate +func (p *ClusterLevelsServiceListResponse) Levels() (*ClusterLevelSlice, bool) { + if p.levels != nil { + return p.levels, true + } + return nil, false +} + +func (p *ClusterLevelsServiceListResponse) MustLevels() *ClusterLevelSlice { + if p.levels == nil { + panic("levels in response does not exist") + } + return p.levels +} + +// +// Lists the cluster levels supported by the system. +// [source] // ---- -// With a request body like this: +// GET /ovirt-engine/api/clusterlevels +// ---- +// This will return a list of available cluster levels. // [source,xml] // ---- -// -// -// host:brick_directory -// -// +// +// +// ... +// +// ... +// // ---- +// The order of the returned cluster levels isn't guaranteed. // -func (p *GlusterBricksService) StopMigrate() *GlusterBricksServiceStopMigrateRequest { - return &GlusterBricksServiceStopMigrateRequest{GlusterBricksService: p} +func (p *ClusterLevelsService) List() *ClusterLevelsServiceListRequest { + return &ClusterLevelsServiceListRequest{ClusterLevelsService: p} } // -// Returns a reference to the service managing a single gluster brick. +// Reference to the service that provides information about an specific cluster level. // -func (op *GlusterBricksService) BrickService(id string) *GlusterBrickService { - return NewGlusterBrickService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *ClusterLevelsService) LevelService(id string) *ClusterLevelService { + return NewClusterLevelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *GlusterBricksService) Service(path string) (Service, error) { +func (op *ClusterLevelsService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.BrickService(path), nil + return op.LevelService(path), nil } - return op.BrickService(path[:index]).Service(path[index+1:]) + return op.LevelService(path[:index]).Service(path[index+1:]) } -func (op *GlusterBricksService) String() string { - return fmt.Sprintf("GlusterBricksService:%s", op.path) +func (op *ClusterLevelsService) String() string { + return fmt.Sprintf("ClusterLevelsService:%s", op.path) } // -// Manages the set of snapshots of a storage domain or virtual machine. +// A service to manage a specific cluster network. // -type SnapshotsService struct { +type ClusterNetworkService struct { BaseService } -func NewSnapshotsService(connection *Connection, path string) *SnapshotsService { - var result SnapshotsService +func NewClusterNetworkService(connection *Connection, path string) *ClusterNetworkService { + var result ClusterNetworkService result.connection = connection result.path = path return &result } // -// Creates a virtual machine snapshot. -// For example, to create a new snapshot for virtual machine `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/vms/123/snapshots -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// My snapshot -// -// ---- -// For including only a sub-set of disks in the snapshots, add `disk_attachments` element to the -// request body. Note that disks which are not specified in `disk_attachments` element will not be a -// part of the snapshot. If an empty `disk_attachments` element is passed, the snapshot will include -// only the virtual machine configuration. If no `disk_attachments` element is passed, then all -// the disks will be included in the snapshot. -// For each disk, `image_id` element can be specified for setting the new active image id. -// This is used in order to restore a chain of images from backup. I.e. when restoring -// a disk with snapshots, the relevant `image_id` should be specified for each snapshot -// (so the identifiers of the disk snapshots are identical to the backup). -// [source,xml] -// ---- -// -// My snapshot -// -// -// -// 456 -// -// -// -// -// ---- -// [IMPORTANT] -// ==== -// When a snapshot is created the default value for the <> attribute is `true`. That means that the content of the memory of the virtual -// machine will be included in the snapshot, and it also means that the virtual machine will be paused -// for a longer time. That can negatively affect applications that are very sensitive to timing (NTP -// servers, for example). In those cases make sure that you set the attribute to `false`: -// [source,xml] -// ---- -// -// My snapshot -// false -// -// ---- -// ==== +// Retrieves the cluster network details. // -type SnapshotsServiceAddRequest struct { - SnapshotsService *SnapshotsService - header map[string]string - query map[string]string - snapshot *Snapshot +type ClusterNetworkServiceGetRequest struct { + ClusterNetworkService *ClusterNetworkService + header map[string]string + query map[string]string + follow *string } -func (p *SnapshotsServiceAddRequest) Header(key, value string) *SnapshotsServiceAddRequest { +func (p *ClusterNetworkServiceGetRequest) Header(key, value string) *ClusterNetworkServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -17589,7 +16037,7 @@ func (p *SnapshotsServiceAddRequest) Header(key, value string) *SnapshotsService return p } -func (p *SnapshotsServiceAddRequest) Query(key, value string) *SnapshotsServiceAddRequest { +func (p *ClusterNetworkServiceGetRequest) Query(key, value string) *ClusterNetworkServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -17597,14 +16045,18 @@ func (p *SnapshotsServiceAddRequest) Query(key, value string) *SnapshotsServiceA return p } -func (p *SnapshotsServiceAddRequest) Snapshot(snapshot *Snapshot) *SnapshotsServiceAddRequest { - p.snapshot = snapshot +func (p *ClusterNetworkServiceGetRequest) Follow(follow string) *ClusterNetworkServiceGetRequest { + p.follow = &follow return p } -func (p *SnapshotsServiceAddRequest) Send() (*SnapshotsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SnapshotsService.connection.URL(), p.SnapshotsService.path) +func (p *ClusterNetworkServiceGetRequest) Send() (*ClusterNetworkServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterNetworkService.connection.URL(), p.ClusterNetworkService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -17613,19 +16065,12 @@ func (p *SnapshotsServiceAddRequest) Send() (*SnapshotsServiceAddResponse, error if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLSnapshotWriteOne(writer, p.snapshot, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SnapshotsService.connection.headers { + for hk, hv := range p.ClusterNetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -17640,18 +16085,18 @@ func (p *SnapshotsServiceAddRequest) Send() (*SnapshotsServiceAddResponse, error req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SnapshotsService.connection.authenticate() + token, err := p.ClusterNetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SnapshotsService.connection.client.Do(req) + resp, err := p.ClusterNetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SnapshotsService.connection.logFunc != nil { + if p.ClusterNetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -17660,9 +16105,9 @@ func (p *SnapshotsServiceAddRequest) Send() (*SnapshotsServiceAddResponse, error if err != nil { return nil, err } - p.SnapshotsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -17670,14 +16115,14 @@ func (p *SnapshotsServiceAddRequest) Send() (*SnapshotsServiceAddResponse, error return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSnapshotReadOne(reader, nil, "") + result, err := XMLNetworkReadOne(reader, nil, "") if err != nil { return nil, err } - return &SnapshotsServiceAddResponse{snapshot: result}, nil + return &ClusterNetworkServiceGetResponse{network: result}, nil } -func (p *SnapshotsServiceAddRequest) MustSend() *SnapshotsServiceAddResponse { +func (p *ClusterNetworkServiceGetRequest) MustSend() *ClusterNetworkServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -17686,145 +16131,43 @@ func (p *SnapshotsServiceAddRequest) MustSend() *SnapshotsServiceAddResponse { } // -// Creates a virtual machine snapshot. -// For example, to create a new snapshot for virtual machine `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/vms/123/snapshots -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// My snapshot -// -// ---- -// For including only a sub-set of disks in the snapshots, add `disk_attachments` element to the -// request body. Note that disks which are not specified in `disk_attachments` element will not be a -// part of the snapshot. If an empty `disk_attachments` element is passed, the snapshot will include -// only the virtual machine configuration. If no `disk_attachments` element is passed, then all -// the disks will be included in the snapshot. -// For each disk, `image_id` element can be specified for setting the new active image id. -// This is used in order to restore a chain of images from backup. I.e. when restoring -// a disk with snapshots, the relevant `image_id` should be specified for each snapshot -// (so the identifiers of the disk snapshots are identical to the backup). -// [source,xml] -// ---- -// -// My snapshot -// -// -// -// 456 -// -// -// -// -// ---- -// [IMPORTANT] -// ==== -// When a snapshot is created the default value for the <> attribute is `true`. That means that the content of the memory of the virtual -// machine will be included in the snapshot, and it also means that the virtual machine will be paused -// for a longer time. That can negatively affect applications that are very sensitive to timing (NTP -// servers, for example). In those cases make sure that you set the attribute to `false`: -// [source,xml] -// ---- -// -// My snapshot -// false -// -// ---- -// ==== +// Retrieves the cluster network details. // -type SnapshotsServiceAddResponse struct { - snapshot *Snapshot +type ClusterNetworkServiceGetResponse struct { + network *Network } -func (p *SnapshotsServiceAddResponse) Snapshot() (*Snapshot, bool) { - if p.snapshot != nil { - return p.snapshot, true +func (p *ClusterNetworkServiceGetResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } return nil, false } -func (p *SnapshotsServiceAddResponse) MustSnapshot() *Snapshot { - if p.snapshot == nil { - panic("snapshot in response does not exist") +func (p *ClusterNetworkServiceGetResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } - return p.snapshot + return p.network } // -// Creates a virtual machine snapshot. -// For example, to create a new snapshot for virtual machine `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/vms/123/snapshots -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// My snapshot -// -// ---- -// For including only a sub-set of disks in the snapshots, add `disk_attachments` element to the -// request body. Note that disks which are not specified in `disk_attachments` element will not be a -// part of the snapshot. If an empty `disk_attachments` element is passed, the snapshot will include -// only the virtual machine configuration. If no `disk_attachments` element is passed, then all -// the disks will be included in the snapshot. -// For each disk, `image_id` element can be specified for setting the new active image id. -// This is used in order to restore a chain of images from backup. I.e. when restoring -// a disk with snapshots, the relevant `image_id` should be specified for each snapshot -// (so the identifiers of the disk snapshots are identical to the backup). -// [source,xml] -// ---- -// -// My snapshot -// -// -// -// 456 -// -// -// -// -// ---- -// [IMPORTANT] -// ==== -// When a snapshot is created the default value for the <> attribute is `true`. That means that the content of the memory of the virtual -// machine will be included in the snapshot, and it also means that the virtual machine will be paused -// for a longer time. That can negatively affect applications that are very sensitive to timing (NTP -// servers, for example). In those cases make sure that you set the attribute to `false`: -// [source,xml] -// ---- -// -// My snapshot -// false -// -// ---- -// ==== +// Retrieves the cluster network details. // -func (p *SnapshotsService) Add() *SnapshotsServiceAddRequest { - return &SnapshotsServiceAddRequest{SnapshotsService: p} +func (p *ClusterNetworkService) Get() *ClusterNetworkServiceGetRequest { + return &ClusterNetworkServiceGetRequest{ClusterNetworkService: p} } // -// Returns the list of snapshots of the storage domain or virtual machine. -// The order of the returned list of snapshots isn't guaranteed. +// Unassigns the network from a cluster. // -type SnapshotsServiceListRequest struct { - SnapshotsService *SnapshotsService - header map[string]string - query map[string]string - allContent *bool - follow *string - max *int64 +type ClusterNetworkServiceRemoveRequest struct { + ClusterNetworkService *ClusterNetworkService + header map[string]string + query map[string]string } -func (p *SnapshotsServiceListRequest) Header(key, value string) *SnapshotsServiceListRequest { +func (p *ClusterNetworkServiceRemoveRequest) Header(key, value string) *ClusterNetworkServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -17832,7 +16175,7 @@ func (p *SnapshotsServiceListRequest) Header(key, value string) *SnapshotsServic return p } -func (p *SnapshotsServiceListRequest) Query(key, value string) *SnapshotsServiceListRequest { +func (p *ClusterNetworkServiceRemoveRequest) Query(key, value string) *ClusterNetworkServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -17840,36 +16183,9 @@ func (p *SnapshotsServiceListRequest) Query(key, value string) *SnapshotsService return p } -func (p *SnapshotsServiceListRequest) AllContent(allContent bool) *SnapshotsServiceListRequest { - p.allContent = &allContent - return p -} - -func (p *SnapshotsServiceListRequest) Follow(follow string) *SnapshotsServiceListRequest { - p.follow = &follow - return p -} - -func (p *SnapshotsServiceListRequest) Max(max int64) *SnapshotsServiceListRequest { - p.max = &max - return p -} - -func (p *SnapshotsServiceListRequest) Send() (*SnapshotsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SnapshotsService.connection.URL(), p.SnapshotsService.path) +func (p *ClusterNetworkServiceRemoveRequest) Send() (*ClusterNetworkServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterNetworkService.connection.URL(), p.ClusterNetworkService.path) values := make(url.Values) - if p.allContent != nil { - values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -17878,12 +16194,12 @@ func (p *SnapshotsServiceListRequest) Send() (*SnapshotsServiceListResponse, err if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SnapshotsService.connection.headers { + for hk, hv := range p.ClusterNetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -17898,18 +16214,18 @@ func (p *SnapshotsServiceListRequest) Send() (*SnapshotsServiceListResponse, err req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SnapshotsService.connection.authenticate() + token, err := p.ClusterNetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SnapshotsService.connection.client.Do(req) + resp, err := p.ClusterNetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SnapshotsService.connection.logFunc != nil { + if p.ClusterNetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -17918,24 +16234,19 @@ func (p *SnapshotsServiceListRequest) Send() (*SnapshotsServiceListResponse, err if err != nil { return nil, err } - p.SnapshotsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLSnapshotReadMany(reader, nil) - if err != nil { - return nil, err - } - return &SnapshotsServiceListResponse{snapshots: result}, nil + return new(ClusterNetworkServiceRemoveResponse), nil } -func (p *SnapshotsServiceListRequest) MustSend() *SnapshotsServiceListResponse { +func (p *ClusterNetworkServiceRemoveRequest) MustSend() *ClusterNetworkServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -17944,107 +16255,29 @@ func (p *SnapshotsServiceListRequest) MustSend() *SnapshotsServiceListResponse { } // -// Returns the list of snapshots of the storage domain or virtual machine. -// The order of the returned list of snapshots isn't guaranteed. -// -type SnapshotsServiceListResponse struct { - snapshots *SnapshotSlice -} - -func (p *SnapshotsServiceListResponse) Snapshots() (*SnapshotSlice, bool) { - if p.snapshots != nil { - return p.snapshots, true - } - return nil, false -} - -func (p *SnapshotsServiceListResponse) MustSnapshots() *SnapshotSlice { - if p.snapshots == nil { - panic("snapshots in response does not exist") - } - return p.snapshots -} - -// -// Returns the list of snapshots of the storage domain or virtual machine. -// The order of the returned list of snapshots isn't guaranteed. -// -func (p *SnapshotsService) List() *SnapshotsServiceListRequest { - return &SnapshotsServiceListRequest{SnapshotsService: p} -} - -// -// -func (op *SnapshotsService) SnapshotService(id string) *SnapshotService { - return NewSnapshotService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Unassigns the network from a cluster. // -func (op *SnapshotsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.SnapshotService(path), nil - } - return op.SnapshotService(path[:index]).Service(path[index+1:]) -} - -func (op *SnapshotsService) String() string { - return fmt.Sprintf("SnapshotsService:%s", op.path) +type ClusterNetworkServiceRemoveResponse struct { } // -// This service manages hostgroups. +// Unassigns the network from a cluster. // -type ExternalHostGroupsService struct { - BaseService -} - -func NewExternalHostGroupsService(connection *Connection, path string) *ExternalHostGroupsService { - var result ExternalHostGroupsService - result.connection = connection - result.path = path - return &result +func (p *ClusterNetworkService) Remove() *ClusterNetworkServiceRemoveRequest { + return &ClusterNetworkServiceRemoveRequest{ClusterNetworkService: p} } // -// Get host groups list from external host provider. -// Host group is a term of host providers - the host group includes provision details. This API returns all possible -// hostgroups exposed by the external provider. -// For example, to get the details of all host groups of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/hostgroups -// .... -// The response will be like this: -// [source,xml] -// ---- -// -// -// rhel7 -// x86_64 -// example.com -// RedHat 7.3 -// sat0 -// -// -// ... -// -// ---- -// The order of the returned list of host groups isn't guaranteed. +// Updates the network in the cluster. // -type ExternalHostGroupsServiceListRequest struct { - ExternalHostGroupsService *ExternalHostGroupsService - header map[string]string - query map[string]string - follow *string - max *int64 +type ClusterNetworkServiceUpdateRequest struct { + ClusterNetworkService *ClusterNetworkService + header map[string]string + query map[string]string + network *Network } -func (p *ExternalHostGroupsServiceListRequest) Header(key, value string) *ExternalHostGroupsServiceListRequest { +func (p *ClusterNetworkServiceUpdateRequest) Header(key, value string) *ClusterNetworkServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -18052,7 +16285,7 @@ func (p *ExternalHostGroupsServiceListRequest) Header(key, value string) *Extern return p } -func (p *ExternalHostGroupsServiceListRequest) Query(key, value string) *ExternalHostGroupsServiceListRequest { +func (p *ClusterNetworkServiceUpdateRequest) Query(key, value string) *ClusterNetworkServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -18060,27 +16293,14 @@ func (p *ExternalHostGroupsServiceListRequest) Query(key, value string) *Externa return p } -func (p *ExternalHostGroupsServiceListRequest) Follow(follow string) *ExternalHostGroupsServiceListRequest { - p.follow = &follow - return p -} - -func (p *ExternalHostGroupsServiceListRequest) Max(max int64) *ExternalHostGroupsServiceListRequest { - p.max = &max +func (p *ClusterNetworkServiceUpdateRequest) Network(network *Network) *ClusterNetworkServiceUpdateRequest { + p.network = network return p } -func (p *ExternalHostGroupsServiceListRequest) Send() (*ExternalHostGroupsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostGroupsService.connection.URL(), p.ExternalHostGroupsService.path) +func (p *ClusterNetworkServiceUpdateRequest) Send() (*ClusterNetworkServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterNetworkService.connection.URL(), p.ClusterNetworkService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -18089,12 +16309,19 @@ func (p *ExternalHostGroupsServiceListRequest) Send() (*ExternalHostGroupsServic if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLNetworkWriteOne(writer, p.network, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalHostGroupsService.connection.headers { + for hk, hv := range p.ClusterNetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -18109,18 +16336,18 @@ func (p *ExternalHostGroupsServiceListRequest) Send() (*ExternalHostGroupsServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostGroupsService.connection.authenticate() + token, err := p.ClusterNetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostGroupsService.connection.client.Do(req) + resp, err := p.ClusterNetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostGroupsService.connection.logFunc != nil { + if p.ClusterNetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -18129,7 +16356,7 @@ func (p *ExternalHostGroupsServiceListRequest) Send() (*ExternalHostGroupsServic if err != nil { return nil, err } - p.ExternalHostGroupsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -18139,14 +16366,14 @@ func (p *ExternalHostGroupsServiceListRequest) Send() (*ExternalHostGroupsServic return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostGroupReadMany(reader, nil) + result, err := XMLNetworkReadOne(reader, nil, "") if err != nil { return nil, err } - return &ExternalHostGroupsServiceListResponse{groups: result}, nil + return &ClusterNetworkServiceUpdateResponse{network: result}, nil } -func (p *ExternalHostGroupsServiceListRequest) MustSend() *ExternalHostGroupsServiceListResponse { +func (p *ClusterNetworkServiceUpdateRequest) MustSend() *ClusterNetworkServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -18155,145 +16382,82 @@ func (p *ExternalHostGroupsServiceListRequest) MustSend() *ExternalHostGroupsSer } // -// Get host groups list from external host provider. -// Host group is a term of host providers - the host group includes provision details. This API returns all possible -// hostgroups exposed by the external provider. -// For example, to get the details of all host groups of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/hostgroups -// .... -// The response will be like this: -// [source,xml] -// ---- -// -// -// rhel7 -// x86_64 -// example.com -// RedHat 7.3 -// sat0 -// -// -// ... -// -// ---- -// The order of the returned list of host groups isn't guaranteed. +// Updates the network in the cluster. // -type ExternalHostGroupsServiceListResponse struct { - groups *ExternalHostGroupSlice +type ClusterNetworkServiceUpdateResponse struct { + network *Network } -func (p *ExternalHostGroupsServiceListResponse) Groups() (*ExternalHostGroupSlice, bool) { - if p.groups != nil { - return p.groups, true +func (p *ClusterNetworkServiceUpdateResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } return nil, false } -func (p *ExternalHostGroupsServiceListResponse) MustGroups() *ExternalHostGroupSlice { - if p.groups == nil { - panic("groups in response does not exist") +func (p *ClusterNetworkServiceUpdateResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } - return p.groups -} - -// -// Get host groups list from external host provider. -// Host group is a term of host providers - the host group includes provision details. This API returns all possible -// hostgroups exposed by the external provider. -// For example, to get the details of all host groups of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/hostgroups -// .... -// The response will be like this: -// [source,xml] -// ---- -// -// -// rhel7 -// x86_64 -// example.com -// RedHat 7.3 -// sat0 -// -// -// ... -// -// ---- -// The order of the returned list of host groups isn't guaranteed. -// -func (p *ExternalHostGroupsService) List() *ExternalHostGroupsServiceListRequest { - return &ExternalHostGroupsServiceListRequest{ExternalHostGroupsService: p} + return p.network } // -// This service manages hostgroup instance. +// Updates the network in the cluster. // -func (op *ExternalHostGroupsService) GroupService(id string) *ExternalHostGroupService { - return NewExternalHostGroupService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *ClusterNetworkService) Update() *ClusterNetworkServiceUpdateRequest { + return &ClusterNetworkServiceUpdateRequest{ClusterNetworkService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ExternalHostGroupsService) Service(path string) (Service, error) { +func (op *ClusterNetworkService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.GroupService(path), nil - } - return op.GroupService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *ExternalHostGroupsService) String() string { - return fmt.Sprintf("ExternalHostGroupsService:%s", op.path) +func (op *ClusterNetworkService) String() string { + return fmt.Sprintf("ClusterNetworkService:%s", op.path) } // -// Manages a single external compute resource. -// Compute resource is a term of host external provider. The external provider also needs to know to where the -// provisioned host needs to register. The login details of the engine are saved as a compute resource in the external -// provider side. +// A service to manage cluster networks. // -type ExternalComputeResourceService struct { +type ClusterNetworksService struct { BaseService } -func NewExternalComputeResourceService(connection *Connection, path string) *ExternalComputeResourceService { - var result ExternalComputeResourceService +func NewClusterNetworksService(connection *Connection, path string) *ClusterNetworksService { + var result ClusterNetworksService result.connection = connection result.path = path return &result } // -// Retrieves external compute resource details. -// For example, to get the details of compute resource `234` of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/computeresources/234 -// .... -// It will return a response like this: +// Assigns the network to a cluster. +// Post a request like in the example below to assign the network to a cluster: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/networks +// ---- +// Use the following example in its body: // [source,xml] // ---- -// -// hostname -// oVirt -// https://hostname/api -// admin@internal -// -// +// // ---- // -type ExternalComputeResourceServiceGetRequest struct { - ExternalComputeResourceService *ExternalComputeResourceService - header map[string]string - query map[string]string - follow *string +type ClusterNetworksServiceAddRequest struct { + ClusterNetworksService *ClusterNetworksService + header map[string]string + query map[string]string + network *Network } -func (p *ExternalComputeResourceServiceGetRequest) Header(key, value string) *ExternalComputeResourceServiceGetRequest { +func (p *ClusterNetworksServiceAddRequest) Header(key, value string) *ClusterNetworksServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -18301,7 +16465,7 @@ func (p *ExternalComputeResourceServiceGetRequest) Header(key, value string) *Ex return p } -func (p *ExternalComputeResourceServiceGetRequest) Query(key, value string) *ExternalComputeResourceServiceGetRequest { +func (p *ClusterNetworksServiceAddRequest) Query(key, value string) *ClusterNetworksServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -18309,18 +16473,14 @@ func (p *ExternalComputeResourceServiceGetRequest) Query(key, value string) *Ext return p } -func (p *ExternalComputeResourceServiceGetRequest) Follow(follow string) *ExternalComputeResourceServiceGetRequest { - p.follow = &follow +func (p *ClusterNetworksServiceAddRequest) Network(network *Network) *ClusterNetworksServiceAddRequest { + p.network = network return p } -func (p *ExternalComputeResourceServiceGetRequest) Send() (*ExternalComputeResourceServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalComputeResourceService.connection.URL(), p.ExternalComputeResourceService.path) +func (p *ClusterNetworksServiceAddRequest) Send() (*ClusterNetworksServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterNetworksService.connection.URL(), p.ClusterNetworksService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -18329,12 +16489,19 @@ func (p *ExternalComputeResourceServiceGetRequest) Send() (*ExternalComputeResou if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLNetworkWriteOne(writer, p.network, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalComputeResourceService.connection.headers { + for hk, hv := range p.ClusterNetworksService.connection.headers { req.Header.Add(hk, hv) } @@ -18349,18 +16516,18 @@ func (p *ExternalComputeResourceServiceGetRequest) Send() (*ExternalComputeResou req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalComputeResourceService.connection.authenticate() + token, err := p.ClusterNetworksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalComputeResourceService.connection.client.Do(req) + resp, err := p.ClusterNetworksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalComputeResourceService.connection.logFunc != nil { + if p.ClusterNetworksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -18369,9 +16536,9 @@ func (p *ExternalComputeResourceServiceGetRequest) Send() (*ExternalComputeResou if err != nil { return nil, err } - p.ExternalComputeResourceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -18379,14 +16546,14 @@ func (p *ExternalComputeResourceServiceGetRequest) Send() (*ExternalComputeResou return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalComputeResourceReadOne(reader, nil, "") + result, err := XMLNetworkReadOne(reader, nil, "") if err != nil { return nil, err } - return &ExternalComputeResourceServiceGetResponse{resource: result}, nil + return &ClusterNetworksServiceAddResponse{network: result}, nil } -func (p *ExternalComputeResourceServiceGetRequest) MustSend() *ExternalComputeResourceServiceGetResponse { +func (p *ClusterNetworksServiceAddRequest) MustSend() *ClusterNetworksServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -18395,103 +16562,66 @@ func (p *ExternalComputeResourceServiceGetRequest) MustSend() *ExternalComputeRe } // -// Retrieves external compute resource details. -// For example, to get the details of compute resource `234` of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/computeresources/234 -// .... -// It will return a response like this: +// Assigns the network to a cluster. +// Post a request like in the example below to assign the network to a cluster: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/networks +// ---- +// Use the following example in its body: // [source,xml] // ---- -// -// hostname -// oVirt -// https://hostname/api -// admin@internal -// -// +// // ---- // -type ExternalComputeResourceServiceGetResponse struct { - resource *ExternalComputeResource +type ClusterNetworksServiceAddResponse struct { + network *Network } -func (p *ExternalComputeResourceServiceGetResponse) Resource() (*ExternalComputeResource, bool) { - if p.resource != nil { - return p.resource, true +func (p *ClusterNetworksServiceAddResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } return nil, false } -func (p *ExternalComputeResourceServiceGetResponse) MustResource() *ExternalComputeResource { - if p.resource == nil { - panic("resource in response does not exist") +func (p *ClusterNetworksServiceAddResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } - return p.resource + return p.network } // -// Retrieves external compute resource details. -// For example, to get the details of compute resource `234` of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/computeresources/234 -// .... -// It will return a response like this: +// Assigns the network to a cluster. +// Post a request like in the example below to assign the network to a cluster: +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/networks +// ---- +// Use the following example in its body: // [source,xml] // ---- -// -// hostname -// oVirt -// https://hostname/api -// admin@internal -// -// +// // ---- // -func (p *ExternalComputeResourceService) Get() *ExternalComputeResourceServiceGetRequest { - return &ExternalComputeResourceServiceGetRequest{ExternalComputeResourceService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *ExternalComputeResourceService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *ExternalComputeResourceService) String() string { - return fmt.Sprintf("ExternalComputeResourceService:%s", op.path) -} - -// -// -type ExternalHostsService struct { - BaseService -} - -func NewExternalHostsService(connection *Connection, path string) *ExternalHostsService { - var result ExternalHostsService - result.connection = connection - result.path = path - return &result +func (p *ClusterNetworksService) Add() *ClusterNetworksServiceAddRequest { + return &ClusterNetworksServiceAddRequest{ClusterNetworksService: p} } // -// Return the list of external hosts. -// The order of the returned list of hosts isn't guaranteed. +// Lists the networks that are assigned to the cluster. +// The order of the returned clusters isn't guaranteed. // -type ExternalHostsServiceListRequest struct { - ExternalHostsService *ExternalHostsService - header map[string]string - query map[string]string - follow *string - max *int64 +type ClusterNetworksServiceListRequest struct { + ClusterNetworksService *ClusterNetworksService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *ExternalHostsServiceListRequest) Header(key, value string) *ExternalHostsServiceListRequest { +func (p *ClusterNetworksServiceListRequest) Header(key, value string) *ClusterNetworksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -18499,7 +16629,7 @@ func (p *ExternalHostsServiceListRequest) Header(key, value string) *ExternalHos return p } -func (p *ExternalHostsServiceListRequest) Query(key, value string) *ExternalHostsServiceListRequest { +func (p *ClusterNetworksServiceListRequest) Query(key, value string) *ClusterNetworksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -18507,18 +16637,18 @@ func (p *ExternalHostsServiceListRequest) Query(key, value string) *ExternalHost return p } -func (p *ExternalHostsServiceListRequest) Follow(follow string) *ExternalHostsServiceListRequest { +func (p *ClusterNetworksServiceListRequest) Follow(follow string) *ClusterNetworksServiceListRequest { p.follow = &follow return p } -func (p *ExternalHostsServiceListRequest) Max(max int64) *ExternalHostsServiceListRequest { +func (p *ClusterNetworksServiceListRequest) Max(max int64) *ClusterNetworksServiceListRequest { p.max = &max return p } -func (p *ExternalHostsServiceListRequest) Send() (*ExternalHostsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostsService.connection.URL(), p.ExternalHostsService.path) +func (p *ClusterNetworksServiceListRequest) Send() (*ClusterNetworksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterNetworksService.connection.URL(), p.ClusterNetworksService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -18541,7 +16671,7 @@ func (p *ExternalHostsServiceListRequest) Send() (*ExternalHostsServiceListRespo return nil, err } - for hk, hv := range p.ExternalHostsService.connection.headers { + for hk, hv := range p.ClusterNetworksService.connection.headers { req.Header.Add(hk, hv) } @@ -18556,18 +16686,18 @@ func (p *ExternalHostsServiceListRequest) Send() (*ExternalHostsServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostsService.connection.authenticate() + token, err := p.ClusterNetworksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostsService.connection.client.Do(req) + resp, err := p.ClusterNetworksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostsService.connection.logFunc != nil { + if p.ClusterNetworksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -18576,7 +16706,7 @@ func (p *ExternalHostsServiceListRequest) Send() (*ExternalHostsServiceListRespo if err != nil { return nil, err } - p.ExternalHostsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -18586,14 +16716,14 @@ func (p *ExternalHostsServiceListRequest) Send() (*ExternalHostsServiceListRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostReadMany(reader, nil) + result, err := XMLNetworkReadMany(reader, nil) if err != nil { return nil, err } - return &ExternalHostsServiceListResponse{hosts: result}, nil + return &ClusterNetworksServiceListResponse{networks: result}, nil } -func (p *ExternalHostsServiceListRequest) MustSend() *ExternalHostsServiceListResponse { +func (p *ClusterNetworksServiceListRequest) MustSend() *ClusterNetworksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -18602,82 +16732,159 @@ func (p *ExternalHostsServiceListRequest) MustSend() *ExternalHostsServiceListRe } // -// Return the list of external hosts. -// The order of the returned list of hosts isn't guaranteed. +// Lists the networks that are assigned to the cluster. +// The order of the returned clusters isn't guaranteed. // -type ExternalHostsServiceListResponse struct { - hosts *ExternalHostSlice +type ClusterNetworksServiceListResponse struct { + networks *NetworkSlice } -func (p *ExternalHostsServiceListResponse) Hosts() (*ExternalHostSlice, bool) { - if p.hosts != nil { - return p.hosts, true +func (p *ClusterNetworksServiceListResponse) Networks() (*NetworkSlice, bool) { + if p.networks != nil { + return p.networks, true } return nil, false } -func (p *ExternalHostsServiceListResponse) MustHosts() *ExternalHostSlice { - if p.hosts == nil { - panic("hosts in response does not exist") +func (p *ClusterNetworksServiceListResponse) MustNetworks() *NetworkSlice { + if p.networks == nil { + panic("networks in response does not exist") } - return p.hosts + return p.networks } // -// Return the list of external hosts. -// The order of the returned list of hosts isn't guaranteed. +// Lists the networks that are assigned to the cluster. +// The order of the returned clusters isn't guaranteed. // -func (p *ExternalHostsService) List() *ExternalHostsServiceListRequest { - return &ExternalHostsServiceListRequest{ExternalHostsService: p} +func (p *ClusterNetworksService) List() *ClusterNetworksServiceListRequest { + return &ClusterNetworksServiceListRequest{ClusterNetworksService: p} } // +// Access the cluster network service that manages the cluster network specified by an ID. // -func (op *ExternalHostsService) HostService(id string) *ExternalHostService { - return NewExternalHostService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *ClusterNetworksService) NetworkService(id string) *ClusterNetworkService { + return NewClusterNetworkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ExternalHostsService) Service(path string) (Service, error) { +func (op *ClusterNetworksService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.HostService(path), nil + return op.NetworkService(path), nil } - return op.HostService(path[:index]).Service(path[index+1:]) + return op.NetworkService(path[:index]).Service(path[index+1:]) } -func (op *ExternalHostsService) String() string { - return fmt.Sprintf("ExternalHostsService:%s", op.path) +func (op *ClusterNetworksService) String() string { + return fmt.Sprintf("ClusterNetworksService:%s", op.path) } // +// A service to manage a specific cluster. // -type ExternalHostService struct { +type ClusterService struct { BaseService } -func NewExternalHostService(connection *Connection, path string) *ExternalHostService { - var result ExternalHostService +func NewClusterService(connection *Connection, path string) *ClusterService { + var result ClusterService result.connection = connection result.path = path return &result } // +// Gets information about the cluster. +// An example of getting a cluster: +// [source] +// ---- +// GET /ovirt-engine/api/clusters/123 +// ---- +// [source,xml] +// ---- +// +// +// +// +// Default +// The default server cluster +// +// +// +// +// +// +// false +// +// x86_64 +// Intel Nehalem Family +// +// +// migrate +// +// +// true +// +// false +// 50 +// +// +// false +// +// +// false +// false +// +// true +// true +// +// +// +// 100 +// +// +// true +// +// +// +// inherit +// +// auto +// +// inherit +// +// +// random +// +// +// false +// false +// false +// +// 4 +// 0 +// +// true +// +// +// ---- // -type ExternalHostServiceGetRequest struct { - ExternalHostService *ExternalHostService - header map[string]string - query map[string]string - follow *string +type ClusterServiceGetRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string + filter *bool + follow *string } -func (p *ExternalHostServiceGetRequest) Header(key, value string) *ExternalHostServiceGetRequest { +func (p *ClusterServiceGetRequest) Header(key, value string) *ClusterServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -18685,7 +16892,7 @@ func (p *ExternalHostServiceGetRequest) Header(key, value string) *ExternalHostS return p } -func (p *ExternalHostServiceGetRequest) Query(key, value string) *ExternalHostServiceGetRequest { +func (p *ClusterServiceGetRequest) Query(key, value string) *ClusterServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -18693,14 +16900,23 @@ func (p *ExternalHostServiceGetRequest) Query(key, value string) *ExternalHostSe return p } -func (p *ExternalHostServiceGetRequest) Follow(follow string) *ExternalHostServiceGetRequest { +func (p *ClusterServiceGetRequest) Filter(filter bool) *ClusterServiceGetRequest { + p.filter = &filter + return p +} + +func (p *ClusterServiceGetRequest) Follow(follow string) *ClusterServiceGetRequest { p.follow = &follow return p } -func (p *ExternalHostServiceGetRequest) Send() (*ExternalHostServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostService.connection.URL(), p.ExternalHostService.path) +func (p *ClusterServiceGetRequest) Send() (*ClusterServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterService.connection.URL(), p.ClusterService.path) values := make(url.Values) + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } @@ -18718,7 +16934,7 @@ func (p *ExternalHostServiceGetRequest) Send() (*ExternalHostServiceGetResponse, return nil, err } - for hk, hv := range p.ExternalHostService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -18733,18 +16949,18 @@ func (p *ExternalHostServiceGetRequest) Send() (*ExternalHostServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -18753,7 +16969,7 @@ func (p *ExternalHostServiceGetRequest) Send() (*ExternalHostServiceGetResponse, if err != nil { return nil, err } - p.ExternalHostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -18763,14 +16979,14 @@ func (p *ExternalHostServiceGetRequest) Send() (*ExternalHostServiceGetResponse, return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostReadOne(reader, nil, "") + result, err := XMLClusterReadOne(reader, nil, "") if err != nil { return nil, err } - return &ExternalHostServiceGetResponse{host: result}, nil + return &ClusterServiceGetResponse{cluster: result}, nil } -func (p *ExternalHostServiceGetRequest) MustSend() *ExternalHostServiceGetResponse { +func (p *ClusterServiceGetRequest) MustSend() *ClusterServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -18779,93 +16995,195 @@ func (p *ExternalHostServiceGetRequest) MustSend() *ExternalHostServiceGetRespon } // -// -type ExternalHostServiceGetResponse struct { - host *ExternalHost -} - -func (p *ExternalHostServiceGetResponse) Host() (*ExternalHost, bool) { - if p.host != nil { - return p.host, true - } - return nil, false -} - -func (p *ExternalHostServiceGetResponse) MustHost() *ExternalHost { - if p.host == nil { - panic("host in response does not exist") - } - return p.host -} - -// -// -func (p *ExternalHostService) Get() *ExternalHostServiceGetRequest { - return &ExternalHostServiceGetRequest{ExternalHostService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *ExternalHostService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +// Gets information about the cluster. +// An example of getting a cluster: +// [source] +// ---- +// GET /ovirt-engine/api/clusters/123 +// ---- +// [source,xml] +// ---- +// +// +// +// +// Default +// The default server cluster +// +// +// +// +// +// +// false +// +// x86_64 +// Intel Nehalem Family +// +// +// migrate +// +// +// true +// +// false +// 50 +// +// +// false +// +// +// false +// false +// +// true +// true +// +// +// +// 100 +// +// +// true +// +// +// +// inherit +// +// auto +// +// inherit +// +// +// random +// +// +// false +// false +// false +// +// 4 +// 0 +// +// true +// +// +// ---- +// +type ClusterServiceGetResponse struct { + cluster *Cluster } -func (op *ExternalHostService) String() string { - return fmt.Sprintf("ExternalHostService:%s", op.path) +func (p *ClusterServiceGetResponse) Cluster() (*Cluster, bool) { + if p.cluster != nil { + return p.cluster, true + } + return nil, false } -// -// Manages a collection of external compute resources. -// Compute resource is a term of host external provider. The external provider also needs to know to where the -// provisioned host needs to register. The login details of the engine is saved as a compute resource in the external -// provider side. -// -type ExternalComputeResourcesService struct { - BaseService +func (p *ClusterServiceGetResponse) MustCluster() *Cluster { + if p.cluster == nil { + panic("cluster in response does not exist") + } + return p.cluster } -func NewExternalComputeResourcesService(connection *Connection, path string) *ExternalComputeResourcesService { - var result ExternalComputeResourcesService - result.connection = connection - result.path = path - return &result +// +// Gets information about the cluster. +// An example of getting a cluster: +// [source] +// ---- +// GET /ovirt-engine/api/clusters/123 +// ---- +// [source,xml] +// ---- +// +// +// +// +// Default +// The default server cluster +// +// +// +// +// +// +// false +// +// x86_64 +// Intel Nehalem Family +// +// +// migrate +// +// +// true +// +// false +// 50 +// +// +// false +// +// +// false +// false +// +// true +// true +// +// +// +// 100 +// +// +// true +// +// +// +// inherit +// +// auto +// +// inherit +// +// +// random +// +// +// false +// false +// false +// +// 4 +// 0 +// +// true +// +// +// ---- +// +func (p *ClusterService) Get() *ClusterServiceGetRequest { + return &ClusterServiceGetRequest{ClusterService: p} } // -// Retrieves a list of external compute resources. -// For example, to retrieve the compute resources of external host provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/computeresources -// .... -// It will return a response like this: -// [source,xml] +// Refresh the Gluster heal info for all volumes in cluster. +// For example, Cluster `123`, send a request like +// this: +// [source] // ---- -// -// -// hostname -// oVirt -// https://address/api -// admin@internal -// -// -// ... -// +// POST /ovirt-engine/api/clusters/123/refreshglusterhealstatus // ---- -// The order of the returned list of compute resources isn't guaranteed. // -type ExternalComputeResourcesServiceListRequest struct { - ExternalComputeResourcesService *ExternalComputeResourcesService - header map[string]string - query map[string]string - follow *string - max *int64 +type ClusterServiceRefreshGlusterHealStatusRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string } -func (p *ExternalComputeResourcesServiceListRequest) Header(key, value string) *ExternalComputeResourcesServiceListRequest { +func (p *ClusterServiceRefreshGlusterHealStatusRequest) Header(key, value string) *ClusterServiceRefreshGlusterHealStatusRequest { if p.header == nil { p.header = make(map[string]string) } @@ -18873,7 +17191,7 @@ func (p *ExternalComputeResourcesServiceListRequest) Header(key, value string) * return p } -func (p *ExternalComputeResourcesServiceListRequest) Query(key, value string) *ExternalComputeResourcesServiceListRequest { +func (p *ClusterServiceRefreshGlusterHealStatusRequest) Query(key, value string) *ClusterServiceRefreshGlusterHealStatusRequest { if p.query == nil { p.query = make(map[string]string) } @@ -18881,27 +17199,14 @@ func (p *ExternalComputeResourcesServiceListRequest) Query(key, value string) *E return p } -func (p *ExternalComputeResourcesServiceListRequest) Follow(follow string) *ExternalComputeResourcesServiceListRequest { - p.follow = &follow - return p -} - -func (p *ExternalComputeResourcesServiceListRequest) Max(max int64) *ExternalComputeResourcesServiceListRequest { - p.max = &max - return p -} - -func (p *ExternalComputeResourcesServiceListRequest) Send() (*ExternalComputeResourcesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalComputeResourcesService.connection.URL(), p.ExternalComputeResourcesService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} +func (p *ClusterServiceRefreshGlusterHealStatusRequest) Send() (*ClusterServiceRefreshGlusterHealStatusResponse, error) { + rawURL := fmt.Sprintf("%s%s/refreshglusterhealstatus", p.ClusterService.connection.URL(), p.ClusterService.path) + actionBuilder := NewActionBuilder() + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -18910,12 +17215,16 @@ func (p *ExternalComputeResourcesServiceListRequest) Send() (*ExternalComputeRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalComputeResourcesService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -18930,18 +17239,18 @@ func (p *ExternalComputeResourcesServiceListRequest) Send() (*ExternalComputeRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalComputeResourcesService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalComputeResourcesService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalComputeResourcesService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -18950,24 +17259,16 @@ func (p *ExternalComputeResourcesServiceListRequest) Send() (*ExternalComputeRes if err != nil { return nil, err } - p.ExternalComputeResourcesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalComputeResourceReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &ExternalComputeResourcesServiceListResponse{resources: result}, nil + return new(ClusterServiceRefreshGlusterHealStatusResponse), nil } -func (p *ExternalComputeResourcesServiceListRequest) MustSend() *ExternalComputeResourcesServiceListResponse { +func (p *ClusterServiceRefreshGlusterHealStatusRequest) MustSend() *ClusterServiceRefreshGlusterHealStatusResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -18976,150 +17277,45 @@ func (p *ExternalComputeResourcesServiceListRequest) MustSend() *ExternalCompute } // -// Retrieves a list of external compute resources. -// For example, to retrieve the compute resources of external host provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/computeresources -// .... -// It will return a response like this: -// [source,xml] +// Refresh the Gluster heal info for all volumes in cluster. +// For example, Cluster `123`, send a request like +// this: +// [source] // ---- -// -// -// hostname -// oVirt -// https://address/api -// admin@internal -// -// -// ... -// +// POST /ovirt-engine/api/clusters/123/refreshglusterhealstatus // ---- -// The order of the returned list of compute resources isn't guaranteed. // -type ExternalComputeResourcesServiceListResponse struct { - resources *ExternalComputeResourceSlice -} - -func (p *ExternalComputeResourcesServiceListResponse) Resources() (*ExternalComputeResourceSlice, bool) { - if p.resources != nil { - return p.resources, true - } - return nil, false -} - -func (p *ExternalComputeResourcesServiceListResponse) MustResources() *ExternalComputeResourceSlice { - if p.resources == nil { - panic("resources in response does not exist") - } - return p.resources +type ClusterServiceRefreshGlusterHealStatusResponse struct { } // -// Retrieves a list of external compute resources. -// For example, to retrieve the compute resources of external host provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/computeresources -// .... -// It will return a response like this: -// [source,xml] +// Refresh the Gluster heal info for all volumes in cluster. +// For example, Cluster `123`, send a request like +// this: +// [source] // ---- -// -// -// hostname -// oVirt -// https://address/api -// admin@internal -// -// -// ... -// +// POST /ovirt-engine/api/clusters/123/refreshglusterhealstatus // ---- -// The order of the returned list of compute resources isn't guaranteed. -// -func (p *ExternalComputeResourcesService) List() *ExternalComputeResourcesServiceListRequest { - return &ExternalComputeResourcesServiceListRequest{ExternalComputeResourcesService: p} -} - -// -// This service manages compute resource instance -// -func (op *ExternalComputeResourcesService) ResourceService(id string) *ExternalComputeResourceService { - return NewExternalComputeResourceService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *ExternalComputeResourcesService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.ResourceService(path), nil - } - return op.ResourceService(path[:index]).Service(path[index+1:]) -} - -func (op *ExternalComputeResourcesService) String() string { - return fmt.Sprintf("ExternalComputeResourcesService:%s", op.path) -} - // -// A service to manage Katello errata. -// The information is retrieved from Katello. -// -type KatelloErrataService struct { - BaseService -} - -func NewKatelloErrataService(connection *Connection, path string) *KatelloErrataService { - var result KatelloErrataService - result.connection = connection - result.path = path - return &result +func (p *ClusterService) RefreshGlusterHealStatus() *ClusterServiceRefreshGlusterHealStatusRequest { + return &ClusterServiceRefreshGlusterHealStatusRequest{ClusterService: p} } // -// Retrieves the representation of the Katello errata. +// Removes the cluster from the system. // [source] // ---- -// GET /ovirt-engine/api/katelloerrata -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ... -// +// DELETE /ovirt-engine/api/clusters/00000000-0000-0000-0000-000000000000 // ---- -// The order of the returned list of erratum isn't guaranteed. // -type KatelloErrataServiceListRequest struct { - KatelloErrataService *KatelloErrataService - header map[string]string - query map[string]string - follow *string - max *int64 +type ClusterServiceRemoveRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string + async *bool } -func (p *KatelloErrataServiceListRequest) Header(key, value string) *KatelloErrataServiceListRequest { +func (p *ClusterServiceRemoveRequest) Header(key, value string) *ClusterServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -19127,7 +17323,7 @@ func (p *KatelloErrataServiceListRequest) Header(key, value string) *KatelloErra return p } -func (p *KatelloErrataServiceListRequest) Query(key, value string) *KatelloErrataServiceListRequest { +func (p *ClusterServiceRemoveRequest) Query(key, value string) *ClusterServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -19135,25 +17331,16 @@ func (p *KatelloErrataServiceListRequest) Query(key, value string) *KatelloErrat return p } -func (p *KatelloErrataServiceListRequest) Follow(follow string) *KatelloErrataServiceListRequest { - p.follow = &follow - return p -} - -func (p *KatelloErrataServiceListRequest) Max(max int64) *KatelloErrataServiceListRequest { - p.max = &max +func (p *ClusterServiceRemoveRequest) Async(async bool) *ClusterServiceRemoveRequest { + p.async = &async return p } -func (p *KatelloErrataServiceListRequest) Send() (*KatelloErrataServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.KatelloErrataService.connection.URL(), p.KatelloErrataService.path) +func (p *ClusterServiceRemoveRequest) Send() (*ClusterServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterService.connection.URL(), p.ClusterService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -19164,12 +17351,12 @@ func (p *KatelloErrataServiceListRequest) Send() (*KatelloErrataServiceListRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.KatelloErrataService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -19184,18 +17371,18 @@ func (p *KatelloErrataServiceListRequest) Send() (*KatelloErrataServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.KatelloErrataService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.KatelloErrataService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.KatelloErrataService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -19204,24 +17391,19 @@ func (p *KatelloErrataServiceListRequest) Send() (*KatelloErrataServiceListRespo if err != nil { return nil, err } - p.KatelloErrataService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLKatelloErratumReadMany(reader, nil) - if err != nil { - return nil, err - } - return &KatelloErrataServiceListResponse{errata: result}, nil + return new(ClusterServiceRemoveResponse), nil } -func (p *KatelloErrataServiceListRequest) MustSend() *KatelloErrataServiceListResponse { +func (p *ClusterServiceRemoveRequest) MustSend() *ClusterServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -19230,156 +17412,36 @@ func (p *KatelloErrataServiceListRequest) MustSend() *KatelloErrataServiceListRe } // -// Retrieves the representation of the Katello errata. +// Removes the cluster from the system. // [source] // ---- -// GET /ovirt-engine/api/katelloerrata +// DELETE /ovirt-engine/api/clusters/00000000-0000-0000-0000-000000000000 // ---- -// You will receive response in XML like this one: -// [source,xml] +// +type ClusterServiceRemoveResponse struct { +} + +// +// Removes the cluster from the system. +// [source] // ---- -// -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ... -// +// DELETE /ovirt-engine/api/clusters/00000000-0000-0000-0000-000000000000 // ---- -// The order of the returned list of erratum isn't guaranteed. // -type KatelloErrataServiceListResponse struct { - errata *KatelloErratumSlice -} - -func (p *KatelloErrataServiceListResponse) Errata() (*KatelloErratumSlice, bool) { - if p.errata != nil { - return p.errata, true - } - return nil, false -} - -func (p *KatelloErrataServiceListResponse) MustErrata() *KatelloErratumSlice { - if p.errata == nil { - panic("errata in response does not exist") - } - return p.errata -} - -// -// Retrieves the representation of the Katello errata. -// [source] -// ---- -// GET /ovirt-engine/api/katelloerrata -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ... -// -// ---- -// The order of the returned list of erratum isn't guaranteed. -// -func (p *KatelloErrataService) List() *KatelloErrataServiceListRequest { - return &KatelloErrataServiceListRequest{KatelloErrataService: p} -} - -// -// Reference to the Katello erratum service. -// Use this service to view the erratum by its id. -// -func (op *KatelloErrataService) KatelloErratumService(id string) *KatelloErratumService { - return NewKatelloErratumService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *KatelloErrataService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.KatelloErratumService(path), nil - } - return op.KatelloErratumService(path[:index]).Service(path[index+1:]) -} - -func (op *KatelloErrataService) String() string { - return fmt.Sprintf("KatelloErrataService:%s", op.path) -} - -// -// This service manages a single discovered host. -// -type ExternalDiscoveredHostService struct { - BaseService -} - -func NewExternalDiscoveredHostService(connection *Connection, path string) *ExternalDiscoveredHostService { - var result ExternalDiscoveredHostService - result.connection = connection - result.path = path - return &result +func (p *ClusterService) Remove() *ClusterServiceRemoveRequest { + return &ClusterServiceRemoveRequest{ClusterService: p} } // -// Get discovered host info. -// Retrieves information about an host that is managed in external provider management system, such as Foreman. The -// information includes hostname, address, subnet, base image and more. -// For example, to get the details of host `234` from provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/discoveredhosts/234 -// .... -// The result will be like this: -// [source,xml] -// ---- -// -// mac001a4ad04040 -// 10.34.67.43 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:40 -// sat0 -// -// -// ---- // -type ExternalDiscoveredHostServiceGetRequest struct { - ExternalDiscoveredHostService *ExternalDiscoveredHostService - header map[string]string - query map[string]string - follow *string +type ClusterServiceResetEmulatedMachineRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string + async *bool } -func (p *ExternalDiscoveredHostServiceGetRequest) Header(key, value string) *ExternalDiscoveredHostServiceGetRequest { +func (p *ClusterServiceResetEmulatedMachineRequest) Header(key, value string) *ClusterServiceResetEmulatedMachineRequest { if p.header == nil { p.header = make(map[string]string) } @@ -19387,7 +17449,7 @@ func (p *ExternalDiscoveredHostServiceGetRequest) Header(key, value string) *Ext return p } -func (p *ExternalDiscoveredHostServiceGetRequest) Query(key, value string) *ExternalDiscoveredHostServiceGetRequest { +func (p *ClusterServiceResetEmulatedMachineRequest) Query(key, value string) *ClusterServiceResetEmulatedMachineRequest { if p.query == nil { p.query = make(map[string]string) } @@ -19395,18 +17457,22 @@ func (p *ExternalDiscoveredHostServiceGetRequest) Query(key, value string) *Exte return p } -func (p *ExternalDiscoveredHostServiceGetRequest) Follow(follow string) *ExternalDiscoveredHostServiceGetRequest { - p.follow = &follow +func (p *ClusterServiceResetEmulatedMachineRequest) Async(async bool) *ClusterServiceResetEmulatedMachineRequest { + p.async = &async return p } -func (p *ExternalDiscoveredHostServiceGetRequest) Send() (*ExternalDiscoveredHostServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalDiscoveredHostService.connection.URL(), p.ExternalDiscoveredHostService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *ClusterServiceResetEmulatedMachineRequest) Send() (*ClusterServiceResetEmulatedMachineResponse, error) { + rawURL := fmt.Sprintf("%s%s/resetemulatedmachine", p.ClusterService.connection.URL(), p.ClusterService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -19415,12 +17481,16 @@ func (p *ExternalDiscoveredHostServiceGetRequest) Send() (*ExternalDiscoveredHos if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalDiscoveredHostService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -19435,18 +17505,18 @@ func (p *ExternalDiscoveredHostServiceGetRequest) Send() (*ExternalDiscoveredHos req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalDiscoveredHostService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalDiscoveredHostService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalDiscoveredHostService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -19455,24 +17525,16 @@ func (p *ExternalDiscoveredHostServiceGetRequest) Send() (*ExternalDiscoveredHos if err != nil { return nil, err } - p.ExternalDiscoveredHostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalDiscoveredHostReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &ExternalDiscoveredHostServiceGetResponse{host: result}, nil + return new(ClusterServiceResetEmulatedMachineResponse), nil } -func (p *ExternalDiscoveredHostServiceGetRequest) MustSend() *ExternalDiscoveredHostServiceGetResponse { +func (p *ClusterServiceResetEmulatedMachineRequest) MustSend() *ClusterServiceResetEmulatedMachineResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -19481,126 +17543,36 @@ func (p *ExternalDiscoveredHostServiceGetRequest) MustSend() *ExternalDiscovered } // -// Get discovered host info. -// Retrieves information about an host that is managed in external provider management system, such as Foreman. The -// information includes hostname, address, subnet, base image and more. -// For example, to get the details of host `234` from provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/discoveredhosts/234 -// .... -// The result will be like this: -// [source,xml] -// ---- -// -// mac001a4ad04040 -// 10.34.67.43 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:40 -// sat0 -// -// -// ---- -// -type ExternalDiscoveredHostServiceGetResponse struct { - host *ExternalDiscoveredHost -} - -func (p *ExternalDiscoveredHostServiceGetResponse) Host() (*ExternalDiscoveredHost, bool) { - if p.host != nil { - return p.host, true - } - return nil, false -} - -func (p *ExternalDiscoveredHostServiceGetResponse) MustHost() *ExternalDiscoveredHost { - if p.host == nil { - panic("host in response does not exist") - } - return p.host -} - -// -// Get discovered host info. -// Retrieves information about an host that is managed in external provider management system, such as Foreman. The -// information includes hostname, address, subnet, base image and more. -// For example, to get the details of host `234` from provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/discoveredhosts/234 -// .... -// The result will be like this: -// [source,xml] -// ---- -// -// mac001a4ad04040 -// 10.34.67.43 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:40 -// sat0 -// -// -// ---- -// -func (p *ExternalDiscoveredHostService) Get() *ExternalDiscoveredHostServiceGetRequest { - return &ExternalDiscoveredHostServiceGetRequest{ExternalDiscoveredHostService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. // -func (op *ExternalDiscoveredHostService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *ExternalDiscoveredHostService) String() string { - return fmt.Sprintf("ExternalDiscoveredHostService:%s", op.path) +type ClusterServiceResetEmulatedMachineResponse struct { } // -// Represents an external host provider, such as Foreman or Satellite. -// See https://www.theforeman.org/ for more details on Foreman. -// See https://access.redhat.com/products/red-hat-satellite for more details on Red Hat Satellite. // -type ExternalHostProviderService struct { - BaseService -} - -func NewExternalHostProviderService(connection *Connection, path string) *ExternalHostProviderService { - var result ExternalHostProviderService - result.connection = connection - result.path = path - return &result +func (p *ClusterService) ResetEmulatedMachine() *ClusterServiceResetEmulatedMachineRequest { + return &ClusterServiceResetEmulatedMachineRequest{ClusterService: p} } // -// Get external host provider information -// Host provider, Foreman or Satellite, can be set as an external provider in ovirt. To see details about specific -// host providers attached to ovirt use this API. -// For example, to get the details of host provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123 -// .... -// The response will be like this: +// Synchronizes all networks on the cluster. +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/syncallnetworks +// ---- +// With a request body like this: // [source,xml] // ---- -// -// mysatellite -// true -// https://mysatellite.example.com -// admin -// +// // ---- // -type ExternalHostProviderServiceGetRequest struct { - ExternalHostProviderService *ExternalHostProviderService - header map[string]string - query map[string]string - follow *string +type ClusterServiceSyncAllNetworksRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string + async *bool } -func (p *ExternalHostProviderServiceGetRequest) Header(key, value string) *ExternalHostProviderServiceGetRequest { +func (p *ClusterServiceSyncAllNetworksRequest) Header(key, value string) *ClusterServiceSyncAllNetworksRequest { if p.header == nil { p.header = make(map[string]string) } @@ -19608,7 +17580,7 @@ func (p *ExternalHostProviderServiceGetRequest) Header(key, value string) *Exter return p } -func (p *ExternalHostProviderServiceGetRequest) Query(key, value string) *ExternalHostProviderServiceGetRequest { +func (p *ClusterServiceSyncAllNetworksRequest) Query(key, value string) *ClusterServiceSyncAllNetworksRequest { if p.query == nil { p.query = make(map[string]string) } @@ -19616,18 +17588,22 @@ func (p *ExternalHostProviderServiceGetRequest) Query(key, value string) *Extern return p } -func (p *ExternalHostProviderServiceGetRequest) Follow(follow string) *ExternalHostProviderServiceGetRequest { - p.follow = &follow +func (p *ClusterServiceSyncAllNetworksRequest) Async(async bool) *ClusterServiceSyncAllNetworksRequest { + p.async = &async return p } -func (p *ExternalHostProviderServiceGetRequest) Send() (*ExternalHostProviderServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostProviderService.connection.URL(), p.ExternalHostProviderService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *ClusterServiceSyncAllNetworksRequest) Send() (*ClusterServiceSyncAllNetworksResponse, error) { + rawURL := fmt.Sprintf("%s%s/syncallnetworks", p.ClusterService.connection.URL(), p.ClusterService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -19636,12 +17612,16 @@ func (p *ExternalHostProviderServiceGetRequest) Send() (*ExternalHostProviderSer if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalHostProviderService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -19656,18 +17636,18 @@ func (p *ExternalHostProviderServiceGetRequest) Send() (*ExternalHostProviderSer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostProviderService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostProviderService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostProviderService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -19676,24 +17656,16 @@ func (p *ExternalHostProviderServiceGetRequest) Send() (*ExternalHostProviderSer if err != nil { return nil, err } - p.ExternalHostProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostProviderReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &ExternalHostProviderServiceGetResponse{provider: result}, nil + return new(ClusterServiceSyncAllNetworksResponse), nil } -func (p *ExternalHostProviderServiceGetRequest) MustSend() *ExternalHostProviderServiceGetResponse { +func (p *ClusterServiceSyncAllNetworksRequest) MustSend() *ClusterServiceSyncAllNetworksResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -19702,76 +17674,63 @@ func (p *ExternalHostProviderServiceGetRequest) MustSend() *ExternalHostProvider } // -// Get external host provider information -// Host provider, Foreman or Satellite, can be set as an external provider in ovirt. To see details about specific -// host providers attached to ovirt use this API. -// For example, to get the details of host provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123 -// .... -// The response will be like this: +// Synchronizes all networks on the cluster. +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/syncallnetworks +// ---- +// With a request body like this: // [source,xml] // ---- -// -// mysatellite -// true -// https://mysatellite.example.com -// admin -// +// // ---- // -type ExternalHostProviderServiceGetResponse struct { - provider *ExternalHostProvider -} - -func (p *ExternalHostProviderServiceGetResponse) Provider() (*ExternalHostProvider, bool) { - if p.provider != nil { - return p.provider, true - } - return nil, false -} - -func (p *ExternalHostProviderServiceGetResponse) MustProvider() *ExternalHostProvider { - if p.provider == nil { - panic("provider in response does not exist") - } - return p.provider +type ClusterServiceSyncAllNetworksResponse struct { } // -// Get external host provider information -// Host provider, Foreman or Satellite, can be set as an external provider in ovirt. To see details about specific -// host providers attached to ovirt use this API. -// For example, to get the details of host provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123 -// .... -// The response will be like this: +// Synchronizes all networks on the cluster. +// [source] +// ---- +// POST /ovirt-engine/api/clusters/123/syncallnetworks +// ---- +// With a request body like this: // [source,xml] // ---- -// -// mysatellite -// true -// https://mysatellite.example.com -// admin -// +// // ---- // -func (p *ExternalHostProviderService) Get() *ExternalHostProviderServiceGetRequest { - return &ExternalHostProviderServiceGetRequest{ExternalHostProviderService: p} +func (p *ClusterService) SyncAllNetworks() *ClusterServiceSyncAllNetworksRequest { + return &ClusterServiceSyncAllNetworksRequest{ClusterService: p} } // -// Import the SSL certificates of the external host provider. +// Updates information about the cluster. +// Only the specified fields are updated; others remain unchanged. +// For example, to update the cluster's CPU: +// [source] +// ---- +// PUT /ovirt-engine/api/clusters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// Intel Haswell-noTSX Family +// +// +// ---- // -type ExternalHostProviderServiceImportCertificatesRequest struct { - ExternalHostProviderService *ExternalHostProviderService - header map[string]string - query map[string]string - certificates *CertificateSlice +type ClusterServiceUpdateRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string + async *bool + cluster *Cluster } -func (p *ExternalHostProviderServiceImportCertificatesRequest) Header(key, value string) *ExternalHostProviderServiceImportCertificatesRequest { +func (p *ClusterServiceUpdateRequest) Header(key, value string) *ClusterServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -19779,7 +17738,7 @@ func (p *ExternalHostProviderServiceImportCertificatesRequest) Header(key, value return p } -func (p *ExternalHostProviderServiceImportCertificatesRequest) Query(key, value string) *ExternalHostProviderServiceImportCertificatesRequest { +func (p *ClusterServiceUpdateRequest) Query(key, value string) *ClusterServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -19787,28 +17746,23 @@ func (p *ExternalHostProviderServiceImportCertificatesRequest) Query(key, value return p } -func (p *ExternalHostProviderServiceImportCertificatesRequest) Certificates(certificates *CertificateSlice) *ExternalHostProviderServiceImportCertificatesRequest { - p.certificates = certificates +func (p *ClusterServiceUpdateRequest) Async(async bool) *ClusterServiceUpdateRequest { + p.async = &async return p } -func (p *ExternalHostProviderServiceImportCertificatesRequest) CertificatesOfAny(anys ...*Certificate) *ExternalHostProviderServiceImportCertificatesRequest { - if p.certificates == nil { - p.certificates = new(CertificateSlice) - } - p.certificates.slice = append(p.certificates.slice, anys...) +func (p *ClusterServiceUpdateRequest) Cluster(cluster *Cluster) *ClusterServiceUpdateRequest { + p.cluster = cluster return p } -func (p *ExternalHostProviderServiceImportCertificatesRequest) Send() (*ExternalHostProviderServiceImportCertificatesResponse, error) { - rawURL := fmt.Sprintf("%s%s/importcertificates", p.ExternalHostProviderService.connection.URL(), p.ExternalHostProviderService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Certificates(p.certificates) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *ClusterServiceUpdateRequest) Send() (*ClusterServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClusterService.connection.URL(), p.ClusterService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -19819,14 +17773,17 @@ func (p *ExternalHostProviderServiceImportCertificatesRequest) Send() (*External } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLClusterWriteOne(writer, p.cluster, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalHostProviderService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -19841,18 +17798,18 @@ func (p *ExternalHostProviderServiceImportCertificatesRequest) Send() (*External req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostProviderService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostProviderService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostProviderService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -19861,16 +17818,24 @@ func (p *ExternalHostProviderServiceImportCertificatesRequest) Send() (*External if err != nil { return nil, err } - p.ExternalHostProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(ExternalHostProviderServiceImportCertificatesResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLClusterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &ClusterServiceUpdateResponse{cluster: result}, nil } -func (p *ExternalHostProviderServiceImportCertificatesRequest) MustSend() *ExternalHostProviderServiceImportCertificatesResponse { +func (p *ClusterServiceUpdateRequest) MustSend() *ClusterServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -19879,150 +17844,90 @@ func (p *ExternalHostProviderServiceImportCertificatesRequest) MustSend() *Exter } // -// Import the SSL certificates of the external host provider. -// -type ExternalHostProviderServiceImportCertificatesResponse struct { -} - -// -// Import the SSL certificates of the external host provider. -// -func (p *ExternalHostProviderService) ImportCertificates() *ExternalHostProviderServiceImportCertificatesRequest { - return &ExternalHostProviderServiceImportCertificatesRequest{ExternalHostProviderService: p} -} - -// +// Updates information about the cluster. +// Only the specified fields are updated; others remain unchanged. +// For example, to update the cluster's CPU: +// [source] +// ---- +// PUT /ovirt-engine/api/clusters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// Intel Haswell-noTSX Family +// +// +// ---- // -type ExternalHostProviderServiceRemoveRequest struct { - ExternalHostProviderService *ExternalHostProviderService - header map[string]string - query map[string]string - async *bool -} - -func (p *ExternalHostProviderServiceRemoveRequest) Header(key, value string) *ExternalHostProviderServiceRemoveRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *ExternalHostProviderServiceRemoveRequest) Query(key, value string) *ExternalHostProviderServiceRemoveRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *ExternalHostProviderServiceRemoveRequest) Async(async bool) *ExternalHostProviderServiceRemoveRequest { - p.async = &async - return p +type ClusterServiceUpdateResponse struct { + cluster *Cluster } -func (p *ExternalHostProviderServiceRemoveRequest) Send() (*ExternalHostProviderServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostProviderService.connection.URL(), p.ExternalHostProviderService.path) - values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - req, err := http.NewRequest("DELETE", rawURL, nil) - if err != nil { - return nil, err - } - - for hk, hv := range p.ExternalHostProviderService.connection.headers { - req.Header.Add(hk, hv) - } - - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } - - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.ExternalHostProviderService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.ExternalHostProviderService.connection.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if p.ExternalHostProviderService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.ExternalHostProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody +func (p *ClusterServiceUpdateResponse) Cluster() (*Cluster, bool) { + if p.cluster != nil { + return p.cluster, true } - return new(ExternalHostProviderServiceRemoveResponse), nil + return nil, false } -func (p *ExternalHostProviderServiceRemoveRequest) MustSend() *ExternalHostProviderServiceRemoveResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v +func (p *ClusterServiceUpdateResponse) MustCluster() *Cluster { + if p.cluster == nil { + panic("cluster in response does not exist") } + return p.cluster } // +// Updates information about the cluster. +// Only the specified fields are updated; others remain unchanged. +// For example, to update the cluster's CPU: +// [source] +// ---- +// PUT /ovirt-engine/api/clusters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// Intel Haswell-noTSX Family +// +// +// ---- // -type ExternalHostProviderServiceRemoveResponse struct { -} - -// -// -func (p *ExternalHostProviderService) Remove() *ExternalHostProviderServiceRemoveRequest { - return &ExternalHostProviderServiceRemoveRequest{ExternalHostProviderService: p} +func (p *ClusterService) Update() *ClusterServiceUpdateRequest { + return &ClusterServiceUpdateRequest{ClusterService: p} } // -// In order to test connectivity for external provider we need -// to run following request where 123 is an id of a provider. +// Start or finish upgrade process for the cluster based on the action value. This action marks the cluster for +// upgrade or clears the upgrade running flag on the cluster based on the action value which takes values of +// start or stop. // [source] // ---- -// POST /ovirt-engine/api/externalhostproviders/123/testconnectivity +// POST /ovirt-engine/api/clusters/123/upgrade +// ---- +// With a request body like this to mark the cluster for upgrade: +// [source,xml] +// ---- +// +// +// start +// +// // ---- // -type ExternalHostProviderServiceTestConnectivityRequest struct { - ExternalHostProviderService *ExternalHostProviderService - header map[string]string - query map[string]string - async *bool +type ClusterServiceUpgradeRequest struct { + ClusterService *ClusterService + header map[string]string + query map[string]string + async *bool + upgradeAction *ClusterUpgradeAction } -func (p *ExternalHostProviderServiceTestConnectivityRequest) Header(key, value string) *ExternalHostProviderServiceTestConnectivityRequest { +func (p *ClusterServiceUpgradeRequest) Header(key, value string) *ClusterServiceUpgradeRequest { if p.header == nil { p.header = make(map[string]string) } @@ -20030,7 +17935,7 @@ func (p *ExternalHostProviderServiceTestConnectivityRequest) Header(key, value s return p } -func (p *ExternalHostProviderServiceTestConnectivityRequest) Query(key, value string) *ExternalHostProviderServiceTestConnectivityRequest { +func (p *ClusterServiceUpgradeRequest) Query(key, value string) *ClusterServiceUpgradeRequest { if p.query == nil { p.query = make(map[string]string) } @@ -20038,17 +17943,25 @@ func (p *ExternalHostProviderServiceTestConnectivityRequest) Query(key, value st return p } -func (p *ExternalHostProviderServiceTestConnectivityRequest) Async(async bool) *ExternalHostProviderServiceTestConnectivityRequest { +func (p *ClusterServiceUpgradeRequest) Async(async bool) *ClusterServiceUpgradeRequest { p.async = &async return p } -func (p *ExternalHostProviderServiceTestConnectivityRequest) Send() (*ExternalHostProviderServiceTestConnectivityResponse, error) { - rawURL := fmt.Sprintf("%s%s/testconnectivity", p.ExternalHostProviderService.connection.URL(), p.ExternalHostProviderService.path) +func (p *ClusterServiceUpgradeRequest) UpgradeAction(upgradeAction ClusterUpgradeAction) *ClusterServiceUpgradeRequest { + p.upgradeAction = &upgradeAction + return p +} + +func (p *ClusterServiceUpgradeRequest) Send() (*ClusterServiceUpgradeResponse, error) { + rawURL := fmt.Sprintf("%s%s/upgrade", p.ClusterService.connection.URL(), p.ClusterService.path) actionBuilder := NewActionBuilder() if p.async != nil { actionBuilder.Async(*p.async) } + if p.upgradeAction != nil { + actionBuilder.UpgradeAction(*p.upgradeAction) + } action, err := actionBuilder.Build() if err != nil { return nil, err @@ -20071,7 +17984,7 @@ func (p *ExternalHostProviderServiceTestConnectivityRequest) Send() (*ExternalHo return nil, err } - for hk, hv := range p.ExternalHostProviderService.connection.headers { + for hk, hv := range p.ClusterService.connection.headers { req.Header.Add(hk, hv) } @@ -20086,18 +17999,18 @@ func (p *ExternalHostProviderServiceTestConnectivityRequest) Send() (*ExternalHo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostProviderService.connection.authenticate() + token, err := p.ClusterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostProviderService.connection.client.Do(req) + resp, err := p.ClusterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostProviderService.connection.logFunc != nil { + if p.ClusterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -20106,16 +18019,16 @@ func (p *ExternalHostProviderServiceTestConnectivityRequest) Send() (*ExternalHo if err != nil { return nil, err } - p.ExternalHostProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClusterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(ExternalHostProviderServiceTestConnectivityResponse), nil + return new(ClusterServiceUpgradeResponse), nil } -func (p *ExternalHostProviderServiceTestConnectivityRequest) MustSend() *ExternalHostProviderServiceTestConnectivityResponse { +func (p *ClusterServiceUpgradeRequest) MustSend() *ClusterServiceUpgradeResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -20124,40 +18037,241 @@ func (p *ExternalHostProviderServiceTestConnectivityRequest) MustSend() *Externa } // -// In order to test connectivity for external provider we need -// to run following request where 123 is an id of a provider. +// Start or finish upgrade process for the cluster based on the action value. This action marks the cluster for +// upgrade or clears the upgrade running flag on the cluster based on the action value which takes values of +// start or stop. // [source] // ---- -// POST /ovirt-engine/api/externalhostproviders/123/testconnectivity +// POST /ovirt-engine/api/clusters/123/upgrade +// ---- +// With a request body like this to mark the cluster for upgrade: +// [source,xml] +// ---- +// +// +// start +// +// // ---- // -type ExternalHostProviderServiceTestConnectivityResponse struct { +type ClusterServiceUpgradeResponse struct { } // -// In order to test connectivity for external provider we need -// to run following request where 123 is an id of a provider. +// Start or finish upgrade process for the cluster based on the action value. This action marks the cluster for +// upgrade or clears the upgrade running flag on the cluster based on the action value which takes values of +// start or stop. // [source] // ---- -// POST /ovirt-engine/api/externalhostproviders/123/testconnectivity +// POST /ovirt-engine/api/clusters/123/upgrade +// ---- +// With a request body like this to mark the cluster for upgrade: +// [source,xml] +// ---- +// +// +// start +// +// // ---- // -func (p *ExternalHostProviderService) TestConnectivity() *ExternalHostProviderServiceTestConnectivityRequest { - return &ExternalHostProviderServiceTestConnectivityRequest{ExternalHostProviderService: p} +func (p *ClusterService) Upgrade() *ClusterServiceUpgradeRequest { + return &ClusterServiceUpgradeRequest{ClusterService: p} } // -// Update the specified external host provider in the system. +// A reference to the service that manages affinity groups. // -type ExternalHostProviderServiceUpdateRequest struct { - ExternalHostProviderService *ExternalHostProviderService - header map[string]string - query map[string]string - async *bool - provider *ExternalHostProvider +func (op *ClusterService) AffinityGroupsService() *AffinityGroupsService { + return NewAffinityGroupsService(op.connection, fmt.Sprintf("%s/affinitygroups", op.path)) } -func (p *ExternalHostProviderServiceUpdateRequest) Header(key, value string) *ExternalHostProviderServiceUpdateRequest { +// +// A reference to the service that manages assigned CPU profiles for the cluster. +// +func (op *ClusterService) CpuProfilesService() *AssignedCpuProfilesService { + return NewAssignedCpuProfilesService(op.connection, fmt.Sprintf("%s/cpuprofiles", op.path)) +} + +// +// A reference to the service that manages the collection of enabled features for the cluster. +// +func (op *ClusterService) EnabledFeaturesService() *ClusterEnabledFeaturesService { + return NewClusterEnabledFeaturesService(op.connection, fmt.Sprintf("%s/enabledfeatures", op.path)) +} + +// +// A reference to the service that manages the collection of external network providers. +// +func (op *ClusterService) ExternalNetworkProvidersService() *ClusterExternalProvidersService { + return NewClusterExternalProvidersService(op.connection, fmt.Sprintf("%s/externalnetworkproviders", op.path)) +} + +// +// A reference to the service that manages the Gluster hooks for the cluster. +// +func (op *ClusterService) GlusterHooksService() *GlusterHooksService { + return NewGlusterHooksService(op.connection, fmt.Sprintf("%s/glusterhooks", op.path)) +} + +// +// A reference to the service that manages Gluster volumes for the cluster. +// +func (op *ClusterService) GlusterVolumesService() *GlusterVolumesService { + return NewGlusterVolumesService(op.connection, fmt.Sprintf("%s/glustervolumes", op.path)) +} + +// +// A sub-collection with all the supported network filters for the cluster. +// +func (op *ClusterService) NetworkFiltersService() *NetworkFiltersService { + return NewNetworkFiltersService(op.connection, fmt.Sprintf("%s/networkfilters", op.path)) +} + +// +// A reference to the service that manages assigned networks for the cluster. +// +func (op *ClusterService) NetworksService() *ClusterNetworksService { + return NewClusterNetworksService(op.connection, fmt.Sprintf("%s/networks", op.path)) +} + +// +// A reference to permissions. +// +func (op *ClusterService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ClusterService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "affinitygroups" { + return op.AffinityGroupsService(), nil + } + if strings.HasPrefix(path, "affinitygroups/") { + return op.AffinityGroupsService().Service(path[15:]) + } + if path == "cpuprofiles" { + return op.CpuProfilesService(), nil + } + if strings.HasPrefix(path, "cpuprofiles/") { + return op.CpuProfilesService().Service(path[12:]) + } + if path == "enabledfeatures" { + return op.EnabledFeaturesService(), nil + } + if strings.HasPrefix(path, "enabledfeatures/") { + return op.EnabledFeaturesService().Service(path[16:]) + } + if path == "externalnetworkproviders" { + return op.ExternalNetworkProvidersService(), nil + } + if strings.HasPrefix(path, "externalnetworkproviders/") { + return op.ExternalNetworkProvidersService().Service(path[25:]) + } + if path == "glusterhooks" { + return op.GlusterHooksService(), nil + } + if strings.HasPrefix(path, "glusterhooks/") { + return op.GlusterHooksService().Service(path[13:]) + } + if path == "glustervolumes" { + return op.GlusterVolumesService(), nil + } + if strings.HasPrefix(path, "glustervolumes/") { + return op.GlusterVolumesService().Service(path[15:]) + } + if path == "networkfilters" { + return op.NetworkFiltersService(), nil + } + if strings.HasPrefix(path, "networkfilters/") { + return op.NetworkFiltersService().Service(path[15:]) + } + if path == "networks" { + return op.NetworksService(), nil + } + if strings.HasPrefix(path, "networks/") { + return op.NetworksService().Service(path[9:]) + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *ClusterService) String() string { + return fmt.Sprintf("ClusterService:%s", op.path) +} + +// +// A service to manage clusters. +// +type ClustersService struct { + BaseService +} + +func NewClustersService(connection *Connection, path string) *ClustersService { + var result ClustersService + result.connection = connection + result.path = path + return &result +} + +// +// Creates a new cluster. +// This requires the `name`, `cpu.type`, and `data_center` attributes. Identify the data center with either the `id` +// or `name` attribute. +// [source] +// ---- +// POST /ovirt-engine/api/clusters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// mycluster +// +// Intel Nehalem Family +// +// +// +// ---- +// To create a cluster with an external network provider to be deployed on +// every host that is added to the cluster, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/clusters +// ---- +// With a request body containing a reference to the desired provider: +// [source,xml] +// ---- +// +// mycluster +// +// Intel Nehalem Family +// +// +// +// +// +// +// ---- +// +type ClustersServiceAddRequest struct { + ClustersService *ClustersService + header map[string]string + query map[string]string + cluster *Cluster +} + +func (p *ClustersServiceAddRequest) Header(key, value string) *ClustersServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -20165,7 +18279,7 @@ func (p *ExternalHostProviderServiceUpdateRequest) Header(key, value string) *Ex return p } -func (p *ExternalHostProviderServiceUpdateRequest) Query(key, value string) *ExternalHostProviderServiceUpdateRequest { +func (p *ClustersServiceAddRequest) Query(key, value string) *ClustersServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -20173,23 +18287,14 @@ func (p *ExternalHostProviderServiceUpdateRequest) Query(key, value string) *Ext return p } -func (p *ExternalHostProviderServiceUpdateRequest) Async(async bool) *ExternalHostProviderServiceUpdateRequest { - p.async = &async - return p -} - -func (p *ExternalHostProviderServiceUpdateRequest) Provider(provider *ExternalHostProvider) *ExternalHostProviderServiceUpdateRequest { - p.provider = provider +func (p *ClustersServiceAddRequest) Cluster(cluster *Cluster) *ClustersServiceAddRequest { + p.cluster = cluster return p } -func (p *ExternalHostProviderServiceUpdateRequest) Send() (*ExternalHostProviderServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostProviderService.connection.URL(), p.ExternalHostProviderService.path) +func (p *ClustersServiceAddRequest) Send() (*ClustersServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClustersService.connection.URL(), p.ClustersService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -20200,17 +18305,17 @@ func (p *ExternalHostProviderServiceUpdateRequest) Send() (*ExternalHostProvider } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLExternalHostProviderWriteOne(writer, p.provider, "") + err := XMLClusterWriteOne(writer, p.cluster, "") if err != nil { return nil, err } writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalHostProviderService.connection.headers { + for hk, hv := range p.ClustersService.connection.headers { req.Header.Add(hk, hv) } @@ -20225,18 +18330,18 @@ func (p *ExternalHostProviderServiceUpdateRequest) Send() (*ExternalHostProvider req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostProviderService.connection.authenticate() + token, err := p.ClustersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostProviderService.connection.client.Do(req) + resp, err := p.ClustersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostProviderService.connection.logFunc != nil { + if p.ClustersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -20245,9 +18350,9 @@ func (p *ExternalHostProviderServiceUpdateRequest) Send() (*ExternalHostProvider if err != nil { return nil, err } - p.ExternalHostProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClustersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -20255,14 +18360,14 @@ func (p *ExternalHostProviderServiceUpdateRequest) Send() (*ExternalHostProvider return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostProviderReadOne(reader, nil, "") + result, err := XMLClusterReadOne(reader, nil, "") if err != nil { return nil, err } - return &ExternalHostProviderServiceUpdateResponse{provider: result}, nil + return &ClustersServiceAddResponse{cluster: result}, nil } -func (p *ExternalHostProviderServiceUpdateRequest) MustSend() *ExternalHostProviderServiceUpdateResponse { +func (p *ClustersServiceAddRequest) MustSend() *ClustersServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -20271,156 +18376,124 @@ func (p *ExternalHostProviderServiceUpdateRequest) MustSend() *ExternalHostProvi } // -// Update the specified external host provider in the system. -// -type ExternalHostProviderServiceUpdateResponse struct { - provider *ExternalHostProvider -} - -func (p *ExternalHostProviderServiceUpdateResponse) Provider() (*ExternalHostProvider, bool) { - if p.provider != nil { - return p.provider, true - } - return nil, false -} - -func (p *ExternalHostProviderServiceUpdateResponse) MustProvider() *ExternalHostProvider { - if p.provider == nil { - panic("provider in response does not exist") - } - return p.provider -} - -// -// Update the specified external host provider in the system. -// -func (p *ExternalHostProviderService) Update() *ExternalHostProviderServiceUpdateRequest { - return &ExternalHostProviderServiceUpdateRequest{ExternalHostProviderService: p} -} - -// -// A service to view certificates for this external provider. -// -func (op *ExternalHostProviderService) CertificatesService() *ExternalProviderCertificatesService { - return NewExternalProviderCertificatesService(op.connection, fmt.Sprintf("%s/certificates", op.path)) -} - -// -// -func (op *ExternalHostProviderService) ComputeResourcesService() *ExternalComputeResourcesService { - return NewExternalComputeResourcesService(op.connection, fmt.Sprintf("%s/computeresources", op.path)) -} - -// -// -func (op *ExternalHostProviderService) DiscoveredHostsService() *ExternalDiscoveredHostsService { - return NewExternalDiscoveredHostsService(op.connection, fmt.Sprintf("%s/discoveredhosts", op.path)) -} - -// -// -func (op *ExternalHostProviderService) HostGroupsService() *ExternalHostGroupsService { - return NewExternalHostGroupsService(op.connection, fmt.Sprintf("%s/hostgroups", op.path)) -} - -// +// Creates a new cluster. +// This requires the `name`, `cpu.type`, and `data_center` attributes. Identify the data center with either the `id` +// or `name` attribute. +// [source] +// ---- +// POST /ovirt-engine/api/clusters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// mycluster +// +// Intel Nehalem Family +// +// +// +// ---- +// To create a cluster with an external network provider to be deployed on +// every host that is added to the cluster, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/clusters +// ---- +// With a request body containing a reference to the desired provider: +// [source,xml] +// ---- +// +// mycluster +// +// Intel Nehalem Family +// +// +// +// +// +// +// ---- // -func (op *ExternalHostProviderService) HostsService() *ExternalHostsService { - return NewExternalHostsService(op.connection, fmt.Sprintf("%s/hosts", op.path)) +type ClustersServiceAddResponse struct { + cluster *Cluster } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *ExternalHostProviderService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - if path == "certificates" { - return op.CertificatesService(), nil - } - if strings.HasPrefix(path, "certificates/") { - return op.CertificatesService().Service(path[13:]) - } - if path == "computeresources" { - return op.ComputeResourcesService(), nil - } - if strings.HasPrefix(path, "computeresources/") { - return op.ComputeResourcesService().Service(path[17:]) - } - if path == "discoveredhosts" { - return op.DiscoveredHostsService(), nil - } - if strings.HasPrefix(path, "discoveredhosts/") { - return op.DiscoveredHostsService().Service(path[16:]) - } - if path == "hostgroups" { - return op.HostGroupsService(), nil - } - if strings.HasPrefix(path, "hostgroups/") { - return op.HostGroupsService().Service(path[11:]) - } - if path == "hosts" { - return op.HostsService(), nil - } - if strings.HasPrefix(path, "hosts/") { - return op.HostsService().Service(path[6:]) +func (p *ClustersServiceAddResponse) Cluster() (*Cluster, bool) { + if p.cluster != nil { + return p.cluster, true } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *ExternalHostProviderService) String() string { - return fmt.Sprintf("ExternalHostProviderService:%s", op.path) -} - -// -// A service to manage a Katello erratum. -// -type KatelloErratumService struct { - BaseService + return nil, false } -func NewKatelloErratumService(connection *Connection, path string) *KatelloErratumService { - var result KatelloErratumService - result.connection = connection - result.path = path - return &result +func (p *ClustersServiceAddResponse) MustCluster() *Cluster { + if p.cluster == nil { + panic("cluster in response does not exist") + } + return p.cluster } // -// Retrieves a Katello erratum. +// Creates a new cluster. +// This requires the `name`, `cpu.type`, and `data_center` attributes. Identify the data center with either the `id` +// or `name` attribute. // [source] // ---- -// GET /ovirt-engine/api/katelloerrata/123 +// POST /ovirt-engine/api/clusters // ---- -// You will receive response in XML like this one: +// With a request body like this: // [source,xml] // ---- -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// +// +// mycluster +// +// Intel Nehalem Family +// +// +// +// ---- +// To create a cluster with an external network provider to be deployed on +// every host that is added to the cluster, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/clusters +// ---- +// With a request body containing a reference to the desired provider: +// [source,xml] +// ---- +// +// mycluster +// +// Intel Nehalem Family +// +// +// +// +// +// // ---- // -type KatelloErratumServiceGetRequest struct { - KatelloErratumService *KatelloErratumService - header map[string]string - query map[string]string - follow *string +func (p *ClustersService) Add() *ClustersServiceAddRequest { + return &ClustersServiceAddRequest{ClustersService: p} } -func (p *KatelloErratumServiceGetRequest) Header(key, value string) *KatelloErratumServiceGetRequest { +// +// Returns the list of clusters of the system. +// The order of the returned clusters is guaranteed only if the `sortby` clause is included in the +// `search` parameter. +// +type ClustersServiceListRequest struct { + ClustersService *ClustersService + header map[string]string + query map[string]string + caseSensitive *bool + filter *bool + follow *string + max *int64 + search *string +} + +func (p *ClustersServiceListRequest) Header(key, value string) *ClustersServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -20428,7 +18501,7 @@ func (p *KatelloErratumServiceGetRequest) Header(key, value string) *KatelloErra return p } -func (p *KatelloErratumServiceGetRequest) Query(key, value string) *KatelloErratumServiceGetRequest { +func (p *ClustersServiceListRequest) Query(key, value string) *ClustersServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -20436,18 +18509,54 @@ func (p *KatelloErratumServiceGetRequest) Query(key, value string) *KatelloErrat return p } -func (p *KatelloErratumServiceGetRequest) Follow(follow string) *KatelloErratumServiceGetRequest { +func (p *ClustersServiceListRequest) CaseSensitive(caseSensitive bool) *ClustersServiceListRequest { + p.caseSensitive = &caseSensitive + return p +} + +func (p *ClustersServiceListRequest) Filter(filter bool) *ClustersServiceListRequest { + p.filter = &filter + return p +} + +func (p *ClustersServiceListRequest) Follow(follow string) *ClustersServiceListRequest { p.follow = &follow return p } -func (p *KatelloErratumServiceGetRequest) Send() (*KatelloErratumServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.KatelloErratumService.connection.URL(), p.KatelloErratumService.path) +func (p *ClustersServiceListRequest) Max(max int64) *ClustersServiceListRequest { + p.max = &max + return p +} + +func (p *ClustersServiceListRequest) Search(search string) *ClustersServiceListRequest { + p.search = &search + return p +} + +func (p *ClustersServiceListRequest) Send() (*ClustersServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ClustersService.connection.URL(), p.ClustersService.path) values := make(url.Values) + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -20461,7 +18570,7 @@ func (p *KatelloErratumServiceGetRequest) Send() (*KatelloErratumServiceGetRespo return nil, err } - for hk, hv := range p.KatelloErratumService.connection.headers { + for hk, hv := range p.ClustersService.connection.headers { req.Header.Add(hk, hv) } @@ -20476,18 +18585,18 @@ func (p *KatelloErratumServiceGetRequest) Send() (*KatelloErratumServiceGetRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.KatelloErratumService.connection.authenticate() + token, err := p.ClustersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.KatelloErratumService.connection.client.Do(req) + resp, err := p.ClustersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.KatelloErratumService.connection.logFunc != nil { + if p.ClustersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -20496,7 +18605,7 @@ func (p *KatelloErratumServiceGetRequest) Send() (*KatelloErratumServiceGetRespo if err != nil { return nil, err } - p.KatelloErratumService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ClustersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -20506,14 +18615,14 @@ func (p *KatelloErratumServiceGetRequest) Send() (*KatelloErratumServiceGetRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLKatelloErratumReadOne(reader, nil, "") + result, err := XMLClusterReadMany(reader, nil) if err != nil { return nil, err } - return &KatelloErratumServiceGetResponse{erratum: result}, nil + return &ClustersServiceListResponse{clusters: result}, nil } -func (p *KatelloErratumServiceGetRequest) MustSend() *KatelloErratumServiceGetResponse { +func (p *ClustersServiceListRequest) MustSend() *ClustersServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -20522,117 +18631,85 @@ func (p *KatelloErratumServiceGetRequest) MustSend() *KatelloErratumServiceGetRe } // -// Retrieves a Katello erratum. -// [source] -// ---- -// GET /ovirt-engine/api/katelloerrata/123 -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ---- +// Returns the list of clusters of the system. +// The order of the returned clusters is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type KatelloErratumServiceGetResponse struct { - erratum *KatelloErratum +type ClustersServiceListResponse struct { + clusters *ClusterSlice } -func (p *KatelloErratumServiceGetResponse) Erratum() (*KatelloErratum, bool) { - if p.erratum != nil { - return p.erratum, true +func (p *ClustersServiceListResponse) Clusters() (*ClusterSlice, bool) { + if p.clusters != nil { + return p.clusters, true } return nil, false } -func (p *KatelloErratumServiceGetResponse) MustErratum() *KatelloErratum { - if p.erratum == nil { - panic("erratum in response does not exist") +func (p *ClustersServiceListResponse) MustClusters() *ClusterSlice { + if p.clusters == nil { + panic("clusters in response does not exist") } - return p.erratum + return p.clusters } // -// Retrieves a Katello erratum. -// [source] -// ---- -// GET /ovirt-engine/api/katelloerrata/123 -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ---- +// Returns the list of clusters of the system. +// The order of the returned clusters is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -func (p *KatelloErratumService) Get() *KatelloErratumServiceGetRequest { - return &KatelloErratumServiceGetRequest{KatelloErratumService: p} +func (p *ClustersService) List() *ClustersServiceListRequest { + return &ClustersServiceListRequest{ClustersService: p} +} + +// +// A reference to the service that manages a specific cluster. +// +func (op *ClustersService) ClusterService(id string) *ClusterService { + return NewClusterService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *KatelloErratumService) Service(path string) (Service, error) { +func (op *ClustersService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.ClusterService(path), nil + } + return op.ClusterService(path[:index]).Service(path[index+1:]) } -func (op *KatelloErratumService) String() string { - return fmt.Sprintf("KatelloErratumService:%s", op.path) +func (op *ClustersService) String() string { + return fmt.Sprintf("ClustersService:%s", op.path) } // // -type ExternalHostProvidersService struct { +type CopyableService struct { BaseService } -func NewExternalHostProvidersService(connection *Connection, path string) *ExternalHostProvidersService { - var result ExternalHostProvidersService +func NewCopyableService(connection *Connection, path string) *CopyableService { + var result CopyableService result.connection = connection result.path = path return &result } // -// Add a new external host provider to the system. // -type ExternalHostProvidersServiceAddRequest struct { - ExternalHostProvidersService *ExternalHostProvidersService - header map[string]string - query map[string]string - provider *ExternalHostProvider +type CopyableServiceCopyRequest struct { + CopyableService *CopyableService + header map[string]string + query map[string]string + async *bool } -func (p *ExternalHostProvidersServiceAddRequest) Header(key, value string) *ExternalHostProvidersServiceAddRequest { +func (p *CopyableServiceCopyRequest) Header(key, value string) *CopyableServiceCopyRequest { if p.header == nil { p.header = make(map[string]string) } @@ -20640,7 +18717,7 @@ func (p *ExternalHostProvidersServiceAddRequest) Header(key, value string) *Exte return p } -func (p *ExternalHostProvidersServiceAddRequest) Query(key, value string) *ExternalHostProvidersServiceAddRequest { +func (p *CopyableServiceCopyRequest) Query(key, value string) *CopyableServiceCopyRequest { if p.query == nil { p.query = make(map[string]string) } @@ -20648,13 +18725,21 @@ func (p *ExternalHostProvidersServiceAddRequest) Query(key, value string) *Exter return p } -func (p *ExternalHostProvidersServiceAddRequest) Provider(provider *ExternalHostProvider) *ExternalHostProvidersServiceAddRequest { - p.provider = provider +func (p *CopyableServiceCopyRequest) Async(async bool) *CopyableServiceCopyRequest { + p.async = &async return p } -func (p *ExternalHostProvidersServiceAddRequest) Send() (*ExternalHostProvidersServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostProvidersService.connection.URL(), p.ExternalHostProvidersService.path) +func (p *CopyableServiceCopyRequest) Send() (*CopyableServiceCopyResponse, error) { + rawURL := fmt.Sprintf("%s%s/copy", p.CopyableService.connection.URL(), p.CopyableService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) + } + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -20666,17 +18751,14 @@ func (p *ExternalHostProvidersServiceAddRequest) Send() (*ExternalHostProvidersS } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLExternalHostProviderWriteOne(writer, p.provider, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalHostProvidersService.connection.headers { + for hk, hv := range p.CopyableService.connection.headers { req.Header.Add(hk, hv) } @@ -20691,18 +18773,18 @@ func (p *ExternalHostProvidersServiceAddRequest) Send() (*ExternalHostProvidersS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostProvidersService.connection.authenticate() + token, err := p.CopyableService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostProvidersService.connection.client.Do(req) + resp, err := p.CopyableService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostProvidersService.connection.logFunc != nil { + if p.CopyableService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -20711,24 +18793,16 @@ func (p *ExternalHostProvidersServiceAddRequest) Send() (*ExternalHostProvidersS if err != nil { return nil, err } - p.ExternalHostProvidersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.CopyableService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostProviderReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &ExternalHostProvidersServiceAddResponse{provider: result}, nil + return new(CopyableServiceCopyResponse), nil } -func (p *ExternalHostProvidersServiceAddRequest) MustSend() *ExternalHostProvidersServiceAddResponse { +func (p *CopyableServiceCopyRequest) MustSend() *CopyableServiceCopyResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -20737,47 +18811,53 @@ func (p *ExternalHostProvidersServiceAddRequest) MustSend() *ExternalHostProvide } // -// Add a new external host provider to the system. // -type ExternalHostProvidersServiceAddResponse struct { - provider *ExternalHostProvider +type CopyableServiceCopyResponse struct { } -func (p *ExternalHostProvidersServiceAddResponse) Provider() (*ExternalHostProvider, bool) { - if p.provider != nil { - return p.provider, true - } - return nil, false +// +// +func (p *CopyableService) Copy() *CopyableServiceCopyRequest { + return &CopyableServiceCopyRequest{CopyableService: p} } -func (p *ExternalHostProvidersServiceAddResponse) MustProvider() *ExternalHostProvider { - if p.provider == nil { - panic("provider in response does not exist") +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *CopyableService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - return p.provider + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *CopyableService) String() string { + return fmt.Sprintf("CopyableService:%s", op.path) } // -// Add a new external host provider to the system. // -func (p *ExternalHostProvidersService) Add() *ExternalHostProvidersServiceAddRequest { - return &ExternalHostProvidersServiceAddRequest{ExternalHostProvidersService: p} +type CpuProfileService struct { + BaseService +} + +func NewCpuProfileService(connection *Connection, path string) *CpuProfileService { + var result CpuProfileService + result.connection = connection + result.path = path + return &result } // -// Returns the list of external host providers. -// The order of the returned list of host providers isn't guaranteed. // -type ExternalHostProvidersServiceListRequest struct { - ExternalHostProvidersService *ExternalHostProvidersService - header map[string]string - query map[string]string - follow *string - max *int64 - search *string +type CpuProfileServiceGetRequest struct { + CpuProfileService *CpuProfileService + header map[string]string + query map[string]string + follow *string } -func (p *ExternalHostProvidersServiceListRequest) Header(key, value string) *ExternalHostProvidersServiceListRequest { +func (p *CpuProfileServiceGetRequest) Header(key, value string) *CpuProfileServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -20785,7 +18865,7 @@ func (p *ExternalHostProvidersServiceListRequest) Header(key, value string) *Ext return p } -func (p *ExternalHostProvidersServiceListRequest) Query(key, value string) *ExternalHostProvidersServiceListRequest { +func (p *CpuProfileServiceGetRequest) Query(key, value string) *CpuProfileServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -20793,40 +18873,22 @@ func (p *ExternalHostProvidersServiceListRequest) Query(key, value string) *Exte return p } -func (p *ExternalHostProvidersServiceListRequest) Follow(follow string) *ExternalHostProvidersServiceListRequest { +func (p *CpuProfileServiceGetRequest) Follow(follow string) *CpuProfileServiceGetRequest { p.follow = &follow return p } -func (p *ExternalHostProvidersServiceListRequest) Max(max int64) *ExternalHostProvidersServiceListRequest { - p.max = &max - return p -} - -func (p *ExternalHostProvidersServiceListRequest) Search(search string) *ExternalHostProvidersServiceListRequest { - p.search = &search - return p -} - -func (p *ExternalHostProvidersServiceListRequest) Send() (*ExternalHostProvidersServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostProvidersService.connection.URL(), p.ExternalHostProvidersService.path) +func (p *CpuProfileServiceGetRequest) Send() (*CpuProfileServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.CpuProfileService.connection.URL(), p.CpuProfileService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} + } } if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) @@ -20836,7 +18898,7 @@ func (p *ExternalHostProvidersServiceListRequest) Send() (*ExternalHostProviders return nil, err } - for hk, hv := range p.ExternalHostProvidersService.connection.headers { + for hk, hv := range p.CpuProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -20851,18 +18913,18 @@ func (p *ExternalHostProvidersServiceListRequest) Send() (*ExternalHostProviders req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostProvidersService.connection.authenticate() + token, err := p.CpuProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostProvidersService.connection.client.Do(req) + resp, err := p.CpuProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostProvidersService.connection.logFunc != nil { + if p.CpuProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -20871,7 +18933,7 @@ func (p *ExternalHostProvidersServiceListRequest) Send() (*ExternalHostProviders if err != nil { return nil, err } - p.ExternalHostProvidersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.CpuProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -20881,14 +18943,14 @@ func (p *ExternalHostProvidersServiceListRequest) Send() (*ExternalHostProviders return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostProviderReadMany(reader, nil) + result, err := XMLCpuProfileReadOne(reader, nil, "") if err != nil { return nil, err } - return &ExternalHostProvidersServiceListResponse{providers: result}, nil + return &CpuProfileServiceGetResponse{profile: result}, nil } -func (p *ExternalHostProvidersServiceListRequest) MustSend() *ExternalHostProvidersServiceListResponse { +func (p *CpuProfileServiceGetRequest) MustSend() *CpuProfileServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -20897,114 +18959,159 @@ func (p *ExternalHostProvidersServiceListRequest) MustSend() *ExternalHostProvid } // -// Returns the list of external host providers. -// The order of the returned list of host providers isn't guaranteed. // -type ExternalHostProvidersServiceListResponse struct { - providers *ExternalHostProviderSlice +type CpuProfileServiceGetResponse struct { + profile *CpuProfile } -func (p *ExternalHostProvidersServiceListResponse) Providers() (*ExternalHostProviderSlice, bool) { - if p.providers != nil { - return p.providers, true +func (p *CpuProfileServiceGetResponse) Profile() (*CpuProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *ExternalHostProvidersServiceListResponse) MustProviders() *ExternalHostProviderSlice { - if p.providers == nil { - panic("providers in response does not exist") +func (p *CpuProfileServiceGetResponse) MustProfile() *CpuProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.providers + return p.profile } // -// Returns the list of external host providers. -// The order of the returned list of host providers isn't guaranteed. // -func (p *ExternalHostProvidersService) List() *ExternalHostProvidersServiceListRequest { - return &ExternalHostProvidersServiceListRequest{ExternalHostProvidersService: p} +func (p *CpuProfileService) Get() *CpuProfileServiceGetRequest { + return &CpuProfileServiceGetRequest{CpuProfileService: p} } // // -func (op *ExternalHostProvidersService) ProviderService(id string) *ExternalHostProviderService { - return NewExternalHostProviderService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +type CpuProfileServiceRemoveRequest struct { + CpuProfileService *CpuProfileService + header map[string]string + query map[string]string + async *bool } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *ExternalHostProvidersService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *CpuProfileServiceRemoveRequest) Header(key, value string) *CpuProfileServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) } - index := strings.Index(path, "/") - if index == -1 { - return op.ProviderService(path), nil + p.header[key] = value + return p +} + +func (p *CpuProfileServiceRemoveRequest) Query(key, value string) *CpuProfileServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) } - return op.ProviderService(path[:index]).Service(path[index+1:]) + p.query[key] = value + return p } -func (op *ExternalHostProvidersService) String() string { - return fmt.Sprintf("ExternalHostProvidersService:%s", op.path) +func (p *CpuProfileServiceRemoveRequest) Async(async bool) *CpuProfileServiceRemoveRequest { + p.async = &async + return p +} + +func (p *CpuProfileServiceRemoveRequest) Send() (*CpuProfileServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.CpuProfileService.connection.URL(), p.CpuProfileService.path) + values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} + } + } + if len(values) > 0 { + rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) + } + req, err := http.NewRequest("DELETE", rawURL, nil) + if err != nil { + return nil, err + } + + for hk, hv := range p.CpuProfileService.connection.headers { + req.Header.Add(hk, hv) + } + + if p.header != nil { + for hk, hv := range p.header { + req.Header.Add(hk, hv) + } + } + + req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) + req.Header.Add("Version", "4") + req.Header.Add("Content-Type", "application/xml") + req.Header.Add("Accept", "application/xml") + // get OAuth access token + token, err := p.CpuProfileService.connection.authenticate() + if err != nil { + return nil, err + } + req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) + // Send the request and wait for the response + resp, err := p.CpuProfileService.connection.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if p.CpuProfileService.connection.logFunc != nil { + dumpReq, err := httputil.DumpRequestOut(req, true) + if err != nil { + return nil, err + } + dumpResp, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, err + } + p.CpuProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + } + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(CpuProfileServiceRemoveResponse), nil +} + +func (p *CpuProfileServiceRemoveRequest) MustSend() *CpuProfileServiceRemoveResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } } // -// This service manages external discovered hosts. // -type ExternalDiscoveredHostsService struct { - BaseService +type CpuProfileServiceRemoveResponse struct { } -func NewExternalDiscoveredHostsService(connection *Connection, path string) *ExternalDiscoveredHostsService { - var result ExternalDiscoveredHostsService - result.connection = connection - result.path = path - return &result +// +// +func (p *CpuProfileService) Remove() *CpuProfileServiceRemoveRequest { + return &CpuProfileServiceRemoveRequest{CpuProfileService: p} } // -// Get list of discovered hosts' information. -// Discovered hosts are fetched from third-party providers such as Foreman. -// To list all discovered hosts for provider `123` send the following: -// [source] -// ---- -// GET /ovirt-engine/api/externalhostproviders/123/discoveredhost -// ---- -// [source,xml] -// ---- -// -// -// mac001a4ad04031 -// 10.34.67.42 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:31 -// sat0 -// -// -// -// mac001a4ad04040 -// 10.34.67.43 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:40 -// sat0 -// -// -// ... -// -// ---- -// The order of the returned list of hosts isn't guaranteed. +// Update the specified cpu profile in the system. // -type ExternalDiscoveredHostsServiceListRequest struct { - ExternalDiscoveredHostsService *ExternalDiscoveredHostsService - header map[string]string - query map[string]string - follow *string - max *int64 +type CpuProfileServiceUpdateRequest struct { + CpuProfileService *CpuProfileService + header map[string]string + query map[string]string + async *bool + profile *CpuProfile } -func (p *ExternalDiscoveredHostsServiceListRequest) Header(key, value string) *ExternalDiscoveredHostsServiceListRequest { +func (p *CpuProfileServiceUpdateRequest) Header(key, value string) *CpuProfileServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -21012,7 +19119,7 @@ func (p *ExternalDiscoveredHostsServiceListRequest) Header(key, value string) *E return p } -func (p *ExternalDiscoveredHostsServiceListRequest) Query(key, value string) *ExternalDiscoveredHostsServiceListRequest { +func (p *CpuProfileServiceUpdateRequest) Query(key, value string) *CpuProfileServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -21020,25 +19127,21 @@ func (p *ExternalDiscoveredHostsServiceListRequest) Query(key, value string) *Ex return p } -func (p *ExternalDiscoveredHostsServiceListRequest) Follow(follow string) *ExternalDiscoveredHostsServiceListRequest { - p.follow = &follow +func (p *CpuProfileServiceUpdateRequest) Async(async bool) *CpuProfileServiceUpdateRequest { + p.async = &async return p } -func (p *ExternalDiscoveredHostsServiceListRequest) Max(max int64) *ExternalDiscoveredHostsServiceListRequest { - p.max = &max +func (p *CpuProfileServiceUpdateRequest) Profile(profile *CpuProfile) *CpuProfileServiceUpdateRequest { + p.profile = profile return p } -func (p *ExternalDiscoveredHostsServiceListRequest) Send() (*ExternalDiscoveredHostsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalDiscoveredHostsService.connection.URL(), p.ExternalDiscoveredHostsService.path) +func (p *CpuProfileServiceUpdateRequest) Send() (*CpuProfileServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.CpuProfileService.connection.URL(), p.CpuProfileService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -21049,12 +19152,19 @@ func (p *ExternalDiscoveredHostsServiceListRequest) Send() (*ExternalDiscoveredH if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLCpuProfileWriteOne(writer, p.profile, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalDiscoveredHostsService.connection.headers { + for hk, hv := range p.CpuProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -21069,18 +19179,18 @@ func (p *ExternalDiscoveredHostsServiceListRequest) Send() (*ExternalDiscoveredH req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalDiscoveredHostsService.connection.authenticate() + token, err := p.CpuProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalDiscoveredHostsService.connection.client.Do(req) + resp, err := p.CpuProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalDiscoveredHostsService.connection.logFunc != nil { + if p.CpuProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -21089,7 +19199,7 @@ func (p *ExternalDiscoveredHostsServiceListRequest) Send() (*ExternalDiscoveredH if err != nil { return nil, err } - p.ExternalDiscoveredHostsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.CpuProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -21099,14 +19209,14 @@ func (p *ExternalDiscoveredHostsServiceListRequest) Send() (*ExternalDiscoveredH return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalDiscoveredHostReadMany(reader, nil) + result, err := XMLCpuProfileReadOne(reader, nil, "") if err != nil { return nil, err } - return &ExternalDiscoveredHostsServiceListResponse{hosts: result}, nil + return &CpuProfileServiceUpdateResponse{profile: result}, nil } -func (p *ExternalDiscoveredHostsServiceListRequest) MustSend() *ExternalDiscoveredHostsServiceListResponse { +func (p *CpuProfileServiceUpdateRequest) MustSend() *CpuProfileServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -21115,169 +19225,83 @@ func (p *ExternalDiscoveredHostsServiceListRequest) MustSend() *ExternalDiscover } // -// Get list of discovered hosts' information. -// Discovered hosts are fetched from third-party providers such as Foreman. -// To list all discovered hosts for provider `123` send the following: -// [source] -// ---- -// GET /ovirt-engine/api/externalhostproviders/123/discoveredhost -// ---- -// [source,xml] -// ---- -// -// -// mac001a4ad04031 -// 10.34.67.42 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:31 -// sat0 -// -// -// -// mac001a4ad04040 -// 10.34.67.43 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:40 -// sat0 -// -// -// ... -// -// ---- -// The order of the returned list of hosts isn't guaranteed. +// Update the specified cpu profile in the system. // -type ExternalDiscoveredHostsServiceListResponse struct { - hosts *ExternalDiscoveredHostSlice +type CpuProfileServiceUpdateResponse struct { + profile *CpuProfile } -func (p *ExternalDiscoveredHostsServiceListResponse) Hosts() (*ExternalDiscoveredHostSlice, bool) { - if p.hosts != nil { - return p.hosts, true +func (p *CpuProfileServiceUpdateResponse) Profile() (*CpuProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *ExternalDiscoveredHostsServiceListResponse) MustHosts() *ExternalDiscoveredHostSlice { - if p.hosts == nil { - panic("hosts in response does not exist") +func (p *CpuProfileServiceUpdateResponse) MustProfile() *CpuProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.hosts + return p.profile } // -// Get list of discovered hosts' information. -// Discovered hosts are fetched from third-party providers such as Foreman. -// To list all discovered hosts for provider `123` send the following: -// [source] -// ---- -// GET /ovirt-engine/api/externalhostproviders/123/discoveredhost -// ---- -// [source,xml] -// ---- -// -// -// mac001a4ad04031 -// 10.34.67.42 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:31 -// sat0 -// -// -// -// mac001a4ad04040 -// 10.34.67.43 -// 2017-04-24 11:05:41 UTC -// 00:1a:4a:d0:40:40 -// sat0 -// -// -// ... -// -// ---- -// The order of the returned list of hosts isn't guaranteed. +// Update the specified cpu profile in the system. // -func (p *ExternalDiscoveredHostsService) List() *ExternalDiscoveredHostsServiceListRequest { - return &ExternalDiscoveredHostsServiceListRequest{ExternalDiscoveredHostsService: p} +func (p *CpuProfileService) Update() *CpuProfileServiceUpdateRequest { + return &CpuProfileServiceUpdateRequest{CpuProfileService: p} } // // -func (op *ExternalDiscoveredHostsService) HostService(id string) *ExternalDiscoveredHostService { - return NewExternalDiscoveredHostService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *CpuProfileService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ExternalDiscoveredHostsService) Service(path string) (Service, error) { +func (op *CpuProfileService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.HostService(path), nil + if path == "permissions" { + return op.PermissionsService(), nil } - return op.HostService(path[:index]).Service(path[index+1:]) + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *ExternalDiscoveredHostsService) String() string { - return fmt.Sprintf("ExternalDiscoveredHostsService:%s", op.path) +func (op *CpuProfileService) String() string { + return fmt.Sprintf("CpuProfileService:%s", op.path) } // -// A service to manage Katello errata assigned to the engine. -// The information is retrieved from Katello. // -type EngineKatelloErrataService struct { +type CpuProfilesService struct { BaseService } -func NewEngineKatelloErrataService(connection *Connection, path string) *EngineKatelloErrataService { - var result EngineKatelloErrataService +func NewCpuProfilesService(connection *Connection, path string) *CpuProfilesService { + var result CpuProfilesService result.connection = connection result.path = path return &result } // -// Retrieves the representation of the Katello errata. -// [source] -// ---- -// GET /ovirt-engine/api/katelloerrata -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ... -// -// ---- -// The order of the returned list of erratum isn't guaranteed. +// Add a new cpu profile to the system. // -type EngineKatelloErrataServiceListRequest struct { - EngineKatelloErrataService *EngineKatelloErrataService - header map[string]string - query map[string]string - follow *string - max *int64 +type CpuProfilesServiceAddRequest struct { + CpuProfilesService *CpuProfilesService + header map[string]string + query map[string]string + profile *CpuProfile } -func (p *EngineKatelloErrataServiceListRequest) Header(key, value string) *EngineKatelloErrataServiceListRequest { +func (p *CpuProfilesServiceAddRequest) Header(key, value string) *CpuProfilesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -21285,7 +19309,7 @@ func (p *EngineKatelloErrataServiceListRequest) Header(key, value string) *Engin return p } -func (p *EngineKatelloErrataServiceListRequest) Query(key, value string) *EngineKatelloErrataServiceListRequest { +func (p *CpuProfilesServiceAddRequest) Query(key, value string) *CpuProfilesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -21293,27 +19317,14 @@ func (p *EngineKatelloErrataServiceListRequest) Query(key, value string) *Engine return p } -func (p *EngineKatelloErrataServiceListRequest) Follow(follow string) *EngineKatelloErrataServiceListRequest { - p.follow = &follow - return p -} - -func (p *EngineKatelloErrataServiceListRequest) Max(max int64) *EngineKatelloErrataServiceListRequest { - p.max = &max +func (p *CpuProfilesServiceAddRequest) Profile(profile *CpuProfile) *CpuProfilesServiceAddRequest { + p.profile = profile return p } -func (p *EngineKatelloErrataServiceListRequest) Send() (*EngineKatelloErrataServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.EngineKatelloErrataService.connection.URL(), p.EngineKatelloErrataService.path) +func (p *CpuProfilesServiceAddRequest) Send() (*CpuProfilesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.CpuProfilesService.connection.URL(), p.CpuProfilesService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -21322,12 +19333,19 @@ func (p *EngineKatelloErrataServiceListRequest) Send() (*EngineKatelloErrataServ if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLCpuProfileWriteOne(writer, p.profile, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.EngineKatelloErrataService.connection.headers { + for hk, hv := range p.CpuProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -21342,18 +19360,18 @@ func (p *EngineKatelloErrataServiceListRequest) Send() (*EngineKatelloErrataServ req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.EngineKatelloErrataService.connection.authenticate() + token, err := p.CpuProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.EngineKatelloErrataService.connection.client.Do(req) + resp, err := p.CpuProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.EngineKatelloErrataService.connection.logFunc != nil { + if p.CpuProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -21362,9 +19380,9 @@ func (p *EngineKatelloErrataServiceListRequest) Send() (*EngineKatelloErrataServ if err != nil { return nil, err } - p.EngineKatelloErrataService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.CpuProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -21372,14 +19390,14 @@ func (p *EngineKatelloErrataServiceListRequest) Send() (*EngineKatelloErrataServ return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLKatelloErratumReadMany(reader, nil) + result, err := XMLCpuProfileReadOne(reader, nil, "") if err != nil { return nil, err } - return &EngineKatelloErrataServiceListResponse{errata: result}, nil + return &CpuProfilesServiceAddResponse{profile: result}, nil } -func (p *EngineKatelloErrataServiceListRequest) MustSend() *EngineKatelloErrataServiceListResponse { +func (p *CpuProfilesServiceAddRequest) MustSend() *CpuProfilesServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -21388,156 +19406,46 @@ func (p *EngineKatelloErrataServiceListRequest) MustSend() *EngineKatelloErrataS } // -// Retrieves the representation of the Katello errata. -// [source] -// ---- -// GET /ovirt-engine/api/katelloerrata -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ... -// -// ---- -// The order of the returned list of erratum isn't guaranteed. +// Add a new cpu profile to the system. // -type EngineKatelloErrataServiceListResponse struct { - errata *KatelloErratumSlice +type CpuProfilesServiceAddResponse struct { + profile *CpuProfile } -func (p *EngineKatelloErrataServiceListResponse) Errata() (*KatelloErratumSlice, bool) { - if p.errata != nil { - return p.errata, true +func (p *CpuProfilesServiceAddResponse) Profile() (*CpuProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *EngineKatelloErrataServiceListResponse) MustErrata() *KatelloErratumSlice { - if p.errata == nil { - panic("errata in response does not exist") - } - return p.errata -} - -// -// Retrieves the representation of the Katello errata. -// [source] -// ---- -// GET /ovirt-engine/api/katelloerrata -// ---- -// You will receive response in XML like this one: -// [source,xml] -// ---- -// -// -// RHBA-2013:XYZ -// The description of the erratum -// some bug fix update -// bugfix -// 2013-11-20T02:00:00.000+02:00 -// Few guidelines regarding the solution -// Updated packages that fix one bug are now available for XYZ -// -// -// libipa_hbac-1.9.2-82.11.el6_4.i686 -// -// ... -// -// -// ... -// -// ---- -// The order of the returned list of erratum isn't guaranteed. -// -func (p *EngineKatelloErrataService) List() *EngineKatelloErrataServiceListRequest { - return &EngineKatelloErrataServiceListRequest{EngineKatelloErrataService: p} -} - -// -// Reference to the Katello erratum service. -// Use this service to view the erratum by its id. -// -func (op *EngineKatelloErrataService) KatelloErratumService(id string) *KatelloErratumService { - return NewKatelloErratumService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *EngineKatelloErrataService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.KatelloErratumService(path), nil +func (p *CpuProfilesServiceAddResponse) MustProfile() *CpuProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return op.KatelloErratumService(path[:index]).Service(path[index+1:]) -} - -func (op *EngineKatelloErrataService) String() string { - return fmt.Sprintf("EngineKatelloErrataService:%s", op.path) + return p.profile } // -// This service manages a single host group information. -// Host group is a term of host provider - the host group includes provision details that are applied to new discovered -// host. Information such as subnet, operating system, domain, etc. +// Add a new cpu profile to the system. // -type ExternalHostGroupService struct { - BaseService -} - -func NewExternalHostGroupService(connection *Connection, path string) *ExternalHostGroupService { - var result ExternalHostGroupService - result.connection = connection - result.path = path - return &result +func (p *CpuProfilesService) Add() *CpuProfilesServiceAddRequest { + return &CpuProfilesServiceAddRequest{CpuProfilesService: p} } // -// Get host group information. -// For example, to get the details of hostgroup `234` of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/hostgroups/234 -// .... -// It will return a response like this: -// [source,xml] -// ---- -// -// rhel7 -// x86_64 -// s.com -// RedHat 7.3 -// sat0 -// -// -// ---- +// Returns the list of CPU profiles of the system. +// The order of the returned list of CPU profiles is random. // -type ExternalHostGroupServiceGetRequest struct { - ExternalHostGroupService *ExternalHostGroupService - header map[string]string - query map[string]string - follow *string +type CpuProfilesServiceListRequest struct { + CpuProfilesService *CpuProfilesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *ExternalHostGroupServiceGetRequest) Header(key, value string) *ExternalHostGroupServiceGetRequest { +func (p *CpuProfilesServiceListRequest) Header(key, value string) *CpuProfilesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -21545,7 +19453,7 @@ func (p *ExternalHostGroupServiceGetRequest) Header(key, value string) *External return p } -func (p *ExternalHostGroupServiceGetRequest) Query(key, value string) *ExternalHostGroupServiceGetRequest { +func (p *CpuProfilesServiceListRequest) Query(key, value string) *CpuProfilesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -21553,18 +19461,27 @@ func (p *ExternalHostGroupServiceGetRequest) Query(key, value string) *ExternalH return p } -func (p *ExternalHostGroupServiceGetRequest) Follow(follow string) *ExternalHostGroupServiceGetRequest { +func (p *CpuProfilesServiceListRequest) Follow(follow string) *CpuProfilesServiceListRequest { p.follow = &follow return p } -func (p *ExternalHostGroupServiceGetRequest) Send() (*ExternalHostGroupServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalHostGroupService.connection.URL(), p.ExternalHostGroupService.path) +func (p *CpuProfilesServiceListRequest) Max(max int64) *CpuProfilesServiceListRequest { + p.max = &max + return p +} + +func (p *CpuProfilesServiceListRequest) Send() (*CpuProfilesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.CpuProfilesService.connection.URL(), p.CpuProfilesService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -21578,7 +19495,7 @@ func (p *ExternalHostGroupServiceGetRequest) Send() (*ExternalHostGroupServiceGe return nil, err } - for hk, hv := range p.ExternalHostGroupService.connection.headers { + for hk, hv := range p.CpuProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -21593,18 +19510,18 @@ func (p *ExternalHostGroupServiceGetRequest) Send() (*ExternalHostGroupServiceGe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalHostGroupService.connection.authenticate() + token, err := p.CpuProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalHostGroupService.connection.client.Do(req) + resp, err := p.CpuProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalHostGroupService.connection.logFunc != nil { + if p.CpuProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -21613,7 +19530,7 @@ func (p *ExternalHostGroupServiceGetRequest) Send() (*ExternalHostGroupServiceGe if err != nil { return nil, err } - p.ExternalHostGroupService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.CpuProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -21623,14 +19540,14 @@ func (p *ExternalHostGroupServiceGetRequest) Send() (*ExternalHostGroupServiceGe return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalHostGroupReadOne(reader, nil, "") + result, err := XMLCpuProfileReadMany(reader, nil) if err != nil { return nil, err } - return &ExternalHostGroupServiceGetResponse{group: result}, nil + return &CpuProfilesServiceListResponse{profile: result}, nil } -func (p *ExternalHostGroupServiceGetRequest) MustSend() *ExternalHostGroupServiceGetResponse { +func (p *CpuProfilesServiceListRequest) MustSend() *CpuProfilesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -21639,104 +19556,84 @@ func (p *ExternalHostGroupServiceGetRequest) MustSend() *ExternalHostGroupServic } // -// Get host group information. -// For example, to get the details of hostgroup `234` of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/hostgroups/234 -// .... -// It will return a response like this: -// [source,xml] -// ---- -// -// rhel7 -// x86_64 -// s.com -// RedHat 7.3 -// sat0 -// -// -// ---- +// Returns the list of CPU profiles of the system. +// The order of the returned list of CPU profiles is random. // -type ExternalHostGroupServiceGetResponse struct { - group *ExternalHostGroup +type CpuProfilesServiceListResponse struct { + profile *CpuProfileSlice } -func (p *ExternalHostGroupServiceGetResponse) Group() (*ExternalHostGroup, bool) { - if p.group != nil { - return p.group, true +func (p *CpuProfilesServiceListResponse) Profile() (*CpuProfileSlice, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *ExternalHostGroupServiceGetResponse) MustGroup() *ExternalHostGroup { - if p.group == nil { - panic("group in response does not exist") +func (p *CpuProfilesServiceListResponse) MustProfile() *CpuProfileSlice { + if p.profile == nil { + panic("profile in response does not exist") } - return p.group + return p.profile } // -// Get host group information. -// For example, to get the details of hostgroup `234` of provider `123`, send a request like this: -// .... -// GET /ovirt-engine/api/externalhostproviders/123/hostgroups/234 -// .... -// It will return a response like this: -// [source,xml] -// ---- -// -// rhel7 -// x86_64 -// s.com -// RedHat 7.3 -// sat0 -// -// -// ---- +// Returns the list of CPU profiles of the system. +// The order of the returned list of CPU profiles is random. // -func (p *ExternalHostGroupService) Get() *ExternalHostGroupServiceGetRequest { - return &ExternalHostGroupServiceGetRequest{ExternalHostGroupService: p} +func (p *CpuProfilesService) List() *CpuProfilesServiceListRequest { + return &CpuProfilesServiceListRequest{CpuProfilesService: p} +} + +// +// +func (op *CpuProfilesService) ProfileService(id string) *CpuProfileService { + return NewCpuProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ExternalHostGroupService) Service(path string) (Service, error) { +func (op *CpuProfilesService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.ProfileService(path), nil + } + return op.ProfileService(path[:index]).Service(path[index+1:]) } -func (op *ExternalHostGroupService) String() string { - return fmt.Sprintf("ExternalHostGroupService:%s", op.path) +func (op *CpuProfilesService) String() string { + return fmt.Sprintf("CpuProfilesService:%s", op.path) } // -// Manages the set of quota limits configured for a cluster. +// A service to manage a specific data center network. // -type QuotaClusterLimitsService struct { +type DataCenterNetworkService struct { BaseService } -func NewQuotaClusterLimitsService(connection *Connection, path string) *QuotaClusterLimitsService { - var result QuotaClusterLimitsService +func NewDataCenterNetworkService(connection *Connection, path string) *DataCenterNetworkService { + var result DataCenterNetworkService result.connection = connection result.path = path return &result } // -// Add a cluster limit to a specified Quota. +// Retrieves the data center network details. // -type QuotaClusterLimitsServiceAddRequest struct { - QuotaClusterLimitsService *QuotaClusterLimitsService - header map[string]string - query map[string]string - limit *QuotaClusterLimit +type DataCenterNetworkServiceGetRequest struct { + DataCenterNetworkService *DataCenterNetworkService + header map[string]string + query map[string]string + follow *string } -func (p *QuotaClusterLimitsServiceAddRequest) Header(key, value string) *QuotaClusterLimitsServiceAddRequest { +func (p *DataCenterNetworkServiceGetRequest) Header(key, value string) *DataCenterNetworkServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -21744,7 +19641,7 @@ func (p *QuotaClusterLimitsServiceAddRequest) Header(key, value string) *QuotaCl return p } -func (p *QuotaClusterLimitsServiceAddRequest) Query(key, value string) *QuotaClusterLimitsServiceAddRequest { +func (p *DataCenterNetworkServiceGetRequest) Query(key, value string) *DataCenterNetworkServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -21752,14 +19649,18 @@ func (p *QuotaClusterLimitsServiceAddRequest) Query(key, value string) *QuotaClu return p } -func (p *QuotaClusterLimitsServiceAddRequest) Limit(limit *QuotaClusterLimit) *QuotaClusterLimitsServiceAddRequest { - p.limit = limit +func (p *DataCenterNetworkServiceGetRequest) Follow(follow string) *DataCenterNetworkServiceGetRequest { + p.follow = &follow return p } -func (p *QuotaClusterLimitsServiceAddRequest) Send() (*QuotaClusterLimitsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QuotaClusterLimitsService.connection.URL(), p.QuotaClusterLimitsService.path) +func (p *DataCenterNetworkServiceGetRequest) Send() (*DataCenterNetworkServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworkService.connection.URL(), p.DataCenterNetworkService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -21768,19 +19669,12 @@ func (p *QuotaClusterLimitsServiceAddRequest) Send() (*QuotaClusterLimitsService if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLQuotaClusterLimitWriteOne(writer, p.limit, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.QuotaClusterLimitsService.connection.headers { + for hk, hv := range p.DataCenterNetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -21795,18 +19689,18 @@ func (p *QuotaClusterLimitsServiceAddRequest) Send() (*QuotaClusterLimitsService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QuotaClusterLimitsService.connection.authenticate() + token, err := p.DataCenterNetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QuotaClusterLimitsService.connection.client.Do(req) + resp, err := p.DataCenterNetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QuotaClusterLimitsService.connection.logFunc != nil { + if p.DataCenterNetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -21815,9 +19709,9 @@ func (p *QuotaClusterLimitsServiceAddRequest) Send() (*QuotaClusterLimitsService if err != nil { return nil, err } - p.QuotaClusterLimitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -21825,14 +19719,14 @@ func (p *QuotaClusterLimitsServiceAddRequest) Send() (*QuotaClusterLimitsService return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLQuotaClusterLimitReadOne(reader, nil, "") + result, err := XMLNetworkReadOne(reader, nil, "") if err != nil { return nil, err } - return &QuotaClusterLimitsServiceAddResponse{limit: result}, nil + return &DataCenterNetworkServiceGetResponse{network: result}, nil } -func (p *QuotaClusterLimitsServiceAddRequest) MustSend() *QuotaClusterLimitsServiceAddResponse { +func (p *DataCenterNetworkServiceGetRequest) MustSend() *DataCenterNetworkServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -21841,46 +19735,43 @@ func (p *QuotaClusterLimitsServiceAddRequest) MustSend() *QuotaClusterLimitsServ } // -// Add a cluster limit to a specified Quota. +// Retrieves the data center network details. // -type QuotaClusterLimitsServiceAddResponse struct { - limit *QuotaClusterLimit +type DataCenterNetworkServiceGetResponse struct { + network *Network } -func (p *QuotaClusterLimitsServiceAddResponse) Limit() (*QuotaClusterLimit, bool) { - if p.limit != nil { - return p.limit, true +func (p *DataCenterNetworkServiceGetResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } return nil, false } -func (p *QuotaClusterLimitsServiceAddResponse) MustLimit() *QuotaClusterLimit { - if p.limit == nil { - panic("limit in response does not exist") +func (p *DataCenterNetworkServiceGetResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } - return p.limit + return p.network } // -// Add a cluster limit to a specified Quota. +// Retrieves the data center network details. // -func (p *QuotaClusterLimitsService) Add() *QuotaClusterLimitsServiceAddRequest { - return &QuotaClusterLimitsServiceAddRequest{QuotaClusterLimitsService: p} +func (p *DataCenterNetworkService) Get() *DataCenterNetworkServiceGetRequest { + return &DataCenterNetworkServiceGetRequest{DataCenterNetworkService: p} } // -// Returns the set of quota limits configured for the cluster. -// The returned list of quota limits isn't guaranteed. +// Removes the network. // -type QuotaClusterLimitsServiceListRequest struct { - QuotaClusterLimitsService *QuotaClusterLimitsService - header map[string]string - query map[string]string - follow *string - max *int64 +type DataCenterNetworkServiceRemoveRequest struct { + DataCenterNetworkService *DataCenterNetworkService + header map[string]string + query map[string]string } -func (p *QuotaClusterLimitsServiceListRequest) Header(key, value string) *QuotaClusterLimitsServiceListRequest { +func (p *DataCenterNetworkServiceRemoveRequest) Header(key, value string) *DataCenterNetworkServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -21888,7 +19779,7 @@ func (p *QuotaClusterLimitsServiceListRequest) Header(key, value string) *QuotaC return p } -func (p *QuotaClusterLimitsServiceListRequest) Query(key, value string) *QuotaClusterLimitsServiceListRequest { +func (p *DataCenterNetworkServiceRemoveRequest) Query(key, value string) *DataCenterNetworkServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -21896,27 +19787,9 @@ func (p *QuotaClusterLimitsServiceListRequest) Query(key, value string) *QuotaCl return p } -func (p *QuotaClusterLimitsServiceListRequest) Follow(follow string) *QuotaClusterLimitsServiceListRequest { - p.follow = &follow - return p -} - -func (p *QuotaClusterLimitsServiceListRequest) Max(max int64) *QuotaClusterLimitsServiceListRequest { - p.max = &max - return p -} - -func (p *QuotaClusterLimitsServiceListRequest) Send() (*QuotaClusterLimitsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QuotaClusterLimitsService.connection.URL(), p.QuotaClusterLimitsService.path) +func (p *DataCenterNetworkServiceRemoveRequest) Send() (*DataCenterNetworkServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworkService.connection.URL(), p.DataCenterNetworkService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -21925,12 +19798,12 @@ func (p *QuotaClusterLimitsServiceListRequest) Send() (*QuotaClusterLimitsServic if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.QuotaClusterLimitsService.connection.headers { + for hk, hv := range p.DataCenterNetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -21945,18 +19818,18 @@ func (p *QuotaClusterLimitsServiceListRequest) Send() (*QuotaClusterLimitsServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QuotaClusterLimitsService.connection.authenticate() + token, err := p.DataCenterNetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QuotaClusterLimitsService.connection.client.Do(req) + resp, err := p.DataCenterNetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QuotaClusterLimitsService.connection.logFunc != nil { + if p.DataCenterNetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -21965,24 +19838,19 @@ func (p *QuotaClusterLimitsServiceListRequest) Send() (*QuotaClusterLimitsServic if err != nil { return nil, err } - p.QuotaClusterLimitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLQuotaClusterLimitReadMany(reader, nil) - if err != nil { - return nil, err - } - return &QuotaClusterLimitsServiceListResponse{limits: result}, nil + return new(DataCenterNetworkServiceRemoveResponse), nil } -func (p *QuotaClusterLimitsServiceListRequest) MustSend() *QuotaClusterLimitsServiceListResponse { +func (p *DataCenterNetworkServiceRemoveRequest) MustSend() *DataCenterNetworkServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -21991,130 +19859,29 @@ func (p *QuotaClusterLimitsServiceListRequest) MustSend() *QuotaClusterLimitsSer } // -// Returns the set of quota limits configured for the cluster. -// The returned list of quota limits isn't guaranteed. -// -type QuotaClusterLimitsServiceListResponse struct { - limits *QuotaClusterLimitSlice -} - -func (p *QuotaClusterLimitsServiceListResponse) Limits() (*QuotaClusterLimitSlice, bool) { - if p.limits != nil { - return p.limits, true - } - return nil, false -} - -func (p *QuotaClusterLimitsServiceListResponse) MustLimits() *QuotaClusterLimitSlice { - if p.limits == nil { - panic("limits in response does not exist") - } - return p.limits -} - -// -// Returns the set of quota limits configured for the cluster. -// The returned list of quota limits isn't guaranteed. -// -func (p *QuotaClusterLimitsService) List() *QuotaClusterLimitsServiceListRequest { - return &QuotaClusterLimitsServiceListRequest{QuotaClusterLimitsService: p} -} - -// -// -func (op *QuotaClusterLimitsService) LimitService(id string) *QuotaClusterLimitService { - return NewQuotaClusterLimitService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Removes the network. // -func (op *QuotaClusterLimitsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.LimitService(path), nil - } - return op.LimitService(path[:index]).Service(path[index+1:]) -} - -func (op *QuotaClusterLimitsService) String() string { - return fmt.Sprintf("QuotaClusterLimitsService:%s", op.path) +type DataCenterNetworkServiceRemoveResponse struct { } // -// This service doesn't add any new methods, it is just a placeholder for the annotation that specifies the path of the -// resource that manages the permissions assigned to the system object. +// Removes the network. // -type SystemPermissionsService struct { - BaseService -} - -func NewSystemPermissionsService(connection *Connection, path string) *SystemPermissionsService { - var result SystemPermissionsService - result.connection = connection - result.path = path - return &result +func (p *DataCenterNetworkService) Remove() *DataCenterNetworkServiceRemoveRequest { + return &DataCenterNetworkServiceRemoveRequest{DataCenterNetworkService: p} } // -// Assign a new permission to a user or group for specific entity. -// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` -// send a request like this: -// .... -// POST /ovirt-engine/api/vms/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserVmManager -// -// -// -// ---- -// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: -// .... -// POST /ovirt-engine/api/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// SuperUser -// -// -// -// ---- -// If you want to assign permission to the group instead of the user please replace the `user` element with the -// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with -// id `123` to the group with id `789` send a request like this: -// .... -// POST /ovirt-engine/api/clusters/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserRole -// -// -// -// ---- +// Updates the network in the data center. // -type SystemPermissionsServiceAddRequest struct { - SystemPermissionsService *SystemPermissionsService +type DataCenterNetworkServiceUpdateRequest struct { + DataCenterNetworkService *DataCenterNetworkService header map[string]string query map[string]string - permission *Permission + network *Network } -func (p *SystemPermissionsServiceAddRequest) Header(key, value string) *SystemPermissionsServiceAddRequest { +func (p *DataCenterNetworkServiceUpdateRequest) Header(key, value string) *DataCenterNetworkServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -22122,7 +19889,7 @@ func (p *SystemPermissionsServiceAddRequest) Header(key, value string) *SystemPe return p } -func (p *SystemPermissionsServiceAddRequest) Query(key, value string) *SystemPermissionsServiceAddRequest { +func (p *DataCenterNetworkServiceUpdateRequest) Query(key, value string) *DataCenterNetworkServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -22130,13 +19897,13 @@ func (p *SystemPermissionsServiceAddRequest) Query(key, value string) *SystemPer return p } -func (p *SystemPermissionsServiceAddRequest) Permission(permission *Permission) *SystemPermissionsServiceAddRequest { - p.permission = permission +func (p *DataCenterNetworkServiceUpdateRequest) Network(network *Network) *DataCenterNetworkServiceUpdateRequest { + p.network = network return p } -func (p *SystemPermissionsServiceAddRequest) Send() (*SystemPermissionsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) +func (p *DataCenterNetworkServiceUpdateRequest) Send() (*DataCenterNetworkServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworkService.connection.URL(), p.DataCenterNetworkService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -22148,17 +19915,17 @@ func (p *SystemPermissionsServiceAddRequest) Send() (*SystemPermissionsServiceAd } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLPermissionWriteOne(writer, p.permission, "") + err := XMLNetworkWriteOne(writer, p.network, "") if err != nil { return nil, err } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterNetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -22173,18 +19940,18 @@ func (p *SystemPermissionsServiceAddRequest) Send() (*SystemPermissionsServiceAd req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterNetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterNetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterNetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -22193,9 +19960,9 @@ func (p *SystemPermissionsServiceAddRequest) Send() (*SystemPermissionsServiceAd if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -22203,14 +19970,14 @@ func (p *SystemPermissionsServiceAddRequest) Send() (*SystemPermissionsServiceAd return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLPermissionReadOne(reader, nil, "") + result, err := XMLNetworkReadOne(reader, nil, "") if err != nil { return nil, err } - return &SystemPermissionsServiceAddResponse{permission: result}, nil + return &DataCenterNetworkServiceUpdateResponse{network: result}, nil } -func (p *SystemPermissionsServiceAddRequest) MustSend() *SystemPermissionsServiceAddResponse { +func (p *DataCenterNetworkServiceUpdateRequest) MustSend() *DataCenterNetworkServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -22219,134 +19986,84 @@ func (p *SystemPermissionsServiceAddRequest) MustSend() *SystemPermissionsServic } // -// Assign a new permission to a user or group for specific entity. -// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` -// send a request like this: -// .... -// POST /ovirt-engine/api/vms/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserVmManager -// -// -// -// ---- -// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: -// .... -// POST /ovirt-engine/api/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// SuperUser -// -// -// -// ---- -// If you want to assign permission to the group instead of the user please replace the `user` element with the -// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with -// id `123` to the group with id `789` send a request like this: -// .... -// POST /ovirt-engine/api/clusters/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserRole -// -// -// -// ---- +// Updates the network in the data center. // -type SystemPermissionsServiceAddResponse struct { - permission *Permission +type DataCenterNetworkServiceUpdateResponse struct { + network *Network } -func (p *SystemPermissionsServiceAddResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCenterNetworkServiceUpdateResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } return nil, false } -func (p *SystemPermissionsServiceAddResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCenterNetworkServiceUpdateResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } - return p.permission + return p.network } // -// Assign a new permission to a user or group for specific entity. -// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` -// send a request like this: -// .... -// POST /ovirt-engine/api/vms/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserVmManager -// -// -// -// ---- -// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: -// .... -// POST /ovirt-engine/api/permissions -// .... -// With a request body like this: -// [source,xml] +// Updates the network in the data center. +// +func (p *DataCenterNetworkService) Update() *DataCenterNetworkServiceUpdateRequest { + return &DataCenterNetworkServiceUpdateRequest{DataCenterNetworkService: p} +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DataCenterNetworkService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *DataCenterNetworkService) String() string { + return fmt.Sprintf("DataCenterNetworkService:%s", op.path) +} + +// +// A service to manage data center networks. +// +type DataCenterNetworksService struct { + BaseService +} + +func NewDataCenterNetworksService(connection *Connection, path string) *DataCenterNetworksService { + var result DataCenterNetworksService + result.connection = connection + result.path = path + return &result +} + +// +// Create a new network in a data center. +// Post a request like in the example below to create a new network in a data center with an ID of `123`. +// [source] // ---- -// -// -// SuperUser -// -// -// +// POST /ovirt-engine/api/datacenters/123/networks // ---- -// If you want to assign permission to the group instead of the user please replace the `user` element with the -// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with -// id `123` to the group with id `789` send a request like this: -// .... -// POST /ovirt-engine/api/clusters/123/permissions -// .... -// With a request body like this: +// Use the following example in its body: // [source,xml] // ---- -// -// -// UserRole -// -// -// +// +// mynetwork +// // ---- // -func (p *SystemPermissionsService) Add() *SystemPermissionsServiceAddRequest { - return &SystemPermissionsServiceAddRequest{SystemPermissionsService: p} -} - -// -// Add a new permission on the cluster to the group in the system. -// -type SystemPermissionsServiceAddClusterPermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +type DataCenterNetworksServiceAddRequest struct { + DataCenterNetworksService *DataCenterNetworksService + header map[string]string + query map[string]string + network *Network } -func (p *SystemPermissionsServiceAddClusterPermissionRequest) Header(key, value string) *SystemPermissionsServiceAddClusterPermissionRequest { +func (p *DataCenterNetworksServiceAddRequest) Header(key, value string) *DataCenterNetworksServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -22354,7 +20071,7 @@ func (p *SystemPermissionsServiceAddClusterPermissionRequest) Header(key, value return p } -func (p *SystemPermissionsServiceAddClusterPermissionRequest) Query(key, value string) *SystemPermissionsServiceAddClusterPermissionRequest { +func (p *DataCenterNetworksServiceAddRequest) Query(key, value string) *DataCenterNetworksServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -22362,19 +20079,13 @@ func (p *SystemPermissionsServiceAddClusterPermissionRequest) Query(key, value s return p } -func (p *SystemPermissionsServiceAddClusterPermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddClusterPermissionRequest { - p.permission = permission +func (p *DataCenterNetworksServiceAddRequest) Network(network *Network) *DataCenterNetworksServiceAddRequest { + p.network = network return p } -func (p *SystemPermissionsServiceAddClusterPermissionRequest) Send() (*SystemPermissionsServiceAddClusterPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/clusterpermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DataCenterNetworksServiceAddRequest) Send() (*DataCenterNetworksServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworksService.connection.URL(), p.DataCenterNetworksService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -22386,14 +20097,17 @@ func (p *SystemPermissionsServiceAddClusterPermissionRequest) Send() (*SystemPer } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkWriteOne(writer, p.network, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterNetworksService.connection.headers { req.Header.Add(hk, hv) } @@ -22408,18 +20122,18 @@ func (p *SystemPermissionsServiceAddClusterPermissionRequest) Send() (*SystemPer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterNetworksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterNetworksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterNetworksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -22428,17 +20142,24 @@ func (p *SystemPermissionsServiceAddClusterPermissionRequest) Send() (*SystemPer if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddClusterPermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DataCenterNetworksServiceAddResponse{network: result}, nil } -func (p *SystemPermissionsServiceAddClusterPermissionRequest) MustSend() *SystemPermissionsServiceAddClusterPermissionResponse { +func (p *DataCenterNetworksServiceAddRequest) MustSend() *DataCenterNetworksServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -22447,44 +20168,70 @@ func (p *SystemPermissionsServiceAddClusterPermissionRequest) MustSend() *System } // -// Add a new permission on the cluster to the group in the system. +// Create a new network in a data center. +// Post a request like in the example below to create a new network in a data center with an ID of `123`. +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/networks +// ---- +// Use the following example in its body: +// [source,xml] +// ---- +// +// mynetwork +// +// ---- // -type SystemPermissionsServiceAddClusterPermissionResponse struct { - permission *Permission +type DataCenterNetworksServiceAddResponse struct { + network *Network } -func (p *SystemPermissionsServiceAddClusterPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCenterNetworksServiceAddResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } return nil, false } -func (p *SystemPermissionsServiceAddClusterPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCenterNetworksServiceAddResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } - return p.permission + return p.network } // -// Add a new permission on the cluster to the group in the system. +// Create a new network in a data center. +// Post a request like in the example below to create a new network in a data center with an ID of `123`. +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/networks +// ---- +// Use the following example in its body: +// [source,xml] +// ---- +// +// mynetwork +// +// ---- // -func (p *SystemPermissionsService) AddClusterPermission() *SystemPermissionsServiceAddClusterPermissionRequest { - return &SystemPermissionsServiceAddClusterPermissionRequest{SystemPermissionsService: p} +func (p *DataCenterNetworksService) Add() *DataCenterNetworksServiceAddRequest { + return &DataCenterNetworksServiceAddRequest{DataCenterNetworksService: p} } // -// Add a new permission on the data center to the group in the system. +// Lists networks in the data center. +// The order of the returned list of networks isn't guaranteed. // -type SystemPermissionsServiceAddDataCenterPermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +type DataCenterNetworksServiceListRequest struct { + DataCenterNetworksService *DataCenterNetworksService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Header(key, value string) *SystemPermissionsServiceAddDataCenterPermissionRequest { +func (p *DataCenterNetworksServiceListRequest) Header(key, value string) *DataCenterNetworksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -22492,7 +20239,7 @@ func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Header(key, val return p } -func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Query(key, value string) *SystemPermissionsServiceAddDataCenterPermissionRequest { +func (p *DataCenterNetworksServiceListRequest) Query(key, value string) *DataCenterNetworksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -22500,20 +20247,27 @@ func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Query(key, valu return p } -func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddDataCenterPermissionRequest { - p.permission = permission +func (p *DataCenterNetworksServiceListRequest) Follow(follow string) *DataCenterNetworksServiceListRequest { + p.follow = &follow return p } -func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Send() (*SystemPermissionsServiceAddDataCenterPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/datacenterpermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DataCenterNetworksServiceListRequest) Max(max int64) *DataCenterNetworksServiceListRequest { + p.max = &max + return p +} + +func (p *DataCenterNetworksServiceListRequest) Send() (*DataCenterNetworksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworksService.connection.URL(), p.DataCenterNetworksService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -22522,16 +20276,12 @@ func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Send() (*System if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterNetworksService.connection.headers { req.Header.Add(hk, hv) } @@ -22546,18 +20296,18 @@ func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Send() (*System req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterNetworksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterNetworksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterNetworksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -22566,17 +20316,24 @@ func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) Send() (*System if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddDataCenterPermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkReadMany(reader, nil) + if err != nil { + return nil, err + } + return &DataCenterNetworksServiceListResponse{networks: result}, nil } -func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) MustSend() *SystemPermissionsServiceAddDataCenterPermissionResponse { +func (p *DataCenterNetworksServiceListRequest) MustSend() *DataCenterNetworksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -22585,44 +20342,97 @@ func (p *SystemPermissionsServiceAddDataCenterPermissionRequest) MustSend() *Sys } // -// Add a new permission on the data center to the group in the system. +// Lists networks in the data center. +// The order of the returned list of networks isn't guaranteed. // -type SystemPermissionsServiceAddDataCenterPermissionResponse struct { - permission *Permission +type DataCenterNetworksServiceListResponse struct { + networks *NetworkSlice } -func (p *SystemPermissionsServiceAddDataCenterPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCenterNetworksServiceListResponse) Networks() (*NetworkSlice, bool) { + if p.networks != nil { + return p.networks, true } return nil, false } -func (p *SystemPermissionsServiceAddDataCenterPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCenterNetworksServiceListResponse) MustNetworks() *NetworkSlice { + if p.networks == nil { + panic("networks in response does not exist") } - return p.permission + return p.networks } // -// Add a new permission on the data center to the group in the system. +// Lists networks in the data center. +// The order of the returned list of networks isn't guaranteed. // -func (p *SystemPermissionsService) AddDataCenterPermission() *SystemPermissionsServiceAddDataCenterPermissionRequest { - return &SystemPermissionsServiceAddDataCenterPermissionRequest{SystemPermissionsService: p} +func (p *DataCenterNetworksService) List() *DataCenterNetworksServiceListRequest { + return &DataCenterNetworksServiceListRequest{DataCenterNetworksService: p} } // -// Add a new group level permission for a given virtual machine. +// Access the data center network service that manages the data center network specified by an ID. // -type SystemPermissionsServiceAddGroupLevelRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +func (op *DataCenterNetworksService) NetworkService(id string) *DataCenterNetworkService { + return NewDataCenterNetworkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *SystemPermissionsServiceAddGroupLevelRequest) Header(key, value string) *SystemPermissionsServiceAddGroupLevelRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DataCenterNetworksService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.NetworkService(path), nil + } + return op.NetworkService(path[:index]).Service(path[index+1:]) +} + +func (op *DataCenterNetworksService) String() string { + return fmt.Sprintf("DataCenterNetworksService:%s", op.path) +} + +// +// A service to manage a data center. +// +type DataCenterService struct { + BaseService +} + +func NewDataCenterService(connection *Connection, path string) *DataCenterService { + var result DataCenterService + result.connection = connection + result.path = path + return &result +} + +// +// Currently, the storage pool manager (SPM) fails to +// switch to another host if the SPM has uncleared tasks. +// Clearing all finished tasks enables the SPM switching. +// For example, to clean all the finished tasks on a data center with ID `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/cleanfinishedtasks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- +// +type DataCenterServiceCleanFinishedTasksRequest struct { + DataCenterService *DataCenterService + header map[string]string + query map[string]string + async *bool +} + +func (p *DataCenterServiceCleanFinishedTasksRequest) Header(key, value string) *DataCenterServiceCleanFinishedTasksRequest { if p.header == nil { p.header = make(map[string]string) } @@ -22630,7 +20440,7 @@ func (p *SystemPermissionsServiceAddGroupLevelRequest) Header(key, value string) return p } -func (p *SystemPermissionsServiceAddGroupLevelRequest) Query(key, value string) *SystemPermissionsServiceAddGroupLevelRequest { +func (p *DataCenterServiceCleanFinishedTasksRequest) Query(key, value string) *DataCenterServiceCleanFinishedTasksRequest { if p.query == nil { p.query = make(map[string]string) } @@ -22638,15 +20448,17 @@ func (p *SystemPermissionsServiceAddGroupLevelRequest) Query(key, value string) return p } -func (p *SystemPermissionsServiceAddGroupLevelRequest) Permission(permission *Permission) *SystemPermissionsServiceAddGroupLevelRequest { - p.permission = permission +func (p *DataCenterServiceCleanFinishedTasksRequest) Async(async bool) *DataCenterServiceCleanFinishedTasksRequest { + p.async = &async return p } -func (p *SystemPermissionsServiceAddGroupLevelRequest) Send() (*SystemPermissionsServiceAddGroupLevelResponse, error) { - rawURL := fmt.Sprintf("%s%s/grouplevel", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) +func (p *DataCenterServiceCleanFinishedTasksRequest) Send() (*DataCenterServiceCleanFinishedTasksResponse, error) { + rawURL := fmt.Sprintf("%s%s/cleanfinishedtasks", p.DataCenterService.connection.URL(), p.DataCenterService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.async != nil { + actionBuilder.Async(*p.async) + } action, err := actionBuilder.Build() if err != nil { return nil, err @@ -22669,7 +20481,7 @@ func (p *SystemPermissionsServiceAddGroupLevelRequest) Send() (*SystemPermission return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterService.connection.headers { req.Header.Add(hk, hv) } @@ -22684,18 +20496,18 @@ func (p *SystemPermissionsServiceAddGroupLevelRequest) Send() (*SystemPermission req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -22704,17 +20516,16 @@ func (p *SystemPermissionsServiceAddGroupLevelRequest) Send() (*SystemPermission if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &SystemPermissionsServiceAddGroupLevelResponse{permission: result}, nil + return new(DataCenterServiceCleanFinishedTasksResponse), nil } -func (p *SystemPermissionsServiceAddGroupLevelRequest) MustSend() *SystemPermissionsServiceAddGroupLevelResponse { +func (p *DataCenterServiceCleanFinishedTasksRequest) MustSend() *DataCenterServiceCleanFinishedTasksResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -22723,44 +20534,88 @@ func (p *SystemPermissionsServiceAddGroupLevelRequest) MustSend() *SystemPermiss } // -// Add a new group level permission for a given virtual machine. +// Currently, the storage pool manager (SPM) fails to +// switch to another host if the SPM has uncleared tasks. +// Clearing all finished tasks enables the SPM switching. +// For example, to clean all the finished tasks on a data center with ID `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/cleanfinishedtasks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -type SystemPermissionsServiceAddGroupLevelResponse struct { - permission *Permission -} - -func (p *SystemPermissionsServiceAddGroupLevelResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *SystemPermissionsServiceAddGroupLevelResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type DataCenterServiceCleanFinishedTasksResponse struct { } // -// Add a new group level permission for a given virtual machine. +// Currently, the storage pool manager (SPM) fails to +// switch to another host if the SPM has uncleared tasks. +// Clearing all finished tasks enables the SPM switching. +// For example, to clean all the finished tasks on a data center with ID `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/cleanfinishedtasks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -func (p *SystemPermissionsService) AddGroupLevel() *SystemPermissionsServiceAddGroupLevelRequest { - return &SystemPermissionsServiceAddGroupLevelRequest{SystemPermissionsService: p} +func (p *DataCenterService) CleanFinishedTasks() *DataCenterServiceCleanFinishedTasksRequest { + return &DataCenterServiceCleanFinishedTasksRequest{DataCenterService: p} } // -// Add a new permission on the host to the group in the system. -// -type SystemPermissionsServiceAddHostPermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +// Get a data center. +// An example of getting a data center: +// [source] +// ---- +// GET /ovirt-engine/api/datacenters/123 +// ---- +// [source,xml] +// ---- +// +// Default +// The default Data Center +// +// +// +// +// +// +// +// false +// disabled +// up +// v3 +// +// +// 4 +// 0 +// +// +// +// 4 +// 0 +// +// +// +// ---- +// +type DataCenterServiceGetRequest struct { + DataCenterService *DataCenterService + header map[string]string + query map[string]string + filter *bool + follow *string } -func (p *SystemPermissionsServiceAddHostPermissionRequest) Header(key, value string) *SystemPermissionsServiceAddHostPermissionRequest { +func (p *DataCenterServiceGetRequest) Header(key, value string) *DataCenterServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -22768,7 +20623,7 @@ func (p *SystemPermissionsServiceAddHostPermissionRequest) Header(key, value str return p } -func (p *SystemPermissionsServiceAddHostPermissionRequest) Query(key, value string) *SystemPermissionsServiceAddHostPermissionRequest { +func (p *DataCenterServiceGetRequest) Query(key, value string) *DataCenterServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -22776,20 +20631,27 @@ func (p *SystemPermissionsServiceAddHostPermissionRequest) Query(key, value stri return p } -func (p *SystemPermissionsServiceAddHostPermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddHostPermissionRequest { - p.permission = permission +func (p *DataCenterServiceGetRequest) Filter(filter bool) *DataCenterServiceGetRequest { + p.filter = &filter return p } -func (p *SystemPermissionsServiceAddHostPermissionRequest) Send() (*SystemPermissionsServiceAddHostPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/hostpermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DataCenterServiceGetRequest) Follow(follow string) *DataCenterServiceGetRequest { + p.follow = &follow + return p +} + +func (p *DataCenterServiceGetRequest) Send() (*DataCenterServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterService.connection.URL(), p.DataCenterService.path) values := make(url.Values) + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -22798,16 +20660,12 @@ func (p *SystemPermissionsServiceAddHostPermissionRequest) Send() (*SystemPermis if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterService.connection.headers { req.Header.Add(hk, hv) } @@ -22822,18 +20680,18 @@ func (p *SystemPermissionsServiceAddHostPermissionRequest) Send() (*SystemPermis req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -22842,17 +20700,24 @@ func (p *SystemPermissionsServiceAddHostPermissionRequest) Send() (*SystemPermis if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddHostPermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDataCenterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DataCenterServiceGetResponse{dataCenter: result}, nil } -func (p *SystemPermissionsServiceAddHostPermissionRequest) MustSend() *SystemPermissionsServiceAddHostPermissionResponse { +func (p *DataCenterServiceGetRequest) MustSend() *DataCenterServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -22861,64 +20726,123 @@ func (p *SystemPermissionsServiceAddHostPermissionRequest) MustSend() *SystemPer } // -// Add a new permission on the host to the group in the system. +// Get a data center. +// An example of getting a data center: +// [source] +// ---- +// GET /ovirt-engine/api/datacenters/123 +// ---- +// [source,xml] +// ---- +// +// Default +// The default Data Center +// +// +// +// +// +// +// +// false +// disabled +// up +// v3 +// +// +// 4 +// 0 +// +// +// +// 4 +// 0 +// +// +// +// ---- // -type SystemPermissionsServiceAddHostPermissionResponse struct { - permission *Permission +type DataCenterServiceGetResponse struct { + dataCenter *DataCenter } -func (p *SystemPermissionsServiceAddHostPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCenterServiceGetResponse) DataCenter() (*DataCenter, bool) { + if p.dataCenter != nil { + return p.dataCenter, true } return nil, false } -func (p *SystemPermissionsServiceAddHostPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCenterServiceGetResponse) MustDataCenter() *DataCenter { + if p.dataCenter == nil { + panic("dataCenter in response does not exist") } - return p.permission + return p.dataCenter } // -// Add a new permission on the host to the group in the system. +// Get a data center. +// An example of getting a data center: +// [source] +// ---- +// GET /ovirt-engine/api/datacenters/123 +// ---- +// [source,xml] +// ---- +// +// Default +// The default Data Center +// +// +// +// +// +// +// +// false +// disabled +// up +// v3 +// +// +// 4 +// 0 +// +// +// +// 4 +// 0 +// +// +// +// ---- // -func (p *SystemPermissionsService) AddHostPermission() *SystemPermissionsServiceAddHostPermissionRequest { - return &SystemPermissionsServiceAddHostPermissionRequest{SystemPermissionsService: p} +func (p *DataCenterService) Get() *DataCenterServiceGetRequest { + return &DataCenterServiceGetRequest{DataCenterService: p} } // -// List all the permissions of the specific entity. -// For example to list all the permissions of the cluster with id `123` send a request like this: -// .... -// GET /ovirt-engine/api/clusters/123/permissions -// .... -// [source,xml] +// Removes the data center. +// [source] // ---- -// -// -// -// -// -// -// -// -// -// -// -// +// DELETE /ovirt-engine/api/datacenters/123 // ---- -// The order of the returned permissions isn't guaranteed. +// Without any special parameters, the storage domains attached to the data center are detached and then removed +// from the storage. If something fails when performing this operation, for example if there is no host available to +// remove the storage domains from the storage, the complete operation will fail. +// If the `force` parameter is `true` then the operation will always succeed, even if something fails while removing +// one storage domain, for example. The failure is just ignored and the data center is removed from the database +// anyway. // -type SystemPermissionsServiceListRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - follow *string +type DataCenterServiceRemoveRequest struct { + DataCenterService *DataCenterService + header map[string]string + query map[string]string + async *bool + force *bool } -func (p *SystemPermissionsServiceListRequest) Header(key, value string) *SystemPermissionsServiceListRequest { +func (p *DataCenterServiceRemoveRequest) Header(key, value string) *DataCenterServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -22926,7 +20850,7 @@ func (p *SystemPermissionsServiceListRequest) Header(key, value string) *SystemP return p } -func (p *SystemPermissionsServiceListRequest) Query(key, value string) *SystemPermissionsServiceListRequest { +func (p *DataCenterServiceRemoveRequest) Query(key, value string) *DataCenterServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -22934,16 +20858,25 @@ func (p *SystemPermissionsServiceListRequest) Query(key, value string) *SystemPe return p } -func (p *SystemPermissionsServiceListRequest) Follow(follow string) *SystemPermissionsServiceListRequest { - p.follow = &follow +func (p *DataCenterServiceRemoveRequest) Async(async bool) *DataCenterServiceRemoveRequest { + p.async = &async return p } -func (p *SystemPermissionsServiceListRequest) Send() (*SystemPermissionsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) +func (p *DataCenterServiceRemoveRequest) Force(force bool) *DataCenterServiceRemoveRequest { + p.force = &force + return p +} + +func (p *DataCenterServiceRemoveRequest) Send() (*DataCenterServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterService.connection.URL(), p.DataCenterService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + + if p.force != nil { + values["force"] = []string{fmt.Sprintf("%v", *p.force)} } if p.query != nil { @@ -22954,12 +20887,12 @@ func (p *SystemPermissionsServiceListRequest) Send() (*SystemPermissionsServiceL if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterService.connection.headers { req.Header.Add(hk, hv) } @@ -22974,18 +20907,18 @@ func (p *SystemPermissionsServiceListRequest) Send() (*SystemPermissionsServiceL req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -22994,24 +20927,19 @@ func (p *SystemPermissionsServiceListRequest) Send() (*SystemPermissionsServiceL if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLPermissionReadMany(reader, nil) - if err != nil { - return nil, err - } - return &SystemPermissionsServiceListResponse{permissions: result}, nil + return new(DataCenterServiceRemoveResponse), nil } -func (p *SystemPermissionsServiceListRequest) MustSend() *SystemPermissionsServiceListResponse { +func (p *DataCenterServiceRemoveRequest) MustSend() *DataCenterServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23020,84 +20948,64 @@ func (p *SystemPermissionsServiceListRequest) MustSend() *SystemPermissionsServi } // -// List all the permissions of the specific entity. -// For example to list all the permissions of the cluster with id `123` send a request like this: -// .... -// GET /ovirt-engine/api/clusters/123/permissions -// .... -// [source,xml] +// Removes the data center. +// [source] // ---- -// -// -// -// -// -// -// -// -// -// -// -// +// DELETE /ovirt-engine/api/datacenters/123 // ---- -// The order of the returned permissions isn't guaranteed. +// Without any special parameters, the storage domains attached to the data center are detached and then removed +// from the storage. If something fails when performing this operation, for example if there is no host available to +// remove the storage domains from the storage, the complete operation will fail. +// If the `force` parameter is `true` then the operation will always succeed, even if something fails while removing +// one storage domain, for example. The failure is just ignored and the data center is removed from the database +// anyway. // -type SystemPermissionsServiceListResponse struct { - permissions *PermissionSlice -} - -func (p *SystemPermissionsServiceListResponse) Permissions() (*PermissionSlice, bool) { - if p.permissions != nil { - return p.permissions, true - } - return nil, false -} - -func (p *SystemPermissionsServiceListResponse) MustPermissions() *PermissionSlice { - if p.permissions == nil { - panic("permissions in response does not exist") - } - return p.permissions +type DataCenterServiceRemoveResponse struct { } // -// List all the permissions of the specific entity. -// For example to list all the permissions of the cluster with id `123` send a request like this: -// .... -// GET /ovirt-engine/api/clusters/123/permissions -// .... -// [source,xml] +// Removes the data center. +// [source] // ---- -// -// -// -// -// -// -// -// -// -// -// -// +// DELETE /ovirt-engine/api/datacenters/123 // ---- -// The order of the returned permissions isn't guaranteed. +// Without any special parameters, the storage domains attached to the data center are detached and then removed +// from the storage. If something fails when performing this operation, for example if there is no host available to +// remove the storage domains from the storage, the complete operation will fail. +// If the `force` parameter is `true` then the operation will always succeed, even if something fails while removing +// one storage domain, for example. The failure is just ignored and the data center is removed from the database +// anyway. // -func (p *SystemPermissionsService) List() *SystemPermissionsServiceListRequest { - return &SystemPermissionsServiceListRequest{SystemPermissionsService: p} +func (p *DataCenterService) Remove() *DataCenterServiceRemoveRequest { + return &DataCenterServiceRemoveRequest{DataCenterService: p} } // -// Add a new permission on the storage domain to the group in the system. +// Used for manually setting a storage domain in the data center as a master. +// For example, for setting a storage domain with ID '456' as a master on a data center with ID '123', +// send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/setmaster +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// +// ---- +// The new master storage domain can be also specified by its name. // -type SystemPermissionsServiceAddStorageDomainPermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +type DataCenterServiceSetMasterRequest struct { + DataCenterService *DataCenterService + header map[string]string + query map[string]string + async *bool + storageDomain *StorageDomain } -func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Header(key, value string) *SystemPermissionsServiceAddStorageDomainPermissionRequest { +func (p *DataCenterServiceSetMasterRequest) Header(key, value string) *DataCenterServiceSetMasterRequest { if p.header == nil { p.header = make(map[string]string) } @@ -23105,7 +21013,7 @@ func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Header(key, return p } -func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Query(key, value string) *SystemPermissionsServiceAddStorageDomainPermissionRequest { +func (p *DataCenterServiceSetMasterRequest) Query(key, value string) *DataCenterServiceSetMasterRequest { if p.query == nil { p.query = make(map[string]string) } @@ -23113,15 +21021,23 @@ func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Query(key, v return p } -func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddStorageDomainPermissionRequest { - p.permission = permission +func (p *DataCenterServiceSetMasterRequest) Async(async bool) *DataCenterServiceSetMasterRequest { + p.async = &async return p } -func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Send() (*SystemPermissionsServiceAddStorageDomainPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/storagedomainpermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) +func (p *DataCenterServiceSetMasterRequest) StorageDomain(storageDomain *StorageDomain) *DataCenterServiceSetMasterRequest { + p.storageDomain = storageDomain + return p +} + +func (p *DataCenterServiceSetMasterRequest) Send() (*DataCenterServiceSetMasterResponse, error) { + rawURL := fmt.Sprintf("%s%s/setmaster", p.DataCenterService.connection.URL(), p.DataCenterService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.StorageDomain(p.storageDomain) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -23144,7 +21060,7 @@ func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Send() (*Sys return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterService.connection.headers { req.Header.Add(hk, hv) } @@ -23159,18 +21075,18 @@ func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Send() (*Sys req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -23179,17 +21095,16 @@ func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) Send() (*Sys if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &SystemPermissionsServiceAddStorageDomainPermissionResponse{permission: result}, nil + return new(DataCenterServiceSetMasterResponse), nil } -func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) MustSend() *SystemPermissionsServiceAddStorageDomainPermissionResponse { +func (p *DataCenterServiceSetMasterRequest) MustSend() *DataCenterServiceSetMasterResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23198,44 +21113,72 @@ func (p *SystemPermissionsServiceAddStorageDomainPermissionRequest) MustSend() * } // -// Add a new permission on the storage domain to the group in the system. +// Used for manually setting a storage domain in the data center as a master. +// For example, for setting a storage domain with ID '456' as a master on a data center with ID '123', +// send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/setmaster +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// +// ---- +// The new master storage domain can be also specified by its name. // -type SystemPermissionsServiceAddStorageDomainPermissionResponse struct { - permission *Permission -} - -func (p *SystemPermissionsServiceAddStorageDomainPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *SystemPermissionsServiceAddStorageDomainPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type DataCenterServiceSetMasterResponse struct { } // -// Add a new permission on the storage domain to the group in the system. +// Used for manually setting a storage domain in the data center as a master. +// For example, for setting a storage domain with ID '456' as a master on a data center with ID '123', +// send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/setmaster +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// +// ---- +// The new master storage domain can be also specified by its name. // -func (p *SystemPermissionsService) AddStorageDomainPermission() *SystemPermissionsServiceAddStorageDomainPermissionRequest { - return &SystemPermissionsServiceAddStorageDomainPermissionRequest{SystemPermissionsService: p} +func (p *DataCenterService) SetMaster() *DataCenterServiceSetMasterRequest { + return &DataCenterServiceSetMasterRequest{DataCenterService: p} } // -// Add a new permission on the template to the group in the system. +// Updates the data center. +// The `name`, `description`, `storage_type`, `version`, `storage_format` and `mac_pool` elements are updatable +// post-creation. For example, to change the name and description of data center `123` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// myupdatedname +// An updated description for the data center +// +// ---- // -type SystemPermissionsServiceAddTemplatePermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +type DataCenterServiceUpdateRequest struct { + DataCenterService *DataCenterService + header map[string]string + query map[string]string + async *bool + dataCenter *DataCenter } -func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Header(key, value string) *SystemPermissionsServiceAddTemplatePermissionRequest { +func (p *DataCenterServiceUpdateRequest) Header(key, value string) *DataCenterServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -23243,7 +21186,7 @@ func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Header(key, value return p } -func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Query(key, value string) *SystemPermissionsServiceAddTemplatePermissionRequest { +func (p *DataCenterServiceUpdateRequest) Query(key, value string) *DataCenterServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -23251,23 +21194,26 @@ func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Query(key, value return p } -func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddTemplatePermissionRequest { - p.permission = permission +func (p *DataCenterServiceUpdateRequest) Async(async bool) *DataCenterServiceUpdateRequest { + p.async = &async return p } -func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Send() (*SystemPermissionsServiceAddTemplatePermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/templatepermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} +func (p *DataCenterServiceUpdateRequest) DataCenter(dataCenter *DataCenter) *DataCenterServiceUpdateRequest { + p.dataCenter = dataCenter + return p +} + +func (p *DataCenterServiceUpdateRequest) Send() (*DataCenterServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCenterService.connection.URL(), p.DataCenterService.path) + values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} } } if len(values) > 0 { @@ -23275,14 +21221,17 @@ func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Send() (*SystemPe } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLDataCenterWriteOne(writer, p.dataCenter, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCenterService.connection.headers { req.Header.Add(hk, hv) } @@ -23297,18 +21246,18 @@ func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Send() (*SystemPe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCenterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCenterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCenterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -23317,17 +21266,24 @@ func (p *SystemPermissionsServiceAddTemplatePermissionRequest) Send() (*SystemPe if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCenterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddTemplatePermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDataCenterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DataCenterServiceUpdateResponse{dataCenter: result}, nil } -func (p *SystemPermissionsServiceAddTemplatePermissionRequest) MustSend() *SystemPermissionsServiceAddTemplatePermissionResponse { +func (p *DataCenterServiceUpdateRequest) MustSend() *DataCenterServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23336,44 +21292,221 @@ func (p *SystemPermissionsServiceAddTemplatePermissionRequest) MustSend() *Syste } // -// Add a new permission on the template to the group in the system. +// Updates the data center. +// The `name`, `description`, `storage_type`, `version`, `storage_format` and `mac_pool` elements are updatable +// post-creation. For example, to change the name and description of data center `123` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// myupdatedname +// An updated description for the data center +// +// ---- // -type SystemPermissionsServiceAddTemplatePermissionResponse struct { - permission *Permission +type DataCenterServiceUpdateResponse struct { + dataCenter *DataCenter } -func (p *SystemPermissionsServiceAddTemplatePermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCenterServiceUpdateResponse) DataCenter() (*DataCenter, bool) { + if p.dataCenter != nil { + return p.dataCenter, true } return nil, false } -func (p *SystemPermissionsServiceAddTemplatePermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCenterServiceUpdateResponse) MustDataCenter() *DataCenter { + if p.dataCenter == nil { + panic("dataCenter in response does not exist") } - return p.permission + return p.dataCenter } // -// Add a new permission on the template to the group in the system. +// Updates the data center. +// The `name`, `description`, `storage_type`, `version`, `storage_format` and `mac_pool` elements are updatable +// post-creation. For example, to change the name and description of data center `123` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// myupdatedname +// An updated description for the data center +// +// ---- // -func (p *SystemPermissionsService) AddTemplatePermission() *SystemPermissionsServiceAddTemplatePermissionRequest { - return &SystemPermissionsServiceAddTemplatePermissionRequest{SystemPermissionsService: p} +func (p *DataCenterService) Update() *DataCenterServiceUpdateRequest { + return &DataCenterServiceUpdateRequest{DataCenterService: p} } // -// Add a new user level permission for a given virtual machine. // -type SystemPermissionsServiceAddUserLevelRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +func (op *DataCenterService) ClustersService() *ClustersService { + return NewClustersService(op.connection, fmt.Sprintf("%s/clusters", op.path)) } -func (p *SystemPermissionsServiceAddUserLevelRequest) Header(key, value string) *SystemPermissionsServiceAddUserLevelRequest { +// +// Reference to the iSCSI bonds service. +// +func (op *DataCenterService) IscsiBondsService() *IscsiBondsService { + return NewIscsiBondsService(op.connection, fmt.Sprintf("%s/iscsibonds", op.path)) +} + +// +// Returns a reference to the service, that manages the networks, that are associated with the data center. +// +func (op *DataCenterService) NetworksService() *DataCenterNetworksService { + return NewDataCenterNetworksService(op.connection, fmt.Sprintf("%s/networks", op.path)) +} + +// +// Reference to the permissions service. +// +func (op *DataCenterService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +} + +// +// Reference to the QOSs service. +// +func (op *DataCenterService) QossService() *QossService { + return NewQossService(op.connection, fmt.Sprintf("%s/qoss", op.path)) +} + +// +// Reference to the quotas service. +// +func (op *DataCenterService) QuotasService() *QuotasService { + return NewQuotasService(op.connection, fmt.Sprintf("%s/quotas", op.path)) +} + +// +// Attach and detach storage domains to and from a data center. +// For attaching a single storage domain we should use the following POST request: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/storagedomains +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// data1 +// +// ---- +// For detaching a single storage domain we should use the following DELETE request: +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/storagedomains/123 +// ---- +// +func (op *DataCenterService) StorageDomainsService() *AttachedStorageDomainsService { + return NewAttachedStorageDomainsService(op.connection, fmt.Sprintf("%s/storagedomains", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DataCenterService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "clusters" { + return op.ClustersService(), nil + } + if strings.HasPrefix(path, "clusters/") { + return op.ClustersService().Service(path[9:]) + } + if path == "iscsibonds" { + return op.IscsiBondsService(), nil + } + if strings.HasPrefix(path, "iscsibonds/") { + return op.IscsiBondsService().Service(path[11:]) + } + if path == "networks" { + return op.NetworksService(), nil + } + if strings.HasPrefix(path, "networks/") { + return op.NetworksService().Service(path[9:]) + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + if path == "qoss" { + return op.QossService(), nil + } + if strings.HasPrefix(path, "qoss/") { + return op.QossService().Service(path[5:]) + } + if path == "quotas" { + return op.QuotasService(), nil + } + if strings.HasPrefix(path, "quotas/") { + return op.QuotasService().Service(path[7:]) + } + if path == "storagedomains" { + return op.StorageDomainsService(), nil + } + if strings.HasPrefix(path, "storagedomains/") { + return op.StorageDomainsService().Service(path[15:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *DataCenterService) String() string { + return fmt.Sprintf("DataCenterService:%s", op.path) +} + +// +// A service to manage data centers. +// +type DataCentersService struct { + BaseService +} + +func NewDataCentersService(connection *Connection, path string) *DataCentersService { + var result DataCentersService + result.connection = connection + result.path = path + return &result +} + +// +// Creates a new data center. +// Creation of a new data center requires the `name` and `local` elements. For example, to create a data center +// named `mydc` that uses shared storage (NFS, iSCSI or fibre channel) send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// mydc +// false +// +// ---- +// +type DataCentersServiceAddRequest struct { + DataCentersService *DataCentersService + header map[string]string + query map[string]string + dataCenter *DataCenter +} + +func (p *DataCentersServiceAddRequest) Header(key, value string) *DataCentersServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -23381,7 +21514,7 @@ func (p *SystemPermissionsServiceAddUserLevelRequest) Header(key, value string) return p } -func (p *SystemPermissionsServiceAddUserLevelRequest) Query(key, value string) *SystemPermissionsServiceAddUserLevelRequest { +func (p *DataCentersServiceAddRequest) Query(key, value string) *DataCentersServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -23389,19 +21522,13 @@ func (p *SystemPermissionsServiceAddUserLevelRequest) Query(key, value string) * return p } -func (p *SystemPermissionsServiceAddUserLevelRequest) Permission(permission *Permission) *SystemPermissionsServiceAddUserLevelRequest { - p.permission = permission +func (p *DataCentersServiceAddRequest) DataCenter(dataCenter *DataCenter) *DataCentersServiceAddRequest { + p.dataCenter = dataCenter return p } -func (p *SystemPermissionsServiceAddUserLevelRequest) Send() (*SystemPermissionsServiceAddUserLevelResponse, error) { - rawURL := fmt.Sprintf("%s%s/userlevel", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DataCentersServiceAddRequest) Send() (*DataCentersServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCentersService.connection.URL(), p.DataCentersService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -23413,14 +21540,17 @@ func (p *SystemPermissionsServiceAddUserLevelRequest) Send() (*SystemPermissions } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLDataCenterWriteOne(writer, p.dataCenter, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCentersService.connection.headers { req.Header.Add(hk, hv) } @@ -23435,18 +21565,18 @@ func (p *SystemPermissionsServiceAddUserLevelRequest) Send() (*SystemPermissions req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCentersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCentersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCentersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -23455,17 +21585,24 @@ func (p *SystemPermissionsServiceAddUserLevelRequest) Send() (*SystemPermissions if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCentersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddUserLevelResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDataCenterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DataCentersServiceAddResponse{dataCenter: result}, nil } -func (p *SystemPermissionsServiceAddUserLevelRequest) MustSend() *SystemPermissionsServiceAddUserLevelResponse { +func (p *DataCentersServiceAddRequest) MustSend() *DataCentersServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23474,44 +21611,126 @@ func (p *SystemPermissionsServiceAddUserLevelRequest) MustSend() *SystemPermissi } // -// Add a new user level permission for a given virtual machine. +// Creates a new data center. +// Creation of a new data center requires the `name` and `local` elements. For example, to create a data center +// named `mydc` that uses shared storage (NFS, iSCSI or fibre channel) send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// mydc +// false +// +// ---- // -type SystemPermissionsServiceAddUserLevelResponse struct { - permission *Permission +type DataCentersServiceAddResponse struct { + dataCenter *DataCenter } -func (p *SystemPermissionsServiceAddUserLevelResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCentersServiceAddResponse) DataCenter() (*DataCenter, bool) { + if p.dataCenter != nil { + return p.dataCenter, true } return nil, false } -func (p *SystemPermissionsServiceAddUserLevelResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCentersServiceAddResponse) MustDataCenter() *DataCenter { + if p.dataCenter == nil { + panic("dataCenter in response does not exist") } - return p.permission + return p.dataCenter } // -// Add a new user level permission for a given virtual machine. +// Creates a new data center. +// Creation of a new data center requires the `name` and `local` elements. For example, to create a data center +// named `mydc` that uses shared storage (NFS, iSCSI or fibre channel) send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// mydc +// false +// +// ---- // -func (p *SystemPermissionsService) AddUserLevel() *SystemPermissionsServiceAddUserLevelRequest { - return &SystemPermissionsServiceAddUserLevelRequest{SystemPermissionsService: p} +func (p *DataCentersService) Add() *DataCentersServiceAddRequest { + return &DataCentersServiceAddRequest{DataCentersService: p} } // -// Add a new permission on the vm to the group in the system. +// Lists the data centers. +// The following request retrieves a representation of the data centers: +// [source] +// ---- +// GET /ovirt-engine/api/datacenters +// ---- +// The above request performed with `curl`: +// [source,bash] +// ---- +// curl \ +// --request GET \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --header "Version: 4" \ +// --header "Accept: application/xml" \ +// --user "admin@internal:mypassword" \ +// https://myengine.example.com/ovirt-engine/api/datacenters +// ---- +// This is what an example response could look like: +// [source,xml] +// ---- +// +// Default +// The default Data Center +// +// +// +// +// +// +// +// false +// disabled +// up +// +// +// 4 +// 0 +// +// +// +// 4 +// 0 +// +// +// ---- +// Note the `id` code of your `Default` data center. This code identifies this data center in relation to other +// resources of your virtual environment. +// The data center also contains a link to the storage domains collection. The data center uses this collection to +// attach storage domains from the storage domains main collection. +// The order of the returned list of data centers is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type SystemPermissionsServiceAddVmPermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +type DataCentersServiceListRequest struct { + DataCentersService *DataCentersService + header map[string]string + query map[string]string + caseSensitive *bool + filter *bool + follow *string + max *int64 + search *string } -func (p *SystemPermissionsServiceAddVmPermissionRequest) Header(key, value string) *SystemPermissionsServiceAddVmPermissionRequest { +func (p *DataCentersServiceListRequest) Header(key, value string) *DataCentersServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -23519,7 +21738,7 @@ func (p *SystemPermissionsServiceAddVmPermissionRequest) Header(key, value strin return p } -func (p *SystemPermissionsServiceAddVmPermissionRequest) Query(key, value string) *SystemPermissionsServiceAddVmPermissionRequest { +func (p *DataCentersServiceListRequest) Query(key, value string) *DataCentersServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -23527,20 +21746,54 @@ func (p *SystemPermissionsServiceAddVmPermissionRequest) Query(key, value string return p } -func (p *SystemPermissionsServiceAddVmPermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddVmPermissionRequest { - p.permission = permission +func (p *DataCentersServiceListRequest) CaseSensitive(caseSensitive bool) *DataCentersServiceListRequest { + p.caseSensitive = &caseSensitive return p } -func (p *SystemPermissionsServiceAddVmPermissionRequest) Send() (*SystemPermissionsServiceAddVmPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/vmpermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DataCentersServiceListRequest) Filter(filter bool) *DataCentersServiceListRequest { + p.filter = &filter + return p +} + +func (p *DataCentersServiceListRequest) Follow(follow string) *DataCentersServiceListRequest { + p.follow = &follow + return p +} + +func (p *DataCentersServiceListRequest) Max(max int64) *DataCentersServiceListRequest { + p.max = &max + return p +} + +func (p *DataCentersServiceListRequest) Search(search string) *DataCentersServiceListRequest { + p.search = &search + return p +} + +func (p *DataCentersServiceListRequest) Send() (*DataCentersServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DataCentersService.connection.URL(), p.DataCentersService.path) values := make(url.Values) + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -23549,16 +21802,12 @@ func (p *SystemPermissionsServiceAddVmPermissionRequest) Send() (*SystemPermissi if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DataCentersService.connection.headers { req.Header.Add(hk, hv) } @@ -23573,18 +21822,18 @@ func (p *SystemPermissionsServiceAddVmPermissionRequest) Send() (*SystemPermissi req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DataCentersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DataCentersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DataCentersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -23593,17 +21842,24 @@ func (p *SystemPermissionsServiceAddVmPermissionRequest) Send() (*SystemPermissi if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DataCentersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddVmPermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDataCenterReadMany(reader, nil) + if err != nil { + return nil, err + } + return &DataCentersServiceListResponse{dataCenters: result}, nil } -func (p *SystemPermissionsServiceAddVmPermissionRequest) MustSend() *SystemPermissionsServiceAddVmPermissionResponse { +func (p *DataCentersServiceListRequest) MustSend() *DataCentersServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23612,44 +21868,198 @@ func (p *SystemPermissionsServiceAddVmPermissionRequest) MustSend() *SystemPermi } // -// Add a new permission on the vm to the group in the system. +// Lists the data centers. +// The following request retrieves a representation of the data centers: +// [source] +// ---- +// GET /ovirt-engine/api/datacenters +// ---- +// The above request performed with `curl`: +// [source,bash] +// ---- +// curl \ +// --request GET \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --header "Version: 4" \ +// --header "Accept: application/xml" \ +// --user "admin@internal:mypassword" \ +// https://myengine.example.com/ovirt-engine/api/datacenters +// ---- +// This is what an example response could look like: +// [source,xml] +// ---- +// +// Default +// The default Data Center +// +// +// +// +// +// +// +// false +// disabled +// up +// +// +// 4 +// 0 +// +// +// +// 4 +// 0 +// +// +// ---- +// Note the `id` code of your `Default` data center. This code identifies this data center in relation to other +// resources of your virtual environment. +// The data center also contains a link to the storage domains collection. The data center uses this collection to +// attach storage domains from the storage domains main collection. +// The order of the returned list of data centers is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type SystemPermissionsServiceAddVmPermissionResponse struct { - permission *Permission +type DataCentersServiceListResponse struct { + dataCenters *DataCenterSlice } -func (p *SystemPermissionsServiceAddVmPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DataCentersServiceListResponse) DataCenters() (*DataCenterSlice, bool) { + if p.dataCenters != nil { + return p.dataCenters, true } return nil, false } -func (p *SystemPermissionsServiceAddVmPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *DataCentersServiceListResponse) MustDataCenters() *DataCenterSlice { + if p.dataCenters == nil { + panic("dataCenters in response does not exist") } - return p.permission + return p.dataCenters } // -// Add a new permission on the vm to the group in the system. +// Lists the data centers. +// The following request retrieves a representation of the data centers: +// [source] +// ---- +// GET /ovirt-engine/api/datacenters +// ---- +// The above request performed with `curl`: +// [source,bash] +// ---- +// curl \ +// --request GET \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --header "Version: 4" \ +// --header "Accept: application/xml" \ +// --user "admin@internal:mypassword" \ +// https://myengine.example.com/ovirt-engine/api/datacenters +// ---- +// This is what an example response could look like: +// [source,xml] +// ---- +// +// Default +// The default Data Center +// +// +// +// +// +// +// +// false +// disabled +// up +// +// +// 4 +// 0 +// +// +// +// 4 +// 0 +// +// +// ---- +// Note the `id` code of your `Default` data center. This code identifies this data center in relation to other +// resources of your virtual environment. +// The data center also contains a link to the storage domains collection. The data center uses this collection to +// attach storage domains from the storage domains main collection. +// The order of the returned list of data centers is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -func (p *SystemPermissionsService) AddVmPermission() *SystemPermissionsServiceAddVmPermissionRequest { - return &SystemPermissionsServiceAddVmPermissionRequest{SystemPermissionsService: p} +func (p *DataCentersService) List() *DataCentersServiceListRequest { + return &DataCentersServiceListRequest{DataCentersService: p} } // -// Add a new permission on the vm pool to the group in the system. +// Reference to the service that manages a specific data center. // -type SystemPermissionsServiceAddVmPoolPermissionRequest struct { - SystemPermissionsService *SystemPermissionsService - header map[string]string - query map[string]string - permission *Permission +func (op *DataCentersService) DataCenterService(id string) *DataCenterService { + return NewDataCenterService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Header(key, value string) *SystemPermissionsServiceAddVmPoolPermissionRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DataCentersService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.DataCenterService(path), nil + } + return op.DataCenterService(path[:index]).Service(path[index+1:]) +} + +func (op *DataCentersService) String() string { + return fmt.Sprintf("DataCentersService:%s", op.path) +} + +// +// This service manages the attachment of a disk to a virtual machine. +// +type DiskAttachmentService struct { + BaseService +} + +func NewDiskAttachmentService(connection *Connection, path string) *DiskAttachmentService { + var result DiskAttachmentService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the details of the attachment, including the bootable flag and link to the disk. +// An example of getting a disk attachment: +// [source] +// ---- +// GET /ovirt-engine/api/vms/123/diskattachments/456 +// ---- +// [source,xml] +// ---- +// +// true +// true +// virtio +// +// +// +// ---- +// +type DiskAttachmentServiceGetRequest struct { + DiskAttachmentService *DiskAttachmentService + header map[string]string + query map[string]string + follow *string +} + +func (p *DiskAttachmentServiceGetRequest) Header(key, value string) *DiskAttachmentServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -23657,7 +22067,7 @@ func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Header(key, value s return p } -func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Query(key, value string) *SystemPermissionsServiceAddVmPoolPermissionRequest { +func (p *DiskAttachmentServiceGetRequest) Query(key, value string) *DiskAttachmentServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -23665,20 +22075,18 @@ func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Query(key, value st return p } -func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Permission(permission *Permission) *SystemPermissionsServiceAddVmPoolPermissionRequest { - p.permission = permission +func (p *DiskAttachmentServiceGetRequest) Follow(follow string) *DiskAttachmentServiceGetRequest { + p.follow = &follow return p } -func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Send() (*SystemPermissionsServiceAddVmPoolPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/vmpoolpermission", p.SystemPermissionsService.connection.URL(), p.SystemPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskAttachmentServiceGetRequest) Send() (*DiskAttachmentServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentService.connection.URL(), p.DiskAttachmentService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -23687,16 +22095,12 @@ func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Send() (*SystemPerm if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SystemPermissionsService.connection.headers { + for hk, hv := range p.DiskAttachmentService.connection.headers { req.Header.Add(hk, hv) } @@ -23711,18 +22115,18 @@ func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Send() (*SystemPerm req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SystemPermissionsService.connection.authenticate() + token, err := p.DiskAttachmentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SystemPermissionsService.connection.client.Do(req) + resp, err := p.DiskAttachmentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SystemPermissionsService.connection.logFunc != nil { + if p.DiskAttachmentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -23731,17 +22135,24 @@ func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) Send() (*SystemPerm if err != nil { return nil, err } - p.SystemPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskAttachmentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &SystemPermissionsServiceAddVmPoolPermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskAttachmentReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DiskAttachmentServiceGetResponse{attachment: result}, nil } -func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) MustSend() *SystemPermissionsServiceAddVmPoolPermissionResponse { +func (p *DiskAttachmentServiceGetRequest) MustSend() *DiskAttachmentServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23750,89 +22161,81 @@ func (p *SystemPermissionsServiceAddVmPoolPermissionRequest) MustSend() *SystemP } // -// Add a new permission on the vm pool to the group in the system. +// Returns the details of the attachment, including the bootable flag and link to the disk. +// An example of getting a disk attachment: +// [source] +// ---- +// GET /ovirt-engine/api/vms/123/diskattachments/456 +// ---- +// [source,xml] +// ---- +// +// true +// true +// virtio +// +// +// +// ---- // -type SystemPermissionsServiceAddVmPoolPermissionResponse struct { - permission *Permission +type DiskAttachmentServiceGetResponse struct { + attachment *DiskAttachment } -func (p *SystemPermissionsServiceAddVmPoolPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *DiskAttachmentServiceGetResponse) Attachment() (*DiskAttachment, bool) { + if p.attachment != nil { + return p.attachment, true } return nil, false } -func (p *SystemPermissionsServiceAddVmPoolPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission -} - -// -// Add a new permission on the vm pool to the group in the system. -// -func (p *SystemPermissionsService) AddVmPoolPermission() *SystemPermissionsServiceAddVmPoolPermissionRequest { - return &SystemPermissionsServiceAddVmPoolPermissionRequest{SystemPermissionsService: p} -} - -// -// Sub-resource locator method, returns individual permission resource on which the remainder of the URI is -// dispatched. -// -func (op *SystemPermissionsService) PermissionService(id string) *PermissionService { - return NewPermissionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *SystemPermissionsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.PermissionService(path), nil +func (p *DiskAttachmentServiceGetResponse) MustAttachment() *DiskAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") } - return op.PermissionService(path[:index]).Service(path[index+1:]) -} - -func (op *SystemPermissionsService) String() string { - return fmt.Sprintf("SystemPermissionsService:%s", op.path) + return p.attachment } // -// Manages the set of disks available in a storage domain. +// Returns the details of the attachment, including the bootable flag and link to the disk. +// An example of getting a disk attachment: +// [source] +// ---- +// GET /ovirt-engine/api/vms/123/diskattachments/456 +// ---- +// [source,xml] +// ---- +// +// true +// true +// virtio +// +// +// +// ---- // -type StorageDomainContentDisksService struct { - BaseService -} - -func NewStorageDomainContentDisksService(connection *Connection, path string) *StorageDomainContentDisksService { - var result StorageDomainContentDisksService - result.connection = connection - result.path = path - return &result +func (p *DiskAttachmentService) Get() *DiskAttachmentServiceGetRequest { + return &DiskAttachmentServiceGetRequest{DiskAttachmentService: p} } // -// Returns the list of disks available in the storage domain. -// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in -// the `search` parameter. +// Removes the disk attachment. +// This will only detach the disk from the virtual machine, but won't remove it from +// the system, unless the `detach_only` parameter is `false`. +// An example of removing a disk attachment: +// [source] +// ---- +// DELETE /ovirt-engine/api/vms/123/diskattachments/456?detach_only=true +// ---- // -type StorageDomainContentDisksServiceListRequest struct { - StorageDomainContentDisksService *StorageDomainContentDisksService - header map[string]string - query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string +type DiskAttachmentServiceRemoveRequest struct { + DiskAttachmentService *DiskAttachmentService + header map[string]string + query map[string]string + detachOnly *bool } -func (p *StorageDomainContentDisksServiceListRequest) Header(key, value string) *StorageDomainContentDisksServiceListRequest { +func (p *DiskAttachmentServiceRemoveRequest) Header(key, value string) *DiskAttachmentServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -23840,7 +22243,7 @@ func (p *StorageDomainContentDisksServiceListRequest) Header(key, value string) return p } -func (p *StorageDomainContentDisksServiceListRequest) Query(key, value string) *StorageDomainContentDisksServiceListRequest { +func (p *DiskAttachmentServiceRemoveRequest) Query(key, value string) *DiskAttachmentServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -23848,43 +22251,16 @@ func (p *StorageDomainContentDisksServiceListRequest) Query(key, value string) * return p } -func (p *StorageDomainContentDisksServiceListRequest) CaseSensitive(caseSensitive bool) *StorageDomainContentDisksServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *StorageDomainContentDisksServiceListRequest) Follow(follow string) *StorageDomainContentDisksServiceListRequest { - p.follow = &follow - return p -} - -func (p *StorageDomainContentDisksServiceListRequest) Max(max int64) *StorageDomainContentDisksServiceListRequest { - p.max = &max - return p -} - -func (p *StorageDomainContentDisksServiceListRequest) Search(search string) *StorageDomainContentDisksServiceListRequest { - p.search = &search +func (p *DiskAttachmentServiceRemoveRequest) DetachOnly(detachOnly bool) *DiskAttachmentServiceRemoveRequest { + p.detachOnly = &detachOnly return p } -func (p *StorageDomainContentDisksServiceListRequest) Send() (*StorageDomainContentDisksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainContentDisksService.connection.URL(), p.StorageDomainContentDisksService.path) +func (p *DiskAttachmentServiceRemoveRequest) Send() (*DiskAttachmentServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentService.connection.URL(), p.DiskAttachmentService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} + if p.detachOnly != nil { + values["detach_only"] = []string{fmt.Sprintf("%v", *p.detachOnly)} } if p.query != nil { @@ -23895,12 +22271,12 @@ func (p *StorageDomainContentDisksServiceListRequest) Send() (*StorageDomainCont if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainContentDisksService.connection.headers { + for hk, hv := range p.DiskAttachmentService.connection.headers { req.Header.Add(hk, hv) } @@ -23915,18 +22291,18 @@ func (p *StorageDomainContentDisksServiceListRequest) Send() (*StorageDomainCont req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainContentDisksService.connection.authenticate() + token, err := p.DiskAttachmentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainContentDisksService.connection.client.Do(req) + resp, err := p.DiskAttachmentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainContentDisksService.connection.logFunc != nil { + if p.DiskAttachmentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -23935,24 +22311,19 @@ func (p *StorageDomainContentDisksServiceListRequest) Send() (*StorageDomainCont if err != nil { return nil, err } - p.StorageDomainContentDisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskAttachmentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadMany(reader, nil) - if err != nil { - return nil, err - } - return &StorageDomainContentDisksServiceListResponse{disks: result}, nil + return new(DiskAttachmentServiceRemoveResponse), nil } -func (p *StorageDomainContentDisksServiceListRequest) MustSend() *StorageDomainContentDisksServiceListResponse { +func (p *DiskAttachmentServiceRemoveRequest) MustSend() *DiskAttachmentServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -23961,100 +22332,57 @@ func (p *StorageDomainContentDisksServiceListRequest) MustSend() *StorageDomainC } // -// Returns the list of disks available in the storage domain. -// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in -// the `search` parameter. +// Removes the disk attachment. +// This will only detach the disk from the virtual machine, but won't remove it from +// the system, unless the `detach_only` parameter is `false`. +// An example of removing a disk attachment: +// [source] +// ---- +// DELETE /ovirt-engine/api/vms/123/diskattachments/456?detach_only=true +// ---- // -type StorageDomainContentDisksServiceListResponse struct { - disks *DiskSlice -} - -func (p *StorageDomainContentDisksServiceListResponse) Disks() (*DiskSlice, bool) { - if p.disks != nil { - return p.disks, true - } - return nil, false -} - -func (p *StorageDomainContentDisksServiceListResponse) MustDisks() *DiskSlice { - if p.disks == nil { - panic("disks in response does not exist") - } - return p.disks +type DiskAttachmentServiceRemoveResponse struct { } // -// Returns the list of disks available in the storage domain. -// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in -// the `search` parameter. +// Removes the disk attachment. +// This will only detach the disk from the virtual machine, but won't remove it from +// the system, unless the `detach_only` parameter is `false`. +// An example of removing a disk attachment: +// [source] +// ---- +// DELETE /ovirt-engine/api/vms/123/diskattachments/456?detach_only=true +// ---- // -func (p *StorageDomainContentDisksService) List() *StorageDomainContentDisksServiceListRequest { - return &StorageDomainContentDisksServiceListRequest{StorageDomainContentDisksService: p} +func (p *DiskAttachmentService) Remove() *DiskAttachmentServiceRemoveRequest { + return &DiskAttachmentServiceRemoveRequest{DiskAttachmentService: p} } // +// Update the disk attachment and the disk properties within it. +// [source] +// ---- +// PUT /vms/{vm:id}/disksattachments/{attachment:id} +// +// true +// ide +// true +// +// mydisk +// 1024 +// ... +// +// +// ---- // -func (op *StorageDomainContentDisksService) DiskService(id string) *StorageDomainContentDiskService { - return NewStorageDomainContentDiskService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *StorageDomainContentDisksService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.DiskService(path), nil - } - return op.DiskService(path[:index]).Service(path[index+1:]) -} - -func (op *StorageDomainContentDisksService) String() string { - return fmt.Sprintf("StorageDomainContentDisksService:%s", op.path) -} - -// -// Provides information about the cluster features that are supported by a cluster level. -// -type ClusterFeaturesService struct { - BaseService -} - -func NewClusterFeaturesService(connection *Connection, path string) *ClusterFeaturesService { - var result ClusterFeaturesService - result.connection = connection - result.path = path - return &result -} - -// -// Lists the cluster features supported by the cluster level. -// [source] -// ---- -// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures -// ---- -// This will return a list of cluster features supported by the cluster level: -// [source,xml] -// ---- -// -// -// test_feature -// -// ... -// -// ---- -// -type ClusterFeaturesServiceListRequest struct { - ClusterFeaturesService *ClusterFeaturesService - header map[string]string - query map[string]string - follow *string +type DiskAttachmentServiceUpdateRequest struct { + DiskAttachmentService *DiskAttachmentService + header map[string]string + query map[string]string + diskAttachment *DiskAttachment } -func (p *ClusterFeaturesServiceListRequest) Header(key, value string) *ClusterFeaturesServiceListRequest { +func (p *DiskAttachmentServiceUpdateRequest) Header(key, value string) *DiskAttachmentServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -24062,7 +22390,7 @@ func (p *ClusterFeaturesServiceListRequest) Header(key, value string) *ClusterFe return p } -func (p *ClusterFeaturesServiceListRequest) Query(key, value string) *ClusterFeaturesServiceListRequest { +func (p *DiskAttachmentServiceUpdateRequest) Query(key, value string) *DiskAttachmentServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -24070,18 +22398,14 @@ func (p *ClusterFeaturesServiceListRequest) Query(key, value string) *ClusterFea return p } -func (p *ClusterFeaturesServiceListRequest) Follow(follow string) *ClusterFeaturesServiceListRequest { - p.follow = &follow +func (p *DiskAttachmentServiceUpdateRequest) DiskAttachment(diskAttachment *DiskAttachment) *DiskAttachmentServiceUpdateRequest { + p.diskAttachment = diskAttachment return p } -func (p *ClusterFeaturesServiceListRequest) Send() (*ClusterFeaturesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ClusterFeaturesService.connection.URL(), p.ClusterFeaturesService.path) +func (p *DiskAttachmentServiceUpdateRequest) Send() (*DiskAttachmentServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentService.connection.URL(), p.DiskAttachmentService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -24090,12 +22414,19 @@ func (p *ClusterFeaturesServiceListRequest) Send() (*ClusterFeaturesServiceListR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLDiskAttachmentWriteOne(writer, p.diskAttachment, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ClusterFeaturesService.connection.headers { + for hk, hv := range p.DiskAttachmentService.connection.headers { req.Header.Add(hk, hv) } @@ -24110,18 +22441,18 @@ func (p *ClusterFeaturesServiceListRequest) Send() (*ClusterFeaturesServiceListR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ClusterFeaturesService.connection.authenticate() + token, err := p.DiskAttachmentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ClusterFeaturesService.connection.client.Do(req) + resp, err := p.DiskAttachmentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ClusterFeaturesService.connection.logFunc != nil { + if p.DiskAttachmentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -24130,7 +22461,7 @@ func (p *ClusterFeaturesServiceListRequest) Send() (*ClusterFeaturesServiceListR if err != nil { return nil, err } - p.ClusterFeaturesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskAttachmentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -24140,14 +22471,14 @@ func (p *ClusterFeaturesServiceListRequest) Send() (*ClusterFeaturesServiceListR return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLClusterFeatureReadMany(reader, nil) + result, err := XMLDiskAttachmentReadOne(reader, nil, "") if err != nil { return nil, err } - return &ClusterFeaturesServiceListResponse{features: result}, nil + return &DiskAttachmentServiceUpdateResponse{diskAttachment: result}, nil } -func (p *ClusterFeaturesServiceListRequest) MustSend() *ClusterFeaturesServiceListResponse { +func (p *DiskAttachmentServiceUpdateRequest) MustSend() *DiskAttachmentServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -24156,110 +22487,138 @@ func (p *ClusterFeaturesServiceListRequest) MustSend() *ClusterFeaturesServiceLi } // -// Lists the cluster features supported by the cluster level. +// Update the disk attachment and the disk properties within it. // [source] // ---- -// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures -// ---- -// This will return a list of cluster features supported by the cluster level: -// [source,xml] -// ---- -// -// -// test_feature -// -// ... -// +// PUT /vms/{vm:id}/disksattachments/{attachment:id} +// +// true +// ide +// true +// +// mydisk +// 1024 +// ... +// +// // ---- // -type ClusterFeaturesServiceListResponse struct { - features *ClusterFeatureSlice +type DiskAttachmentServiceUpdateResponse struct { + diskAttachment *DiskAttachment } -func (p *ClusterFeaturesServiceListResponse) Features() (*ClusterFeatureSlice, bool) { - if p.features != nil { - return p.features, true +func (p *DiskAttachmentServiceUpdateResponse) DiskAttachment() (*DiskAttachment, bool) { + if p.diskAttachment != nil { + return p.diskAttachment, true } return nil, false } -func (p *ClusterFeaturesServiceListResponse) MustFeatures() *ClusterFeatureSlice { - if p.features == nil { - panic("features in response does not exist") +func (p *DiskAttachmentServiceUpdateResponse) MustDiskAttachment() *DiskAttachment { + if p.diskAttachment == nil { + panic("diskAttachment in response does not exist") } - return p.features + return p.diskAttachment } // -// Lists the cluster features supported by the cluster level. +// Update the disk attachment and the disk properties within it. // [source] // ---- -// GET /ovirt-engine/api/clusterlevels/4.1/clusterfeatures -// ---- -// This will return a list of cluster features supported by the cluster level: -// [source,xml] -// ---- -// -// -// test_feature -// -// ... -// +// PUT /vms/{vm:id}/disksattachments/{attachment:id} +// +// true +// ide +// true +// +// mydisk +// 1024 +// ... +// +// // ---- // -func (p *ClusterFeaturesService) List() *ClusterFeaturesServiceListRequest { - return &ClusterFeaturesServiceListRequest{ClusterFeaturesService: p} -} - -// -// Reference to the service that provides information about a specific feature. -// -func (op *ClusterFeaturesService) FeatureService(id string) *ClusterFeatureService { - return NewClusterFeatureService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *DiskAttachmentService) Update() *DiskAttachmentServiceUpdateRequest { + return &DiskAttachmentServiceUpdateRequest{DiskAttachmentService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ClusterFeaturesService) Service(path string) (Service, error) { +func (op *DiskAttachmentService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.FeatureService(path), nil - } - return op.FeatureService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *ClusterFeaturesService) String() string { - return fmt.Sprintf("ClusterFeaturesService:%s", op.path) +func (op *DiskAttachmentService) String() string { + return fmt.Sprintf("DiskAttachmentService:%s", op.path) } // +// This service manages the set of disks attached to a virtual machine. Each attached disk is represented by a +// <>, containing the bootable flag, the disk interface and the reference to +// the disk. // -type SchedulingPolicyUnitService struct { +type DiskAttachmentsService struct { BaseService } -func NewSchedulingPolicyUnitService(connection *Connection, path string) *SchedulingPolicyUnitService { - var result SchedulingPolicyUnitService +func NewDiskAttachmentsService(connection *Connection, path string) *DiskAttachmentsService { + var result DiskAttachmentsService result.connection = connection result.path = path return &result } // +// Adds a new disk attachment to the virtual machine. The `attachment` parameter can contain just a reference, if +// the disk already exists: +// [source,xml] +// ---- +// +// true +// true +// ide +// true +// +// +// ---- +// Or it can contain the complete representation of the disk, if the disk doesn't exist yet: +// [source,xml] +// ---- +// +// true +// true +// ide +// true +// +// mydisk +// 1024 +// ... +// +// +// ---- +// In this case the disk will be created and then attached to the virtual machine. +// In both cases, use the following URL for a virtual machine with an id `345`: +// [source] +// ---- +// POST /ovirt-engine/api/vms/345/diskattachments +// ---- +// IMPORTANT: The server accepts requests that don't contain the `active` attribute, but the effect is +// undefined. In some cases the disk will be automatically activated and in other cases it won't. To +// avoid issues it is strongly recommended to always include the `active` attribute with the desired +// value. // -type SchedulingPolicyUnitServiceGetRequest struct { - SchedulingPolicyUnitService *SchedulingPolicyUnitService - header map[string]string - query map[string]string - filter *bool - follow *string +type DiskAttachmentsServiceAddRequest struct { + DiskAttachmentsService *DiskAttachmentsService + header map[string]string + query map[string]string + attachment *DiskAttachment } -func (p *SchedulingPolicyUnitServiceGetRequest) Header(key, value string) *SchedulingPolicyUnitServiceGetRequest { +func (p *DiskAttachmentsServiceAddRequest) Header(key, value string) *DiskAttachmentsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -24267,7 +22626,7 @@ func (p *SchedulingPolicyUnitServiceGetRequest) Header(key, value string) *Sched return p } -func (p *SchedulingPolicyUnitServiceGetRequest) Query(key, value string) *SchedulingPolicyUnitServiceGetRequest { +func (p *DiskAttachmentsServiceAddRequest) Query(key, value string) *DiskAttachmentsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -24275,27 +22634,14 @@ func (p *SchedulingPolicyUnitServiceGetRequest) Query(key, value string) *Schedu return p } -func (p *SchedulingPolicyUnitServiceGetRequest) Filter(filter bool) *SchedulingPolicyUnitServiceGetRequest { - p.filter = &filter - return p -} - -func (p *SchedulingPolicyUnitServiceGetRequest) Follow(follow string) *SchedulingPolicyUnitServiceGetRequest { - p.follow = &follow +func (p *DiskAttachmentsServiceAddRequest) Attachment(attachment *DiskAttachment) *DiskAttachmentsServiceAddRequest { + p.attachment = attachment return p } -func (p *SchedulingPolicyUnitServiceGetRequest) Send() (*SchedulingPolicyUnitServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SchedulingPolicyUnitService.connection.URL(), p.SchedulingPolicyUnitService.path) +func (p *DiskAttachmentsServiceAddRequest) Send() (*DiskAttachmentsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -24304,12 +22650,19 @@ func (p *SchedulingPolicyUnitServiceGetRequest) Send() (*SchedulingPolicyUnitSer if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLDiskAttachmentWriteOne(writer, p.attachment, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SchedulingPolicyUnitService.connection.headers { + for hk, hv := range p.DiskAttachmentsService.connection.headers { req.Header.Add(hk, hv) } @@ -24324,18 +22677,18 @@ func (p *SchedulingPolicyUnitServiceGetRequest) Send() (*SchedulingPolicyUnitSer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SchedulingPolicyUnitService.connection.authenticate() + token, err := p.DiskAttachmentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SchedulingPolicyUnitService.connection.client.Do(req) + resp, err := p.DiskAttachmentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SchedulingPolicyUnitService.connection.logFunc != nil { + if p.DiskAttachmentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -24344,9 +22697,9 @@ func (p *SchedulingPolicyUnitServiceGetRequest) Send() (*SchedulingPolicyUnitSer if err != nil { return nil, err } - p.SchedulingPolicyUnitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -24354,14 +22707,14 @@ func (p *SchedulingPolicyUnitServiceGetRequest) Send() (*SchedulingPolicyUnitSer return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSchedulingPolicyUnitReadOne(reader, nil, "") + result, err := XMLDiskAttachmentReadOne(reader, nil, "") if err != nil { return nil, err } - return &SchedulingPolicyUnitServiceGetResponse{unit: result}, nil + return &DiskAttachmentsServiceAddResponse{attachment: result}, nil } -func (p *SchedulingPolicyUnitServiceGetRequest) MustSend() *SchedulingPolicyUnitServiceGetResponse { +func (p *DiskAttachmentsServiceAddRequest) MustSend() *DiskAttachmentsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -24370,41 +22723,117 @@ func (p *SchedulingPolicyUnitServiceGetRequest) MustSend() *SchedulingPolicyUnit } // +// Adds a new disk attachment to the virtual machine. The `attachment` parameter can contain just a reference, if +// the disk already exists: +// [source,xml] +// ---- +// +// true +// true +// ide +// true +// +// +// ---- +// Or it can contain the complete representation of the disk, if the disk doesn't exist yet: +// [source,xml] +// ---- +// +// true +// true +// ide +// true +// +// mydisk +// 1024 +// ... +// +// +// ---- +// In this case the disk will be created and then attached to the virtual machine. +// In both cases, use the following URL for a virtual machine with an id `345`: +// [source] +// ---- +// POST /ovirt-engine/api/vms/345/diskattachments +// ---- +// IMPORTANT: The server accepts requests that don't contain the `active` attribute, but the effect is +// undefined. In some cases the disk will be automatically activated and in other cases it won't. To +// avoid issues it is strongly recommended to always include the `active` attribute with the desired +// value. // -type SchedulingPolicyUnitServiceGetResponse struct { - unit *SchedulingPolicyUnit +type DiskAttachmentsServiceAddResponse struct { + attachment *DiskAttachment } -func (p *SchedulingPolicyUnitServiceGetResponse) Unit() (*SchedulingPolicyUnit, bool) { - if p.unit != nil { - return p.unit, true +func (p *DiskAttachmentsServiceAddResponse) Attachment() (*DiskAttachment, bool) { + if p.attachment != nil { + return p.attachment, true } return nil, false } -func (p *SchedulingPolicyUnitServiceGetResponse) MustUnit() *SchedulingPolicyUnit { - if p.unit == nil { - panic("unit in response does not exist") +func (p *DiskAttachmentsServiceAddResponse) MustAttachment() *DiskAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") } - return p.unit + return p.attachment } // +// Adds a new disk attachment to the virtual machine. The `attachment` parameter can contain just a reference, if +// the disk already exists: +// [source,xml] +// ---- +// +// true +// true +// ide +// true +// +// +// ---- +// Or it can contain the complete representation of the disk, if the disk doesn't exist yet: +// [source,xml] +// ---- +// +// true +// true +// ide +// true +// +// mydisk +// 1024 +// ... +// +// +// ---- +// In this case the disk will be created and then attached to the virtual machine. +// In both cases, use the following URL for a virtual machine with an id `345`: +// [source] +// ---- +// POST /ovirt-engine/api/vms/345/diskattachments +// ---- +// IMPORTANT: The server accepts requests that don't contain the `active` attribute, but the effect is +// undefined. In some cases the disk will be automatically activated and in other cases it won't. To +// avoid issues it is strongly recommended to always include the `active` attribute with the desired +// value. // -func (p *SchedulingPolicyUnitService) Get() *SchedulingPolicyUnitServiceGetRequest { - return &SchedulingPolicyUnitServiceGetRequest{SchedulingPolicyUnitService: p} +func (p *DiskAttachmentsService) Add() *DiskAttachmentsServiceAddRequest { + return &DiskAttachmentsServiceAddRequest{DiskAttachmentsService: p} } // +// List the disk that are attached to the virtual machine. +// The order of the returned list of disks attachments isn't guaranteed. // -type SchedulingPolicyUnitServiceRemoveRequest struct { - SchedulingPolicyUnitService *SchedulingPolicyUnitService - header map[string]string - query map[string]string - async *bool +type DiskAttachmentsServiceListRequest struct { + DiskAttachmentsService *DiskAttachmentsService + header map[string]string + query map[string]string + follow *string } -func (p *SchedulingPolicyUnitServiceRemoveRequest) Header(key, value string) *SchedulingPolicyUnitServiceRemoveRequest { +func (p *DiskAttachmentsServiceListRequest) Header(key, value string) *DiskAttachmentsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -24412,7 +22841,7 @@ func (p *SchedulingPolicyUnitServiceRemoveRequest) Header(key, value string) *Sc return p } -func (p *SchedulingPolicyUnitServiceRemoveRequest) Query(key, value string) *SchedulingPolicyUnitServiceRemoveRequest { +func (p *DiskAttachmentsServiceListRequest) Query(key, value string) *DiskAttachmentsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -24420,16 +22849,16 @@ func (p *SchedulingPolicyUnitServiceRemoveRequest) Query(key, value string) *Sch return p } -func (p *SchedulingPolicyUnitServiceRemoveRequest) Async(async bool) *SchedulingPolicyUnitServiceRemoveRequest { - p.async = &async +func (p *DiskAttachmentsServiceListRequest) Follow(follow string) *DiskAttachmentsServiceListRequest { + p.follow = &follow return p } -func (p *SchedulingPolicyUnitServiceRemoveRequest) Send() (*SchedulingPolicyUnitServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SchedulingPolicyUnitService.connection.URL(), p.SchedulingPolicyUnitService.path) +func (p *DiskAttachmentsServiceListRequest) Send() (*DiskAttachmentsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -24440,12 +22869,12 @@ func (p *SchedulingPolicyUnitServiceRemoveRequest) Send() (*SchedulingPolicyUnit if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SchedulingPolicyUnitService.connection.headers { + for hk, hv := range p.DiskAttachmentsService.connection.headers { req.Header.Add(hk, hv) } @@ -24460,18 +22889,18 @@ func (p *SchedulingPolicyUnitServiceRemoveRequest) Send() (*SchedulingPolicyUnit req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SchedulingPolicyUnitService.connection.authenticate() + token, err := p.DiskAttachmentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SchedulingPolicyUnitService.connection.client.Do(req) + resp, err := p.DiskAttachmentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SchedulingPolicyUnitService.connection.logFunc != nil { + if p.DiskAttachmentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -24480,19 +22909,24 @@ func (p *SchedulingPolicyUnitServiceRemoveRequest) Send() (*SchedulingPolicyUnit if err != nil { return nil, err } - p.SchedulingPolicyUnitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(SchedulingPolicyUnitServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskAttachmentReadMany(reader, nil) + if err != nil { + return nil, err + } + return &DiskAttachmentsServiceListResponse{attachments: result}, nil } -func (p *SchedulingPolicyUnitServiceRemoveRequest) MustSend() *SchedulingPolicyUnitServiceRemoveResponse { +func (p *DiskAttachmentsServiceListRequest) MustSend() *DiskAttachmentsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -24501,94 +22935,73 @@ func (p *SchedulingPolicyUnitServiceRemoveRequest) MustSend() *SchedulingPolicyU } // +// List the disk that are attached to the virtual machine. +// The order of the returned list of disks attachments isn't guaranteed. // -type SchedulingPolicyUnitServiceRemoveResponse struct { +type DiskAttachmentsServiceListResponse struct { + attachments *DiskAttachmentSlice +} + +func (p *DiskAttachmentsServiceListResponse) Attachments() (*DiskAttachmentSlice, bool) { + if p.attachments != nil { + return p.attachments, true + } + return nil, false +} + +func (p *DiskAttachmentsServiceListResponse) MustAttachments() *DiskAttachmentSlice { + if p.attachments == nil { + panic("attachments in response does not exist") + } + return p.attachments } // +// List the disk that are attached to the virtual machine. +// The order of the returned list of disks attachments isn't guaranteed. // -func (p *SchedulingPolicyUnitService) Remove() *SchedulingPolicyUnitServiceRemoveRequest { - return &SchedulingPolicyUnitServiceRemoveRequest{SchedulingPolicyUnitService: p} +func (p *DiskAttachmentsService) List() *DiskAttachmentsServiceListRequest { + return &DiskAttachmentsServiceListRequest{DiskAttachmentsService: p} } // -// Service locator method, returns individual service on which the URI is dispatched. // -func (op *SchedulingPolicyUnitService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +type DiskAttachmentsServiceAddProvidingDiskIdRequest struct { + DiskAttachmentsService *DiskAttachmentsService + header map[string]string + query map[string]string + attachment *DiskAttachment } -func (op *SchedulingPolicyUnitService) String() string { - return fmt.Sprintf("SchedulingPolicyUnitService:%s", op.path) +func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Header(key, value string) *DiskAttachmentsServiceAddProvidingDiskIdRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value + return p } -// -// -type StorageServerConnectionsService struct { - BaseService +func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Query(key, value string) *DiskAttachmentsServiceAddProvidingDiskIdRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p } -func NewStorageServerConnectionsService(connection *Connection, path string) *StorageServerConnectionsService { - var result StorageServerConnectionsService - result.connection = connection - result.path = path - return &result +func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Attachment(attachment *DiskAttachment) *DiskAttachmentsServiceAddProvidingDiskIdRequest { + p.attachment = attachment + return p } -// -// Creates a new storage connection. -// For example, to create a new storage connection for the NFS server `mynfs.example.com` and NFS share -// `/export/mydata` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/storageconnections -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// nfs -//
mynfs.example.com
-// /export/mydata -// -// myhost -// -//
-// ---- -// -type StorageServerConnectionsServiceAddRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection -} - -func (p *StorageServerConnectionsServiceAddRequest) Header(key, value string) *StorageServerConnectionsServiceAddRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *StorageServerConnectionsServiceAddRequest) Query(key, value string) *StorageServerConnectionsServiceAddRequest { - if p.query == nil { - p.query = make(map[string]string) +func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) Send() (*DiskAttachmentsServiceAddProvidingDiskIdResponse, error) { + rawURL := fmt.Sprintf("%s%s/providingdiskid", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Attachment(p.attachment) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - p.query[key] = value - return p -} - -func (p *StorageServerConnectionsServiceAddRequest) Connection(connection *StorageConnection) *StorageServerConnectionsServiceAddRequest { - p.connection = connection - return p -} - -func (p *StorageServerConnectionsServiceAddRequest) Send() (*StorageServerConnectionsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -24600,17 +23013,14 @@ func (p *StorageServerConnectionsServiceAddRequest) Send() (*StorageServerConnec } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLStorageConnectionWriteOne(writer, p.connection, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskAttachmentsService.connection.headers { req.Header.Add(hk, hv) } @@ -24625,18 +23035,18 @@ func (p *StorageServerConnectionsServiceAddRequest) Send() (*StorageServerConnec req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskAttachmentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskAttachmentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskAttachmentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -24645,24 +23055,17 @@ func (p *StorageServerConnectionsServiceAddRequest) Send() (*StorageServerConnec if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &StorageServerConnectionsServiceAddResponse{connection: result}, nil + result := action.MustAttachment() + return &DiskAttachmentsServiceAddProvidingDiskIdResponse{attachment: result}, nil } -func (p *StorageServerConnectionsServiceAddRequest) MustSend() *StorageServerConnectionsServiceAddResponse { +func (p *DiskAttachmentsServiceAddProvidingDiskIdRequest) MustSend() *DiskAttachmentsServiceAddProvidingDiskIdResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -24671,80 +23074,41 @@ func (p *StorageServerConnectionsServiceAddRequest) MustSend() *StorageServerCon } // -// Creates a new storage connection. -// For example, to create a new storage connection for the NFS server `mynfs.example.com` and NFS share -// `/export/mydata` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/storageconnections -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// nfs -//
mynfs.example.com
-// /export/mydata -// -// myhost -// -//
-// ---- // -type StorageServerConnectionsServiceAddResponse struct { - connection *StorageConnection +type DiskAttachmentsServiceAddProvidingDiskIdResponse struct { + attachment *DiskAttachment } -func (p *StorageServerConnectionsServiceAddResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *DiskAttachmentsServiceAddProvidingDiskIdResponse) Attachment() (*DiskAttachment, bool) { + if p.attachment != nil { + return p.attachment, true } return nil, false } -func (p *StorageServerConnectionsServiceAddResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *DiskAttachmentsServiceAddProvidingDiskIdResponse) MustAttachment() *DiskAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") } - return p.connection + return p.attachment } // -// Creates a new storage connection. -// For example, to create a new storage connection for the NFS server `mynfs.example.com` and NFS share -// `/export/mydata` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/storageconnections -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// nfs -//
mynfs.example.com
-// /export/mydata -// -// myhost -// -//
-// ---- // -func (p *StorageServerConnectionsService) Add() *StorageServerConnectionsServiceAddRequest { - return &StorageServerConnectionsServiceAddRequest{StorageServerConnectionsService: p} +func (p *DiskAttachmentsService) AddProvidingDiskId() *DiskAttachmentsServiceAddProvidingDiskIdRequest { + return &DiskAttachmentsServiceAddProvidingDiskIdRequest{DiskAttachmentsService: p} } // -// Add a Glusterfs storage connection to the system. // -type StorageServerConnectionsServiceAddGlusterfsRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection +type DiskAttachmentsServiceAddSignature1Request struct { + DiskAttachmentsService *DiskAttachmentsService + header map[string]string + query map[string]string + attachment *DiskAttachment } -func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Header(key, value string) *StorageServerConnectionsServiceAddGlusterfsRequest { +func (p *DiskAttachmentsServiceAddSignature1Request) Header(key, value string) *DiskAttachmentsServiceAddSignature1Request { if p.header == nil { p.header = make(map[string]string) } @@ -24752,7 +23116,7 @@ func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Header(key, value s return p } -func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Query(key, value string) *StorageServerConnectionsServiceAddGlusterfsRequest { +func (p *DiskAttachmentsServiceAddSignature1Request) Query(key, value string) *DiskAttachmentsServiceAddSignature1Request { if p.query == nil { p.query = make(map[string]string) } @@ -24760,15 +23124,15 @@ func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Query(key, value st return p } -func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Connection(connection *StorageConnection) *StorageServerConnectionsServiceAddGlusterfsRequest { - p.connection = connection +func (p *DiskAttachmentsServiceAddSignature1Request) Attachment(attachment *DiskAttachment) *DiskAttachmentsServiceAddSignature1Request { + p.attachment = attachment return p } -func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Send() (*StorageServerConnectionsServiceAddGlusterfsResponse, error) { - rawURL := fmt.Sprintf("%s%s/glusterfs", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) +func (p *DiskAttachmentsServiceAddSignature1Request) Send() (*DiskAttachmentsServiceAddSignature1Response, error) { + rawURL := fmt.Sprintf("%s%s/signature1", p.DiskAttachmentsService.connection.URL(), p.DiskAttachmentsService.path) actionBuilder := NewActionBuilder() - actionBuilder.Connection(p.connection) + actionBuilder.Attachment(p.attachment) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -24791,7 +23155,7 @@ func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Send() (*StorageSer return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskAttachmentsService.connection.headers { req.Header.Add(hk, hv) } @@ -24806,18 +23170,18 @@ func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Send() (*StorageSer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskAttachmentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskAttachmentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskAttachmentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -24826,17 +23190,17 @@ func (p *StorageServerConnectionsServiceAddGlusterfsRequest) Send() (*StorageSer if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } action, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustConnection() - return &StorageServerConnectionsServiceAddGlusterfsResponse{connection: result}, nil + result := action.MustAttachment() + return &DiskAttachmentsServiceAddSignature1Response{attachment: result}, nil } -func (p *StorageServerConnectionsServiceAddGlusterfsRequest) MustSend() *StorageServerConnectionsServiceAddGlusterfsResponse { +func (p *DiskAttachmentsServiceAddSignature1Request) MustSend() *DiskAttachmentsServiceAddSignature1Response { if v, err := p.Send(); err != nil { panic(err) } else { @@ -24845,44 +23209,79 @@ func (p *StorageServerConnectionsServiceAddGlusterfsRequest) MustSend() *Storage } // -// Add a Glusterfs storage connection to the system. // -type StorageServerConnectionsServiceAddGlusterfsResponse struct { - connection *StorageConnection +type DiskAttachmentsServiceAddSignature1Response struct { + attachment *DiskAttachment } -func (p *StorageServerConnectionsServiceAddGlusterfsResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *DiskAttachmentsServiceAddSignature1Response) Attachment() (*DiskAttachment, bool) { + if p.attachment != nil { + return p.attachment, true } return nil, false } -func (p *StorageServerConnectionsServiceAddGlusterfsResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *DiskAttachmentsServiceAddSignature1Response) MustAttachment() *DiskAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") } - return p.connection + return p.attachment } // -// Add a Glusterfs storage connection to the system. // -func (p *StorageServerConnectionsService) AddGlusterfs() *StorageServerConnectionsServiceAddGlusterfsRequest { - return &StorageServerConnectionsServiceAddGlusterfsRequest{StorageServerConnectionsService: p} +func (p *DiskAttachmentsService) AddSignature1() *DiskAttachmentsServiceAddSignature1Request { + return &DiskAttachmentsServiceAddSignature1Request{DiskAttachmentsService: p} } // -// Add a iSCSI storage connection to the system. +// Reference to the service that manages a specific attachment. // -type StorageServerConnectionsServiceAddIscsiRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection +func (op *DiskAttachmentsService) AttachmentService(id string) *DiskAttachmentService { + return NewDiskAttachmentService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *StorageServerConnectionsServiceAddIscsiRequest) Header(key, value string) *StorageServerConnectionsServiceAddIscsiRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DiskAttachmentsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.AttachmentService(path), nil + } + return op.AttachmentService(path[:index]).Service(path[index+1:]) +} + +func (op *DiskAttachmentsService) String() string { + return fmt.Sprintf("DiskAttachmentsService:%s", op.path) +} + +// +// +type DiskProfileService struct { + BaseService +} + +func NewDiskProfileService(connection *Connection, path string) *DiskProfileService { + var result DiskProfileService + result.connection = connection + result.path = path + return &result +} + +// +// +type DiskProfileServiceGetRequest struct { + DiskProfileService *DiskProfileService + header map[string]string + query map[string]string + follow *string +} + +func (p *DiskProfileServiceGetRequest) Header(key, value string) *DiskProfileServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -24890,7 +23289,7 @@ func (p *StorageServerConnectionsServiceAddIscsiRequest) Header(key, value strin return p } -func (p *StorageServerConnectionsServiceAddIscsiRequest) Query(key, value string) *StorageServerConnectionsServiceAddIscsiRequest { +func (p *DiskProfileServiceGetRequest) Query(key, value string) *DiskProfileServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -24898,20 +23297,18 @@ func (p *StorageServerConnectionsServiceAddIscsiRequest) Query(key, value string return p } -func (p *StorageServerConnectionsServiceAddIscsiRequest) Connection(connection *StorageConnection) *StorageServerConnectionsServiceAddIscsiRequest { - p.connection = connection +func (p *DiskProfileServiceGetRequest) Follow(follow string) *DiskProfileServiceGetRequest { + p.follow = &follow return p } -func (p *StorageServerConnectionsServiceAddIscsiRequest) Send() (*StorageServerConnectionsServiceAddIscsiResponse, error) { - rawURL := fmt.Sprintf("%s%s/iscsi", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Connection(p.connection) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskProfileServiceGetRequest) Send() (*DiskProfileServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskProfileService.connection.URL(), p.DiskProfileService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -24920,16 +23317,12 @@ func (p *StorageServerConnectionsServiceAddIscsiRequest) Send() (*StorageServerC if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -24944,18 +23337,18 @@ func (p *StorageServerConnectionsServiceAddIscsiRequest) Send() (*StorageServerC req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -24964,17 +23357,24 @@ func (p *StorageServerConnectionsServiceAddIscsiRequest) Send() (*StorageServerC if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustConnection() - return &StorageServerConnectionsServiceAddIscsiResponse{connection: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskProfileReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DiskProfileServiceGetResponse{profile: result}, nil } -func (p *StorageServerConnectionsServiceAddIscsiRequest) MustSend() *StorageServerConnectionsServiceAddIscsiResponse { +func (p *DiskProfileServiceGetRequest) MustSend() *DiskProfileServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -24983,46 +23383,41 @@ func (p *StorageServerConnectionsServiceAddIscsiRequest) MustSend() *StorageServ } // -// Add a iSCSI storage connection to the system. // -type StorageServerConnectionsServiceAddIscsiResponse struct { - connection *StorageConnection +type DiskProfileServiceGetResponse struct { + profile *DiskProfile } -func (p *StorageServerConnectionsServiceAddIscsiResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *DiskProfileServiceGetResponse) Profile() (*DiskProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *StorageServerConnectionsServiceAddIscsiResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *DiskProfileServiceGetResponse) MustProfile() *DiskProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.connection + return p.profile } // -// Add a iSCSI storage connection to the system. // -func (p *StorageServerConnectionsService) AddIscsi() *StorageServerConnectionsServiceAddIscsiRequest { - return &StorageServerConnectionsServiceAddIscsiRequest{StorageServerConnectionsService: p} +func (p *DiskProfileService) Get() *DiskProfileServiceGetRequest { + return &DiskProfileServiceGetRequest{DiskProfileService: p} } // -// Returns the list of storage connections. -// The order of the returned list of connections isn't guaranteed. // -type StorageServerConnectionsServiceListRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - follow *string - max *int64 +type DiskProfileServiceRemoveRequest struct { + DiskProfileService *DiskProfileService + header map[string]string + query map[string]string + async *bool } -func (p *StorageServerConnectionsServiceListRequest) Header(key, value string) *StorageServerConnectionsServiceListRequest { +func (p *DiskProfileServiceRemoveRequest) Header(key, value string) *DiskProfileServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -25030,7 +23425,7 @@ func (p *StorageServerConnectionsServiceListRequest) Header(key, value string) * return p } -func (p *StorageServerConnectionsServiceListRequest) Query(key, value string) *StorageServerConnectionsServiceListRequest { +func (p *DiskProfileServiceRemoveRequest) Query(key, value string) *DiskProfileServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -25038,25 +23433,16 @@ func (p *StorageServerConnectionsServiceListRequest) Query(key, value string) *S return p } -func (p *StorageServerConnectionsServiceListRequest) Follow(follow string) *StorageServerConnectionsServiceListRequest { - p.follow = &follow - return p -} - -func (p *StorageServerConnectionsServiceListRequest) Max(max int64) *StorageServerConnectionsServiceListRequest { - p.max = &max +func (p *DiskProfileServiceRemoveRequest) Async(async bool) *DiskProfileServiceRemoveRequest { + p.async = &async return p } -func (p *StorageServerConnectionsServiceListRequest) Send() (*StorageServerConnectionsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) +func (p *DiskProfileServiceRemoveRequest) Send() (*DiskProfileServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskProfileService.connection.URL(), p.DiskProfileService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -25067,12 +23453,12 @@ func (p *StorageServerConnectionsServiceListRequest) Send() (*StorageServerConne if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -25087,18 +23473,18 @@ func (p *StorageServerConnectionsServiceListRequest) Send() (*StorageServerConne req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -25107,24 +23493,19 @@ func (p *StorageServerConnectionsServiceListRequest) Send() (*StorageServerConne if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionReadMany(reader, nil) - if err != nil { - return nil, err - } - return &StorageServerConnectionsServiceListResponse{connections: result}, nil + return new(DiskProfileServiceRemoveResponse), nil } -func (p *StorageServerConnectionsServiceListRequest) MustSend() *StorageServerConnectionsServiceListResponse { +func (p *DiskProfileServiceRemoveRequest) MustSend() *DiskProfileServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -25133,46 +23514,28 @@ func (p *StorageServerConnectionsServiceListRequest) MustSend() *StorageServerCo } // -// Returns the list of storage connections. -// The order of the returned list of connections isn't guaranteed. // -type StorageServerConnectionsServiceListResponse struct { - connections *StorageConnectionSlice -} - -func (p *StorageServerConnectionsServiceListResponse) Connections() (*StorageConnectionSlice, bool) { - if p.connections != nil { - return p.connections, true - } - return nil, false -} - -func (p *StorageServerConnectionsServiceListResponse) MustConnections() *StorageConnectionSlice { - if p.connections == nil { - panic("connections in response does not exist") - } - return p.connections +type DiskProfileServiceRemoveResponse struct { } // -// Returns the list of storage connections. -// The order of the returned list of connections isn't guaranteed. // -func (p *StorageServerConnectionsService) List() *StorageServerConnectionsServiceListRequest { - return &StorageServerConnectionsServiceListRequest{StorageServerConnectionsService: p} +func (p *DiskProfileService) Remove() *DiskProfileServiceRemoveRequest { + return &DiskProfileServiceRemoveRequest{DiskProfileService: p} } // -// Add a local storage connection to the system. +// Update the specified disk profile in the system. // -type StorageServerConnectionsServiceAddLocalRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection +type DiskProfileServiceUpdateRequest struct { + DiskProfileService *DiskProfileService + header map[string]string + query map[string]string + async *bool + profile *DiskProfile } -func (p *StorageServerConnectionsServiceAddLocalRequest) Header(key, value string) *StorageServerConnectionsServiceAddLocalRequest { +func (p *DiskProfileServiceUpdateRequest) Header(key, value string) *DiskProfileServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -25180,7 +23543,7 @@ func (p *StorageServerConnectionsServiceAddLocalRequest) Header(key, value strin return p } -func (p *StorageServerConnectionsServiceAddLocalRequest) Query(key, value string) *StorageServerConnectionsServiceAddLocalRequest { +func (p *DiskProfileServiceUpdateRequest) Query(key, value string) *DiskProfileServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -25188,20 +23551,23 @@ func (p *StorageServerConnectionsServiceAddLocalRequest) Query(key, value string return p } -func (p *StorageServerConnectionsServiceAddLocalRequest) Connection(connection *StorageConnection) *StorageServerConnectionsServiceAddLocalRequest { - p.connection = connection +func (p *DiskProfileServiceUpdateRequest) Async(async bool) *DiskProfileServiceUpdateRequest { + p.async = &async return p } -func (p *StorageServerConnectionsServiceAddLocalRequest) Send() (*StorageServerConnectionsServiceAddLocalResponse, error) { - rawURL := fmt.Sprintf("%s%s/local", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Connection(p.connection) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskProfileServiceUpdateRequest) Profile(profile *DiskProfile) *DiskProfileServiceUpdateRequest { + p.profile = profile + return p +} + +func (p *DiskProfileServiceUpdateRequest) Send() (*DiskProfileServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskProfileService.connection.URL(), p.DiskProfileService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -25212,14 +23578,17 @@ func (p *StorageServerConnectionsServiceAddLocalRequest) Send() (*StorageServerC } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLDiskProfileWriteOne(writer, p.profile, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskProfileService.connection.headers { req.Header.Add(hk, hv) } @@ -25234,18 +23603,18 @@ func (p *StorageServerConnectionsServiceAddLocalRequest) Send() (*StorageServerC req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskProfileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskProfileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskProfileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -25254,17 +23623,24 @@ func (p *StorageServerConnectionsServiceAddLocalRequest) Send() (*StorageServerC if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustConnection() - return &StorageServerConnectionsServiceAddLocalResponse{connection: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskProfileReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DiskProfileServiceUpdateResponse{profile: result}, nil } -func (p *StorageServerConnectionsServiceAddLocalRequest) MustSend() *StorageServerConnectionsServiceAddLocalResponse { +func (p *DiskProfileServiceUpdateRequest) MustSend() *DiskProfileServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -25273,44 +23649,83 @@ func (p *StorageServerConnectionsServiceAddLocalRequest) MustSend() *StorageServ } // -// Add a local storage connection to the system. +// Update the specified disk profile in the system. // -type StorageServerConnectionsServiceAddLocalResponse struct { - connection *StorageConnection -} +type DiskProfileServiceUpdateResponse struct { + profile *DiskProfile +} -func (p *StorageServerConnectionsServiceAddLocalResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *DiskProfileServiceUpdateResponse) Profile() (*DiskProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *StorageServerConnectionsServiceAddLocalResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *DiskProfileServiceUpdateResponse) MustProfile() *DiskProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.connection + return p.profile } // -// Add a local storage connection to the system. +// Update the specified disk profile in the system. // -func (p *StorageServerConnectionsService) AddLocal() *StorageServerConnectionsServiceAddLocalRequest { - return &StorageServerConnectionsServiceAddLocalRequest{StorageServerConnectionsService: p} +func (p *DiskProfileService) Update() *DiskProfileServiceUpdateRequest { + return &DiskProfileServiceUpdateRequest{DiskProfileService: p} } // -// Add a nfs storage connection to the system. // -type StorageServerConnectionsServiceAddNfsRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection +func (op *DiskProfileService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) } -func (p *StorageServerConnectionsServiceAddNfsRequest) Header(key, value string) *StorageServerConnectionsServiceAddNfsRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DiskProfileService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *DiskProfileService) String() string { + return fmt.Sprintf("DiskProfileService:%s", op.path) +} + +// +// +type DiskProfilesService struct { + BaseService +} + +func NewDiskProfilesService(connection *Connection, path string) *DiskProfilesService { + var result DiskProfilesService + result.connection = connection + result.path = path + return &result +} + +// +// Add a new disk profile to the system. +// +type DiskProfilesServiceAddRequest struct { + DiskProfilesService *DiskProfilesService + header map[string]string + query map[string]string + profile *DiskProfile +} + +func (p *DiskProfilesServiceAddRequest) Header(key, value string) *DiskProfilesServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -25318,7 +23733,7 @@ func (p *StorageServerConnectionsServiceAddNfsRequest) Header(key, value string) return p } -func (p *StorageServerConnectionsServiceAddNfsRequest) Query(key, value string) *StorageServerConnectionsServiceAddNfsRequest { +func (p *DiskProfilesServiceAddRequest) Query(key, value string) *DiskProfilesServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -25326,19 +23741,13 @@ func (p *StorageServerConnectionsServiceAddNfsRequest) Query(key, value string) return p } -func (p *StorageServerConnectionsServiceAddNfsRequest) Connection(connection *StorageConnection) *StorageServerConnectionsServiceAddNfsRequest { - p.connection = connection +func (p *DiskProfilesServiceAddRequest) Profile(profile *DiskProfile) *DiskProfilesServiceAddRequest { + p.profile = profile return p } -func (p *StorageServerConnectionsServiceAddNfsRequest) Send() (*StorageServerConnectionsServiceAddNfsResponse, error) { - rawURL := fmt.Sprintf("%s%s/nfs", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Connection(p.connection) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskProfilesServiceAddRequest) Send() (*DiskProfilesServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskProfilesService.connection.URL(), p.DiskProfilesService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -25350,14 +23759,17 @@ func (p *StorageServerConnectionsServiceAddNfsRequest) Send() (*StorageServerCon } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLDiskProfileWriteOne(writer, p.profile, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -25372,18 +23784,18 @@ func (p *StorageServerConnectionsServiceAddNfsRequest) Send() (*StorageServerCon req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -25392,17 +23804,24 @@ func (p *StorageServerConnectionsServiceAddNfsRequest) Send() (*StorageServerCon if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - result := action.MustConnection() - return &StorageServerConnectionsServiceAddNfsResponse{connection: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskProfileReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DiskProfilesServiceAddResponse{profile: result}, nil } -func (p *StorageServerConnectionsServiceAddNfsRequest) MustSend() *StorageServerConnectionsServiceAddNfsResponse { +func (p *DiskProfilesServiceAddRequest) MustSend() *DiskProfilesServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -25411,44 +23830,46 @@ func (p *StorageServerConnectionsServiceAddNfsRequest) MustSend() *StorageServer } // -// Add a nfs storage connection to the system. +// Add a new disk profile to the system. // -type StorageServerConnectionsServiceAddNfsResponse struct { - connection *StorageConnection +type DiskProfilesServiceAddResponse struct { + profile *DiskProfile } -func (p *StorageServerConnectionsServiceAddNfsResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *DiskProfilesServiceAddResponse) Profile() (*DiskProfile, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *StorageServerConnectionsServiceAddNfsResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *DiskProfilesServiceAddResponse) MustProfile() *DiskProfile { + if p.profile == nil { + panic("profile in response does not exist") } - return p.connection + return p.profile } // -// Add a nfs storage connection to the system. +// Add a new disk profile to the system. // -func (p *StorageServerConnectionsService) AddNfs() *StorageServerConnectionsServiceAddNfsRequest { - return &StorageServerConnectionsServiceAddNfsRequest{StorageServerConnectionsService: p} +func (p *DiskProfilesService) Add() *DiskProfilesServiceAddRequest { + return &DiskProfilesServiceAddRequest{DiskProfilesService: p} } // -// Add a vfs storage connection to the system. +// Returns the list of disk profiles of the system. +// The order of the returned list of disk profiles isn't guaranteed. // -type StorageServerConnectionsServiceAddVfsRequest struct { - StorageServerConnectionsService *StorageServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection +type DiskProfilesServiceListRequest struct { + DiskProfilesService *DiskProfilesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *StorageServerConnectionsServiceAddVfsRequest) Header(key, value string) *StorageServerConnectionsServiceAddVfsRequest { +func (p *DiskProfilesServiceListRequest) Header(key, value string) *DiskProfilesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -25456,7 +23877,7 @@ func (p *StorageServerConnectionsServiceAddVfsRequest) Header(key, value string) return p } -func (p *StorageServerConnectionsServiceAddVfsRequest) Query(key, value string) *StorageServerConnectionsServiceAddVfsRequest { +func (p *DiskProfilesServiceListRequest) Query(key, value string) *DiskProfilesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -25464,20 +23885,27 @@ func (p *StorageServerConnectionsServiceAddVfsRequest) Query(key, value string) return p } -func (p *StorageServerConnectionsServiceAddVfsRequest) Connection(connection *StorageConnection) *StorageServerConnectionsServiceAddVfsRequest { - p.connection = connection +func (p *DiskProfilesServiceListRequest) Follow(follow string) *DiskProfilesServiceListRequest { + p.follow = &follow return p } -func (p *StorageServerConnectionsServiceAddVfsRequest) Send() (*StorageServerConnectionsServiceAddVfsResponse, error) { - rawURL := fmt.Sprintf("%s%s/vfs", p.StorageServerConnectionsService.connection.URL(), p.StorageServerConnectionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Connection(p.connection) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskProfilesServiceListRequest) Max(max int64) *DiskProfilesServiceListRequest { + p.max = &max + return p +} + +func (p *DiskProfilesServiceListRequest) Send() (*DiskProfilesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskProfilesService.connection.URL(), p.DiskProfilesService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -25486,16 +23914,12 @@ func (p *StorageServerConnectionsServiceAddVfsRequest) Send() (*StorageServerCon if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageServerConnectionsService.connection.headers { + for hk, hv := range p.DiskProfilesService.connection.headers { req.Header.Add(hk, hv) } @@ -25510,18 +23934,18 @@ func (p *StorageServerConnectionsServiceAddVfsRequest) Send() (*StorageServerCon req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageServerConnectionsService.connection.authenticate() + token, err := p.DiskProfilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageServerConnectionsService.connection.client.Do(req) + resp, err := p.DiskProfilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageServerConnectionsService.connection.logFunc != nil { + if p.DiskProfilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -25530,17 +23954,24 @@ func (p *StorageServerConnectionsServiceAddVfsRequest) Send() (*StorageServerCon if err != nil { return nil, err } - p.StorageServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustConnection() - return &StorageServerConnectionsServiceAddVfsResponse{connection: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskProfileReadMany(reader, nil) + if err != nil { + return nil, err + } + return &DiskProfilesServiceListResponse{profile: result}, nil } -func (p *StorageServerConnectionsServiceAddVfsRequest) MustSend() *StorageServerConnectionsServiceAddVfsResponse { +func (p *DiskProfilesServiceListRequest) MustSend() *DiskProfilesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -25549,203 +23980,115 @@ func (p *StorageServerConnectionsServiceAddVfsRequest) MustSend() *StorageServer } // -// Add a vfs storage connection to the system. +// Returns the list of disk profiles of the system. +// The order of the returned list of disk profiles isn't guaranteed. // -type StorageServerConnectionsServiceAddVfsResponse struct { - connection *StorageConnection +type DiskProfilesServiceListResponse struct { + profile *DiskProfileSlice } -func (p *StorageServerConnectionsServiceAddVfsResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *DiskProfilesServiceListResponse) Profile() (*DiskProfileSlice, bool) { + if p.profile != nil { + return p.profile, true } return nil, false } -func (p *StorageServerConnectionsServiceAddVfsResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *DiskProfilesServiceListResponse) MustProfile() *DiskProfileSlice { + if p.profile == nil { + panic("profile in response does not exist") } - return p.connection + return p.profile } // -// Add a vfs storage connection to the system. +// Returns the list of disk profiles of the system. +// The order of the returned list of disk profiles isn't guaranteed. // -func (p *StorageServerConnectionsService) AddVfs() *StorageServerConnectionsServiceAddVfsRequest { - return &StorageServerConnectionsServiceAddVfsRequest{StorageServerConnectionsService: p} +func (p *DiskProfilesService) List() *DiskProfilesServiceListRequest { + return &DiskProfilesServiceListRequest{DiskProfilesService: p} } // // -func (op *StorageServerConnectionsService) StorageConnectionService(id string) *StorageServerConnectionService { - return NewStorageServerConnectionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *DiskProfilesService) DiskProfileService(id string) *DiskProfileService { + return NewDiskProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *StorageServerConnectionsService) Service(path string) (Service, error) { +func (op *DiskProfilesService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.StorageConnectionService(path), nil + return op.DiskProfileService(path), nil } - return op.StorageConnectionService(path[:index]).Service(path[index+1:]) + return op.DiskProfileService(path[:index]).Service(path[index+1:]) } -func (op *StorageServerConnectionsService) String() string { - return fmt.Sprintf("StorageServerConnectionsService:%s", op.path) +func (op *DiskProfilesService) String() string { + return fmt.Sprintf("DiskProfilesService:%s", op.path) } // -// Manages the collection of disks available in the system. +// Manages a single disk. // -type DisksService struct { +type DiskService struct { BaseService } -func NewDisksService(connection *Connection, path string) *DisksService { - var result DisksService +func NewDiskService(connection *Connection, path string) *DiskService { + var result DiskService result.connection = connection result.path = path return &result } // -// Adds a new floating disk. -// There are three types of disks that can be added - disk image, direct LUN and -// https://wiki.openstack.org/wiki/Cinder[Cinder] disk. -// *Adding a new image disk:* -// When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size` -// and `format` attributes. -// Note that block storage domains (i.e., storage domains with the <> of iSCSI or -// FCP) don't support the combination of the raw `format` with `sparse=true`, so `sparse=false` must be stated -// explicitly. -// To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain -// with an id `123`, send a request as follows: -// [source] -// ---- -// POST /ovirt-engine/api/disks -// ---- -// With a request body as follows: -// [source,xml] -// ---- -// -// -// -// -// mydisk -// 1048576 -// cow -// -// ---- -// *Adding a new direct LUN disk:* -// When adding a new floating direct LUN via the API, there are two flavors that can be used: -// . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and -// to retrieve basic information about the LUN (e.g., size and serial). -// . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never -// accessed. -// To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and -// `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`), -// send a request as follows: -// [source] -// ---- -// POST /ovirt-engine/api/disks -// ---- -// With a request body as follows: -// [source,xml] -// ---- -// -// mylun -// -// -// iscsi -// -// -//
10.35.10.20
-// 3260 -// iqn.2017-01.com.myhost:444 -//
-//
-//
-//
-// ---- -// To create a new floating direct LUN disk without using a host, remove the `host` element. -// *Adding a new Cinder disk:* -// To create a new floating Cinder disk, send a request as follows: +// This operation copies a disk to the specified storage domain. +// For example, a disk can be copied using the following request: // [source] // ---- -// POST /ovirt-engine/api/disks +// POST /ovirt-engine/api/disks/123/copy // ---- -// With a request body as follows: +// With a request body like this: // [source,xml] // ---- -// -// -// myceph -// -// -// -// cinderDomain -// -// -// 1073741824 -// virtio -// raw -// -// ---- -// *Adding a floating disks in order to upload disk snapshots:* -// Since version 4.2 of the engine it is possible to upload disks with -// snapshots. This request should be used to create the base image of the -// images chain (The consecutive disk snapshots (images), should be created -// using `disk-attachments` element when creating a snapshot). -// The disk has to be created with the same disk identifier and image identifier -// of the uploaded image. I.e. the identifiers should be saved as part of the -// backup process. The image identifier can be also fetched using the -// `qemu-img info` command. For example, if the disk image is stored into -// a file named `b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img`: -// [source,shell] -// ---- -// $ qemu-img info b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img -// image: b548366b-fb51-4b41-97be-733c887fe305 -// file format: qcow2 -// virtual size: 1.0G (1073741824 bytes) -// disk size: 196K -// cluster_size: 65536 -// backing file: ad58716a-1fe9-481f-815e-664de1df04eb -// backing file format: raw -// ---- -// To create a disk with with the disk identifier and image identifier obtained -// with the `qemu-img info` command shown above, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/disks +// +// +// +// mydisk +// +// // ---- -// With a request body as follows: +// If the disk profile or the quota currently used by the disk are not defined for the new storage domain, they +// can be explicitly specified. If they are not specified, the first available disk profile and the default quota are used. +// For example, to specify disk profile `987` and quota `753`, send a request body like this: // [source,xml] // ---- -// -// b548366b-fb51-4b41-97be-733c887fe305 -// -// -// -// mydisk -// 1048576 -// cow -// +// +// +// +// +// // ---- // -type DisksServiceAddRequest struct { - DisksService *DisksService - header map[string]string - query map[string]string - disk *Disk +type DiskServiceCopyRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + async *bool + disk *Disk + diskProfile *DiskProfile + filter *bool + quota *Quota + storageDomain *StorageDomain } -func (p *DisksServiceAddRequest) Header(key, value string) *DisksServiceAddRequest { +func (p *DiskServiceCopyRequest) Header(key, value string) *DiskServiceCopyRequest { if p.header == nil { p.header = make(map[string]string) } @@ -25753,7 +24096,7 @@ func (p *DisksServiceAddRequest) Header(key, value string) *DisksServiceAddReque return p } -func (p *DisksServiceAddRequest) Query(key, value string) *DisksServiceAddRequest { +func (p *DiskServiceCopyRequest) Query(key, value string) *DiskServiceCopyRequest { if p.query == nil { p.query = make(map[string]string) } @@ -25761,13 +24104,53 @@ func (p *DisksServiceAddRequest) Query(key, value string) *DisksServiceAddReques return p } -func (p *DisksServiceAddRequest) Disk(disk *Disk) *DisksServiceAddRequest { +func (p *DiskServiceCopyRequest) Async(async bool) *DiskServiceCopyRequest { + p.async = &async + return p +} + +func (p *DiskServiceCopyRequest) Disk(disk *Disk) *DiskServiceCopyRequest { p.disk = disk return p } -func (p *DisksServiceAddRequest) Send() (*DisksServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DisksService.connection.URL(), p.DisksService.path) +func (p *DiskServiceCopyRequest) DiskProfile(diskProfile *DiskProfile) *DiskServiceCopyRequest { + p.diskProfile = diskProfile + return p +} + +func (p *DiskServiceCopyRequest) Filter(filter bool) *DiskServiceCopyRequest { + p.filter = &filter + return p +} + +func (p *DiskServiceCopyRequest) Quota(quota *Quota) *DiskServiceCopyRequest { + p.quota = quota + return p +} + +func (p *DiskServiceCopyRequest) StorageDomain(storageDomain *StorageDomain) *DiskServiceCopyRequest { + p.storageDomain = storageDomain + return p +} + +func (p *DiskServiceCopyRequest) Send() (*DiskServiceCopyResponse, error) { + rawURL := fmt.Sprintf("%s%s/copy", p.DiskService.connection.URL(), p.DiskService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Disk(p.disk) + actionBuilder.DiskProfile(p.diskProfile) + if p.filter != nil { + actionBuilder.Filter(*p.filter) + } + actionBuilder.Quota(p.quota) + actionBuilder.StorageDomain(p.storageDomain) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -25779,17 +24162,14 @@ func (p *DisksServiceAddRequest) Send() (*DisksServiceAddResponse, error) { } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLDiskWriteOne(writer, p.disk, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DisksService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -25804,18 +24184,18 @@ func (p *DisksServiceAddRequest) Send() (*DisksServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DisksService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DisksService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DisksService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -25824,24 +24204,16 @@ func (p *DisksServiceAddRequest) Send() (*DisksServiceAddResponse, error) { if err != nil { return nil, err } - p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &DisksServiceAddResponse{disk: result}, nil + return new(DiskServiceCopyResponse), nil } -func (p *DisksServiceAddRequest) MustSend() *DisksServiceAddResponse { +func (p *DiskServiceCopyRequest) MustSend() *DiskServiceCopyResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -25850,318 +24222,83 @@ func (p *DisksServiceAddRequest) MustSend() *DisksServiceAddResponse { } // -// Adds a new floating disk. -// There are three types of disks that can be added - disk image, direct LUN and -// https://wiki.openstack.org/wiki/Cinder[Cinder] disk. -// *Adding a new image disk:* -// When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size` -// and `format` attributes. -// Note that block storage domains (i.e., storage domains with the <> of iSCSI or -// FCP) don't support the combination of the raw `format` with `sparse=true`, so `sparse=false` must be stated -// explicitly. -// To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain -// with an id `123`, send a request as follows: -// [source] -// ---- -// POST /ovirt-engine/api/disks -// ---- -// With a request body as follows: -// [source,xml] -// ---- -// -// -// -// -// mydisk -// 1048576 -// cow -// -// ---- -// *Adding a new direct LUN disk:* -// When adding a new floating direct LUN via the API, there are two flavors that can be used: -// . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and -// to retrieve basic information about the LUN (e.g., size and serial). -// . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never -// accessed. -// To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and -// `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`), -// send a request as follows: -// [source] -// ---- -// POST /ovirt-engine/api/disks -// ---- -// With a request body as follows: -// [source,xml] -// ---- -// -// mylun -// -// -// iscsi -// -// -//
10.35.10.20
-// 3260 -// iqn.2017-01.com.myhost:444 -//
-//
-//
-//
-// ---- -// To create a new floating direct LUN disk without using a host, remove the `host` element. -// *Adding a new Cinder disk:* -// To create a new floating Cinder disk, send a request as follows: +// This operation copies a disk to the specified storage domain. +// For example, a disk can be copied using the following request: // [source] // ---- -// POST /ovirt-engine/api/disks +// POST /ovirt-engine/api/disks/123/copy // ---- -// With a request body as follows: +// With a request body like this: // [source,xml] // ---- -// -// -// myceph -// -// -// -// cinderDomain -// -// -// 1073741824 -// virtio -// raw -// -// ---- -// *Adding a floating disks in order to upload disk snapshots:* -// Since version 4.2 of the engine it is possible to upload disks with -// snapshots. This request should be used to create the base image of the -// images chain (The consecutive disk snapshots (images), should be created -// using `disk-attachments` element when creating a snapshot). -// The disk has to be created with the same disk identifier and image identifier -// of the uploaded image. I.e. the identifiers should be saved as part of the -// backup process. The image identifier can be also fetched using the -// `qemu-img info` command. For example, if the disk image is stored into -// a file named `b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img`: -// [source,shell] -// ---- -// $ qemu-img info b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img -// image: b548366b-fb51-4b41-97be-733c887fe305 -// file format: qcow2 -// virtual size: 1.0G (1073741824 bytes) -// disk size: 196K -// cluster_size: 65536 -// backing file: ad58716a-1fe9-481f-815e-664de1df04eb -// backing file format: raw -// ---- -// To create a disk with with the disk identifier and image identifier obtained -// with the `qemu-img info` command shown above, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/disks +// +// +// +// mydisk +// +// // ---- -// With a request body as follows: +// If the disk profile or the quota currently used by the disk are not defined for the new storage domain, they +// can be explicitly specified. If they are not specified, the first available disk profile and the default quota are used. +// For example, to specify disk profile `987` and quota `753`, send a request body like this: // [source,xml] // ---- -// -// b548366b-fb51-4b41-97be-733c887fe305 -// -// -// -// mydisk -// 1048576 -// cow -// +// +// +// +// +// // ---- // -type DisksServiceAddResponse struct { - disk *Disk -} - -func (p *DisksServiceAddResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true - } - return nil, false -} - -func (p *DisksServiceAddResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") - } - return p.disk +type DiskServiceCopyResponse struct { } // -// Adds a new floating disk. -// There are three types of disks that can be added - disk image, direct LUN and -// https://wiki.openstack.org/wiki/Cinder[Cinder] disk. -// *Adding a new image disk:* -// When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size` -// and `format` attributes. -// Note that block storage domains (i.e., storage domains with the <> of iSCSI or -// FCP) don't support the combination of the raw `format` with `sparse=true`, so `sparse=false` must be stated -// explicitly. -// To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain -// with an id `123`, send a request as follows: -// [source] -// ---- -// POST /ovirt-engine/api/disks -// ---- -// With a request body as follows: -// [source,xml] -// ---- -// -// -// -// -// mydisk -// 1048576 -// cow -// -// ---- -// *Adding a new direct LUN disk:* -// When adding a new floating direct LUN via the API, there are two flavors that can be used: -// . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and -// to retrieve basic information about the LUN (e.g., size and serial). -// . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never -// accessed. -// To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and -// `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`), -// send a request as follows: -// [source] -// ---- -// POST /ovirt-engine/api/disks -// ---- -// With a request body as follows: -// [source,xml] -// ---- -// -// mylun -// -// -// iscsi -// -// -//
10.35.10.20
-// 3260 -// iqn.2017-01.com.myhost:444 -//
-//
-//
-//
-// ---- -// To create a new floating direct LUN disk without using a host, remove the `host` element. -// *Adding a new Cinder disk:* -// To create a new floating Cinder disk, send a request as follows: +// This operation copies a disk to the specified storage domain. +// For example, a disk can be copied using the following request: // [source] // ---- -// POST /ovirt-engine/api/disks +// POST /ovirt-engine/api/disks/123/copy // ---- -// With a request body as follows: +// With a request body like this: // [source,xml] // ---- -// -// -// myceph -// -// -// -// cinderDomain -// -// -// 1073741824 -// virtio -// raw -// -// ---- -// *Adding a floating disks in order to upload disk snapshots:* -// Since version 4.2 of the engine it is possible to upload disks with -// snapshots. This request should be used to create the base image of the -// images chain (The consecutive disk snapshots (images), should be created -// using `disk-attachments` element when creating a snapshot). -// The disk has to be created with the same disk identifier and image identifier -// of the uploaded image. I.e. the identifiers should be saved as part of the -// backup process. The image identifier can be also fetched using the -// `qemu-img info` command. For example, if the disk image is stored into -// a file named `b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img`: -// [source,shell] -// ---- -// $ qemu-img info b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img -// image: b548366b-fb51-4b41-97be-733c887fe305 -// file format: qcow2 -// virtual size: 1.0G (1073741824 bytes) -// disk size: 196K -// cluster_size: 65536 -// backing file: ad58716a-1fe9-481f-815e-664de1df04eb -// backing file format: raw -// ---- -// To create a disk with with the disk identifier and image identifier obtained -// with the `qemu-img info` command shown above, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/disks +// +// +// +// mydisk +// +// // ---- -// With a request body as follows: +// If the disk profile or the quota currently used by the disk are not defined for the new storage domain, they +// can be explicitly specified. If they are not specified, the first available disk profile and the default quota are used. +// For example, to specify disk profile `987` and quota `753`, send a request body like this: // [source,xml] // ---- -// -// b548366b-fb51-4b41-97be-733c887fe305 -// -// -// -// mydisk -// 1048576 -// cow -// +// +// +// +// +// // ---- // -func (p *DisksService) Add() *DisksServiceAddRequest { - return &DisksServiceAddRequest{DisksService: p} +func (p *DiskService) Copy() *DiskServiceCopyRequest { + return &DiskServiceCopyRequest{DiskService: p} } // -// Get list of disks. -// [source] -// ---- -// GET /ovirt-engine/api/disks -// ---- -// You will get a XML response which will look like this one: -// [source,xml] -// ---- -// -// -// ... -// MyDisk -// MyDisk description -// -// -// 5345845248 -// MyDisk alias -// ... -// ok -// image -// false -// -// -// ... -// -// ... -// -// ---- -// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in the -// `search` parameter. +// Exports a disk to an export storage domain. // -type DisksServiceListRequest struct { - DisksService *DisksService +type DiskServiceExportRequest struct { + DiskService *DiskService header map[string]string query map[string]string - caseSensitive *bool - follow *string - max *int64 - search *string + async *bool + filter *bool + storageDomain *StorageDomain } -func (p *DisksServiceListRequest) Header(key, value string) *DisksServiceListRequest { +func (p *DiskServiceExportRequest) Header(key, value string) *DiskServiceExportRequest { if p.header == nil { p.header = make(map[string]string) } @@ -26169,7 +24306,7 @@ func (p *DisksServiceListRequest) Header(key, value string) *DisksServiceListReq return p } -func (p *DisksServiceListRequest) Query(key, value string) *DisksServiceListRequest { +func (p *DiskServiceExportRequest) Query(key, value string) *DiskServiceExportRequest { if p.query == nil { p.query = make(map[string]string) } @@ -26177,45 +24314,36 @@ func (p *DisksServiceListRequest) Query(key, value string) *DisksServiceListRequ return p } -func (p *DisksServiceListRequest) CaseSensitive(caseSensitive bool) *DisksServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *DisksServiceListRequest) Follow(follow string) *DisksServiceListRequest { - p.follow = &follow +func (p *DiskServiceExportRequest) Async(async bool) *DiskServiceExportRequest { + p.async = &async return p } -func (p *DisksServiceListRequest) Max(max int64) *DisksServiceListRequest { - p.max = &max +func (p *DiskServiceExportRequest) Filter(filter bool) *DiskServiceExportRequest { + p.filter = &filter return p } -func (p *DisksServiceListRequest) Search(search string) *DisksServiceListRequest { - p.search = &search +func (p *DiskServiceExportRequest) StorageDomain(storageDomain *StorageDomain) *DiskServiceExportRequest { + p.storageDomain = storageDomain return p } -func (p *DisksServiceListRequest) Send() (*DisksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DisksService.connection.URL(), p.DisksService.path) - values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *DiskServiceExportRequest) Send() (*DiskServiceExportResponse, error) { + rawURL := fmt.Sprintf("%s%s/export", p.DiskService.connection.URL(), p.DiskService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.filter != nil { + actionBuilder.Filter(*p.filter) } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} + actionBuilder.StorageDomain(p.storageDomain) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -26224,12 +24352,16 @@ func (p *DisksServiceListRequest) Send() (*DisksServiceListResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.DisksService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -26244,18 +24376,18 @@ func (p *DisksServiceListRequest) Send() (*DisksServiceListResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DisksService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DisksService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DisksService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -26264,24 +24396,16 @@ func (p *DisksServiceListRequest) Send() (*DisksServiceListResponse, error) { if err != nil { return nil, err } - p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &DisksServiceListResponse{disks: result}, nil + return new(DiskServiceExportResponse), nil } -func (p *DisksServiceListRequest) MustSend() *DisksServiceListResponse { +func (p *DiskServiceExportRequest) MustSend() *DiskServiceExportResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -26290,102 +24414,30 @@ func (p *DisksServiceListRequest) MustSend() *DisksServiceListResponse { } // -// Get list of disks. -// [source] -// ---- -// GET /ovirt-engine/api/disks -// ---- -// You will get a XML response which will look like this one: -// [source,xml] -// ---- -// -// -// ... -// MyDisk -// MyDisk description -// -// -// 5345845248 -// MyDisk alias -// ... -// ok -// image -// false -// -// -// ... -// -// ... -// -// ---- -// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in the -// `search` parameter. +// Exports a disk to an export storage domain. // -type DisksServiceListResponse struct { - disks *DiskSlice -} - -func (p *DisksServiceListResponse) Disks() (*DiskSlice, bool) { - if p.disks != nil { - return p.disks, true - } - return nil, false -} - -func (p *DisksServiceListResponse) MustDisks() *DiskSlice { - if p.disks == nil { - panic("disks in response does not exist") - } - return p.disks +type DiskServiceExportResponse struct { } // -// Get list of disks. -// [source] -// ---- -// GET /ovirt-engine/api/disks -// ---- -// You will get a XML response which will look like this one: -// [source,xml] -// ---- -// -// -// ... -// MyDisk -// MyDisk description -// -// -// 5345845248 -// MyDisk alias -// ... -// ok -// image -// false -// -// -// ... -// -// ... -// -// ---- -// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in the -// `search` parameter. +// Exports a disk to an export storage domain. // -func (p *DisksService) List() *DisksServiceListRequest { - return &DisksServiceListRequest{DisksService: p} +func (p *DiskService) Export() *DiskServiceExportRequest { + return &DiskServiceExportRequest{DiskService: p} } // -// Add a new lun disk to the storage domain. +// Retrieves the description of the disk. // -type DisksServiceAddLunRequest struct { - DisksService *DisksService - header map[string]string - query map[string]string - disk *Disk +type DiskServiceGetRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + allContent *bool + follow *string } -func (p *DisksServiceAddLunRequest) Header(key, value string) *DisksServiceAddLunRequest { +func (p *DiskServiceGetRequest) Header(key, value string) *DiskServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -26393,7 +24445,7 @@ func (p *DisksServiceAddLunRequest) Header(key, value string) *DisksServiceAddLu return p } -func (p *DisksServiceAddLunRequest) Query(key, value string) *DisksServiceAddLunRequest { +func (p *DiskServiceGetRequest) Query(key, value string) *DiskServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -26401,20 +24453,27 @@ func (p *DisksServiceAddLunRequest) Query(key, value string) *DisksServiceAddLun return p } -func (p *DisksServiceAddLunRequest) Disk(disk *Disk) *DisksServiceAddLunRequest { - p.disk = disk +func (p *DiskServiceGetRequest) AllContent(allContent bool) *DiskServiceGetRequest { + p.allContent = &allContent return p } -func (p *DisksServiceAddLunRequest) Send() (*DisksServiceAddLunResponse, error) { - rawURL := fmt.Sprintf("%s%s/lun", p.DisksService.connection.URL(), p.DisksService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Disk(p.disk) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskServiceGetRequest) Follow(follow string) *DiskServiceGetRequest { + p.follow = &follow + return p +} + +func (p *DiskServiceGetRequest) Send() (*DiskServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskService.connection.URL(), p.DiskService.path) values := make(url.Values) + if p.allContent != nil { + values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -26423,16 +24482,12 @@ func (p *DisksServiceAddLunRequest) Send() (*DisksServiceAddLunResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DisksService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -26447,18 +24502,18 @@ func (p *DisksServiceAddLunRequest) Send() (*DisksServiceAddLunResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DisksService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DisksService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DisksService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -26467,17 +24522,24 @@ func (p *DisksServiceAddLunRequest) Send() (*DisksServiceAddLunResponse, error) if err != nil { return nil, err } - p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustDisk() - return &DisksServiceAddLunResponse{disk: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DiskServiceGetResponse{disk: result}, nil } -func (p *DisksServiceAddLunRequest) MustSend() *DisksServiceAddLunResponse { +func (p *DiskServiceGetRequest) MustSend() *DiskServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -26486,20 +24548,20 @@ func (p *DisksServiceAddLunRequest) MustSend() *DisksServiceAddLunResponse { } // -// Add a new lun disk to the storage domain. +// Retrieves the description of the disk. // -type DisksServiceAddLunResponse struct { +type DiskServiceGetResponse struct { disk *Disk } -func (p *DisksServiceAddLunResponse) Disk() (*Disk, bool) { +func (p *DiskServiceGetResponse) Disk() (*Disk, bool) { if p.disk != nil { return p.disk, true } return nil, false } -func (p *DisksServiceAddLunResponse) MustDisk() *Disk { +func (p *DiskServiceGetResponse) MustDisk() *Disk { if p.disk == nil { panic("disk in response does not exist") } @@ -26507,23 +24569,55 @@ func (p *DisksServiceAddLunResponse) MustDisk() *Disk { } // -// Add a new lun disk to the storage domain. +// Retrieves the description of the disk. // -func (p *DisksService) AddLun() *DisksServiceAddLunRequest { - return &DisksServiceAddLunRequest{DisksService: p} +func (p *DiskService) Get() *DiskServiceGetRequest { + return &DiskServiceGetRequest{DiskService: p} } // -// Add a new disk to the storage domain with the specified size allocating space from the storage domain. +// Moves a disk to another storage domain. +// For example, to move the disk with identifier `123` to a storage domain with identifier `456` send the following +// request: +// [source] +// ---- +// POST /ovirt-engine/api/disks/123/move +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// +// +// ---- +// If the disk profile or the quota used currently by +// the disk aren't defined for the new storage domain, +// then they can be explicitly specified. If they aren't +// then the first available disk profile and the default +// quota are used. +// For example, to explicitly use disk profile `987` and +// quota `753` send a request body like this: +// [source,xml] +// ---- +// +// +// +// +// +// ---- // -type DisksServiceAddOnStorageDomainRequest struct { - DisksService *DisksService - header map[string]string - query map[string]string - disk *Disk +type DiskServiceMoveRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + async *bool + diskProfile *DiskProfile + filter *bool + quota *Quota + storageDomain *StorageDomain } -func (p *DisksServiceAddOnStorageDomainRequest) Header(key, value string) *DisksServiceAddOnStorageDomainRequest { +func (p *DiskServiceMoveRequest) Header(key, value string) *DiskServiceMoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -26531,7 +24625,7 @@ func (p *DisksServiceAddOnStorageDomainRequest) Header(key, value string) *Disks return p } -func (p *DisksServiceAddOnStorageDomainRequest) Query(key, value string) *DisksServiceAddOnStorageDomainRequest { +func (p *DiskServiceMoveRequest) Query(key, value string) *DiskServiceMoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -26539,15 +24633,43 @@ func (p *DisksServiceAddOnStorageDomainRequest) Query(key, value string) *DisksS return p } -func (p *DisksServiceAddOnStorageDomainRequest) Disk(disk *Disk) *DisksServiceAddOnStorageDomainRequest { - p.disk = disk +func (p *DiskServiceMoveRequest) Async(async bool) *DiskServiceMoveRequest { + p.async = &async return p } -func (p *DisksServiceAddOnStorageDomainRequest) Send() (*DisksServiceAddOnStorageDomainResponse, error) { - rawURL := fmt.Sprintf("%s%s/onstoragedomain", p.DisksService.connection.URL(), p.DisksService.path) +func (p *DiskServiceMoveRequest) DiskProfile(diskProfile *DiskProfile) *DiskServiceMoveRequest { + p.diskProfile = diskProfile + return p +} + +func (p *DiskServiceMoveRequest) Filter(filter bool) *DiskServiceMoveRequest { + p.filter = &filter + return p +} + +func (p *DiskServiceMoveRequest) Quota(quota *Quota) *DiskServiceMoveRequest { + p.quota = quota + return p +} + +func (p *DiskServiceMoveRequest) StorageDomain(storageDomain *StorageDomain) *DiskServiceMoveRequest { + p.storageDomain = storageDomain + return p +} + +func (p *DiskServiceMoveRequest) Send() (*DiskServiceMoveResponse, error) { + rawURL := fmt.Sprintf("%s%s/move", p.DiskService.connection.URL(), p.DiskService.path) actionBuilder := NewActionBuilder() - actionBuilder.Disk(p.disk) + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.DiskProfile(p.diskProfile) + if p.filter != nil { + actionBuilder.Filter(*p.filter) + } + actionBuilder.Quota(p.quota) + actionBuilder.StorageDomain(p.storageDomain) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -26570,7 +24692,7 @@ func (p *DisksServiceAddOnStorageDomainRequest) Send() (*DisksServiceAddOnStorag return nil, err } - for hk, hv := range p.DisksService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -26585,18 +24707,18 @@ func (p *DisksServiceAddOnStorageDomainRequest) Send() (*DisksServiceAddOnStorag req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DisksService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DisksService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DisksService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -26605,17 +24727,16 @@ func (p *DisksServiceAddOnStorageDomainRequest) Send() (*DisksServiceAddOnStorag if err != nil { return nil, err } - p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustDisk() - return &DisksServiceAddOnStorageDomainResponse{disk: result}, nil + return new(DiskServiceMoveResponse), nil } -func (p *DisksServiceAddOnStorageDomainRequest) MustSend() *DisksServiceAddOnStorageDomainResponse { +func (p *DiskServiceMoveRequest) MustSend() *DiskServiceMoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -26624,81 +24745,88 @@ func (p *DisksServiceAddOnStorageDomainRequest) MustSend() *DisksServiceAddOnSto } // -// Add a new disk to the storage domain with the specified size allocating space from the storage domain. -// -type DisksServiceAddOnStorageDomainResponse struct { - disk *Disk -} - -func (p *DisksServiceAddOnStorageDomainResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true - } - return nil, false -} - -func (p *DisksServiceAddOnStorageDomainResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") - } - return p.disk -} - -// -// Add a new disk to the storage domain with the specified size allocating space from the storage domain. -// -func (p *DisksService) AddOnStorageDomain() *DisksServiceAddOnStorageDomainRequest { - return &DisksServiceAddOnStorageDomainRequest{DisksService: p} -} - -// -// Reference to a service managing a specific disk. -// -func (op *DisksService) DiskService(id string) *DiskService { - return NewDiskService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Moves a disk to another storage domain. +// For example, to move the disk with identifier `123` to a storage domain with identifier `456` send the following +// request: +// [source] +// ---- +// POST /ovirt-engine/api/disks/123/move +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// +// +// ---- +// If the disk profile or the quota used currently by +// the disk aren't defined for the new storage domain, +// then they can be explicitly specified. If they aren't +// then the first available disk profile and the default +// quota are used. +// For example, to explicitly use disk profile `987` and +// quota `753` send a request body like this: +// [source,xml] +// ---- +// +// +// +// +// +// ---- // -func (op *DisksService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.DiskService(path), nil - } - return op.DiskService(path[:index]).Service(path[index+1:]) -} - -func (op *DisksService) String() string { - return fmt.Sprintf("DisksService:%s", op.path) +type DiskServiceMoveResponse struct { } // +// Moves a disk to another storage domain. +// For example, to move the disk with identifier `123` to a storage domain with identifier `456` send the following +// request: +// [source] +// ---- +// POST /ovirt-engine/api/disks/123/move +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// +// +// ---- +// If the disk profile or the quota used currently by +// the disk aren't defined for the new storage domain, +// then they can be explicitly specified. If they aren't +// then the first available disk profile and the default +// quota are used. +// For example, to explicitly use disk profile `987` and +// quota `753` send a request body like this: +// [source,xml] +// ---- +// +// +// +// +// +// ---- // -type VirtualFunctionAllowedNetworkService struct { - BaseService -} - -func NewVirtualFunctionAllowedNetworkService(connection *Connection, path string) *VirtualFunctionAllowedNetworkService { - var result VirtualFunctionAllowedNetworkService - result.connection = connection - result.path = path - return &result +func (p *DiskService) Move() *DiskServiceMoveRequest { + return &DiskServiceMoveRequest{DiskService: p} } // +// Reduces the size of the disk image. +// Invokes _reduce_ on the logical volume (i.e. this is only applicable for block storage domains). +// This is applicable for floating disks and disks attached to non-running virtual machines. +// There is no need to specify the size as the optimal size is calculated automatically. // -type VirtualFunctionAllowedNetworkServiceGetRequest struct { - VirtualFunctionAllowedNetworkService *VirtualFunctionAllowedNetworkService - header map[string]string - query map[string]string - follow *string +type DiskServiceReduceRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + async *bool } -func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Header(key, value string) *VirtualFunctionAllowedNetworkServiceGetRequest { +func (p *DiskServiceReduceRequest) Header(key, value string) *DiskServiceReduceRequest { if p.header == nil { p.header = make(map[string]string) } @@ -26706,7 +24834,7 @@ func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Header(key, value strin return p } -func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Query(key, value string) *VirtualFunctionAllowedNetworkServiceGetRequest { +func (p *DiskServiceReduceRequest) Query(key, value string) *DiskServiceReduceRequest { if p.query == nil { p.query = make(map[string]string) } @@ -26714,18 +24842,22 @@ func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Query(key, value string return p } -func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Follow(follow string) *VirtualFunctionAllowedNetworkServiceGetRequest { - p.follow = &follow +func (p *DiskServiceReduceRequest) Async(async bool) *DiskServiceReduceRequest { + p.async = &async return p } -func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Send() (*VirtualFunctionAllowedNetworkServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VirtualFunctionAllowedNetworkService.connection.URL(), p.VirtualFunctionAllowedNetworkService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *DiskServiceReduceRequest) Send() (*DiskServiceReduceResponse, error) { + rawURL := fmt.Sprintf("%s%s/reduce", p.DiskService.connection.URL(), p.DiskService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -26734,12 +24866,16 @@ func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Send() (*VirtualFunctio if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VirtualFunctionAllowedNetworkService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -26754,18 +24890,18 @@ func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Send() (*VirtualFunctio req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VirtualFunctionAllowedNetworkService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VirtualFunctionAllowedNetworkService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VirtualFunctionAllowedNetworkService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -26774,24 +24910,16 @@ func (p *VirtualFunctionAllowedNetworkServiceGetRequest) Send() (*VirtualFunctio if err != nil { return nil, err } - p.VirtualFunctionAllowedNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VirtualFunctionAllowedNetworkServiceGetResponse{network: result}, nil + return new(DiskServiceReduceResponse), nil } -func (p *VirtualFunctionAllowedNetworkServiceGetRequest) MustSend() *VirtualFunctionAllowedNetworkServiceGetResponse { +func (p *DiskServiceReduceRequest) MustSend() *DiskServiceReduceResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -26800,41 +24928,51 @@ func (p *VirtualFunctionAllowedNetworkServiceGetRequest) MustSend() *VirtualFunc } // +// Reduces the size of the disk image. +// Invokes _reduce_ on the logical volume (i.e. this is only applicable for block storage domains). +// This is applicable for floating disks and disks attached to non-running virtual machines. +// There is no need to specify the size as the optimal size is calculated automatically. // -type VirtualFunctionAllowedNetworkServiceGetResponse struct { - network *Network -} - -func (p *VirtualFunctionAllowedNetworkServiceGetResponse) Network() (*Network, bool) { - if p.network != nil { - return p.network, true - } - return nil, false -} - -func (p *VirtualFunctionAllowedNetworkServiceGetResponse) MustNetwork() *Network { - if p.network == nil { - panic("network in response does not exist") - } - return p.network +type DiskServiceReduceResponse struct { } // +// Reduces the size of the disk image. +// Invokes _reduce_ on the logical volume (i.e. this is only applicable for block storage domains). +// This is applicable for floating disks and disks attached to non-running virtual machines. +// There is no need to specify the size as the optimal size is calculated automatically. // -func (p *VirtualFunctionAllowedNetworkService) Get() *VirtualFunctionAllowedNetworkServiceGetRequest { - return &VirtualFunctionAllowedNetworkServiceGetRequest{VirtualFunctionAllowedNetworkService: p} +func (p *DiskService) Reduce() *DiskServiceReduceRequest { + return &DiskServiceReduceRequest{DiskService: p} } // +// Refreshes a direct LUN disk with up-to-date information from the storage. +// Refreshing a direct LUN disk is useful when: +// - The LUN was added using the API without the host parameter, and therefore does not contain +// any information from the storage (see <>). +// - New information about the LUN is available on the storage and you want to update the LUN with it. +// To refresh direct LUN disk `123` using host `456`, send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/disks/123/refreshlun +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// +// +// ---- // -type VirtualFunctionAllowedNetworkServiceRemoveRequest struct { - VirtualFunctionAllowedNetworkService *VirtualFunctionAllowedNetworkService - header map[string]string - query map[string]string - async *bool +type DiskServiceRefreshLunRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + host *Host } -func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Header(key, value string) *VirtualFunctionAllowedNetworkServiceRemoveRequest { +func (p *DiskServiceRefreshLunRequest) Header(key, value string) *DiskServiceRefreshLunRequest { if p.header == nil { p.header = make(map[string]string) } @@ -26842,7 +24980,7 @@ func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Header(key, value st return p } -func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Query(key, value string) *VirtualFunctionAllowedNetworkServiceRemoveRequest { +func (p *DiskServiceRefreshLunRequest) Query(key, value string) *DiskServiceRefreshLunRequest { if p.query == nil { p.query = make(map[string]string) } @@ -26850,18 +24988,20 @@ func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Query(key, value str return p } -func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Async(async bool) *VirtualFunctionAllowedNetworkServiceRemoveRequest { - p.async = &async +func (p *DiskServiceRefreshLunRequest) Host(host *Host) *DiskServiceRefreshLunRequest { + p.host = host return p } -func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Send() (*VirtualFunctionAllowedNetworkServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VirtualFunctionAllowedNetworkService.connection.URL(), p.VirtualFunctionAllowedNetworkService.path) - values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} +func (p *DiskServiceRefreshLunRequest) Send() (*DiskServiceRefreshLunResponse, error) { + rawURL := fmt.Sprintf("%s%s/refreshlun", p.DiskService.connection.URL(), p.DiskService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Host(p.host) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -26870,12 +25010,16 @@ func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Send() (*VirtualFunc if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VirtualFunctionAllowedNetworkService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -26890,18 +25034,18 @@ func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Send() (*VirtualFunc req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VirtualFunctionAllowedNetworkService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VirtualFunctionAllowedNetworkService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VirtualFunctionAllowedNetworkService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -26910,19 +25054,16 @@ func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) Send() (*VirtualFunc if err != nil { return nil, err } - p.VirtualFunctionAllowedNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(VirtualFunctionAllowedNetworkServiceRemoveResponse), nil + return new(DiskServiceRefreshLunResponse), nil } -func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) MustSend() *VirtualFunctionAllowedNetworkServiceRemoveResponse { +func (p *DiskServiceRefreshLunRequest) MustSend() *DiskServiceRefreshLunResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -26931,58 +25072,61 @@ func (p *VirtualFunctionAllowedNetworkServiceRemoveRequest) MustSend() *VirtualF } // +// Refreshes a direct LUN disk with up-to-date information from the storage. +// Refreshing a direct LUN disk is useful when: +// - The LUN was added using the API without the host parameter, and therefore does not contain +// any information from the storage (see <>). +// - New information about the LUN is available on the storage and you want to update the LUN with it. +// To refresh direct LUN disk `123` using host `456`, send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/disks/123/refreshlun +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// +// +// ---- // -type VirtualFunctionAllowedNetworkServiceRemoveResponse struct { +type DiskServiceRefreshLunResponse struct { } // +// Refreshes a direct LUN disk with up-to-date information from the storage. +// Refreshing a direct LUN disk is useful when: +// - The LUN was added using the API without the host parameter, and therefore does not contain +// any information from the storage (see <>). +// - New information about the LUN is available on the storage and you want to update the LUN with it. +// To refresh direct LUN disk `123` using host `456`, send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/disks/123/refreshlun +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// +// +// ---- // -func (p *VirtualFunctionAllowedNetworkService) Remove() *VirtualFunctionAllowedNetworkServiceRemoveRequest { - return &VirtualFunctionAllowedNetworkServiceRemoveRequest{VirtualFunctionAllowedNetworkService: p} +func (p *DiskService) RefreshLun() *DiskServiceRefreshLunRequest { + return &DiskServiceRefreshLunRequest{DiskService: p} } // -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *VirtualFunctionAllowedNetworkService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *VirtualFunctionAllowedNetworkService) String() string { - return fmt.Sprintf("VirtualFunctionAllowedNetworkService:%s", op.path) -} - -// -// Manages the set of scheduling policy units available in the system. -// -type SchedulingPolicyUnitsService struct { - BaseService -} - -func NewSchedulingPolicyUnitsService(connection *Connection, path string) *SchedulingPolicyUnitsService { - var result SchedulingPolicyUnitsService - result.connection = connection - result.path = path - return &result -} - -// -// Returns the list of scheduling policy units available in the system. -// The order of the returned list of scheduling policy units isn't guaranteed. +// Removes a disk. // -type SchedulingPolicyUnitsServiceListRequest struct { - SchedulingPolicyUnitsService *SchedulingPolicyUnitsService - header map[string]string - query map[string]string - filter *bool - follow *string - max *int64 +type DiskServiceRemoveRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + async *bool } -func (p *SchedulingPolicyUnitsServiceListRequest) Header(key, value string) *SchedulingPolicyUnitsServiceListRequest { +func (p *DiskServiceRemoveRequest) Header(key, value string) *DiskServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -26990,7 +25134,7 @@ func (p *SchedulingPolicyUnitsServiceListRequest) Header(key, value string) *Sch return p } -func (p *SchedulingPolicyUnitsServiceListRequest) Query(key, value string) *SchedulingPolicyUnitsServiceListRequest { +func (p *DiskServiceRemoveRequest) Query(key, value string) *DiskServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -26998,34 +25142,16 @@ func (p *SchedulingPolicyUnitsServiceListRequest) Query(key, value string) *Sche return p } -func (p *SchedulingPolicyUnitsServiceListRequest) Filter(filter bool) *SchedulingPolicyUnitsServiceListRequest { - p.filter = &filter - return p -} - -func (p *SchedulingPolicyUnitsServiceListRequest) Follow(follow string) *SchedulingPolicyUnitsServiceListRequest { - p.follow = &follow - return p -} - -func (p *SchedulingPolicyUnitsServiceListRequest) Max(max int64) *SchedulingPolicyUnitsServiceListRequest { - p.max = &max +func (p *DiskServiceRemoveRequest) Async(async bool) *DiskServiceRemoveRequest { + p.async = &async return p } -func (p *SchedulingPolicyUnitsServiceListRequest) Send() (*SchedulingPolicyUnitsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SchedulingPolicyUnitsService.connection.URL(), p.SchedulingPolicyUnitsService.path) +func (p *DiskServiceRemoveRequest) Send() (*DiskServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskService.connection.URL(), p.DiskService.path) values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -27036,12 +25162,12 @@ func (p *SchedulingPolicyUnitsServiceListRequest) Send() (*SchedulingPolicyUnits if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.SchedulingPolicyUnitsService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -27056,18 +25182,18 @@ func (p *SchedulingPolicyUnitsServiceListRequest) Send() (*SchedulingPolicyUnits req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SchedulingPolicyUnitsService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SchedulingPolicyUnitsService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SchedulingPolicyUnitsService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27076,24 +25202,19 @@ func (p *SchedulingPolicyUnitsServiceListRequest) Send() (*SchedulingPolicyUnits if err != nil { return nil, err } - p.SchedulingPolicyUnitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLSchedulingPolicyUnitReadMany(reader, nil) - if err != nil { - return nil, err - } - return &SchedulingPolicyUnitsServiceListResponse{units: result}, nil + return new(DiskServiceRemoveResponse), nil } -func (p *SchedulingPolicyUnitsServiceListRequest) MustSend() *SchedulingPolicyUnitsServiceListResponse { +func (p *DiskServiceRemoveRequest) MustSend() *DiskServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27102,92 +25223,32 @@ func (p *SchedulingPolicyUnitsServiceListRequest) MustSend() *SchedulingPolicyUn } // -// Returns the list of scheduling policy units available in the system. -// The order of the returned list of scheduling policy units isn't guaranteed. -// -type SchedulingPolicyUnitsServiceListResponse struct { - units *SchedulingPolicyUnitSlice -} - -func (p *SchedulingPolicyUnitsServiceListResponse) Units() (*SchedulingPolicyUnitSlice, bool) { - if p.units != nil { - return p.units, true - } - return nil, false -} - -func (p *SchedulingPolicyUnitsServiceListResponse) MustUnits() *SchedulingPolicyUnitSlice { - if p.units == nil { - panic("units in response does not exist") - } - return p.units -} - -// -// Returns the list of scheduling policy units available in the system. -// The order of the returned list of scheduling policy units isn't guaranteed. -// -func (p *SchedulingPolicyUnitsService) List() *SchedulingPolicyUnitsServiceListRequest { - return &SchedulingPolicyUnitsServiceListRequest{SchedulingPolicyUnitsService: p} -} - -// -// -func (op *SchedulingPolicyUnitsService) UnitService(id string) *SchedulingPolicyUnitService { - return NewSchedulingPolicyUnitService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Removes a disk. // -func (op *SchedulingPolicyUnitsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.UnitService(path), nil - } - return op.UnitService(path[:index]).Service(path[index+1:]) -} - -func (op *SchedulingPolicyUnitsService) String() string { - return fmt.Sprintf("SchedulingPolicyUnitsService:%s", op.path) +type DiskServiceRemoveResponse struct { } // -// Manages a single disk available in a storage domain attached to a data center. -// IMPORTANT: Since version 4.2 of the engine this service is intended only to list disks available in the storage -// domain, and to register unregistered disks. All the other operations, like copying a disk, moving a disk, etc, have -// been deprecated and will be removed in the future. To perform those operations use the <>, or the <>. +// Removes a disk. // -type AttachedStorageDomainDiskService struct { - BaseService -} - -func NewAttachedStorageDomainDiskService(connection *Connection, path string) *AttachedStorageDomainDiskService { - var result AttachedStorageDomainDiskService - result.connection = connection - result.path = path - return &result +func (p *DiskService) Remove() *DiskServiceRemoveRequest { + return &DiskServiceRemoveRequest{DiskService: p} } // -// Copies a disk to the specified storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To copy a disk use the <> -// operation of the service that manages that disk. +// Sparsify the disk. +// Sparsification frees space in the disk image that is not used by its +// filesystem. As a result, the image will occupy less space on the storage. +// Currently sparsification works only on disks without snapshots. Disks +// having derived disks are also not allowed. // -type AttachedStorageDomainDiskServiceCopyRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string - disk *Disk - storageDomain *StorageDomain +type DiskServiceSparsifyRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string } -func (p *AttachedStorageDomainDiskServiceCopyRequest) Header(key, value string) *AttachedStorageDomainDiskServiceCopyRequest { +func (p *DiskServiceSparsifyRequest) Header(key, value string) *DiskServiceSparsifyRequest { if p.header == nil { p.header = make(map[string]string) } @@ -27195,7 +25256,7 @@ func (p *AttachedStorageDomainDiskServiceCopyRequest) Header(key, value string) return p } -func (p *AttachedStorageDomainDiskServiceCopyRequest) Query(key, value string) *AttachedStorageDomainDiskServiceCopyRequest { +func (p *DiskServiceSparsifyRequest) Query(key, value string) *DiskServiceSparsifyRequest { if p.query == nil { p.query = make(map[string]string) } @@ -27203,21 +25264,9 @@ func (p *AttachedStorageDomainDiskServiceCopyRequest) Query(key, value string) * return p } -func (p *AttachedStorageDomainDiskServiceCopyRequest) Disk(disk *Disk) *AttachedStorageDomainDiskServiceCopyRequest { - p.disk = disk - return p -} - -func (p *AttachedStorageDomainDiskServiceCopyRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainDiskServiceCopyRequest { - p.storageDomain = storageDomain - return p -} - -func (p *AttachedStorageDomainDiskServiceCopyRequest) Send() (*AttachedStorageDomainDiskServiceCopyResponse, error) { - rawURL := fmt.Sprintf("%s%s/copy", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) +func (p *DiskServiceSparsifyRequest) Send() (*DiskServiceSparsifyResponse, error) { + rawURL := fmt.Sprintf("%s%s/sparsify", p.DiskService.connection.URL(), p.DiskService.path) actionBuilder := NewActionBuilder() - actionBuilder.Disk(p.disk) - actionBuilder.StorageDomain(p.storageDomain) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -27240,7 +25289,7 @@ func (p *AttachedStorageDomainDiskServiceCopyRequest) Send() (*AttachedStorageDo return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -27255,18 +25304,18 @@ func (p *AttachedStorageDomainDiskServiceCopyRequest) Send() (*AttachedStorageDo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27275,16 +25324,16 @@ func (p *AttachedStorageDomainDiskServiceCopyRequest) Send() (*AttachedStorageDo if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(AttachedStorageDomainDiskServiceCopyResponse), nil + return new(DiskServiceSparsifyResponse), nil } -func (p *AttachedStorageDomainDiskServiceCopyRequest) MustSend() *AttachedStorageDomainDiskServiceCopyResponse { +func (p *DiskServiceSparsifyRequest) MustSend() *DiskServiceSparsifyResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27293,38 +25342,58 @@ func (p *AttachedStorageDomainDiskServiceCopyRequest) MustSend() *AttachedStorag } // -// Copies a disk to the specified storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To copy a disk use the <> -// operation of the service that manages that disk. +// Sparsify the disk. +// Sparsification frees space in the disk image that is not used by its +// filesystem. As a result, the image will occupy less space on the storage. +// Currently sparsification works only on disks without snapshots. Disks +// having derived disks are also not allowed. // -type AttachedStorageDomainDiskServiceCopyResponse struct { +type DiskServiceSparsifyResponse struct { } // -// Copies a disk to the specified storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To copy a disk use the <> -// operation of the service that manages that disk. +// Sparsify the disk. +// Sparsification frees space in the disk image that is not used by its +// filesystem. As a result, the image will occupy less space on the storage. +// Currently sparsification works only on disks without snapshots. Disks +// having derived disks are also not allowed. // -func (p *AttachedStorageDomainDiskService) Copy() *AttachedStorageDomainDiskServiceCopyRequest { - return &AttachedStorageDomainDiskServiceCopyRequest{AttachedStorageDomainDiskService: p} +func (p *DiskService) Sparsify() *DiskServiceSparsifyRequest { + return &DiskServiceSparsifyRequest{DiskService: p} } // -// Exports a disk to an export storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To export a disk use the <> -// operation of the service that manages that disk. +// Updates the parameters of the specified disk. +// This operation allows updating the following floating disk properties: +// * For Image disks: `provisioned_size`, `alias`, `description`, `wipe_after_delete`, `shareable`, `backup` and `disk_profile`. +// * For LUN disks: `alias`, `description` and `shareable`. +// * For Cinder and Managed Block disks: `provisioned_size`, `alias` and `description`. +// * For VM attached disks, the `qcow_version` can also be updated. +// For example, a disk's update can be done by using the following request: +// [source] +// ---- +// PUT /ovirt-engine/api/disks/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// qcow2_v3 +// new-alias +// new-desc +// +// ---- +// Since the backend operation is asynchronous, the disk element that is returned +// to the user might not be synced with the changed properties. // -type AttachedStorageDomainDiskServiceExportRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string - storageDomain *StorageDomain +type DiskServiceUpdateRequest struct { + DiskService *DiskService + header map[string]string + query map[string]string + disk *Disk } -func (p *AttachedStorageDomainDiskServiceExportRequest) Header(key, value string) *AttachedStorageDomainDiskServiceExportRequest { +func (p *DiskServiceUpdateRequest) Header(key, value string) *DiskServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -27332,7 +25401,7 @@ func (p *AttachedStorageDomainDiskServiceExportRequest) Header(key, value string return p } -func (p *AttachedStorageDomainDiskServiceExportRequest) Query(key, value string) *AttachedStorageDomainDiskServiceExportRequest { +func (p *DiskServiceUpdateRequest) Query(key, value string) *DiskServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -27340,19 +25409,13 @@ func (p *AttachedStorageDomainDiskServiceExportRequest) Query(key, value string) return p } -func (p *AttachedStorageDomainDiskServiceExportRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainDiskServiceExportRequest { - p.storageDomain = storageDomain +func (p *DiskServiceUpdateRequest) Disk(disk *Disk) *DiskServiceUpdateRequest { + p.disk = disk return p } -func (p *AttachedStorageDomainDiskServiceExportRequest) Send() (*AttachedStorageDomainDiskServiceExportResponse, error) { - rawURL := fmt.Sprintf("%s%s/export", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) - actionBuilder := NewActionBuilder() - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskServiceUpdateRequest) Send() (*DiskServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskService.connection.URL(), p.DiskService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -27364,14 +25427,17 @@ func (p *AttachedStorageDomainDiskServiceExportRequest) Send() (*AttachedStorage } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLDiskWriteOne(writer, p.disk, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DiskService.connection.headers { req.Header.Add(hk, hv) } @@ -27386,18 +25452,18 @@ func (p *AttachedStorageDomainDiskServiceExportRequest) Send() (*AttachedStorage req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DiskService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DiskService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DiskService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27406,16 +25472,24 @@ func (p *AttachedStorageDomainDiskServiceExportRequest) Send() (*AttachedStorage if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(AttachedStorageDomainDiskServiceExportResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DiskServiceUpdateResponse{disk: result}, nil } -func (p *AttachedStorageDomainDiskServiceExportRequest) MustSend() *AttachedStorageDomainDiskServiceExportResponse { +func (p *DiskServiceUpdateRequest) MustSend() *DiskServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27424,35 +25498,158 @@ func (p *AttachedStorageDomainDiskServiceExportRequest) MustSend() *AttachedStor } // -// Exports a disk to an export storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To export a disk use the <> -// operation of the service that manages that disk. +// Updates the parameters of the specified disk. +// This operation allows updating the following floating disk properties: +// * For Image disks: `provisioned_size`, `alias`, `description`, `wipe_after_delete`, `shareable`, `backup` and `disk_profile`. +// * For LUN disks: `alias`, `description` and `shareable`. +// * For Cinder and Managed Block disks: `provisioned_size`, `alias` and `description`. +// * For VM attached disks, the `qcow_version` can also be updated. +// For example, a disk's update can be done by using the following request: +// [source] +// ---- +// PUT /ovirt-engine/api/disks/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// qcow2_v3 +// new-alias +// new-desc +// +// ---- +// Since the backend operation is asynchronous, the disk element that is returned +// to the user might not be synced with the changed properties. // -type AttachedStorageDomainDiskServiceExportResponse struct { +type DiskServiceUpdateResponse struct { + disk *Disk +} + +func (p *DiskServiceUpdateResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true + } + return nil, false +} + +func (p *DiskServiceUpdateResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") + } + return p.disk } // -// Exports a disk to an export storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To export a disk use the <> -// operation of the service that manages that disk. +// Updates the parameters of the specified disk. +// This operation allows updating the following floating disk properties: +// * For Image disks: `provisioned_size`, `alias`, `description`, `wipe_after_delete`, `shareable`, `backup` and `disk_profile`. +// * For LUN disks: `alias`, `description` and `shareable`. +// * For Cinder and Managed Block disks: `provisioned_size`, `alias` and `description`. +// * For VM attached disks, the `qcow_version` can also be updated. +// For example, a disk's update can be done by using the following request: +// [source] +// ---- +// PUT /ovirt-engine/api/disks/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// qcow2_v3 +// new-alias +// new-desc +// +// ---- +// Since the backend operation is asynchronous, the disk element that is returned +// to the user might not be synced with the changed properties. // -func (p *AttachedStorageDomainDiskService) Export() *AttachedStorageDomainDiskServiceExportRequest { - return &AttachedStorageDomainDiskServiceExportRequest{AttachedStorageDomainDiskService: p} +func (p *DiskService) Update() *DiskServiceUpdateRequest { + return &DiskServiceUpdateRequest{DiskService: p} } // -// Retrieves the description of the disk. +// Reference to the service that manages the DiskSnapshots. +// For example, to list all disk snapshots under the disks resource '123': +// .... +// GET /ovirt-engine/api/disks/123/disksnapshots +// .... +// For example, to retrieve a specific disk snapshot '789' under the disk resource '123': +// .... +// GET /ovirt-engine/api/disks/123/disksnapshots/789 +// .... // -type AttachedStorageDomainDiskServiceGetRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string - follow *string +func (op *DiskService) DiskSnapshotsService() *DiskSnapshotsService { + return NewDiskSnapshotsService(op.connection, fmt.Sprintf("%s/disksnapshots", op.path)) } -func (p *AttachedStorageDomainDiskServiceGetRequest) Header(key, value string) *AttachedStorageDomainDiskServiceGetRequest { +// +// Reference to the service that manages the permissions assigned to the disk. +// +func (op *DiskService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +} + +// +// +func (op *DiskService) StatisticsService() *StatisticsService { + return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DiskService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "disksnapshots" { + return op.DiskSnapshotsService(), nil + } + if strings.HasPrefix(path, "disksnapshots/") { + return op.DiskSnapshotsService().Service(path[14:]) + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + if path == "statistics" { + return op.StatisticsService(), nil + } + if strings.HasPrefix(path, "statistics/") { + return op.StatisticsService().Service(path[11:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *DiskService) String() string { + return fmt.Sprintf("DiskService:%s", op.path) +} + +// +// +type DiskSnapshotService struct { + BaseService +} + +func NewDiskSnapshotService(connection *Connection, path string) *DiskSnapshotService { + var result DiskSnapshotService + result.connection = connection + result.path = path + return &result +} + +// +// +type DiskSnapshotServiceGetRequest struct { + DiskSnapshotService *DiskSnapshotService + header map[string]string + query map[string]string + follow *string +} + +func (p *DiskSnapshotServiceGetRequest) Header(key, value string) *DiskSnapshotServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -27460,7 +25657,7 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) Header(key, value string) * return p } -func (p *AttachedStorageDomainDiskServiceGetRequest) Query(key, value string) *AttachedStorageDomainDiskServiceGetRequest { +func (p *DiskSnapshotServiceGetRequest) Query(key, value string) *DiskSnapshotServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -27468,13 +25665,13 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) Query(key, value string) *A return p } -func (p *AttachedStorageDomainDiskServiceGetRequest) Follow(follow string) *AttachedStorageDomainDiskServiceGetRequest { +func (p *DiskSnapshotServiceGetRequest) Follow(follow string) *DiskSnapshotServiceGetRequest { p.follow = &follow return p } -func (p *AttachedStorageDomainDiskServiceGetRequest) Send() (*AttachedStorageDomainDiskServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) +func (p *DiskSnapshotServiceGetRequest) Send() (*DiskSnapshotServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskSnapshotService.connection.URL(), p.DiskSnapshotService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -27493,7 +25690,7 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) Send() (*AttachedStorageDom return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DiskSnapshotService.connection.headers { req.Header.Add(hk, hv) } @@ -27508,18 +25705,18 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) Send() (*AttachedStorageDom req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DiskSnapshotService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DiskSnapshotService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DiskSnapshotService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27528,7 +25725,7 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) Send() (*AttachedStorageDom if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskSnapshotService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -27538,14 +25735,14 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) Send() (*AttachedStorageDom return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") + result, err := XMLDiskSnapshotReadOne(reader, nil, "") if err != nil { return nil, err } - return &AttachedStorageDomainDiskServiceGetResponse{disk: result}, nil + return &DiskSnapshotServiceGetResponse{snapshot: result}, nil } -func (p *AttachedStorageDomainDiskServiceGetRequest) MustSend() *AttachedStorageDomainDiskServiceGetResponse { +func (p *DiskSnapshotServiceGetRequest) MustSend() *DiskSnapshotServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27554,49 +25751,41 @@ func (p *AttachedStorageDomainDiskServiceGetRequest) MustSend() *AttachedStorage } // -// Retrieves the description of the disk. // -type AttachedStorageDomainDiskServiceGetResponse struct { - disk *Disk +type DiskSnapshotServiceGetResponse struct { + snapshot *DiskSnapshot } -func (p *AttachedStorageDomainDiskServiceGetResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true +func (p *DiskSnapshotServiceGetResponse) Snapshot() (*DiskSnapshot, bool) { + if p.snapshot != nil { + return p.snapshot, true } return nil, false } -func (p *AttachedStorageDomainDiskServiceGetResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") +func (p *DiskSnapshotServiceGetResponse) MustSnapshot() *DiskSnapshot { + if p.snapshot == nil { + panic("snapshot in response does not exist") } - return p.disk + return p.snapshot } // -// Retrieves the description of the disk. // -func (p *AttachedStorageDomainDiskService) Get() *AttachedStorageDomainDiskServiceGetRequest { - return &AttachedStorageDomainDiskServiceGetRequest{AttachedStorageDomainDiskService: p} +func (p *DiskSnapshotService) Get() *DiskSnapshotServiceGetRequest { + return &DiskSnapshotServiceGetRequest{DiskSnapshotService: p} } // -// Moves a disk to another storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To move a disk use the <> -// operation of the service that manages that disk. // -type AttachedStorageDomainDiskServiceMoveRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string - async *bool - filter *bool - storageDomain *StorageDomain +type DiskSnapshotServiceRemoveRequest struct { + DiskSnapshotService *DiskSnapshotService + header map[string]string + query map[string]string + async *bool } -func (p *AttachedStorageDomainDiskServiceMoveRequest) Header(key, value string) *AttachedStorageDomainDiskServiceMoveRequest { +func (p *DiskSnapshotServiceRemoveRequest) Header(key, value string) *DiskSnapshotServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -27604,7 +25793,7 @@ func (p *AttachedStorageDomainDiskServiceMoveRequest) Header(key, value string) return p } -func (p *AttachedStorageDomainDiskServiceMoveRequest) Query(key, value string) *AttachedStorageDomainDiskServiceMoveRequest { +func (p *DiskSnapshotServiceRemoveRequest) Query(key, value string) *DiskSnapshotServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -27612,36 +25801,18 @@ func (p *AttachedStorageDomainDiskServiceMoveRequest) Query(key, value string) * return p } -func (p *AttachedStorageDomainDiskServiceMoveRequest) Async(async bool) *AttachedStorageDomainDiskServiceMoveRequest { +func (p *DiskSnapshotServiceRemoveRequest) Async(async bool) *DiskSnapshotServiceRemoveRequest { p.async = &async return p } -func (p *AttachedStorageDomainDiskServiceMoveRequest) Filter(filter bool) *AttachedStorageDomainDiskServiceMoveRequest { - p.filter = &filter - return p -} - -func (p *AttachedStorageDomainDiskServiceMoveRequest) StorageDomain(storageDomain *StorageDomain) *AttachedStorageDomainDiskServiceMoveRequest { - p.storageDomain = storageDomain - return p -} - -func (p *AttachedStorageDomainDiskServiceMoveRequest) Send() (*AttachedStorageDomainDiskServiceMoveResponse, error) { - rawURL := fmt.Sprintf("%s%s/move", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) - actionBuilder := NewActionBuilder() +func (p *DiskSnapshotServiceRemoveRequest) Send() (*DiskSnapshotServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskSnapshotService.connection.URL(), p.DiskSnapshotService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.filter != nil { - actionBuilder.Filter(*p.filter) - } - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -27650,16 +25821,12 @@ func (p *AttachedStorageDomainDiskServiceMoveRequest) Send() (*AttachedStorageDo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DiskSnapshotService.connection.headers { req.Header.Add(hk, hv) } @@ -27674,18 +25841,18 @@ func (p *AttachedStorageDomainDiskServiceMoveRequest) Send() (*AttachedStorageDo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DiskSnapshotService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DiskSnapshotService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DiskSnapshotService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27694,16 +25861,19 @@ func (p *AttachedStorageDomainDiskServiceMoveRequest) Send() (*AttachedStorageDo if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskSnapshotService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(AttachedStorageDomainDiskServiceMoveResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(DiskSnapshotServiceRemoveResponse), nil } -func (p *AttachedStorageDomainDiskServiceMoveRequest) MustSend() *AttachedStorageDomainDiskServiceMoveResponse { +func (p *DiskSnapshotServiceRemoveRequest) MustSend() *DiskSnapshotServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27712,34 +25882,58 @@ func (p *AttachedStorageDomainDiskServiceMoveRequest) MustSend() *AttachedStorag } // -// Moves a disk to another storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To move a disk use the <> -// operation of the service that manages that disk. // -type AttachedStorageDomainDiskServiceMoveResponse struct { +type DiskSnapshotServiceRemoveResponse struct { } // -// Moves a disk to another storage domain. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To move a disk use the <> -// operation of the service that manages that disk. // -func (p *AttachedStorageDomainDiskService) Move() *AttachedStorageDomainDiskServiceMoveRequest { - return &AttachedStorageDomainDiskServiceMoveRequest{AttachedStorageDomainDiskService: p} +func (p *DiskSnapshotService) Remove() *DiskSnapshotServiceRemoveRequest { + return &DiskSnapshotServiceRemoveRequest{DiskSnapshotService: p} } // -// Registers an unregistered disk. +// Service locator method, returns individual service on which the URI is dispatched. // -type AttachedStorageDomainDiskServiceRegisterRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string +func (op *DiskSnapshotService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *AttachedStorageDomainDiskServiceRegisterRequest) Header(key, value string) *AttachedStorageDomainDiskServiceRegisterRequest { +func (op *DiskSnapshotService) String() string { + return fmt.Sprintf("DiskSnapshotService:%s", op.path) +} + +// +// Manages the collection of disk snapshots available in an storage domain. +// +type DiskSnapshotsService struct { + BaseService +} + +func NewDiskSnapshotsService(connection *Connection, path string) *DiskSnapshotsService { + var result DiskSnapshotsService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the list of disk snapshots of the storage domain. +// The order of the returned list of disk snapshots isn't guaranteed. +// +type DiskSnapshotsServiceListRequest struct { + DiskSnapshotsService *DiskSnapshotsService + header map[string]string + query map[string]string + follow *string + includeActive *bool + max *int64 +} + +func (p *DiskSnapshotsServiceListRequest) Header(key, value string) *DiskSnapshotsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -27747,7 +25941,7 @@ func (p *AttachedStorageDomainDiskServiceRegisterRequest) Header(key, value stri return p } -func (p *AttachedStorageDomainDiskServiceRegisterRequest) Query(key, value string) *AttachedStorageDomainDiskServiceRegisterRequest { +func (p *DiskSnapshotsServiceListRequest) Query(key, value string) *DiskSnapshotsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -27755,14 +25949,36 @@ func (p *AttachedStorageDomainDiskServiceRegisterRequest) Query(key, value strin return p } -func (p *AttachedStorageDomainDiskServiceRegisterRequest) Send() (*AttachedStorageDomainDiskServiceRegisterResponse, error) { - rawURL := fmt.Sprintf("%s%s/register", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) - actionBuilder := NewActionBuilder() - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *DiskSnapshotsServiceListRequest) Follow(follow string) *DiskSnapshotsServiceListRequest { + p.follow = &follow + return p +} + +func (p *DiskSnapshotsServiceListRequest) IncludeActive(includeActive bool) *DiskSnapshotsServiceListRequest { + p.includeActive = &includeActive + return p +} + +func (p *DiskSnapshotsServiceListRequest) Max(max int64) *DiskSnapshotsServiceListRequest { + p.max = &max + return p +} + +func (p *DiskSnapshotsServiceListRequest) Send() (*DiskSnapshotsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DiskSnapshotsService.connection.URL(), p.DiskSnapshotsService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.includeActive != nil { + values["include_active"] = []string{fmt.Sprintf("%v", *p.includeActive)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -27771,16 +25987,12 @@ func (p *AttachedStorageDomainDiskServiceRegisterRequest) Send() (*AttachedStora if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DiskSnapshotsService.connection.headers { req.Header.Add(hk, hv) } @@ -27795,18 +26007,18 @@ func (p *AttachedStorageDomainDiskServiceRegisterRequest) Send() (*AttachedStora req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DiskSnapshotsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DiskSnapshotsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DiskSnapshotsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27815,16 +26027,24 @@ func (p *AttachedStorageDomainDiskServiceRegisterRequest) Send() (*AttachedStora if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DiskSnapshotsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(AttachedStorageDomainDiskServiceRegisterResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskSnapshotReadMany(reader, nil) + if err != nil { + return nil, err + } + return &DiskSnapshotsServiceListResponse{snapshots: result}, nil } -func (p *AttachedStorageDomainDiskServiceRegisterRequest) MustSend() *AttachedStorageDomainDiskServiceRegisterResponse { +func (p *DiskSnapshotsServiceListRequest) MustSend() *DiskSnapshotsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27833,31 +26053,205 @@ func (p *AttachedStorageDomainDiskServiceRegisterRequest) MustSend() *AttachedSt } // -// Registers an unregistered disk. +// Returns the list of disk snapshots of the storage domain. +// The order of the returned list of disk snapshots isn't guaranteed. // -type AttachedStorageDomainDiskServiceRegisterResponse struct { +type DiskSnapshotsServiceListResponse struct { + snapshots *DiskSnapshotSlice +} + +func (p *DiskSnapshotsServiceListResponse) Snapshots() (*DiskSnapshotSlice, bool) { + if p.snapshots != nil { + return p.snapshots, true + } + return nil, false +} + +func (p *DiskSnapshotsServiceListResponse) MustSnapshots() *DiskSnapshotSlice { + if p.snapshots == nil { + panic("snapshots in response does not exist") + } + return p.snapshots } // -// Registers an unregistered disk. +// Returns the list of disk snapshots of the storage domain. +// The order of the returned list of disk snapshots isn't guaranteed. // -func (p *AttachedStorageDomainDiskService) Register() *AttachedStorageDomainDiskServiceRegisterRequest { - return &AttachedStorageDomainDiskServiceRegisterRequest{AttachedStorageDomainDiskService: p} +func (p *DiskSnapshotsService) List() *DiskSnapshotsServiceListRequest { + return &DiskSnapshotsServiceListRequest{DiskSnapshotsService: p} } // -// Removes a disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To remove a disk use the <> -// operation of the service that manages that disk. // -type AttachedStorageDomainDiskServiceRemoveRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string +func (op *DiskSnapshotsService) SnapshotService(id string) *DiskSnapshotService { + return NewDiskSnapshotService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *AttachedStorageDomainDiskServiceRemoveRequest) Header(key, value string) *AttachedStorageDomainDiskServiceRemoveRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DiskSnapshotsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.SnapshotService(path), nil + } + return op.SnapshotService(path[:index]).Service(path[index+1:]) +} + +func (op *DiskSnapshotsService) String() string { + return fmt.Sprintf("DiskSnapshotsService:%s", op.path) +} + +// +// Manages the collection of disks available in the system. +// +type DisksService struct { + BaseService +} + +func NewDisksService(connection *Connection, path string) *DisksService { + var result DisksService + result.connection = connection + result.path = path + return &result +} + +// +// Adds a new floating disk. +// There are three types of disks that can be added - disk image, direct LUN and +// https://wiki.openstack.org/wiki/Cinder[Cinder] disk. +// *Adding a new image disk:* +// When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size` +// and `format` attributes. +// Note that block storage domains (i.e., storage domains with the <> of iSCSI or +// FCP) don't support the combination of the raw `format` with `sparse=true`, so `sparse=false` must be stated +// explicitly. +// To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain +// with an id `123`, send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// +// +// +// mydisk +// 1048576 +// cow +// +// ---- +// *Adding a new direct LUN disk:* +// When adding a new floating direct LUN via the API, there are two flavors that can be used: +// . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and +// to retrieve basic information about the LUN (e.g., size and serial). +// . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never +// accessed. +// To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and +// `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`), +// send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// mylun +// +// +// iscsi +// +// +//
10.35.10.20
+// 3260 +// iqn.2017-01.com.myhost:444 +//
+//
+//
+//
+// ---- +// To create a new floating direct LUN disk without using a host, remove the `host` element. +// *Adding a new Cinder disk:* +// To create a new floating Cinder disk, send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// +// myceph +// +// +// +// cinderDomain +// +// +// 1073741824 +// virtio +// raw +// +// ---- +// *Adding a floating disks in order to upload disk snapshots:* +// Since version 4.2 of the engine it is possible to upload disks with +// snapshots. This request should be used to create the base image of the +// images chain (The consecutive disk snapshots (images), should be created +// using `disk-attachments` element when creating a snapshot). +// The disk has to be created with the same disk identifier and image identifier +// of the uploaded image. I.e. the identifiers should be saved as part of the +// backup process. The image identifier can be also fetched using the +// `qemu-img info` command. For example, if the disk image is stored into +// a file named `b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img`: +// [source,shell] +// ---- +// $ qemu-img info b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img +// image: b548366b-fb51-4b41-97be-733c887fe305 +// file format: qcow2 +// virtual size: 1.0G (1073741824 bytes) +// disk size: 196K +// cluster_size: 65536 +// backing file: ad58716a-1fe9-481f-815e-664de1df04eb +// backing file format: raw +// ---- +// To create a disk with with the disk identifier and image identifier obtained +// with the `qemu-img info` command shown above, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// b548366b-fb51-4b41-97be-733c887fe305 +// +// +// +// mydisk +// 1048576 +// cow +// +// ---- +// +type DisksServiceAddRequest struct { + DisksService *DisksService + header map[string]string + query map[string]string + disk *Disk +} + +func (p *DisksServiceAddRequest) Header(key, value string) *DisksServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -27865,7 +26259,7 @@ func (p *AttachedStorageDomainDiskServiceRemoveRequest) Header(key, value string return p } -func (p *AttachedStorageDomainDiskServiceRemoveRequest) Query(key, value string) *AttachedStorageDomainDiskServiceRemoveRequest { +func (p *DisksServiceAddRequest) Query(key, value string) *DisksServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -27873,8 +26267,13 @@ func (p *AttachedStorageDomainDiskServiceRemoveRequest) Query(key, value string) return p } -func (p *AttachedStorageDomainDiskServiceRemoveRequest) Send() (*AttachedStorageDomainDiskServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) +func (p *DisksServiceAddRequest) Disk(disk *Disk) *DisksServiceAddRequest { + p.disk = disk + return p +} + +func (p *DisksServiceAddRequest) Send() (*DisksServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DisksService.connection.URL(), p.DisksService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -27884,12 +26283,19 @@ func (p *AttachedStorageDomainDiskServiceRemoveRequest) Send() (*AttachedStorage if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLDiskWriteOne(writer, p.disk, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DisksService.connection.headers { req.Header.Add(hk, hv) } @@ -27904,18 +26310,18 @@ func (p *AttachedStorageDomainDiskServiceRemoveRequest) Send() (*AttachedStorage req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DisksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DisksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DisksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -27924,19 +26330,24 @@ func (p *AttachedStorageDomainDiskServiceRemoveRequest) Send() (*AttachedStorage if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(AttachedStorageDomainDiskServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLDiskReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &DisksServiceAddResponse{disk: result}, nil } -func (p *AttachedStorageDomainDiskServiceRemoveRequest) MustSend() *AttachedStorageDomainDiskServiceRemoveResponse { +func (p *DisksServiceAddRequest) MustSend() *DisksServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -27945,162 +26356,318 @@ func (p *AttachedStorageDomainDiskServiceRemoveRequest) MustSend() *AttachedStor } // -// Removes a disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To remove a disk use the <> -// operation of the service that manages that disk. -// -type AttachedStorageDomainDiskServiceRemoveResponse struct { -} - -// -// Removes a disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To remove a disk use the <> -// operation of the service that manages that disk. -// -func (p *AttachedStorageDomainDiskService) Remove() *AttachedStorageDomainDiskServiceRemoveRequest { - return &AttachedStorageDomainDiskServiceRemoveRequest{AttachedStorageDomainDiskService: p} -} - -// -// Sparsify the disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To remove a disk use the <> -// operation of the service that manages that disk. -// -type AttachedStorageDomainDiskServiceSparsifyRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string -} - -func (p *AttachedStorageDomainDiskServiceSparsifyRequest) Header(key, value string) *AttachedStorageDomainDiskServiceSparsifyRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *AttachedStorageDomainDiskServiceSparsifyRequest) Query(key, value string) *AttachedStorageDomainDiskServiceSparsifyRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p +// Adds a new floating disk. +// There are three types of disks that can be added - disk image, direct LUN and +// https://wiki.openstack.org/wiki/Cinder[Cinder] disk. +// *Adding a new image disk:* +// When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size` +// and `format` attributes. +// Note that block storage domains (i.e., storage domains with the <> of iSCSI or +// FCP) don't support the combination of the raw `format` with `sparse=true`, so `sparse=false` must be stated +// explicitly. +// To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain +// with an id `123`, send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// +// +// +// mydisk +// 1048576 +// cow +// +// ---- +// *Adding a new direct LUN disk:* +// When adding a new floating direct LUN via the API, there are two flavors that can be used: +// . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and +// to retrieve basic information about the LUN (e.g., size and serial). +// . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never +// accessed. +// To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and +// `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`), +// send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// mylun +// +// +// iscsi +// +// +//
10.35.10.20
+// 3260 +// iqn.2017-01.com.myhost:444 +//
+//
+//
+//
+// ---- +// To create a new floating direct LUN disk without using a host, remove the `host` element. +// *Adding a new Cinder disk:* +// To create a new floating Cinder disk, send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// +// myceph +// +// +// +// cinderDomain +// +// +// 1073741824 +// virtio +// raw +// +// ---- +// *Adding a floating disks in order to upload disk snapshots:* +// Since version 4.2 of the engine it is possible to upload disks with +// snapshots. This request should be used to create the base image of the +// images chain (The consecutive disk snapshots (images), should be created +// using `disk-attachments` element when creating a snapshot). +// The disk has to be created with the same disk identifier and image identifier +// of the uploaded image. I.e. the identifiers should be saved as part of the +// backup process. The image identifier can be also fetched using the +// `qemu-img info` command. For example, if the disk image is stored into +// a file named `b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img`: +// [source,shell] +// ---- +// $ qemu-img info b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img +// image: b548366b-fb51-4b41-97be-733c887fe305 +// file format: qcow2 +// virtual size: 1.0G (1073741824 bytes) +// disk size: 196K +// cluster_size: 65536 +// backing file: ad58716a-1fe9-481f-815e-664de1df04eb +// backing file format: raw +// ---- +// To create a disk with with the disk identifier and image identifier obtained +// with the `qemu-img info` command shown above, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// b548366b-fb51-4b41-97be-733c887fe305 +// +// +// +// mydisk +// 1048576 +// cow +// +// ---- +// +type DisksServiceAddResponse struct { + disk *Disk } -func (p *AttachedStorageDomainDiskServiceSparsifyRequest) Send() (*AttachedStorageDomainDiskServiceSparsifyResponse, error) { - rawURL := fmt.Sprintf("%s%s/sparsify", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) - actionBuilder := NewActionBuilder() - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) - if err != nil { - return nil, err - } - - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { - req.Header.Add(hk, hv) - } - - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } - - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction +func (p *DisksServiceAddResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true } - return new(AttachedStorageDomainDiskServiceSparsifyResponse), nil + return nil, false } -func (p *AttachedStorageDomainDiskServiceSparsifyRequest) MustSend() *AttachedStorageDomainDiskServiceSparsifyResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v +func (p *DisksServiceAddResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") } + return p.disk } // -// Sparsify the disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To remove a disk use the <> -// operation of the service that manages that disk. -// -type AttachedStorageDomainDiskServiceSparsifyResponse struct { -} - -// -// Sparsify the disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To remove a disk use the <> -// operation of the service that manages that disk. +// Adds a new floating disk. +// There are three types of disks that can be added - disk image, direct LUN and +// https://wiki.openstack.org/wiki/Cinder[Cinder] disk. +// *Adding a new image disk:* +// When creating a new floating image <>, the API requires the `storage_domain`, `provisioned_size` +// and `format` attributes. +// Note that block storage domains (i.e., storage domains with the <> of iSCSI or +// FCP) don't support the combination of the raw `format` with `sparse=true`, so `sparse=false` must be stated +// explicitly. +// To create a new floating image disk with specified `provisioned_size`, `format` and `name` on a storage domain +// with an id `123`, send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// +// +// +// mydisk +// 1048576 +// cow +// +// ---- +// *Adding a new direct LUN disk:* +// When adding a new floating direct LUN via the API, there are two flavors that can be used: +// . With a `host` element - in this case, the host is used for sanity checks (e.g., that the LUN is visible) and +// to retrieve basic information about the LUN (e.g., size and serial). +// . Without a `host` element - in this case, the operation is a database-only operation, and the storage is never +// accessed. +// To create a new floating direct LUN disk with a `host` element with an id `123`, specified `alias`, `type` and +// `logical_unit` with an id `456` (that has the attributes `address`, `port` and `target`), +// send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// mylun +// +// +// iscsi +// +// +//
10.35.10.20
+// 3260 +// iqn.2017-01.com.myhost:444 +//
+//
+//
+//
+// ---- +// To create a new floating direct LUN disk without using a host, remove the `host` element. +// *Adding a new Cinder disk:* +// To create a new floating Cinder disk, send a request as follows: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// +// myceph +// +// +// +// cinderDomain +// +// +// 1073741824 +// virtio +// raw +// +// ---- +// *Adding a floating disks in order to upload disk snapshots:* +// Since version 4.2 of the engine it is possible to upload disks with +// snapshots. This request should be used to create the base image of the +// images chain (The consecutive disk snapshots (images), should be created +// using `disk-attachments` element when creating a snapshot). +// The disk has to be created with the same disk identifier and image identifier +// of the uploaded image. I.e. the identifiers should be saved as part of the +// backup process. The image identifier can be also fetched using the +// `qemu-img info` command. For example, if the disk image is stored into +// a file named `b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img`: +// [source,shell] +// ---- +// $ qemu-img info b7a4c6c5-443b-47c5-967f-6abc79675e8b/myimage.img +// image: b548366b-fb51-4b41-97be-733c887fe305 +// file format: qcow2 +// virtual size: 1.0G (1073741824 bytes) +// disk size: 196K +// cluster_size: 65536 +// backing file: ad58716a-1fe9-481f-815e-664de1df04eb +// backing file format: raw +// ---- +// To create a disk with with the disk identifier and image identifier obtained +// with the `qemu-img info` command shown above, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/disks +// ---- +// With a request body as follows: +// [source,xml] +// ---- +// +// b548366b-fb51-4b41-97be-733c887fe305 +// +// +// +// mydisk +// 1048576 +// cow +// +// ---- // -func (p *AttachedStorageDomainDiskService) Sparsify() *AttachedStorageDomainDiskServiceSparsifyRequest { - return &AttachedStorageDomainDiskServiceSparsifyRequest{AttachedStorageDomainDiskService: p} +func (p *DisksService) Add() *DisksServiceAddRequest { + return &DisksServiceAddRequest{DisksService: p} } // -// Updates the disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To update a disk use the -// <> operation of the service that manages that disk. +// Get list of disks. +// [source] +// ---- +// GET /ovirt-engine/api/disks +// ---- +// You will get a XML response which will look like this one: +// [source,xml] +// ---- +// +// +// ... +// MyDisk +// MyDisk description +// +// +// 5345845248 +// MyDisk alias +// ... +// ok +// image +// false +// +// +// ... +// +// ... +// +// ---- +// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type AttachedStorageDomainDiskServiceUpdateRequest struct { - AttachedStorageDomainDiskService *AttachedStorageDomainDiskService - header map[string]string - query map[string]string - disk *Disk +type DisksServiceListRequest struct { + DisksService *DisksService + header map[string]string + query map[string]string + caseSensitive *bool + follow *string + max *int64 + search *string } -func (p *AttachedStorageDomainDiskServiceUpdateRequest) Header(key, value string) *AttachedStorageDomainDiskServiceUpdateRequest { +func (p *DisksServiceListRequest) Header(key, value string) *DisksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -28108,7 +26675,7 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) Header(key, value string return p } -func (p *AttachedStorageDomainDiskServiceUpdateRequest) Query(key, value string) *AttachedStorageDomainDiskServiceUpdateRequest { +func (p *DisksServiceListRequest) Query(key, value string) *DisksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -28116,14 +26683,45 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) Query(key, value string) return p } -func (p *AttachedStorageDomainDiskServiceUpdateRequest) Disk(disk *Disk) *AttachedStorageDomainDiskServiceUpdateRequest { - p.disk = disk +func (p *DisksServiceListRequest) CaseSensitive(caseSensitive bool) *DisksServiceListRequest { + p.caseSensitive = &caseSensitive return p } -func (p *AttachedStorageDomainDiskServiceUpdateRequest) Send() (*AttachedStorageDomainDiskServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainDiskService.connection.URL(), p.AttachedStorageDomainDiskService.path) +func (p *DisksServiceListRequest) Follow(follow string) *DisksServiceListRequest { + p.follow = &follow + return p +} + +func (p *DisksServiceListRequest) Max(max int64) *DisksServiceListRequest { + p.max = &max + return p +} + +func (p *DisksServiceListRequest) Search(search string) *DisksServiceListRequest { + p.search = &search + return p +} + +func (p *DisksServiceListRequest) Send() (*DisksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.DisksService.connection.URL(), p.DisksService.path) values := make(url.Values) + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -28132,19 +26730,12 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) Send() (*AttachedStorage if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLDiskWriteOne(writer, p.disk, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainDiskService.connection.headers { + for hk, hv := range p.DisksService.connection.headers { req.Header.Add(hk, hv) } @@ -28159,18 +26750,18 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) Send() (*AttachedStorage req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainDiskService.connection.authenticate() + token, err := p.DisksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainDiskService.connection.client.Do(req) + resp, err := p.DisksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainDiskService.connection.logFunc != nil { + if p.DisksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -28179,7 +26770,7 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) Send() (*AttachedStorage if err != nil { return nil, err } - p.AttachedStorageDomainDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -28189,14 +26780,14 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) Send() (*AttachedStorage return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") + result, err := XMLDiskReadMany(reader, nil) if err != nil { return nil, err } - return &AttachedStorageDomainDiskServiceUpdateResponse{disk: result}, nil + return &DisksServiceListResponse{disks: result}, nil } -func (p *AttachedStorageDomainDiskServiceUpdateRequest) MustSend() *AttachedStorageDomainDiskServiceUpdateResponse { +func (p *DisksServiceListRequest) MustSend() *DisksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -28205,103 +26796,102 @@ func (p *AttachedStorageDomainDiskServiceUpdateRequest) MustSend() *AttachedStor } // -// Updates the disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To update a disk use the -// <> operation of the service that manages that disk. +// Get list of disks. +// [source] +// ---- +// GET /ovirt-engine/api/disks +// ---- +// You will get a XML response which will look like this one: +// [source,xml] +// ---- +// +// +// ... +// MyDisk +// MyDisk description +// +// +// 5345845248 +// MyDisk alias +// ... +// ok +// image +// false +// +// +// ... +// +// ... +// +// ---- +// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type AttachedStorageDomainDiskServiceUpdateResponse struct { - disk *Disk +type DisksServiceListResponse struct { + disks *DiskSlice } -func (p *AttachedStorageDomainDiskServiceUpdateResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true +func (p *DisksServiceListResponse) Disks() (*DiskSlice, bool) { + if p.disks != nil { + return p.disks, true } return nil, false } -func (p *AttachedStorageDomainDiskServiceUpdateResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") - } - return p.disk -} - -// -// Updates the disk. -// IMPORTANT: Since version 4.2 of the engine this operation is deprecated, and preserved only for backwards -// compatibility. It will be removed in the future. To update a disk use the -// <> operation of the service that manages that disk. -// -func (p *AttachedStorageDomainDiskService) Update() *AttachedStorageDomainDiskServiceUpdateRequest { - return &AttachedStorageDomainDiskServiceUpdateRequest{AttachedStorageDomainDiskService: p} -} - -// -// Reference to the service that manages the permissions assigned to the disk. -// -func (op *AttachedStorageDomainDiskService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) -} - -// -// -func (op *AttachedStorageDomainDiskService) StatisticsService() *StatisticsService { - return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *AttachedStorageDomainDiskService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) - } - if path == "statistics" { - return op.StatisticsService(), nil - } - if strings.HasPrefix(path, "statistics/") { - return op.StatisticsService().Service(path[11:]) +func (p *DisksServiceListResponse) MustDisks() *DiskSlice { + if p.disks == nil { + panic("disks in response does not exist") } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *AttachedStorageDomainDiskService) String() string { - return fmt.Sprintf("AttachedStorageDomainDiskService:%s", op.path) + return p.disks } // -// Describes how an external network provider is provisioned by the system on the host. +// Get list of disks. +// [source] +// ---- +// GET /ovirt-engine/api/disks +// ---- +// You will get a XML response which will look like this one: +// [source,xml] +// ---- +// +// +// ... +// MyDisk +// MyDisk description +// +// +// 5345845248 +// MyDisk alias +// ... +// ok +// image +// false +// +// +// ... +// +// ... +// +// ---- +// The order of the returned list of disks is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type ExternalNetworkProviderConfigurationService struct { - BaseService -} - -func NewExternalNetworkProviderConfigurationService(connection *Connection, path string) *ExternalNetworkProviderConfigurationService { - var result ExternalNetworkProviderConfigurationService - result.connection = connection - result.path = path - return &result +func (p *DisksService) List() *DisksServiceListRequest { + return &DisksServiceListRequest{DisksService: p} } // -// Returns the information about an external network provider on the host. +// Add a new lun disk to the storage domain. // -type ExternalNetworkProviderConfigurationServiceGetRequest struct { - ExternalNetworkProviderConfigurationService *ExternalNetworkProviderConfigurationService - header map[string]string - query map[string]string - follow *string +type DisksServiceAddLunRequest struct { + DisksService *DisksService + header map[string]string + query map[string]string + disk *Disk } -func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Header(key, value string) *ExternalNetworkProviderConfigurationServiceGetRequest { +func (p *DisksServiceAddLunRequest) Header(key, value string) *DisksServiceAddLunRequest { if p.header == nil { p.header = make(map[string]string) } @@ -28309,7 +26899,7 @@ func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Header(key, valu return p } -func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Query(key, value string) *ExternalNetworkProviderConfigurationServiceGetRequest { +func (p *DisksServiceAddLunRequest) Query(key, value string) *DisksServiceAddLunRequest { if p.query == nil { p.query = make(map[string]string) } @@ -28317,18 +26907,20 @@ func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Query(key, value return p } -func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Follow(follow string) *ExternalNetworkProviderConfigurationServiceGetRequest { - p.follow = &follow +func (p *DisksServiceAddLunRequest) Disk(disk *Disk) *DisksServiceAddLunRequest { + p.disk = disk return p } -func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Send() (*ExternalNetworkProviderConfigurationServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ExternalNetworkProviderConfigurationService.connection.URL(), p.ExternalNetworkProviderConfigurationService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *DisksServiceAddLunRequest) Send() (*DisksServiceAddLunResponse, error) { + rawURL := fmt.Sprintf("%s%s/lun", p.DisksService.connection.URL(), p.DisksService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Disk(p.disk) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -28337,12 +26929,16 @@ func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Send() (*Externa if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.ExternalNetworkProviderConfigurationService.connection.headers { + for hk, hv := range p.DisksService.connection.headers { req.Header.Add(hk, hv) } @@ -28357,18 +26953,18 @@ func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Send() (*Externa req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ExternalNetworkProviderConfigurationService.connection.authenticate() + token, err := p.DisksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ExternalNetworkProviderConfigurationService.connection.client.Do(req) + resp, err := p.DisksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ExternalNetworkProviderConfigurationService.connection.logFunc != nil { + if p.DisksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -28377,24 +26973,17 @@ func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Send() (*Externa if err != nil { return nil, err } - p.ExternalNetworkProviderConfigurationService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLExternalNetworkProviderConfigurationReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &ExternalNetworkProviderConfigurationServiceGetResponse{configuration: result}, nil + result := action.MustDisk() + return &DisksServiceAddLunResponse{disk: result}, nil } -func (p *ExternalNetworkProviderConfigurationServiceGetRequest) MustSend() *ExternalNetworkProviderConfigurationServiceGetResponse { +func (p *DisksServiceAddLunRequest) MustSend() *DisksServiceAddLunResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -28403,72 +26992,44 @@ func (p *ExternalNetworkProviderConfigurationServiceGetRequest) MustSend() *Exte } // -// Returns the information about an external network provider on the host. +// Add a new lun disk to the storage domain. // -type ExternalNetworkProviderConfigurationServiceGetResponse struct { - configuration *ExternalNetworkProviderConfiguration +type DisksServiceAddLunResponse struct { + disk *Disk } -func (p *ExternalNetworkProviderConfigurationServiceGetResponse) Configuration() (*ExternalNetworkProviderConfiguration, bool) { - if p.configuration != nil { - return p.configuration, true +func (p *DisksServiceAddLunResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true } return nil, false } -func (p *ExternalNetworkProviderConfigurationServiceGetResponse) MustConfiguration() *ExternalNetworkProviderConfiguration { - if p.configuration == nil { - panic("configuration in response does not exist") - } - return p.configuration -} - -// -// Returns the information about an external network provider on the host. -// -func (p *ExternalNetworkProviderConfigurationService) Get() *ExternalNetworkProviderConfigurationServiceGetRequest { - return &ExternalNetworkProviderConfigurationServiceGetRequest{ExternalNetworkProviderConfigurationService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *ExternalNetworkProviderConfigurationService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *DisksServiceAddLunResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *ExternalNetworkProviderConfigurationService) String() string { - return fmt.Sprintf("ExternalNetworkProviderConfigurationService:%s", op.path) + return p.disk } // -// Manages the set of scheduling policies available in the system. +// Add a new lun disk to the storage domain. // -type SchedulingPoliciesService struct { - BaseService -} - -func NewSchedulingPoliciesService(connection *Connection, path string) *SchedulingPoliciesService { - var result SchedulingPoliciesService - result.connection = connection - result.path = path - return &result +func (p *DisksService) AddLun() *DisksServiceAddLunRequest { + return &DisksServiceAddLunRequest{DisksService: p} } // -// Add a new scheduling policy to the system. +// Add a new disk to the storage domain with the specified size allocating space from the storage domain. // -type SchedulingPoliciesServiceAddRequest struct { - SchedulingPoliciesService *SchedulingPoliciesService - header map[string]string - query map[string]string - policy *SchedulingPolicy +type DisksServiceAddOnStorageDomainRequest struct { + DisksService *DisksService + header map[string]string + query map[string]string + disk *Disk } -func (p *SchedulingPoliciesServiceAddRequest) Header(key, value string) *SchedulingPoliciesServiceAddRequest { +func (p *DisksServiceAddOnStorageDomainRequest) Header(key, value string) *DisksServiceAddOnStorageDomainRequest { if p.header == nil { p.header = make(map[string]string) } @@ -28476,7 +27037,7 @@ func (p *SchedulingPoliciesServiceAddRequest) Header(key, value string) *Schedul return p } -func (p *SchedulingPoliciesServiceAddRequest) Query(key, value string) *SchedulingPoliciesServiceAddRequest { +func (p *DisksServiceAddOnStorageDomainRequest) Query(key, value string) *DisksServiceAddOnStorageDomainRequest { if p.query == nil { p.query = make(map[string]string) } @@ -28484,13 +27045,19 @@ func (p *SchedulingPoliciesServiceAddRequest) Query(key, value string) *Scheduli return p } -func (p *SchedulingPoliciesServiceAddRequest) Policy(policy *SchedulingPolicy) *SchedulingPoliciesServiceAddRequest { - p.policy = policy +func (p *DisksServiceAddOnStorageDomainRequest) Disk(disk *Disk) *DisksServiceAddOnStorageDomainRequest { + p.disk = disk return p } -func (p *SchedulingPoliciesServiceAddRequest) Send() (*SchedulingPoliciesServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SchedulingPoliciesService.connection.URL(), p.SchedulingPoliciesService.path) +func (p *DisksServiceAddOnStorageDomainRequest) Send() (*DisksServiceAddOnStorageDomainResponse, error) { + rawURL := fmt.Sprintf("%s%s/onstoragedomain", p.DisksService.connection.URL(), p.DisksService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Disk(p.disk) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -28502,17 +27069,14 @@ func (p *SchedulingPoliciesServiceAddRequest) Send() (*SchedulingPoliciesService } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLSchedulingPolicyWriteOne(writer, p.policy, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SchedulingPoliciesService.connection.headers { + for hk, hv := range p.DisksService.connection.headers { req.Header.Add(hk, hv) } @@ -28527,18 +27091,18 @@ func (p *SchedulingPoliciesServiceAddRequest) Send() (*SchedulingPoliciesService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SchedulingPoliciesService.connection.authenticate() + token, err := p.DisksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SchedulingPoliciesService.connection.client.Do(req) + resp, err := p.DisksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SchedulingPoliciesService.connection.logFunc != nil { + if p.DisksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -28547,24 +27111,17 @@ func (p *SchedulingPoliciesServiceAddRequest) Send() (*SchedulingPoliciesService if err != nil { return nil, err } - p.SchedulingPoliciesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.DisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLSchedulingPolicyReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &SchedulingPoliciesServiceAddResponse{policy: result}, nil + result := action.MustDisk() + return &DisksServiceAddOnStorageDomainResponse{disk: result}, nil } -func (p *SchedulingPoliciesServiceAddRequest) MustSend() *SchedulingPoliciesServiceAddResponse { +func (p *DisksServiceAddOnStorageDomainRequest) MustSend() *DisksServiceAddOnStorageDomainResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -28573,47 +27130,107 @@ func (p *SchedulingPoliciesServiceAddRequest) MustSend() *SchedulingPoliciesServ } // -// Add a new scheduling policy to the system. +// Add a new disk to the storage domain with the specified size allocating space from the storage domain. // -type SchedulingPoliciesServiceAddResponse struct { - policy *SchedulingPolicy +type DisksServiceAddOnStorageDomainResponse struct { + disk *Disk } -func (p *SchedulingPoliciesServiceAddResponse) Policy() (*SchedulingPolicy, bool) { - if p.policy != nil { - return p.policy, true +func (p *DisksServiceAddOnStorageDomainResponse) Disk() (*Disk, bool) { + if p.disk != nil { + return p.disk, true } return nil, false } -func (p *SchedulingPoliciesServiceAddResponse) MustPolicy() *SchedulingPolicy { - if p.policy == nil { - panic("policy in response does not exist") +func (p *DisksServiceAddOnStorageDomainResponse) MustDisk() *Disk { + if p.disk == nil { + panic("disk in response does not exist") } - return p.policy + return p.disk } // -// Add a new scheduling policy to the system. +// Add a new disk to the storage domain with the specified size allocating space from the storage domain. // -func (p *SchedulingPoliciesService) Add() *SchedulingPoliciesServiceAddRequest { - return &SchedulingPoliciesServiceAddRequest{SchedulingPoliciesService: p} +func (p *DisksService) AddOnStorageDomain() *DisksServiceAddOnStorageDomainRequest { + return &DisksServiceAddOnStorageDomainRequest{DisksService: p} } // -// Returns the list of scheduling policies available in the system. -// The order of the returned list of scheduling policies isn't guaranteed. +// Reference to a service managing a specific disk. // -type SchedulingPoliciesServiceListRequest struct { - SchedulingPoliciesService *SchedulingPoliciesService - header map[string]string - query map[string]string - filter *bool - follow *string - max *int64 +func (op *DisksService) DiskService(id string) *DiskService { + return NewDiskService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *SchedulingPoliciesServiceListRequest) Header(key, value string) *SchedulingPoliciesServiceListRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *DisksService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.DiskService(path), nil + } + return op.DiskService(path[:index]).Service(path[index+1:]) +} + +func (op *DisksService) String() string { + return fmt.Sprintf("DisksService:%s", op.path) +} + +// +// A service to manage an event in the system. +// +type EventService struct { + BaseService +} + +func NewEventService(connection *Connection, path string) *EventService { + var result EventService + result.connection = connection + result.path = path + return &result +} + +// +// Get an event. +// An example of getting an event: +// [source] +// ---- +// GET /ovirt-engine/api/events/123 +// ---- +// [source,xml] +// ---- +// +// Host example.com was added by admin@internal-authz. +// 42 +// 135 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// +// ---- +// Note that the number of fields changes according to the information that resides on the event. +// For example, for storage domain related events you will get the storage domain reference, +// as well as the reference for the data center this storage domain resides in. +// +type EventServiceGetRequest struct { + EventService *EventService + header map[string]string + query map[string]string + follow *string +} + +func (p *EventServiceGetRequest) Header(key, value string) *EventServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -28621,7 +27238,7 @@ func (p *SchedulingPoliciesServiceListRequest) Header(key, value string) *Schedu return p } -func (p *SchedulingPoliciesServiceListRequest) Query(key, value string) *SchedulingPoliciesServiceListRequest { +func (p *EventServiceGetRequest) Query(key, value string) *EventServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -28629,36 +27246,18 @@ func (p *SchedulingPoliciesServiceListRequest) Query(key, value string) *Schedul return p } -func (p *SchedulingPoliciesServiceListRequest) Filter(filter bool) *SchedulingPoliciesServiceListRequest { - p.filter = &filter - return p -} - -func (p *SchedulingPoliciesServiceListRequest) Follow(follow string) *SchedulingPoliciesServiceListRequest { +func (p *EventServiceGetRequest) Follow(follow string) *EventServiceGetRequest { p.follow = &follow return p } -func (p *SchedulingPoliciesServiceListRequest) Max(max int64) *SchedulingPoliciesServiceListRequest { - p.max = &max - return p -} - -func (p *SchedulingPoliciesServiceListRequest) Send() (*SchedulingPoliciesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SchedulingPoliciesService.connection.URL(), p.SchedulingPoliciesService.path) +func (p *EventServiceGetRequest) Send() (*EventServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventService.connection.URL(), p.EventService.path) values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -28672,7 +27271,7 @@ func (p *SchedulingPoliciesServiceListRequest) Send() (*SchedulingPoliciesServic return nil, err } - for hk, hv := range p.SchedulingPoliciesService.connection.headers { + for hk, hv := range p.EventService.connection.headers { req.Header.Add(hk, hv) } @@ -28687,18 +27286,18 @@ func (p *SchedulingPoliciesServiceListRequest) Send() (*SchedulingPoliciesServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SchedulingPoliciesService.connection.authenticate() + token, err := p.EventService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SchedulingPoliciesService.connection.client.Do(req) + resp, err := p.EventService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SchedulingPoliciesService.connection.logFunc != nil { + if p.EventService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -28707,7 +27306,7 @@ func (p *SchedulingPoliciesServiceListRequest) Send() (*SchedulingPoliciesServic if err != nil { return nil, err } - p.SchedulingPoliciesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -28717,14 +27316,14 @@ func (p *SchedulingPoliciesServiceListRequest) Send() (*SchedulingPoliciesServic return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLSchedulingPolicyReadMany(reader, nil) + result, err := XMLEventReadOne(reader, nil, "") if err != nil { return nil, err } - return &SchedulingPoliciesServiceListResponse{policies: result}, nil + return &EventServiceGetResponse{event: result}, nil } -func (p *SchedulingPoliciesServiceListRequest) MustSend() *SchedulingPoliciesServiceListResponse { +func (p *EventServiceGetRequest) MustSend() *EventServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -28733,82 +27332,267 @@ func (p *SchedulingPoliciesServiceListRequest) MustSend() *SchedulingPoliciesSer } // -// Returns the list of scheduling policies available in the system. -// The order of the returned list of scheduling policies isn't guaranteed. +// Get an event. +// An example of getting an event: +// [source] +// ---- +// GET /ovirt-engine/api/events/123 +// ---- +// [source,xml] +// ---- +// +// Host example.com was added by admin@internal-authz. +// 42 +// 135 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// +// ---- +// Note that the number of fields changes according to the information that resides on the event. +// For example, for storage domain related events you will get the storage domain reference, +// as well as the reference for the data center this storage domain resides in. // -type SchedulingPoliciesServiceListResponse struct { - policies *SchedulingPolicySlice +type EventServiceGetResponse struct { + event *Event } -func (p *SchedulingPoliciesServiceListResponse) Policies() (*SchedulingPolicySlice, bool) { - if p.policies != nil { - return p.policies, true +func (p *EventServiceGetResponse) Event() (*Event, bool) { + if p.event != nil { + return p.event, true } return nil, false } -func (p *SchedulingPoliciesServiceListResponse) MustPolicies() *SchedulingPolicySlice { - if p.policies == nil { - panic("policies in response does not exist") +func (p *EventServiceGetResponse) MustEvent() *Event { + if p.event == nil { + panic("event in response does not exist") } - return p.policies + return p.event } // -// Returns the list of scheduling policies available in the system. -// The order of the returned list of scheduling policies isn't guaranteed. +// Get an event. +// An example of getting an event: +// [source] +// ---- +// GET /ovirt-engine/api/events/123 +// ---- +// [source,xml] +// ---- +// +// Host example.com was added by admin@internal-authz. +// 42 +// 135 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// +// ---- +// Note that the number of fields changes according to the information that resides on the event. +// For example, for storage domain related events you will get the storage domain reference, +// as well as the reference for the data center this storage domain resides in. // -func (p *SchedulingPoliciesService) List() *SchedulingPoliciesServiceListRequest { - return &SchedulingPoliciesServiceListRequest{SchedulingPoliciesService: p} +func (p *EventService) Get() *EventServiceGetRequest { + return &EventServiceGetRequest{EventService: p} } // +// Removes an event from internal audit log. +// An event can be removed by sending following request +// [source] +// ---- +// DELETE /ovirt-engine/api/events/123 +// ---- // -func (op *SchedulingPoliciesService) PolicyService(id string) *SchedulingPolicyService { - return NewSchedulingPolicyService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +type EventServiceRemoveRequest struct { + EventService *EventService + header map[string]string + query map[string]string + async *bool +} + +func (p *EventServiceRemoveRequest) Header(key, value string) *EventServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value + return p +} + +func (p *EventServiceRemoveRequest) Query(key, value string) *EventServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p +} + +func (p *EventServiceRemoveRequest) Async(async bool) *EventServiceRemoveRequest { + p.async = &async + return p +} + +func (p *EventServiceRemoveRequest) Send() (*EventServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventService.connection.URL(), p.EventService.path) + values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} + } + } + if len(values) > 0 { + rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) + } + req, err := http.NewRequest("DELETE", rawURL, nil) + if err != nil { + return nil, err + } + + for hk, hv := range p.EventService.connection.headers { + req.Header.Add(hk, hv) + } + + if p.header != nil { + for hk, hv := range p.header { + req.Header.Add(hk, hv) + } + } + + req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) + req.Header.Add("Version", "4") + req.Header.Add("Content-Type", "application/xml") + req.Header.Add("Accept", "application/xml") + // get OAuth access token + token, err := p.EventService.connection.authenticate() + if err != nil { + return nil, err + } + req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) + // Send the request and wait for the response + resp, err := p.EventService.connection.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if p.EventService.connection.logFunc != nil { + dumpReq, err := httputil.DumpRequestOut(req, true) + if err != nil { + return nil, err + } + dumpResp, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, err + } + p.EventService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + } + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(EventServiceRemoveResponse), nil +} + +func (p *EventServiceRemoveRequest) MustSend() *EventServiceRemoveResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// Removes an event from internal audit log. +// An event can be removed by sending following request +// [source] +// ---- +// DELETE /ovirt-engine/api/events/123 +// ---- +// +type EventServiceRemoveResponse struct { +} + +// +// Removes an event from internal audit log. +// An event can be removed by sending following request +// [source] +// ---- +// DELETE /ovirt-engine/api/events/123 +// ---- +// +func (p *EventService) Remove() *EventServiceRemoveRequest { + return &EventServiceRemoveRequest{EventService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *SchedulingPoliciesService) Service(path string) (Service, error) { +func (op *EventService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.PolicyService(path), nil - } - return op.PolicyService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *SchedulingPoliciesService) String() string { - return fmt.Sprintf("SchedulingPoliciesService:%s", op.path) +func (op *EventService) String() string { + return fmt.Sprintf("EventService:%s", op.path) } // +// A service to manage a specific event-subscription in the system. // -type ImageService struct { +type EventSubscriptionService struct { BaseService } -func NewImageService(connection *Connection, path string) *ImageService { - var result ImageService +func NewEventSubscriptionService(connection *Connection, path string) *EventSubscriptionService { + var result EventSubscriptionService result.connection = connection result.path = path return &result } // +// Gets the information about the event-subscription. +// For example to retrieve the information about the subscription of user '123' to +// the event 'vm_console_detected': +// .... +// GET /ovirt-engine/api/users/123/vm_console_detected +// .... +// [source,xml] +// ---- +// +// vm_console_detected +// smtp +// +//
a@b.com
+//
+// ---- // -type ImageServiceGetRequest struct { - ImageService *ImageService - header map[string]string - query map[string]string - follow *string +type EventSubscriptionServiceGetRequest struct { + EventSubscriptionService *EventSubscriptionService + header map[string]string + query map[string]string } -func (p *ImageServiceGetRequest) Header(key, value string) *ImageServiceGetRequest { +func (p *EventSubscriptionServiceGetRequest) Header(key, value string) *EventSubscriptionServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -28816,7 +27600,7 @@ func (p *ImageServiceGetRequest) Header(key, value string) *ImageServiceGetReque return p } -func (p *ImageServiceGetRequest) Query(key, value string) *ImageServiceGetRequest { +func (p *EventSubscriptionServiceGetRequest) Query(key, value string) *EventSubscriptionServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -28824,18 +27608,9 @@ func (p *ImageServiceGetRequest) Query(key, value string) *ImageServiceGetReques return p } -func (p *ImageServiceGetRequest) Follow(follow string) *ImageServiceGetRequest { - p.follow = &follow - return p -} - -func (p *ImageServiceGetRequest) Send() (*ImageServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.ImageService.connection.URL(), p.ImageService.path) +func (p *EventSubscriptionServiceGetRequest) Send() (*EventSubscriptionServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventSubscriptionService.connection.URL(), p.EventSubscriptionService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -28849,7 +27624,7 @@ func (p *ImageServiceGetRequest) Send() (*ImageServiceGetResponse, error) { return nil, err } - for hk, hv := range p.ImageService.connection.headers { + for hk, hv := range p.EventSubscriptionService.connection.headers { req.Header.Add(hk, hv) } @@ -28864,18 +27639,18 @@ func (p *ImageServiceGetRequest) Send() (*ImageServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageService.connection.authenticate() + token, err := p.EventSubscriptionService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageService.connection.client.Do(req) + resp, err := p.EventSubscriptionService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageService.connection.logFunc != nil { + if p.EventSubscriptionService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -28884,7 +27659,7 @@ func (p *ImageServiceGetRequest) Send() (*ImageServiceGetResponse, error) { if err != nil { return nil, err } - p.ImageService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventSubscriptionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -28894,14 +27669,14 @@ func (p *ImageServiceGetRequest) Send() (*ImageServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLImageReadOne(reader, nil, "") + result, err := XMLEventSubscriptionReadOne(reader, nil, "") if err != nil { return nil, err } - return &ImageServiceGetResponse{image: result}, nil + return &EventSubscriptionServiceGetResponse{eventSubscription: result}, nil } -func (p *ImageServiceGetRequest) MustSend() *ImageServiceGetResponse { +func (p *EventSubscriptionServiceGetRequest) MustSend() *EventSubscriptionServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -28910,57 +27685,76 @@ func (p *ImageServiceGetRequest) MustSend() *ImageServiceGetResponse { } // +// Gets the information about the event-subscription. +// For example to retrieve the information about the subscription of user '123' to +// the event 'vm_console_detected': +// .... +// GET /ovirt-engine/api/users/123/vm_console_detected +// .... +// [source,xml] +// ---- +// +// vm_console_detected +// smtp +// +//
a@b.com
+//
+// ---- // -type ImageServiceGetResponse struct { - image *Image +type EventSubscriptionServiceGetResponse struct { + eventSubscription *EventSubscription } -func (p *ImageServiceGetResponse) Image() (*Image, bool) { - if p.image != nil { - return p.image, true +func (p *EventSubscriptionServiceGetResponse) EventSubscription() (*EventSubscription, bool) { + if p.eventSubscription != nil { + return p.eventSubscription, true } return nil, false } -func (p *ImageServiceGetResponse) MustImage() *Image { - if p.image == nil { - panic("image in response does not exist") +func (p *EventSubscriptionServiceGetResponse) MustEventSubscription() *EventSubscription { + if p.eventSubscription == nil { + panic("eventSubscription in response does not exist") } - return p.image + return p.eventSubscription } // +// Gets the information about the event-subscription. +// For example to retrieve the information about the subscription of user '123' to +// the event 'vm_console_detected': +// .... +// GET /ovirt-engine/api/users/123/vm_console_detected +// .... +// [source,xml] +// ---- +// +// vm_console_detected +// smtp +// +//
a@b.com
+//
+// ---- // -func (p *ImageService) Get() *ImageServiceGetRequest { - return &ImageServiceGetRequest{ImageService: p} +func (p *EventSubscriptionService) Get() *EventSubscriptionServiceGetRequest { + return &EventSubscriptionServiceGetRequest{EventSubscriptionService: p} } // -// Imports an image. -// If the `import_as_template` parameter is `true` then the image will be imported as a template, otherwise it will -// be imported as a disk. -// When imported as a template, the name of the template can be specified by the optional `template.name` -// parameter. If that parameter is not specified, then the name of the template will be automatically assigned by the -// engine as `GlanceTemplate-x` (where `x` will be seven random hexadecimal characters). -// When imported as a disk, the name of the disk can be specified by the optional `disk.name` parameter. If -// that parameter is not specified, then the name of the disk will be automatically assigned by the engine as -// `GlanceDisk-x` (where `x` will be the seven hexadecimal characters of the image identifier). -// It is recommended to always explicitly specify the template or disk name, to avoid these automatic names -// generated by the engine. +// Removes the event-subscription from the system. +// For example to remove user 123's subscription to `vm_console_detected` event: +// .... +// DELETE /ovirt-engine/api/users/123/vm_console_detected +// .... // -type ImageServiceImportRequest struct { - ImageService *ImageService - header map[string]string - query map[string]string - async *bool - cluster *Cluster - disk *Disk - importAsTemplate *bool - storageDomain *StorageDomain - template *Template +type EventSubscriptionServiceRemoveRequest struct { + EventSubscriptionService *EventSubscriptionService + header map[string]string + query map[string]string + async *bool } -func (p *ImageServiceImportRequest) Header(key, value string) *ImageServiceImportRequest { +func (p *EventSubscriptionServiceRemoveRequest) Header(key, value string) *EventSubscriptionServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -28968,7 +27762,7 @@ func (p *ImageServiceImportRequest) Header(key, value string) *ImageServiceImpor return p } -func (p *ImageServiceImportRequest) Query(key, value string) *ImageServiceImportRequest { +func (p *EventSubscriptionServiceRemoveRequest) Query(key, value string) *EventSubscriptionServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -28976,54 +27770,18 @@ func (p *ImageServiceImportRequest) Query(key, value string) *ImageServiceImport return p } -func (p *ImageServiceImportRequest) Async(async bool) *ImageServiceImportRequest { +func (p *EventSubscriptionServiceRemoveRequest) Async(async bool) *EventSubscriptionServiceRemoveRequest { p.async = &async return p } -func (p *ImageServiceImportRequest) Cluster(cluster *Cluster) *ImageServiceImportRequest { - p.cluster = cluster - return p -} - -func (p *ImageServiceImportRequest) Disk(disk *Disk) *ImageServiceImportRequest { - p.disk = disk - return p -} - -func (p *ImageServiceImportRequest) ImportAsTemplate(importAsTemplate bool) *ImageServiceImportRequest { - p.importAsTemplate = &importAsTemplate - return p -} - -func (p *ImageServiceImportRequest) StorageDomain(storageDomain *StorageDomain) *ImageServiceImportRequest { - p.storageDomain = storageDomain - return p -} - -func (p *ImageServiceImportRequest) Template(template *Template) *ImageServiceImportRequest { - p.template = template - return p -} - -func (p *ImageServiceImportRequest) Send() (*ImageServiceImportResponse, error) { - rawURL := fmt.Sprintf("%s%s/import", p.ImageService.connection.URL(), p.ImageService.path) - actionBuilder := NewActionBuilder() +func (p *EventSubscriptionServiceRemoveRequest) Send() (*EventSubscriptionServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventSubscriptionService.connection.URL(), p.EventSubscriptionService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Cluster(p.cluster) - actionBuilder.Disk(p.disk) - if p.importAsTemplate != nil { - actionBuilder.ImportAsTemplate(*p.importAsTemplate) - } - actionBuilder.StorageDomain(p.storageDomain) - actionBuilder.Template(p.template) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -29032,16 +27790,12 @@ func (p *ImageServiceImportRequest) Send() (*ImageServiceImportResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.ImageService.connection.headers { + for hk, hv := range p.EventSubscriptionService.connection.headers { req.Header.Add(hk, hv) } @@ -29056,18 +27810,18 @@ func (p *ImageServiceImportRequest) Send() (*ImageServiceImportResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.ImageService.connection.authenticate() + token, err := p.EventSubscriptionService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.ImageService.connection.client.Do(req) + resp, err := p.EventSubscriptionService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.ImageService.connection.logFunc != nil { + if p.EventSubscriptionService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -29076,16 +27830,19 @@ func (p *ImageServiceImportRequest) Send() (*ImageServiceImportResponse, error) if err != nil { return nil, err } - p.ImageService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventSubscriptionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(ImageServiceImportResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(EventSubscriptionServiceRemoveResponse), nil } -func (p *ImageServiceImportRequest) MustSend() *ImageServiceImportResponse { +func (p *EventSubscriptionServiceRemoveRequest) MustSend() *EventSubscriptionServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -29094,77 +27851,85 @@ func (p *ImageServiceImportRequest) MustSend() *ImageServiceImportResponse { } // -// Imports an image. -// If the `import_as_template` parameter is `true` then the image will be imported as a template, otherwise it will -// be imported as a disk. -// When imported as a template, the name of the template can be specified by the optional `template.name` -// parameter. If that parameter is not specified, then the name of the template will be automatically assigned by the -// engine as `GlanceTemplate-x` (where `x` will be seven random hexadecimal characters). -// When imported as a disk, the name of the disk can be specified by the optional `disk.name` parameter. If -// that parameter is not specified, then the name of the disk will be automatically assigned by the engine as -// `GlanceDisk-x` (where `x` will be the seven hexadecimal characters of the image identifier). -// It is recommended to always explicitly specify the template or disk name, to avoid these automatic names -// generated by the engine. +// Removes the event-subscription from the system. +// For example to remove user 123's subscription to `vm_console_detected` event: +// .... +// DELETE /ovirt-engine/api/users/123/vm_console_detected +// .... // -type ImageServiceImportResponse struct { +type EventSubscriptionServiceRemoveResponse struct { } // -// Imports an image. -// If the `import_as_template` parameter is `true` then the image will be imported as a template, otherwise it will -// be imported as a disk. -// When imported as a template, the name of the template can be specified by the optional `template.name` -// parameter. If that parameter is not specified, then the name of the template will be automatically assigned by the -// engine as `GlanceTemplate-x` (where `x` will be seven random hexadecimal characters). -// When imported as a disk, the name of the disk can be specified by the optional `disk.name` parameter. If -// that parameter is not specified, then the name of the disk will be automatically assigned by the engine as -// `GlanceDisk-x` (where `x` will be the seven hexadecimal characters of the image identifier). -// It is recommended to always explicitly specify the template or disk name, to avoid these automatic names -// generated by the engine. +// Removes the event-subscription from the system. +// For example to remove user 123's subscription to `vm_console_detected` event: +// .... +// DELETE /ovirt-engine/api/users/123/vm_console_detected +// .... // -func (p *ImageService) Import() *ImageServiceImportRequest { - return &ImageServiceImportRequest{ImageService: p} +func (p *EventSubscriptionService) Remove() *EventSubscriptionServiceRemoveRequest { + return &EventSubscriptionServiceRemoveRequest{EventSubscriptionService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *ImageService) Service(path string) (Service, error) { +func (op *EventSubscriptionService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *ImageService) String() string { - return fmt.Sprintf("ImageService:%s", op.path) +func (op *EventSubscriptionService) String() string { + return fmt.Sprintf("EventSubscriptionService:%s", op.path) } // -// A service to manage a network interface of a host. +// Represents a service to manage collection of event-subscription of a user. // -type HostNicService struct { +type EventSubscriptionsService struct { BaseService } -func NewHostNicService(connection *Connection, path string) *HostNicService { - var result HostNicService +func NewEventSubscriptionsService(connection *Connection, path string) *EventSubscriptionsService { + var result EventSubscriptionsService result.connection = connection result.path = path return &result } // +// Add a new event-subscription to the system. +// An event-subscription is always added in the context of a user. For example, to add new +// event-subscription for `host_high_cpu_use` for user `123`, and have the notification +// sent to the e-mail address: `a@b.com`, send a request like this: +// .... +// POST /ovirt-engine/api/users/123/eventsubscriptions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// host_high_cpu_use +//
a@b.com
+//
+// ---- +// The event name will become the ID of the new event-subscription entity: +// GET .../api/users/123/eventsubscriptions/host_high_cpu_use +// Note that no user id is provided in the request body. This is because the user-id (in this case 123) +// is already known to the API from the context. Note also that event-subscription entity contains +// notification-method field, but it is not provided either in the request body. This is because currently +// it's always set to SMTP as SNMP notifications are still unsupported by the API layer. // -type HostNicServiceGetRequest struct { - HostNicService *HostNicService - header map[string]string - query map[string]string - allContent *bool - follow *string +type EventSubscriptionsServiceAddRequest struct { + EventSubscriptionsService *EventSubscriptionsService + header map[string]string + query map[string]string + eventSubscription *EventSubscription } -func (p *HostNicServiceGetRequest) Header(key, value string) *HostNicServiceGetRequest { +func (p *EventSubscriptionsServiceAddRequest) Header(key, value string) *EventSubscriptionsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -29172,7 +27937,7 @@ func (p *HostNicServiceGetRequest) Header(key, value string) *HostNicServiceGetR return p } -func (p *HostNicServiceGetRequest) Query(key, value string) *HostNicServiceGetRequest { +func (p *EventSubscriptionsServiceAddRequest) Query(key, value string) *EventSubscriptionsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -29180,27 +27945,14 @@ func (p *HostNicServiceGetRequest) Query(key, value string) *HostNicServiceGetRe return p } -func (p *HostNicServiceGetRequest) AllContent(allContent bool) *HostNicServiceGetRequest { - p.allContent = &allContent - return p -} - -func (p *HostNicServiceGetRequest) Follow(follow string) *HostNicServiceGetRequest { - p.follow = &follow +func (p *EventSubscriptionsServiceAddRequest) EventSubscription(eventSubscription *EventSubscription) *EventSubscriptionsServiceAddRequest { + p.eventSubscription = eventSubscription return p } -func (p *HostNicServiceGetRequest) Send() (*HostNicServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostNicService.connection.URL(), p.HostNicService.path) +func (p *EventSubscriptionsServiceAddRequest) Send() (*EventSubscriptionsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventSubscriptionsService.connection.URL(), p.EventSubscriptionsService.path) values := make(url.Values) - if p.allContent != nil { - values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -29209,12 +27961,19 @@ func (p *HostNicServiceGetRequest) Send() (*HostNicServiceGetResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLEventSubscriptionWriteOne(writer, p.eventSubscription, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostNicService.connection.headers { + for hk, hv := range p.EventSubscriptionsService.connection.headers { req.Header.Add(hk, hv) } @@ -29229,18 +27988,18 @@ func (p *HostNicServiceGetRequest) Send() (*HostNicServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostNicService.connection.authenticate() + token, err := p.EventSubscriptionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostNicService.connection.client.Do(req) + resp, err := p.EventSubscriptionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostNicService.connection.logFunc != nil { + if p.EventSubscriptionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -29249,9 +28008,9 @@ func (p *HostNicServiceGetRequest) Send() (*HostNicServiceGetResponse, error) { if err != nil { return nil, err } - p.HostNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventSubscriptionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -29259,14 +28018,14 @@ func (p *HostNicServiceGetRequest) Send() (*HostNicServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLHostNicReadOne(reader, nil, "") + result, err := XMLEventSubscriptionReadOne(reader, nil, "") if err != nil { return nil, err } - return &HostNicServiceGetResponse{nic: result}, nil + return &EventSubscriptionsServiceAddResponse{eventSubscription: result}, nil } -func (p *HostNicServiceGetRequest) MustSend() *HostNicServiceGetResponse { +func (p *EventSubscriptionsServiceAddRequest) MustSend() *EventSubscriptionsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -29275,47 +28034,106 @@ func (p *HostNicServiceGetRequest) MustSend() *HostNicServiceGetResponse { } // -// -type HostNicServiceGetResponse struct { - nic *HostNic -} - -func (p *HostNicServiceGetResponse) Nic() (*HostNic, bool) { - if p.nic != nil { - return p.nic, true - } - return nil, false -} +// Add a new event-subscription to the system. +// An event-subscription is always added in the context of a user. For example, to add new +// event-subscription for `host_high_cpu_use` for user `123`, and have the notification +// sent to the e-mail address: `a@b.com`, send a request like this: +// .... +// POST /ovirt-engine/api/users/123/eventsubscriptions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// host_high_cpu_use +//
a@b.com
+//
+// ---- +// The event name will become the ID of the new event-subscription entity: +// GET .../api/users/123/eventsubscriptions/host_high_cpu_use +// Note that no user id is provided in the request body. This is because the user-id (in this case 123) +// is already known to the API from the context. Note also that event-subscription entity contains +// notification-method field, but it is not provided either in the request body. This is because currently +// it's always set to SMTP as SNMP notifications are still unsupported by the API layer. +// +type EventSubscriptionsServiceAddResponse struct { + eventSubscription *EventSubscription +} -func (p *HostNicServiceGetResponse) MustNic() *HostNic { - if p.nic == nil { - panic("nic in response does not exist") +func (p *EventSubscriptionsServiceAddResponse) EventSubscription() (*EventSubscription, bool) { + if p.eventSubscription != nil { + return p.eventSubscription, true } - return p.nic + return nil, false +} + +func (p *EventSubscriptionsServiceAddResponse) MustEventSubscription() *EventSubscription { + if p.eventSubscription == nil { + panic("eventSubscription in response does not exist") + } + return p.eventSubscription } // +// Add a new event-subscription to the system. +// An event-subscription is always added in the context of a user. For example, to add new +// event-subscription for `host_high_cpu_use` for user `123`, and have the notification +// sent to the e-mail address: `a@b.com`, send a request like this: +// .... +// POST /ovirt-engine/api/users/123/eventsubscriptions +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// host_high_cpu_use +//
a@b.com
+//
+// ---- +// The event name will become the ID of the new event-subscription entity: +// GET .../api/users/123/eventsubscriptions/host_high_cpu_use +// Note that no user id is provided in the request body. This is because the user-id (in this case 123) +// is already known to the API from the context. Note also that event-subscription entity contains +// notification-method field, but it is not provided either in the request body. This is because currently +// it's always set to SMTP as SNMP notifications are still unsupported by the API layer. // -func (p *HostNicService) Get() *HostNicServiceGetRequest { - return &HostNicServiceGetRequest{HostNicService: p} +func (p *EventSubscriptionsService) Add() *EventSubscriptionsServiceAddRequest { + return &EventSubscriptionsServiceAddRequest{EventSubscriptionsService: p} } // -// The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. -// The input should be consisted of at least one of the following properties: -// - `allNetworksAllowed` -// - `numberOfVirtualFunctions` -// Please see the `HostNicVirtualFunctionsConfiguration` type for the meaning of the properties. +// List the event-subscriptions for the provided user. +// For example to list event-subscriptions for user `123`: +// .... +// GET /ovirt-engine/api/users/123/event-subscriptions +// .... +// [source,xml] +// ---- +// +// +// host_install_failed +// smtp +// +//
a@b.com
+//
+// +// vm_paused +// smtp +// +//
a@b.com
+//
+//
+// ---- // -type HostNicServiceUpdateVirtualFunctionsConfigurationRequest struct { - HostNicService *HostNicService - header map[string]string - query map[string]string - async *bool - virtualFunctionsConfiguration *HostNicVirtualFunctionsConfiguration +type EventSubscriptionsServiceListRequest struct { + EventSubscriptionsService *EventSubscriptionsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Header(key, value string) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { +func (p *EventSubscriptionsServiceListRequest) Header(key, value string) *EventSubscriptionsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -29323,7 +28141,7 @@ func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Header(key, v return p } -func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Query(key, value string) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { +func (p *EventSubscriptionsServiceListRequest) Query(key, value string) *EventSubscriptionsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -29331,28 +28149,27 @@ func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Query(key, va return p } -func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Async(async bool) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { - p.async = &async +func (p *EventSubscriptionsServiceListRequest) Follow(follow string) *EventSubscriptionsServiceListRequest { + p.follow = &follow return p } -func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) VirtualFunctionsConfiguration(virtualFunctionsConfiguration *HostNicVirtualFunctionsConfiguration) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { - p.virtualFunctionsConfiguration = virtualFunctionsConfiguration +func (p *EventSubscriptionsServiceListRequest) Max(max int64) *EventSubscriptionsServiceListRequest { + p.max = &max return p } -func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Send() (*HostNicServiceUpdateVirtualFunctionsConfigurationResponse, error) { - rawURL := fmt.Sprintf("%s%s/updatevirtualfunctionsconfiguration", p.HostNicService.connection.URL(), p.HostNicService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *EventSubscriptionsServiceListRequest) Send() (*EventSubscriptionsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventSubscriptionsService.connection.URL(), p.EventSubscriptionsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - actionBuilder.VirtualFunctionsConfiguration(p.virtualFunctionsConfiguration) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -29361,16 +28178,12 @@ func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Send() (*Host if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostNicService.connection.headers { + for hk, hv := range p.EventSubscriptionsService.connection.headers { req.Header.Add(hk, hv) } @@ -29385,18 +28198,18 @@ func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Send() (*Host req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostNicService.connection.authenticate() + token, err := p.EventSubscriptionsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostNicService.connection.client.Do(req) + resp, err := p.EventSubscriptionsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostNicService.connection.logFunc != nil { + if p.EventSubscriptionsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -29405,16 +28218,24 @@ func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Send() (*Host if err != nil { return nil, err } - p.HostNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventSubscriptionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostNicServiceUpdateVirtualFunctionsConfigurationResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLEventSubscriptionReadMany(reader, nil) + if err != nil { + return nil, err + } + return &EventSubscriptionsServiceListResponse{eventSubscriptions: result}, nil } -func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) MustSend() *HostNicServiceUpdateVirtualFunctionsConfigurationResponse { +func (p *EventSubscriptionsServiceListRequest) MustSend() *EventSubscriptionsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -29423,185 +28244,154 @@ func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) MustSend() *H } // -// The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. -// The input should be consisted of at least one of the following properties: -// - `allNetworksAllowed` -// - `numberOfVirtualFunctions` -// Please see the `HostNicVirtualFunctionsConfiguration` type for the meaning of the properties. -// -type HostNicServiceUpdateVirtualFunctionsConfigurationResponse struct { -} - -// -// The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. -// The input should be consisted of at least one of the following properties: -// - `allNetworksAllowed` -// - `numberOfVirtualFunctions` -// Please see the `HostNicVirtualFunctionsConfiguration` type for the meaning of the properties. -// -func (p *HostNicService) UpdateVirtualFunctionsConfiguration() *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { - return &HostNicServiceUpdateVirtualFunctionsConfigurationRequest{HostNicService: p} -} - -// -// A reference to information elements received by LLDP on the NIC. -// -func (op *HostNicService) LinkLayerDiscoveryProtocolElementsService() *LinkLayerDiscoveryProtocolService { - return NewLinkLayerDiscoveryProtocolService(op.connection, fmt.Sprintf("%s/linklayerdiscoveryprotocolelements", op.path)) -} - -// -// Reference to the service that manages the network attachments assigned to this network interface. +// List the event-subscriptions for the provided user. +// For example to list event-subscriptions for user `123`: +// .... +// GET /ovirt-engine/api/users/123/event-subscriptions +// .... +// [source,xml] +// ---- +// +// +// host_install_failed +// smtp +// +//
a@b.com
+//
+// +// vm_paused +// smtp +// +//
a@b.com
+//
+//
+// ---- // -func (op *HostNicService) NetworkAttachmentsService() *NetworkAttachmentsService { - return NewNetworkAttachmentsService(op.connection, fmt.Sprintf("%s/networkattachments", op.path)) +type EventSubscriptionsServiceListResponse struct { + eventSubscriptions *EventSubscriptionSlice } -// -// Reference to the service that manages the network labels assigned to this network interface. -// -func (op *HostNicService) NetworkLabelsService() *NetworkLabelsService { - return NewNetworkLabelsService(op.connection, fmt.Sprintf("%s/networklabels", op.path)) +func (p *EventSubscriptionsServiceListResponse) EventSubscriptions() (*EventSubscriptionSlice, bool) { + if p.eventSubscriptions != nil { + return p.eventSubscriptions, true + } + return nil, false } -// -// -func (op *HostNicService) StatisticsService() *StatisticsService { - return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) +func (p *EventSubscriptionsServiceListResponse) MustEventSubscriptions() *EventSubscriptionSlice { + if p.eventSubscriptions == nil { + panic("eventSubscriptions in response does not exist") + } + return p.eventSubscriptions } // -// Retrieves sub-collection resource of network labels that are allowed on an the virtual functions -// in case that the current resource represents an SR-IOV physical function NIC. +// List the event-subscriptions for the provided user. +// For example to list event-subscriptions for user `123`: +// .... +// GET /ovirt-engine/api/users/123/event-subscriptions +// .... +// [source,xml] +// ---- +// +// +// host_install_failed +// smtp +// +//
a@b.com
+//
+// +// vm_paused +// smtp +// +//
a@b.com
+//
+//
+// ---- // -func (op *HostNicService) VirtualFunctionAllowedLabelsService() *NetworkLabelsService { - return NewNetworkLabelsService(op.connection, fmt.Sprintf("%s/virtualfunctionallowedlabels", op.path)) +func (p *EventSubscriptionsService) List() *EventSubscriptionsServiceListRequest { + return &EventSubscriptionsServiceListRequest{EventSubscriptionsService: p} } // -// Retrieves sub-collection resource of networks that are allowed on an the virtual functions -// in case that the current resource represents an SR-IOV physical function NIC. +// Reference to the service that manages a specific event-subscription. // -func (op *HostNicService) VirtualFunctionAllowedNetworksService() *VirtualFunctionAllowedNetworksService { - return NewVirtualFunctionAllowedNetworksService(op.connection, fmt.Sprintf("%s/virtualfunctionallowednetworks", op.path)) +func (op *EventSubscriptionsService) EventSubscriptionService(id string) *EventSubscriptionService { + return NewEventSubscriptionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *HostNicService) Service(path string) (Service, error) { +func (op *EventSubscriptionsService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "linklayerdiscoveryprotocolelements" { - return op.LinkLayerDiscoveryProtocolElementsService(), nil - } - if strings.HasPrefix(path, "linklayerdiscoveryprotocolelements/") { - return op.LinkLayerDiscoveryProtocolElementsService().Service(path[35:]) - } - if path == "networkattachments" { - return op.NetworkAttachmentsService(), nil - } - if strings.HasPrefix(path, "networkattachments/") { - return op.NetworkAttachmentsService().Service(path[19:]) - } - if path == "networklabels" { - return op.NetworkLabelsService(), nil - } - if strings.HasPrefix(path, "networklabels/") { - return op.NetworkLabelsService().Service(path[14:]) - } - if path == "statistics" { - return op.StatisticsService(), nil - } - if strings.HasPrefix(path, "statistics/") { - return op.StatisticsService().Service(path[11:]) - } - if path == "virtualfunctionallowedlabels" { - return op.VirtualFunctionAllowedLabelsService(), nil - } - if strings.HasPrefix(path, "virtualfunctionallowedlabels/") { - return op.VirtualFunctionAllowedLabelsService().Service(path[29:]) - } - if path == "virtualfunctionallowednetworks" { - return op.VirtualFunctionAllowedNetworksService(), nil - } - if strings.HasPrefix(path, "virtualfunctionallowednetworks/") { - return op.VirtualFunctionAllowedNetworksService().Service(path[31:]) + index := strings.Index(path, "/") + if index == -1 { + return op.EventSubscriptionService(path), nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return op.EventSubscriptionService(path[:index]).Service(path[index+1:]) } -func (op *HostNicService) String() string { - return fmt.Sprintf("HostNicService:%s", op.path) +func (op *EventSubscriptionsService) String() string { + return fmt.Sprintf("EventSubscriptionsService:%s", op.path) } // +// A service to manage events in the system. // -type VmNicsService struct { +type EventsService struct { BaseService } -func NewVmNicsService(connection *Connection, path string) *VmNicsService { - var result VmNicsService +func NewEventsService(connection *Connection, path string) *EventsService { + var result EventsService result.connection = connection result.path = path return &result } // -// Adds a NIC to the virtual machine. -// The following example adds to the virtual machine `123` a network interface named `mynic` using `virtio` and the -// NIC profile `456`. +// Adds an external event to the internal audit log. +// This is intended for integration with external systems that detect or produce events relevant for the +// administrator of the system. For example, an external monitoring tool may be able to detect that a file system +// is full inside the guest operating system of a virtual machine. This event can be added to the internal audit +// log sending a request like this: // [source] // ---- -// POST /ovirt-engine/api/vms/123/nics -// ---- -// [source,xml] -// ---- -// -// mynic -// virtio -// -// +// POST /ovirt-engine/api/events +// +// File system /home is full +// alert +// mymonitor +// 1467879754 +// // ---- -// The following example sends that request using `curl`: -// [source,bash] +// Events can also be linked to specific objects. For example, the above event could be linked to the specific +// virtual machine where it happened, using the `vm` link: +// [source] // ---- -// curl \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --user "admin@internal:mypassword" \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --data ' -// -// mynic -// virtio -// -// -// ' \ -// https://myengine.example.com/ovirt-engine/api/vms/123/nics +// POST /ovirt-engine/api/events +// +// File system /home is full +// alert +// mymonitor +// 1467879754 +// +// // ---- -// [IMPORTANT] -// ==== -// The hotplugging feature only supports virtual machine operating systems with hotplugging operations. -// Example operating systems include: -// - Red Hat Enterprise Linux 6 -// - Red Hat Enterprise Linux 5 -// - Windows Server 2008 and -// - Windows Server 2003 -// ==== +// NOTE: When using links, like the `vm` in the previous example, only the `id` attribute is accepted. The `name` +// attribute, if provided, is simply ignored. // -type VmNicsServiceAddRequest struct { - VmNicsService *VmNicsService +type EventsServiceAddRequest struct { + EventsService *EventsService header map[string]string query map[string]string - nic *Nic + event *Event } -func (p *VmNicsServiceAddRequest) Header(key, value string) *VmNicsServiceAddRequest { +func (p *EventsServiceAddRequest) Header(key, value string) *EventsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -29609,7 +28399,7 @@ func (p *VmNicsServiceAddRequest) Header(key, value string) *VmNicsServiceAddReq return p } -func (p *VmNicsServiceAddRequest) Query(key, value string) *VmNicsServiceAddRequest { +func (p *EventsServiceAddRequest) Query(key, value string) *EventsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -29617,13 +28407,13 @@ func (p *VmNicsServiceAddRequest) Query(key, value string) *VmNicsServiceAddRequ return p } -func (p *VmNicsServiceAddRequest) Nic(nic *Nic) *VmNicsServiceAddRequest { - p.nic = nic +func (p *EventsServiceAddRequest) Event(event *Event) *EventsServiceAddRequest { + p.event = event return p } -func (p *VmNicsServiceAddRequest) Send() (*VmNicsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNicsService.connection.URL(), p.VmNicsService.path) +func (p *EventsServiceAddRequest) Send() (*EventsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventsService.connection.URL(), p.EventsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -29635,7 +28425,7 @@ func (p *VmNicsServiceAddRequest) Send() (*VmNicsServiceAddResponse, error) { } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLNicWriteOne(writer, p.nic, "") + err := XMLEventWriteOne(writer, p.event, "") if err != nil { return nil, err } @@ -29645,7 +28435,7 @@ func (p *VmNicsServiceAddRequest) Send() (*VmNicsServiceAddResponse, error) { return nil, err } - for hk, hv := range p.VmNicsService.connection.headers { + for hk, hv := range p.EventsService.connection.headers { req.Header.Add(hk, hv) } @@ -29660,18 +28450,18 @@ func (p *VmNicsServiceAddRequest) Send() (*VmNicsServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNicsService.connection.authenticate() + token, err := p.EventsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNicsService.connection.client.Do(req) + resp, err := p.EventsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNicsService.connection.logFunc != nil { + if p.EventsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -29680,7 +28470,7 @@ func (p *VmNicsServiceAddRequest) Send() (*VmNicsServiceAddResponse, error) { if err != nil { return nil, err } - p.VmNicsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -29690,14 +28480,14 @@ func (p *VmNicsServiceAddRequest) Send() (*VmNicsServiceAddResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadOne(reader, nil, "") + result, err := XMLEventReadOne(reader, nil, "") if err != nil { return nil, err } - return &VmNicsServiceAddResponse{nic: result}, nil + return &EventsServiceAddResponse{event: result}, nil } -func (p *VmNicsServiceAddRequest) MustSend() *VmNicsServiceAddResponse { +func (p *EventsServiceAddRequest) MustSend() *EventsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -29706,130 +28496,148 @@ func (p *VmNicsServiceAddRequest) MustSend() *VmNicsServiceAddResponse { } // -// Adds a NIC to the virtual machine. -// The following example adds to the virtual machine `123` a network interface named `mynic` using `virtio` and the -// NIC profile `456`. +// Adds an external event to the internal audit log. +// This is intended for integration with external systems that detect or produce events relevant for the +// administrator of the system. For example, an external monitoring tool may be able to detect that a file system +// is full inside the guest operating system of a virtual machine. This event can be added to the internal audit +// log sending a request like this: // [source] // ---- -// POST /ovirt-engine/api/vms/123/nics -// ---- -// [source,xml] -// ---- -// -// mynic -// virtio -// -// +// POST /ovirt-engine/api/events +// +// File system /home is full +// alert +// mymonitor +// 1467879754 +// // ---- -// The following example sends that request using `curl`: -// [source,bash] +// Events can also be linked to specific objects. For example, the above event could be linked to the specific +// virtual machine where it happened, using the `vm` link: +// [source] // ---- -// curl \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --user "admin@internal:mypassword" \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --data ' -// -// mynic -// virtio -// -// -// ' \ -// https://myengine.example.com/ovirt-engine/api/vms/123/nics +// POST /ovirt-engine/api/events +// +// File system /home is full +// alert +// mymonitor +// 1467879754 +// +// // ---- -// [IMPORTANT] -// ==== -// The hotplugging feature only supports virtual machine operating systems with hotplugging operations. -// Example operating systems include: -// - Red Hat Enterprise Linux 6 -// - Red Hat Enterprise Linux 5 -// - Windows Server 2008 and -// - Windows Server 2003 -// ==== +// NOTE: When using links, like the `vm` in the previous example, only the `id` attribute is accepted. The `name` +// attribute, if provided, is simply ignored. // -type VmNicsServiceAddResponse struct { - nic *Nic +type EventsServiceAddResponse struct { + event *Event } -func (p *VmNicsServiceAddResponse) Nic() (*Nic, bool) { - if p.nic != nil { - return p.nic, true +func (p *EventsServiceAddResponse) Event() (*Event, bool) { + if p.event != nil { + return p.event, true } return nil, false } -func (p *VmNicsServiceAddResponse) MustNic() *Nic { - if p.nic == nil { - panic("nic in response does not exist") +func (p *EventsServiceAddResponse) MustEvent() *Event { + if p.event == nil { + panic("event in response does not exist") } - return p.nic + return p.event } // -// Adds a NIC to the virtual machine. -// The following example adds to the virtual machine `123` a network interface named `mynic` using `virtio` and the -// NIC profile `456`. +// Adds an external event to the internal audit log. +// This is intended for integration with external systems that detect or produce events relevant for the +// administrator of the system. For example, an external monitoring tool may be able to detect that a file system +// is full inside the guest operating system of a virtual machine. This event can be added to the internal audit +// log sending a request like this: // [source] // ---- -// POST /ovirt-engine/api/vms/123/nics -// ---- -// [source,xml] -// ---- -// -// mynic -// virtio -// -// +// POST /ovirt-engine/api/events +// +// File system /home is full +// alert +// mymonitor +// 1467879754 +// // ---- -// The following example sends that request using `curl`: -// [source,bash] +// Events can also be linked to specific objects. For example, the above event could be linked to the specific +// virtual machine where it happened, using the `vm` link: +// [source] // ---- -// curl \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --user "admin@internal:mypassword" \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --data ' -// -// mynic -// virtio -// -// -// ' \ -// https://myengine.example.com/ovirt-engine/api/vms/123/nics +// POST /ovirt-engine/api/events +// +// File system /home is full +// alert +// mymonitor +// 1467879754 +// +// // ---- -// [IMPORTANT] -// ==== -// The hotplugging feature only supports virtual machine operating systems with hotplugging operations. -// Example operating systems include: -// - Red Hat Enterprise Linux 6 -// - Red Hat Enterprise Linux 5 -// - Windows Server 2008 and -// - Windows Server 2003 -// ==== +// NOTE: When using links, like the `vm` in the previous example, only the `id` attribute is accepted. The `name` +// attribute, if provided, is simply ignored. // -func (p *VmNicsService) Add() *VmNicsServiceAddRequest { - return &VmNicsServiceAddRequest{VmNicsService: p} +func (p *EventsService) Add() *EventsServiceAddRequest { + return &EventsServiceAddRequest{EventsService: p} } // -// Returns the list of NICs of the virtual machine. -// The order of the returned list of NICs isn't guaranteed. +// Get list of events. +// [source] +// ---- +// GET /ovirt-engine/api/events +// ---- +// To the above request we get following response: +// [source,xml] +// ---- +// +// +// User admin@internal-authz logged out. +// 31 +// 1e892ea9 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// User admin logged in. +// 30 +// 1fbd81f4 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// ---- +// The following events occur: +// * id="1" - The API logs in the admin user account. +// * id="2" - The API logs out of the admin user account. +// The order of the returned list of events is always garanteed. If the `sortby` clause is included in the +// `search` parameter, then the events will be ordered according to that clause. If the `sortby` clause isn't +// included, then the events will be sorted by the numeric value of the `id` attribute, starting with the +// highest value. This, combined with the `max` parameter, simplifies obtaining the most recent event: +// .... +// GET /ovirt-engine/api/events?max=1 +// .... // -type VmNicsServiceListRequest struct { - VmNicsService *VmNicsService +type EventsServiceListRequest struct { + EventsService *EventsService header map[string]string query map[string]string + caseSensitive *bool follow *string + from *int64 max *int64 + search *string } -func (p *VmNicsServiceListRequest) Header(key, value string) *VmNicsServiceListRequest { +func (p *EventsServiceListRequest) Header(key, value string) *EventsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -29837,7 +28645,7 @@ func (p *VmNicsServiceListRequest) Header(key, value string) *VmNicsServiceListR return p } -func (p *VmNicsServiceListRequest) Query(key, value string) *VmNicsServiceListRequest { +func (p *EventsServiceListRequest) Query(key, value string) *EventsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -29845,27 +28653,54 @@ func (p *VmNicsServiceListRequest) Query(key, value string) *VmNicsServiceListRe return p } -func (p *VmNicsServiceListRequest) Follow(follow string) *VmNicsServiceListRequest { +func (p *EventsServiceListRequest) CaseSensitive(caseSensitive bool) *EventsServiceListRequest { + p.caseSensitive = &caseSensitive + return p +} + +func (p *EventsServiceListRequest) Follow(follow string) *EventsServiceListRequest { p.follow = &follow return p } -func (p *VmNicsServiceListRequest) Max(max int64) *VmNicsServiceListRequest { +func (p *EventsServiceListRequest) From(from int64) *EventsServiceListRequest { + p.from = &from + return p +} + +func (p *EventsServiceListRequest) Max(max int64) *EventsServiceListRequest { p.max = &max return p } -func (p *VmNicsServiceListRequest) Send() (*VmNicsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNicsService.connection.URL(), p.VmNicsService.path) +func (p *EventsServiceListRequest) Search(search string) *EventsServiceListRequest { + p.search = &search + return p +} + +func (p *EventsServiceListRequest) Send() (*EventsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.EventsService.connection.URL(), p.EventsService.path) values := make(url.Values) + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.from != nil { + values["from"] = []string{fmt.Sprintf("%v", *p.from)} + } + if p.max != nil { values["max"] = []string{fmt.Sprintf("%v", *p.max)} } + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -29879,7 +28714,7 @@ func (p *VmNicsServiceListRequest) Send() (*VmNicsServiceListResponse, error) { return nil, err } - for hk, hv := range p.VmNicsService.connection.headers { + for hk, hv := range p.EventsService.connection.headers { req.Header.Add(hk, hv) } @@ -29894,18 +28729,18 @@ func (p *VmNicsServiceListRequest) Send() (*VmNicsServiceListResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNicsService.connection.authenticate() + token, err := p.EventsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNicsService.connection.client.Do(req) + resp, err := p.EventsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNicsService.connection.logFunc != nil { + if p.EventsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -29914,7 +28749,7 @@ func (p *VmNicsServiceListRequest) Send() (*VmNicsServiceListResponse, error) { if err != nil { return nil, err } - p.VmNicsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.EventsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -29924,14 +28759,14 @@ func (p *VmNicsServiceListRequest) Send() (*VmNicsServiceListResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadMany(reader, nil) + result, err := XMLEventReadMany(reader, nil) if err != nil { return nil, err } - return &VmNicsServiceListResponse{nics: result}, nil + return &EventsServiceListResponse{events: result}, nil } -func (p *VmNicsServiceListRequest) MustSend() *VmNicsServiceListResponse { +func (p *EventsServiceListRequest) MustSend() *EventsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -29940,84 +28775,127 @@ func (p *VmNicsServiceListRequest) MustSend() *VmNicsServiceListResponse { } // -// Returns the list of NICs of the virtual machine. -// The order of the returned list of NICs isn't guaranteed. +// Get list of events. +// [source] +// ---- +// GET /ovirt-engine/api/events +// ---- +// To the above request we get following response: +// [source,xml] +// ---- +// +// +// User admin@internal-authz logged out. +// 31 +// 1e892ea9 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// User admin logged in. +// 30 +// 1fbd81f4 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// ---- +// The following events occur: +// * id="1" - The API logs in the admin user account. +// * id="2" - The API logs out of the admin user account. +// The order of the returned list of events is always garanteed. If the `sortby` clause is included in the +// `search` parameter, then the events will be ordered according to that clause. If the `sortby` clause isn't +// included, then the events will be sorted by the numeric value of the `id` attribute, starting with the +// highest value. This, combined with the `max` parameter, simplifies obtaining the most recent event: +// .... +// GET /ovirt-engine/api/events?max=1 +// .... // -type VmNicsServiceListResponse struct { - nics *NicSlice +type EventsServiceListResponse struct { + events *EventSlice } -func (p *VmNicsServiceListResponse) Nics() (*NicSlice, bool) { - if p.nics != nil { - return p.nics, true +func (p *EventsServiceListResponse) Events() (*EventSlice, bool) { + if p.events != nil { + return p.events, true } return nil, false } -func (p *VmNicsServiceListResponse) MustNics() *NicSlice { - if p.nics == nil { - panic("nics in response does not exist") - } - return p.nics -} - -// -// Returns the list of NICs of the virtual machine. -// The order of the returned list of NICs isn't guaranteed. -// -func (p *VmNicsService) List() *VmNicsServiceListRequest { - return &VmNicsServiceListRequest{VmNicsService: p} -} - -// -// -func (op *VmNicsService) NicService(id string) *VmNicService { - return NewVmNicService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *VmNicsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.NicService(path), nil +func (p *EventsServiceListResponse) MustEvents() *EventSlice { + if p.events == nil { + panic("events in response does not exist") } - return op.NicService(path[:index]).Service(path[index+1:]) -} - -func (op *VmNicsService) String() string { - return fmt.Sprintf("VmNicsService:%s", op.path) + return p.events } // -// This service manages a vNIC profile. +// Get list of events. +// [source] +// ---- +// GET /ovirt-engine/api/events +// ---- +// To the above request we get following response: +// [source,xml] +// ---- +// +// +// User admin@internal-authz logged out. +// 31 +// 1e892ea9 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// User admin logged in. +// 30 +// 1fbd81f4 +// -1 +// 30 +// oVirt +// normal +// +// +// +// +// ---- +// The following events occur: +// * id="1" - The API logs in the admin user account. +// * id="2" - The API logs out of the admin user account. +// The order of the returned list of events is always garanteed. If the `sortby` clause is included in the +// `search` parameter, then the events will be ordered according to that clause. If the `sortby` clause isn't +// included, then the events will be sorted by the numeric value of the `id` attribute, starting with the +// highest value. This, combined with the `max` parameter, simplifies obtaining the most recent event: +// .... +// GET /ovirt-engine/api/events?max=1 +// .... // -type VnicProfileService struct { - BaseService -} - -func NewVnicProfileService(connection *Connection, path string) *VnicProfileService { - var result VnicProfileService - result.connection = connection - result.path = path - return &result +func (p *EventsService) List() *EventsServiceListRequest { + return &EventsServiceListRequest{EventsService: p} } // -// Retrieves details about a vNIC profile. // -type VnicProfileServiceGetRequest struct { - VnicProfileService *VnicProfileService - header map[string]string - query map[string]string - follow *string +type EventsServiceUndeleteRequest struct { + EventsService *EventsService + header map[string]string + query map[string]string + async *bool } -func (p *VnicProfileServiceGetRequest) Header(key, value string) *VnicProfileServiceGetRequest { +func (p *EventsServiceUndeleteRequest) Header(key, value string) *EventsServiceUndeleteRequest { if p.header == nil { p.header = make(map[string]string) } @@ -30025,7 +28903,7 @@ func (p *VnicProfileServiceGetRequest) Header(key, value string) *VnicProfileSer return p } -func (p *VnicProfileServiceGetRequest) Query(key, value string) *VnicProfileServiceGetRequest { +func (p *EventsServiceUndeleteRequest) Query(key, value string) *EventsServiceUndeleteRequest { if p.query == nil { p.query = make(map[string]string) } @@ -30033,18 +28911,22 @@ func (p *VnicProfileServiceGetRequest) Query(key, value string) *VnicProfileServ return p } -func (p *VnicProfileServiceGetRequest) Follow(follow string) *VnicProfileServiceGetRequest { - p.follow = &follow +func (p *EventsServiceUndeleteRequest) Async(async bool) *EventsServiceUndeleteRequest { + p.async = &async return p } -func (p *VnicProfileServiceGetRequest) Send() (*VnicProfileServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VnicProfileService.connection.URL(), p.VnicProfileService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *EventsServiceUndeleteRequest) Send() (*EventsServiceUndeleteResponse, error) { + rawURL := fmt.Sprintf("%s%s/undelete", p.EventsService.connection.URL(), p.EventsService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -30053,12 +28935,16 @@ func (p *VnicProfileServiceGetRequest) Send() (*VnicProfileServiceGetResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VnicProfileService.connection.headers { + for hk, hv := range p.EventsService.connection.headers { req.Header.Add(hk, hv) } @@ -30073,18 +28959,18 @@ func (p *VnicProfileServiceGetRequest) Send() (*VnicProfileServiceGetResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VnicProfileService.connection.authenticate() + token, err := p.EventsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VnicProfileService.connection.client.Do(req) + resp, err := p.EventsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VnicProfileService.connection.logFunc != nil { + if p.EventsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -30093,24 +28979,16 @@ func (p *VnicProfileServiceGetRequest) Send() (*VnicProfileServiceGetResponse, e if err != nil { return nil, err } - p.VnicProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.EventsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLVnicProfileReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VnicProfileServiceGetResponse{profile: result}, nil + return new(EventsServiceUndeleteResponse), nil } -func (p *VnicProfileServiceGetRequest) MustSend() *VnicProfileServiceGetResponse { +func (p *EventsServiceUndeleteRequest) MustSend() *EventsServiceUndeleteResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -30119,44 +28997,66 @@ func (p *VnicProfileServiceGetRequest) MustSend() *VnicProfileServiceGetResponse } // -// Retrieves details about a vNIC profile. // -type VnicProfileServiceGetResponse struct { - profile *VnicProfile +type EventsServiceUndeleteResponse struct { } -func (p *VnicProfileServiceGetResponse) Profile() (*VnicProfile, bool) { - if p.profile != nil { - return p.profile, true - } - return nil, false +// +// +func (p *EventsService) Undelete() *EventsServiceUndeleteRequest { + return &EventsServiceUndeleteRequest{EventsService: p} } -func (p *VnicProfileServiceGetResponse) MustProfile() *VnicProfile { - if p.profile == nil { - panic("profile in response does not exist") +// +// Reference to the service that manages a specific event. +// +func (op *EventsService) EventService(id string) *EventService { + return NewEventService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *EventsService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - return p.profile + index := strings.Index(path, "/") + if index == -1 { + return op.EventService(path), nil + } + return op.EventService(path[:index]).Service(path[index+1:]) +} + +func (op *EventsService) String() string { + return fmt.Sprintf("EventsService:%s", op.path) } // -// Retrieves details about a vNIC profile. +// Describes how an external network provider is provisioned by the system on the host. // -func (p *VnicProfileService) Get() *VnicProfileServiceGetRequest { - return &VnicProfileServiceGetRequest{VnicProfileService: p} +type ExternalNetworkProviderConfigurationService struct { + BaseService +} + +func NewExternalNetworkProviderConfigurationService(connection *Connection, path string) *ExternalNetworkProviderConfigurationService { + var result ExternalNetworkProviderConfigurationService + result.connection = connection + result.path = path + return &result } // -// Removes the vNIC profile. +// Returns the information about an external network provider on the host. // -type VnicProfileServiceRemoveRequest struct { - VnicProfileService *VnicProfileService - header map[string]string - query map[string]string - async *bool +type ExternalNetworkProviderConfigurationServiceGetRequest struct { + ExternalNetworkProviderConfigurationService *ExternalNetworkProviderConfigurationService + header map[string]string + query map[string]string + follow *string } -func (p *VnicProfileServiceRemoveRequest) Header(key, value string) *VnicProfileServiceRemoveRequest { +func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Header(key, value string) *ExternalNetworkProviderConfigurationServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -30164,7 +29064,7 @@ func (p *VnicProfileServiceRemoveRequest) Header(key, value string) *VnicProfile return p } -func (p *VnicProfileServiceRemoveRequest) Query(key, value string) *VnicProfileServiceRemoveRequest { +func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Query(key, value string) *ExternalNetworkProviderConfigurationServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -30172,16 +29072,16 @@ func (p *VnicProfileServiceRemoveRequest) Query(key, value string) *VnicProfileS return p } -func (p *VnicProfileServiceRemoveRequest) Async(async bool) *VnicProfileServiceRemoveRequest { - p.async = &async +func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Follow(follow string) *ExternalNetworkProviderConfigurationServiceGetRequest { + p.follow = &follow return p } -func (p *VnicProfileServiceRemoveRequest) Send() (*VnicProfileServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VnicProfileService.connection.URL(), p.VnicProfileService.path) +func (p *ExternalNetworkProviderConfigurationServiceGetRequest) Send() (*ExternalNetworkProviderConfigurationServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ExternalNetworkProviderConfigurationService.connection.URL(), p.ExternalNetworkProviderConfigurationService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -30192,12 +29092,12 @@ func (p *VnicProfileServiceRemoveRequest) Send() (*VnicProfileServiceRemoveRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.VnicProfileService.connection.headers { + for hk, hv := range p.ExternalNetworkProviderConfigurationService.connection.headers { req.Header.Add(hk, hv) } @@ -30212,18 +29112,18 @@ func (p *VnicProfileServiceRemoveRequest) Send() (*VnicProfileServiceRemoveRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VnicProfileService.connection.authenticate() + token, err := p.ExternalNetworkProviderConfigurationService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VnicProfileService.connection.client.Do(req) + resp, err := p.ExternalNetworkProviderConfigurationService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VnicProfileService.connection.logFunc != nil { + if p.ExternalNetworkProviderConfigurationService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -30232,19 +29132,24 @@ func (p *VnicProfileServiceRemoveRequest) Send() (*VnicProfileServiceRemoveRespo if err != nil { return nil, err } - p.VnicProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ExternalNetworkProviderConfigurationService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(VnicProfileServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLExternalNetworkProviderConfigurationReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &ExternalNetworkProviderConfigurationServiceGetResponse{configuration: result}, nil } -func (p *VnicProfileServiceRemoveRequest) MustSend() *VnicProfileServiceRemoveResponse { +func (p *ExternalNetworkProviderConfigurationServiceGetRequest) MustSend() *ExternalNetworkProviderConfigurationServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -30253,30 +29158,73 @@ func (p *VnicProfileServiceRemoveRequest) MustSend() *VnicProfileServiceRemoveRe } // -// Removes the vNIC profile. +// Returns the information about an external network provider on the host. // -type VnicProfileServiceRemoveResponse struct { +type ExternalNetworkProviderConfigurationServiceGetResponse struct { + configuration *ExternalNetworkProviderConfiguration } -// -// Removes the vNIC profile. -// -func (p *VnicProfileService) Remove() *VnicProfileServiceRemoveRequest { - return &VnicProfileServiceRemoveRequest{VnicProfileService: p} +func (p *ExternalNetworkProviderConfigurationServiceGetResponse) Configuration() (*ExternalNetworkProviderConfiguration, bool) { + if p.configuration != nil { + return p.configuration, true + } + return nil, false +} + +func (p *ExternalNetworkProviderConfigurationServiceGetResponse) MustConfiguration() *ExternalNetworkProviderConfiguration { + if p.configuration == nil { + panic("configuration in response does not exist") + } + return p.configuration } // -// Updates details of a vNIC profile. -// -type VnicProfileServiceUpdateRequest struct { - VnicProfileService *VnicProfileService - header map[string]string - query map[string]string - async *bool - profile *VnicProfile +// Returns the information about an external network provider on the host. +// +func (p *ExternalNetworkProviderConfigurationService) Get() *ExternalNetworkProviderConfigurationServiceGetRequest { + return &ExternalNetworkProviderConfigurationServiceGetRequest{ExternalNetworkProviderConfigurationService: p} } -func (p *VnicProfileServiceUpdateRequest) Header(key, value string) *VnicProfileServiceUpdateRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *ExternalNetworkProviderConfigurationService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *ExternalNetworkProviderConfigurationService) String() string { + return fmt.Sprintf("ExternalNetworkProviderConfigurationService:%s", op.path) +} + +// +// A service to list all external network providers provisioned by the system on the host. +// +type ExternalNetworkProviderConfigurationsService struct { + BaseService +} + +func NewExternalNetworkProviderConfigurationsService(connection *Connection, path string) *ExternalNetworkProviderConfigurationsService { + var result ExternalNetworkProviderConfigurationsService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the list of all external network providers on the host. +// The order of the returned list of networks is not guaranteed. +// +type ExternalNetworkProviderConfigurationsServiceListRequest struct { + ExternalNetworkProviderConfigurationsService *ExternalNetworkProviderConfigurationsService + header map[string]string + query map[string]string + follow *string +} + +func (p *ExternalNetworkProviderConfigurationsServiceListRequest) Header(key, value string) *ExternalNetworkProviderConfigurationsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -30284,7 +29232,7 @@ func (p *VnicProfileServiceUpdateRequest) Header(key, value string) *VnicProfile return p } -func (p *VnicProfileServiceUpdateRequest) Query(key, value string) *VnicProfileServiceUpdateRequest { +func (p *ExternalNetworkProviderConfigurationsServiceListRequest) Query(key, value string) *ExternalNetworkProviderConfigurationsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -30292,21 +29240,16 @@ func (p *VnicProfileServiceUpdateRequest) Query(key, value string) *VnicProfileS return p } -func (p *VnicProfileServiceUpdateRequest) Async(async bool) *VnicProfileServiceUpdateRequest { - p.async = &async - return p -} - -func (p *VnicProfileServiceUpdateRequest) Profile(profile *VnicProfile) *VnicProfileServiceUpdateRequest { - p.profile = profile +func (p *ExternalNetworkProviderConfigurationsServiceListRequest) Follow(follow string) *ExternalNetworkProviderConfigurationsServiceListRequest { + p.follow = &follow return p } -func (p *VnicProfileServiceUpdateRequest) Send() (*VnicProfileServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VnicProfileService.connection.URL(), p.VnicProfileService.path) +func (p *ExternalNetworkProviderConfigurationsServiceListRequest) Send() (*ExternalNetworkProviderConfigurationsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ExternalNetworkProviderConfigurationsService.connection.URL(), p.ExternalNetworkProviderConfigurationsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -30317,19 +29260,12 @@ func (p *VnicProfileServiceUpdateRequest) Send() (*VnicProfileServiceUpdateRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLVnicProfileWriteOne(writer, p.profile, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.VnicProfileService.connection.headers { + for hk, hv := range p.ExternalNetworkProviderConfigurationsService.connection.headers { req.Header.Add(hk, hv) } @@ -30344,18 +29280,18 @@ func (p *VnicProfileServiceUpdateRequest) Send() (*VnicProfileServiceUpdateRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VnicProfileService.connection.authenticate() + token, err := p.ExternalNetworkProviderConfigurationsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VnicProfileService.connection.client.Do(req) + resp, err := p.ExternalNetworkProviderConfigurationsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VnicProfileService.connection.logFunc != nil { + if p.ExternalNetworkProviderConfigurationsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -30364,7 +29300,7 @@ func (p *VnicProfileServiceUpdateRequest) Send() (*VnicProfileServiceUpdateRespo if err != nil { return nil, err } - p.VnicProfileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ExternalNetworkProviderConfigurationsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -30374,14 +29310,14 @@ func (p *VnicProfileServiceUpdateRequest) Send() (*VnicProfileServiceUpdateRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLVnicProfileReadOne(reader, nil, "") + result, err := XMLExternalNetworkProviderConfigurationReadMany(reader, nil) if err != nil { return nil, err } - return &VnicProfileServiceUpdateResponse{profile: result}, nil + return &ExternalNetworkProviderConfigurationsServiceListResponse{configurations: result}, nil } -func (p *VnicProfileServiceUpdateRequest) MustSend() *VnicProfileServiceUpdateResponse { +func (p *ExternalNetworkProviderConfigurationsServiceListRequest) MustSend() *ExternalNetworkProviderConfigurationsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -30390,135 +29326,97 @@ func (p *VnicProfileServiceUpdateRequest) MustSend() *VnicProfileServiceUpdateRe } // -// Updates details of a vNIC profile. +// Returns the list of all external network providers on the host. +// The order of the returned list of networks is not guaranteed. // -type VnicProfileServiceUpdateResponse struct { - profile *VnicProfile +type ExternalNetworkProviderConfigurationsServiceListResponse struct { + configurations *ExternalNetworkProviderConfigurationSlice } -func (p *VnicProfileServiceUpdateResponse) Profile() (*VnicProfile, bool) { - if p.profile != nil { - return p.profile, true +func (p *ExternalNetworkProviderConfigurationsServiceListResponse) Configurations() (*ExternalNetworkProviderConfigurationSlice, bool) { + if p.configurations != nil { + return p.configurations, true } return nil, false } -func (p *VnicProfileServiceUpdateResponse) MustProfile() *VnicProfile { - if p.profile == nil { - panic("profile in response does not exist") +func (p *ExternalNetworkProviderConfigurationsServiceListResponse) MustConfigurations() *ExternalNetworkProviderConfigurationSlice { + if p.configurations == nil { + panic("configurations in response does not exist") } - return p.profile + return p.configurations } // -// Updates details of a vNIC profile. +// Returns the list of all external network providers on the host. +// The order of the returned list of networks is not guaranteed. // -func (p *VnicProfileService) Update() *VnicProfileServiceUpdateRequest { - return &VnicProfileServiceUpdateRequest{VnicProfileService: p} +func (p *ExternalNetworkProviderConfigurationsService) List() *ExternalNetworkProviderConfigurationsServiceListRequest { + return &ExternalNetworkProviderConfigurationsServiceListRequest{ExternalNetworkProviderConfigurationsService: p} } // // -func (op *VnicProfileService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +func (op *ExternalNetworkProviderConfigurationsService) ConfigurationService(id string) *ExternalNetworkProviderConfigurationService { + return NewExternalNetworkProviderConfigurationService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *VnicProfileService) Service(path string) (Service, error) { +func (op *ExternalNetworkProviderConfigurationsService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) + index := strings.Index(path, "/") + if index == -1 { + return op.ConfigurationService(path), nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return op.ConfigurationService(path[:index]).Service(path[index+1:]) } -func (op *VnicProfileService) String() string { - return fmt.Sprintf("VnicProfileService:%s", op.path) +func (op *ExternalNetworkProviderConfigurationsService) String() string { + return fmt.Sprintf("ExternalNetworkProviderConfigurationsService:%s", op.path) } // -// Represents a readonly network filters sub-collection. -// The network filter enables to filter packets send to/from the VM's nic according to defined rules. -// For more information please refer to <> service documentation -// Network filters are supported in different versions, starting from version 3.0. -// A network filter is defined for each vnic profile. -// A vnic profile is defined for a specific network. -// A network can be assigned to several different clusters. In the future, each network will be defined in -// cluster level. -// Currently, each network is being defined at data center level. Potential network filters for each network -// are determined by the network's data center compatibility version V. -// V must be >= the network filter version in order to configure this network filter for a specific network. -// Please note, that if a network is assigned to cluster with a version supporting a network filter, the filter -// may not be available due to the data center version being smaller then the network filter's version. -// Example of listing all of the supported network filters for a specific cluster: -// [source] -// ---- -// GET http://localhost:8080/ovirt-engine/api/clusters/{cluster:id}/networkfilters -// ---- -// Output: -// [source,xml] -// ---- -// -// -// example-network-filter-a -// -// 4 -// 0 -// -1 -// -1 -// -// -// -// example-network-filter-b -// -// 4 -// 0 -// -1 -// -1 -// -// -// -// example-network-filter-a -// -// 3 -// 0 -// -1 -// -1 -// -// -// -// ---- +// A service to view specific certificate for external provider. // -type NetworkFiltersService struct { +type ExternalProviderCertificateService struct { BaseService } -func NewNetworkFiltersService(connection *Connection, path string) *NetworkFiltersService { - var result NetworkFiltersService +func NewExternalProviderCertificateService(connection *Connection, path string) *ExternalProviderCertificateService { + var result ExternalProviderCertificateService result.connection = connection result.path = path return &result } // -// Retrieves the representations of the network filters. -// The order of the returned list of network filters isn't guaranteed. +// Get specific certificate. +// [source] +// ---- +// GET /ovirt-engine/api/externalhostproviders/123/certificate/0 +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// provider.example.com +// CN=provider.example.com +// ... +// +// ---- // -type NetworkFiltersServiceListRequest struct { - NetworkFiltersService *NetworkFiltersService - header map[string]string - query map[string]string - follow *string +type ExternalProviderCertificateServiceGetRequest struct { + ExternalProviderCertificateService *ExternalProviderCertificateService + header map[string]string + query map[string]string + follow *string } -func (p *NetworkFiltersServiceListRequest) Header(key, value string) *NetworkFiltersServiceListRequest { +func (p *ExternalProviderCertificateServiceGetRequest) Header(key, value string) *ExternalProviderCertificateServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -30526,7 +29424,7 @@ func (p *NetworkFiltersServiceListRequest) Header(key, value string) *NetworkFil return p } -func (p *NetworkFiltersServiceListRequest) Query(key, value string) *NetworkFiltersServiceListRequest { +func (p *ExternalProviderCertificateServiceGetRequest) Query(key, value string) *ExternalProviderCertificateServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -30534,13 +29432,13 @@ func (p *NetworkFiltersServiceListRequest) Query(key, value string) *NetworkFilt return p } -func (p *NetworkFiltersServiceListRequest) Follow(follow string) *NetworkFiltersServiceListRequest { +func (p *ExternalProviderCertificateServiceGetRequest) Follow(follow string) *ExternalProviderCertificateServiceGetRequest { p.follow = &follow return p } -func (p *NetworkFiltersServiceListRequest) Send() (*NetworkFiltersServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.NetworkFiltersService.connection.URL(), p.NetworkFiltersService.path) +func (p *ExternalProviderCertificateServiceGetRequest) Send() (*ExternalProviderCertificateServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ExternalProviderCertificateService.connection.URL(), p.ExternalProviderCertificateService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -30559,7 +29457,7 @@ func (p *NetworkFiltersServiceListRequest) Send() (*NetworkFiltersServiceListRes return nil, err } - for hk, hv := range p.NetworkFiltersService.connection.headers { + for hk, hv := range p.ExternalProviderCertificateService.connection.headers { req.Header.Add(hk, hv) } @@ -30574,18 +29472,18 @@ func (p *NetworkFiltersServiceListRequest) Send() (*NetworkFiltersServiceListRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.NetworkFiltersService.connection.authenticate() + token, err := p.ExternalProviderCertificateService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.NetworkFiltersService.connection.client.Do(req) + resp, err := p.ExternalProviderCertificateService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.NetworkFiltersService.connection.logFunc != nil { + if p.ExternalProviderCertificateService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -30594,7 +29492,7 @@ func (p *NetworkFiltersServiceListRequest) Send() (*NetworkFiltersServiceListRes if err != nil { return nil, err } - p.NetworkFiltersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ExternalProviderCertificateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -30604,14 +29502,14 @@ func (p *NetworkFiltersServiceListRequest) Send() (*NetworkFiltersServiceListRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkFilterReadMany(reader, nil) + result, err := XMLCertificateReadOne(reader, nil, "") if err != nil { return nil, err } - return &NetworkFiltersServiceListResponse{filters: result}, nil + return &ExternalProviderCertificateServiceGetResponse{certificate: result}, nil } -func (p *NetworkFiltersServiceListRequest) MustSend() *NetworkFiltersServiceListResponse { +func (p *ExternalProviderCertificateServiceGetRequest) MustSend() *ExternalProviderCertificateServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -30620,85 +29518,113 @@ func (p *NetworkFiltersServiceListRequest) MustSend() *NetworkFiltersServiceList } // -// Retrieves the representations of the network filters. -// The order of the returned list of network filters isn't guaranteed. +// Get specific certificate. +// [source] +// ---- +// GET /ovirt-engine/api/externalhostproviders/123/certificate/0 +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// provider.example.com +// CN=provider.example.com +// ... +// +// ---- // -type NetworkFiltersServiceListResponse struct { - filters *NetworkFilterSlice +type ExternalProviderCertificateServiceGetResponse struct { + certificate *Certificate } -func (p *NetworkFiltersServiceListResponse) Filters() (*NetworkFilterSlice, bool) { - if p.filters != nil { - return p.filters, true +func (p *ExternalProviderCertificateServiceGetResponse) Certificate() (*Certificate, bool) { + if p.certificate != nil { + return p.certificate, true } return nil, false } -func (p *NetworkFiltersServiceListResponse) MustFilters() *NetworkFilterSlice { - if p.filters == nil { - panic("filters in response does not exist") +func (p *ExternalProviderCertificateServiceGetResponse) MustCertificate() *Certificate { + if p.certificate == nil { + panic("certificate in response does not exist") } - return p.filters -} - -// -// Retrieves the representations of the network filters. -// The order of the returned list of network filters isn't guaranteed. -// -func (p *NetworkFiltersService) List() *NetworkFiltersServiceListRequest { - return &NetworkFiltersServiceListRequest{NetworkFiltersService: p} + return p.certificate } // +// Get specific certificate. +// [source] +// ---- +// GET /ovirt-engine/api/externalhostproviders/123/certificate/0 +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// provider.example.com +// CN=provider.example.com +// ... +// +// ---- // -func (op *NetworkFiltersService) NetworkFilterService(id string) *NetworkFilterService { - return NewNetworkFilterService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (p *ExternalProviderCertificateService) Get() *ExternalProviderCertificateServiceGetRequest { + return &ExternalProviderCertificateServiceGetRequest{ExternalProviderCertificateService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *NetworkFiltersService) Service(path string) (Service, error) { +func (op *ExternalProviderCertificateService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.NetworkFilterService(path), nil - } - return op.NetworkFilterService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *NetworkFiltersService) String() string { - return fmt.Sprintf("NetworkFiltersService:%s", op.path) +func (op *ExternalProviderCertificateService) String() string { + return fmt.Sprintf("ExternalProviderCertificateService:%s", op.path) } // -// A service that provides information about an application installed in a virtual machine. +// A service to view certificates for external provider. // -type VmApplicationService struct { +type ExternalProviderCertificatesService struct { BaseService } -func NewVmApplicationService(connection *Connection, path string) *VmApplicationService { - var result VmApplicationService +func NewExternalProviderCertificatesService(connection *Connection, path string) *ExternalProviderCertificatesService { + var result ExternalProviderCertificatesService result.connection = connection result.path = path return &result } // -// Returns the information about the application. +// Returns the chain of certificates presented by the external provider. +// [source] +// ---- +// GET /ovirt-engine/api/externalhostproviders/123/certificates +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// ... +// ... +// +// ---- +// The order of the returned certificates is always guaranteed to be the sign order: the first is the +// certificate of the server itself, the second the certificate of the CA that signs the first, so on. // -type VmApplicationServiceGetRequest struct { - VmApplicationService *VmApplicationService - header map[string]string - query map[string]string - filter *bool - follow *string +type ExternalProviderCertificatesServiceListRequest struct { + ExternalProviderCertificatesService *ExternalProviderCertificatesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *VmApplicationServiceGetRequest) Header(key, value string) *VmApplicationServiceGetRequest { +func (p *ExternalProviderCertificatesServiceListRequest) Header(key, value string) *ExternalProviderCertificatesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -30706,7 +29632,7 @@ func (p *VmApplicationServiceGetRequest) Header(key, value string) *VmApplicatio return p } -func (p *VmApplicationServiceGetRequest) Query(key, value string) *VmApplicationServiceGetRequest { +func (p *ExternalProviderCertificatesServiceListRequest) Query(key, value string) *ExternalProviderCertificatesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -30714,27 +29640,27 @@ func (p *VmApplicationServiceGetRequest) Query(key, value string) *VmApplication return p } -func (p *VmApplicationServiceGetRequest) Filter(filter bool) *VmApplicationServiceGetRequest { - p.filter = &filter +func (p *ExternalProviderCertificatesServiceListRequest) Follow(follow string) *ExternalProviderCertificatesServiceListRequest { + p.follow = &follow return p } -func (p *VmApplicationServiceGetRequest) Follow(follow string) *VmApplicationServiceGetRequest { - p.follow = &follow +func (p *ExternalProviderCertificatesServiceListRequest) Max(max int64) *ExternalProviderCertificatesServiceListRequest { + p.max = &max return p } -func (p *VmApplicationServiceGetRequest) Send() (*VmApplicationServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmApplicationService.connection.URL(), p.VmApplicationService.path) +func (p *ExternalProviderCertificatesServiceListRequest) Send() (*ExternalProviderCertificatesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ExternalProviderCertificatesService.connection.URL(), p.ExternalProviderCertificatesService.path) values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -30748,7 +29674,7 @@ func (p *VmApplicationServiceGetRequest) Send() (*VmApplicationServiceGetRespons return nil, err } - for hk, hv := range p.VmApplicationService.connection.headers { + for hk, hv := range p.ExternalProviderCertificatesService.connection.headers { req.Header.Add(hk, hv) } @@ -30763,18 +29689,18 @@ func (p *VmApplicationServiceGetRequest) Send() (*VmApplicationServiceGetRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmApplicationService.connection.authenticate() + token, err := p.ExternalProviderCertificatesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmApplicationService.connection.client.Do(req) + resp, err := p.ExternalProviderCertificatesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmApplicationService.connection.logFunc != nil { + if p.ExternalProviderCertificatesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -30783,7 +29709,7 @@ func (p *VmApplicationServiceGetRequest) Send() (*VmApplicationServiceGetRespons if err != nil { return nil, err } - p.VmApplicationService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ExternalProviderCertificatesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -30793,14 +29719,14 @@ func (p *VmApplicationServiceGetRequest) Send() (*VmApplicationServiceGetRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLApplicationReadOne(reader, nil, "") + result, err := XMLCertificateReadMany(reader, nil) if err != nil { return nil, err } - return &VmApplicationServiceGetResponse{application: result}, nil + return &ExternalProviderCertificatesServiceListResponse{certificates: result}, nil } -func (p *VmApplicationServiceGetRequest) MustSend() *VmApplicationServiceGetResponse { +func (p *ExternalProviderCertificatesServiceListRequest) MustSend() *ExternalProviderCertificatesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -30809,93 +29735,112 @@ func (p *VmApplicationServiceGetRequest) MustSend() *VmApplicationServiceGetResp } // -// Returns the information about the application. +// Returns the chain of certificates presented by the external provider. +// [source] +// ---- +// GET /ovirt-engine/api/externalhostproviders/123/certificates +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// ... +// ... +// +// ---- +// The order of the returned certificates is always guaranteed to be the sign order: the first is the +// certificate of the server itself, the second the certificate of the CA that signs the first, so on. // -type VmApplicationServiceGetResponse struct { - application *Application +type ExternalProviderCertificatesServiceListResponse struct { + certificates *CertificateSlice } -func (p *VmApplicationServiceGetResponse) Application() (*Application, bool) { - if p.application != nil { - return p.application, true +func (p *ExternalProviderCertificatesServiceListResponse) Certificates() (*CertificateSlice, bool) { + if p.certificates != nil { + return p.certificates, true } return nil, false } -func (p *VmApplicationServiceGetResponse) MustApplication() *Application { - if p.application == nil { - panic("application in response does not exist") +func (p *ExternalProviderCertificatesServiceListResponse) MustCertificates() *CertificateSlice { + if p.certificates == nil { + panic("certificates in response does not exist") } - return p.application + return p.certificates } // -// Returns the information about the application. +// Returns the chain of certificates presented by the external provider. +// [source] +// ---- +// GET /ovirt-engine/api/externalhostproviders/123/certificates +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// ... +// ... +// +// ---- +// The order of the returned certificates is always guaranteed to be the sign order: the first is the +// certificate of the server itself, the second the certificate of the CA that signs the first, so on. // -func (p *VmApplicationService) Get() *VmApplicationServiceGetRequest { - return &VmApplicationServiceGetRequest{VmApplicationService: p} +func (p *ExternalProviderCertificatesService) List() *ExternalProviderCertificatesServiceListRequest { + return &ExternalProviderCertificatesServiceListRequest{ExternalProviderCertificatesService: p} +} + +// +// Reference to service that manages a specific certificate +// for this external provider. +// +func (op *ExternalProviderCertificatesService) CertificateService(id string) *ExternalProviderCertificateService { + return NewExternalProviderCertificateService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *VmApplicationService) Service(path string) (Service, error) { +func (op *ExternalProviderCertificatesService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.CertificateService(path), nil + } + return op.CertificateService(path[:index]).Service(path[index+1:]) } -func (op *VmApplicationService) String() string { - return fmt.Sprintf("VmApplicationService:%s", op.path) +func (op *ExternalProviderCertificatesService) String() string { + return fmt.Sprintf("ExternalProviderCertificatesService:%s", op.path) } // +// Provides capability to manage external providers. // -type VmNumaNodesService struct { +type ExternalProviderService struct { BaseService } -func NewVmNumaNodesService(connection *Connection, path string) *VmNumaNodesService { - var result VmNumaNodesService +func NewExternalProviderService(connection *Connection, path string) *ExternalProviderService { + var result ExternalProviderService result.connection = connection result.path = path return &result } // -// Creates a new virtual NUMA node for the virtual machine. -// An example of creating a NUMA node: -// [source] -// ---- -// POST /ovirt-engine/api/vms/c7ecd2dc/numanodes -// Accept: application/xml -// Content-type: application/xml -// ---- -// The request body can contain the following: -// [source,xml] -// ---- -// -// -// -// -// 0 -// -// -// -// 0 -// 1024 -// -// ---- +// Import the SSL certificates of the external host provider. // -type VmNumaNodesServiceAddRequest struct { - VmNumaNodesService *VmNumaNodesService - header map[string]string - query map[string]string - node *VirtualNumaNode +type ExternalProviderServiceImportCertificatesRequest struct { + ExternalProviderService *ExternalProviderService + header map[string]string + query map[string]string + certificates *CertificateSlice } -func (p *VmNumaNodesServiceAddRequest) Header(key, value string) *VmNumaNodesServiceAddRequest { +func (p *ExternalProviderServiceImportCertificatesRequest) Header(key, value string) *ExternalProviderServiceImportCertificatesRequest { if p.header == nil { p.header = make(map[string]string) } @@ -30903,7 +29848,7 @@ func (p *VmNumaNodesServiceAddRequest) Header(key, value string) *VmNumaNodesSer return p } -func (p *VmNumaNodesServiceAddRequest) Query(key, value string) *VmNumaNodesServiceAddRequest { +func (p *ExternalProviderServiceImportCertificatesRequest) Query(key, value string) *ExternalProviderServiceImportCertificatesRequest { if p.query == nil { p.query = make(map[string]string) } @@ -30911,13 +29856,27 @@ func (p *VmNumaNodesServiceAddRequest) Query(key, value string) *VmNumaNodesServ return p } -func (p *VmNumaNodesServiceAddRequest) Node(node *VirtualNumaNode) *VmNumaNodesServiceAddRequest { - p.node = node +func (p *ExternalProviderServiceImportCertificatesRequest) Certificates(certificates *CertificateSlice) *ExternalProviderServiceImportCertificatesRequest { + p.certificates = certificates return p } -func (p *VmNumaNodesServiceAddRequest) Send() (*VmNumaNodesServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNumaNodesService.connection.URL(), p.VmNumaNodesService.path) +func (p *ExternalProviderServiceImportCertificatesRequest) CertificatesOfAny(anys ...*Certificate) *ExternalProviderServiceImportCertificatesRequest { + if p.certificates == nil { + p.certificates = new(CertificateSlice) + } + p.certificates.slice = append(p.certificates.slice, anys...) + return p +} + +func (p *ExternalProviderServiceImportCertificatesRequest) Send() (*ExternalProviderServiceImportCertificatesResponse, error) { + rawURL := fmt.Sprintf("%s%s/importcertificates", p.ExternalProviderService.connection.URL(), p.ExternalProviderService.path) + actionBuilder := NewActionBuilder() + actionBuilder.Certificates(p.certificates) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -30929,17 +29888,14 @@ func (p *VmNumaNodesServiceAddRequest) Send() (*VmNumaNodesServiceAddResponse, e } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLVirtualNumaNodeWriteOne(writer, p.node, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmNumaNodesService.connection.headers { + for hk, hv := range p.ExternalProviderService.connection.headers { req.Header.Add(hk, hv) } @@ -30954,18 +29910,18 @@ func (p *VmNumaNodesServiceAddRequest) Send() (*VmNumaNodesServiceAddResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNumaNodesService.connection.authenticate() + token, err := p.ExternalProviderService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNumaNodesService.connection.client.Do(req) + resp, err := p.ExternalProviderService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNumaNodesService.connection.logFunc != nil { + if p.ExternalProviderService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -30974,24 +29930,16 @@ func (p *VmNumaNodesServiceAddRequest) Send() (*VmNumaNodesServiceAddResponse, e if err != nil { return nil, err } - p.VmNumaNodesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.ExternalProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLVirtualNumaNodeReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VmNumaNodesServiceAddResponse{node: result}, nil + return new(ExternalProviderServiceImportCertificatesResponse), nil } -func (p *VmNumaNodesServiceAddRequest) MustSend() *VmNumaNodesServiceAddResponse { +func (p *ExternalProviderServiceImportCertificatesRequest) MustSend() *ExternalProviderServiceImportCertificatesResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -31000,90 +29948,34 @@ func (p *VmNumaNodesServiceAddRequest) MustSend() *VmNumaNodesServiceAddResponse } // -// Creates a new virtual NUMA node for the virtual machine. -// An example of creating a NUMA node: -// [source] -// ---- -// POST /ovirt-engine/api/vms/c7ecd2dc/numanodes -// Accept: application/xml -// Content-type: application/xml -// ---- -// The request body can contain the following: -// [source,xml] -// ---- -// -// -// -// -// 0 -// -// -// -// 0 -// 1024 -// -// ---- +// Import the SSL certificates of the external host provider. // -type VmNumaNodesServiceAddResponse struct { - node *VirtualNumaNode -} - -func (p *VmNumaNodesServiceAddResponse) Node() (*VirtualNumaNode, bool) { - if p.node != nil { - return p.node, true - } - return nil, false +type ExternalProviderServiceImportCertificatesResponse struct { } -func (p *VmNumaNodesServiceAddResponse) MustNode() *VirtualNumaNode { - if p.node == nil { - panic("node in response does not exist") - } - return p.node +// +// Import the SSL certificates of the external host provider. +// +func (p *ExternalProviderService) ImportCertificates() *ExternalProviderServiceImportCertificatesRequest { + return &ExternalProviderServiceImportCertificatesRequest{ExternalProviderService: p} } // -// Creates a new virtual NUMA node for the virtual machine. -// An example of creating a NUMA node: +// In order to test connectivity for external provider we need +// to run following request where 123 is an id of a provider. // [source] // ---- -// POST /ovirt-engine/api/vms/c7ecd2dc/numanodes -// Accept: application/xml -// Content-type: application/xml -// ---- -// The request body can contain the following: -// [source,xml] -// ---- -// -// -// -// -// 0 -// -// -// -// 0 -// 1024 -// +// POST /ovirt-engine/api/externalhostproviders/123/testconnectivity // ---- // -func (p *VmNumaNodesService) Add() *VmNumaNodesServiceAddRequest { - return &VmNumaNodesServiceAddRequest{VmNumaNodesService: p} -} - -// -// Lists virtual NUMA nodes of a virtual machine. -// The order of the returned list of NUMA nodes isn't guaranteed. -// -type VmNumaNodesServiceListRequest struct { - VmNumaNodesService *VmNumaNodesService - header map[string]string - query map[string]string - follow *string - max *int64 +type ExternalProviderServiceTestConnectivityRequest struct { + ExternalProviderService *ExternalProviderService + header map[string]string + query map[string]string + async *bool } -func (p *VmNumaNodesServiceListRequest) Header(key, value string) *VmNumaNodesServiceListRequest { +func (p *ExternalProviderServiceTestConnectivityRequest) Header(key, value string) *ExternalProviderServiceTestConnectivityRequest { if p.header == nil { p.header = make(map[string]string) } @@ -31091,7 +29983,7 @@ func (p *VmNumaNodesServiceListRequest) Header(key, value string) *VmNumaNodesSe return p } -func (p *VmNumaNodesServiceListRequest) Query(key, value string) *VmNumaNodesServiceListRequest { +func (p *ExternalProviderServiceTestConnectivityRequest) Query(key, value string) *ExternalProviderServiceTestConnectivityRequest { if p.query == nil { p.query = make(map[string]string) } @@ -31099,27 +29991,22 @@ func (p *VmNumaNodesServiceListRequest) Query(key, value string) *VmNumaNodesSer return p } -func (p *VmNumaNodesServiceListRequest) Follow(follow string) *VmNumaNodesServiceListRequest { - p.follow = &follow - return p -} - -func (p *VmNumaNodesServiceListRequest) Max(max int64) *VmNumaNodesServiceListRequest { - p.max = &max +func (p *ExternalProviderServiceTestConnectivityRequest) Async(async bool) *ExternalProviderServiceTestConnectivityRequest { + p.async = &async return p } -func (p *VmNumaNodesServiceListRequest) Send() (*VmNumaNodesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNumaNodesService.connection.URL(), p.VmNumaNodesService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *ExternalProviderServiceTestConnectivityRequest) Send() (*ExternalProviderServiceTestConnectivityResponse, error) { + rawURL := fmt.Sprintf("%s%s/testconnectivity", p.ExternalProviderService.connection.URL(), p.ExternalProviderService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -31128,12 +30015,16 @@ func (p *VmNumaNodesServiceListRequest) Send() (*VmNumaNodesServiceListResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmNumaNodesService.connection.headers { + for hk, hv := range p.ExternalProviderService.connection.headers { req.Header.Add(hk, hv) } @@ -31148,18 +30039,18 @@ func (p *VmNumaNodesServiceListRequest) Send() (*VmNumaNodesServiceListResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNumaNodesService.connection.authenticate() + token, err := p.ExternalProviderService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNumaNodesService.connection.client.Do(req) + resp, err := p.ExternalProviderService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNumaNodesService.connection.logFunc != nil { + if p.ExternalProviderService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -31168,24 +30059,16 @@ func (p *VmNumaNodesServiceListRequest) Send() (*VmNumaNodesServiceListResponse, if err != nil { return nil, err } - p.VmNumaNodesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.ExternalProviderService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLVirtualNumaNodeReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VmNumaNodesServiceListResponse{nodes: result}, nil + return new(ExternalProviderServiceTestConnectivityResponse), nil } -func (p *VmNumaNodesServiceListRequest) MustSend() *VmNumaNodesServiceListResponse { +func (p *ExternalProviderServiceTestConnectivityRequest) MustSend() *ExternalProviderServiceTestConnectivityResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -31194,83 +30077,103 @@ func (p *VmNumaNodesServiceListRequest) MustSend() *VmNumaNodesServiceListRespon } // -// Lists virtual NUMA nodes of a virtual machine. -// The order of the returned list of NUMA nodes isn't guaranteed. +// In order to test connectivity for external provider we need +// to run following request where 123 is an id of a provider. +// [source] +// ---- +// POST /ovirt-engine/api/externalhostproviders/123/testconnectivity +// ---- // -type VmNumaNodesServiceListResponse struct { - nodes *VirtualNumaNodeSlice -} - -func (p *VmNumaNodesServiceListResponse) Nodes() (*VirtualNumaNodeSlice, bool) { - if p.nodes != nil { - return p.nodes, true - } - return nil, false -} - -func (p *VmNumaNodesServiceListResponse) MustNodes() *VirtualNumaNodeSlice { - if p.nodes == nil { - panic("nodes in response does not exist") - } - return p.nodes +type ExternalProviderServiceTestConnectivityResponse struct { } // -// Lists virtual NUMA nodes of a virtual machine. -// The order of the returned list of NUMA nodes isn't guaranteed. +// In order to test connectivity for external provider we need +// to run following request where 123 is an id of a provider. +// [source] +// ---- +// POST /ovirt-engine/api/externalhostproviders/123/testconnectivity +// ---- // -func (p *VmNumaNodesService) List() *VmNumaNodesServiceListRequest { - return &VmNumaNodesServiceListRequest{VmNumaNodesService: p} +func (p *ExternalProviderService) TestConnectivity() *ExternalProviderServiceTestConnectivityRequest { + return &ExternalProviderServiceTestConnectivityRequest{ExternalProviderService: p} } // +// A service to view certificates for this external provider. // -func (op *VmNumaNodesService) NodeService(id string) *VmNumaNodeService { - return NewVmNumaNodeService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *ExternalProviderService) CertificatesService() *ExternalProviderCertificatesService { + return NewExternalProviderCertificatesService(op.connection, fmt.Sprintf("%s/certificates", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *VmNumaNodesService) Service(path string) (Service, error) { +func (op *ExternalProviderService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.NodeService(path), nil + if path == "certificates" { + return op.CertificatesService(), nil } - return op.NodeService(path[:index]).Service(path[index+1:]) + if strings.HasPrefix(path, "certificates/") { + return op.CertificatesService().Service(path[13:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *VmNumaNodesService) String() string { - return fmt.Sprintf("VmNumaNodesService:%s", op.path) +func (op *ExternalProviderService) String() string { + return fmt.Sprintf("ExternalProviderService:%s", op.path) } // +// Provides capability to import external virtual machines. // -type StorageService struct { +type ExternalVmImportsService struct { BaseService } -func NewStorageService(connection *Connection, path string) *StorageService { - var result StorageService +func NewExternalVmImportsService(connection *Connection, path string) *ExternalVmImportsService { + var result ExternalVmImportsService result.connection = connection result.path = path return &result } // +// This operation is used to import a virtual machine from external hypervisor, such as KVM, XEN or VMware. +// For example import of a virtual machine from VMware can be facilitated using the following request: +// [source] +// ---- +// POST /externalvmimports +// ---- +// With request body of type <>, for example: +// [source,xml] +// ---- +// +// +// my_vm +// +// +// +// vm_name_as_is_in_vmware +// true +// vmware_user +// 123456 +// VMWARE +// vpx://wmware_user@vcenter-host/DataCenter/Cluster/esxi-host?no_verify=1 +// +// +// ---- // -type StorageServiceGetRequest struct { - StorageService *StorageService - header map[string]string - query map[string]string - follow *string - reportStatus *bool +type ExternalVmImportsServiceAddRequest struct { + ExternalVmImportsService *ExternalVmImportsService + header map[string]string + query map[string]string + import_ *ExternalVmImport } -func (p *StorageServiceGetRequest) Header(key, value string) *StorageServiceGetRequest { +func (p *ExternalVmImportsServiceAddRequest) Header(key, value string) *ExternalVmImportsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -31278,7 +30181,7 @@ func (p *StorageServiceGetRequest) Header(key, value string) *StorageServiceGetR return p } -func (p *StorageServiceGetRequest) Query(key, value string) *StorageServiceGetRequest { +func (p *ExternalVmImportsServiceAddRequest) Query(key, value string) *ExternalVmImportsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -31286,27 +30189,14 @@ func (p *StorageServiceGetRequest) Query(key, value string) *StorageServiceGetRe return p } -func (p *StorageServiceGetRequest) Follow(follow string) *StorageServiceGetRequest { - p.follow = &follow - return p -} - -func (p *StorageServiceGetRequest) ReportStatus(reportStatus bool) *StorageServiceGetRequest { - p.reportStatus = &reportStatus +func (p *ExternalVmImportsServiceAddRequest) Import(import_ *ExternalVmImport) *ExternalVmImportsServiceAddRequest { + p.import_ = import_ return p } -func (p *StorageServiceGetRequest) Send() (*StorageServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageService.connection.URL(), p.StorageService.path) +func (p *ExternalVmImportsServiceAddRequest) Send() (*ExternalVmImportsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.ExternalVmImportsService.connection.URL(), p.ExternalVmImportsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.reportStatus != nil { - values["report_status"] = []string{fmt.Sprintf("%v", *p.reportStatus)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -31315,12 +30205,19 @@ func (p *StorageServiceGetRequest) Send() (*StorageServiceGetResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLExternalVmImportWriteOne(writer, p.import_, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageService.connection.headers { + for hk, hv := range p.ExternalVmImportsService.connection.headers { req.Header.Add(hk, hv) } @@ -31335,18 +30232,18 @@ func (p *StorageServiceGetRequest) Send() (*StorageServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageService.connection.authenticate() + token, err := p.ExternalVmImportsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageService.connection.client.Do(req) + resp, err := p.ExternalVmImportsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageService.connection.logFunc != nil { + if p.ExternalVmImportsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -31355,9 +30252,9 @@ func (p *StorageServiceGetRequest) Send() (*StorageServiceGetResponse, error) { if err != nil { return nil, err } - p.StorageService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.ExternalVmImportsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -31365,14 +30262,14 @@ func (p *StorageServiceGetRequest) Send() (*StorageServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLHostStorageReadOne(reader, nil, "") + result, err := XMLExternalVmImportReadOne(reader, nil, "") if err != nil { return nil, err } - return &StorageServiceGetResponse{storage: result}, nil + return &ExternalVmImportsServiceAddResponse{import_: result}, nil } -func (p *StorageServiceGetRequest) MustSend() *StorageServiceGetResponse { +func (p *ExternalVmImportsServiceAddRequest) MustSend() *ExternalVmImportsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -31381,68 +30278,135 @@ func (p *StorageServiceGetRequest) MustSend() *StorageServiceGetResponse { } // +// This operation is used to import a virtual machine from external hypervisor, such as KVM, XEN or VMware. +// For example import of a virtual machine from VMware can be facilitated using the following request: +// [source] +// ---- +// POST /externalvmimports +// ---- +// With request body of type <>, for example: +// [source,xml] +// ---- +// +// +// my_vm +// +// +// +// vm_name_as_is_in_vmware +// true +// vmware_user +// 123456 +// VMWARE +// vpx://wmware_user@vcenter-host/DataCenter/Cluster/esxi-host?no_verify=1 +// +// +// ---- // -type StorageServiceGetResponse struct { - storage *HostStorage +type ExternalVmImportsServiceAddResponse struct { + import_ *ExternalVmImport } -func (p *StorageServiceGetResponse) Storage() (*HostStorage, bool) { - if p.storage != nil { - return p.storage, true +func (p *ExternalVmImportsServiceAddResponse) Import() (*ExternalVmImport, bool) { + if p.import_ != nil { + return p.import_, true } return nil, false } -func (p *StorageServiceGetResponse) MustStorage() *HostStorage { - if p.storage == nil { - panic("storage in response does not exist") +func (p *ExternalVmImportsServiceAddResponse) MustImport() *ExternalVmImport { + if p.import_ == nil { + panic("import_ in response does not exist") } - return p.storage + return p.import_ } // +// This operation is used to import a virtual machine from external hypervisor, such as KVM, XEN or VMware. +// For example import of a virtual machine from VMware can be facilitated using the following request: +// [source] +// ---- +// POST /externalvmimports +// ---- +// With request body of type <>, for example: +// [source,xml] +// ---- +// +// +// my_vm +// +// +// +// vm_name_as_is_in_vmware +// true +// vmware_user +// 123456 +// VMWARE +// vpx://wmware_user@vcenter-host/DataCenter/Cluster/esxi-host?no_verify=1 +// +// +// ---- // -func (p *StorageService) Get() *StorageServiceGetRequest { - return &StorageServiceGetRequest{StorageService: p} +func (p *ExternalVmImportsService) Add() *ExternalVmImportsServiceAddRequest { + return &ExternalVmImportsServiceAddRequest{ExternalVmImportsService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *StorageService) Service(path string) (Service, error) { +func (op *ExternalVmImportsService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *StorageService) String() string { - return fmt.Sprintf("StorageService:%s", op.path) +func (op *ExternalVmImportsService) String() string { + return fmt.Sprintf("ExternalVmImportsService:%s", op.path) } // +// A service to manage fence agent for a specific host. // -type UnmanagedNetworkService struct { +type FenceAgentService struct { BaseService } -func NewUnmanagedNetworkService(connection *Connection, path string) *UnmanagedNetworkService { - var result UnmanagedNetworkService +func NewFenceAgentService(connection *Connection, path string) *FenceAgentService { + var result FenceAgentService result.connection = connection result.path = path return &result } // +// Gets details of this fence agent. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123/fenceagents/0 +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// name1=value1, name2=value2 +// +// ---- // -type UnmanagedNetworkServiceGetRequest struct { - UnmanagedNetworkService *UnmanagedNetworkService - header map[string]string - query map[string]string - follow *string +type FenceAgentServiceGetRequest struct { + FenceAgentService *FenceAgentService + header map[string]string + query map[string]string + follow *string } -func (p *UnmanagedNetworkServiceGetRequest) Header(key, value string) *UnmanagedNetworkServiceGetRequest { +func (p *FenceAgentServiceGetRequest) Header(key, value string) *FenceAgentServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -31450,7 +30414,7 @@ func (p *UnmanagedNetworkServiceGetRequest) Header(key, value string) *Unmanaged return p } -func (p *UnmanagedNetworkServiceGetRequest) Query(key, value string) *UnmanagedNetworkServiceGetRequest { +func (p *FenceAgentServiceGetRequest) Query(key, value string) *FenceAgentServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -31458,13 +30422,13 @@ func (p *UnmanagedNetworkServiceGetRequest) Query(key, value string) *UnmanagedN return p } -func (p *UnmanagedNetworkServiceGetRequest) Follow(follow string) *UnmanagedNetworkServiceGetRequest { +func (p *FenceAgentServiceGetRequest) Follow(follow string) *FenceAgentServiceGetRequest { p.follow = &follow return p } -func (p *UnmanagedNetworkServiceGetRequest) Send() (*UnmanagedNetworkServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UnmanagedNetworkService.connection.URL(), p.UnmanagedNetworkService.path) +func (p *FenceAgentServiceGetRequest) Send() (*FenceAgentServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FenceAgentService.connection.URL(), p.FenceAgentService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -31483,7 +30447,7 @@ func (p *UnmanagedNetworkServiceGetRequest) Send() (*UnmanagedNetworkServiceGetR return nil, err } - for hk, hv := range p.UnmanagedNetworkService.connection.headers { + for hk, hv := range p.FenceAgentService.connection.headers { req.Header.Add(hk, hv) } @@ -31498,18 +30462,18 @@ func (p *UnmanagedNetworkServiceGetRequest) Send() (*UnmanagedNetworkServiceGetR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UnmanagedNetworkService.connection.authenticate() + token, err := p.FenceAgentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UnmanagedNetworkService.connection.client.Do(req) + resp, err := p.FenceAgentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UnmanagedNetworkService.connection.logFunc != nil { + if p.FenceAgentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -31518,7 +30482,7 @@ func (p *UnmanagedNetworkServiceGetRequest) Send() (*UnmanagedNetworkServiceGetR if err != nil { return nil, err } - p.UnmanagedNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FenceAgentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -31528,14 +30492,14 @@ func (p *UnmanagedNetworkServiceGetRequest) Send() (*UnmanagedNetworkServiceGetR return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUnmanagedNetworkReadOne(reader, nil, "") + result, err := XMLAgentReadOne(reader, nil, "") if err != nil { return nil, err } - return &UnmanagedNetworkServiceGetResponse{network: result}, nil + return &FenceAgentServiceGetResponse{agent: result}, nil } -func (p *UnmanagedNetworkServiceGetRequest) MustSend() *UnmanagedNetworkServiceGetResponse { +func (p *FenceAgentServiceGetRequest) MustSend() *FenceAgentServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -31544,41 +30508,82 @@ func (p *UnmanagedNetworkServiceGetRequest) MustSend() *UnmanagedNetworkServiceG } // -// -type UnmanagedNetworkServiceGetResponse struct { - network *UnmanagedNetwork +// Gets details of this fence agent. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123/fenceagents/0 +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// name1=value1, name2=value2 +// +// ---- +// +type FenceAgentServiceGetResponse struct { + agent *Agent } -func (p *UnmanagedNetworkServiceGetResponse) Network() (*UnmanagedNetwork, bool) { - if p.network != nil { - return p.network, true +func (p *FenceAgentServiceGetResponse) Agent() (*Agent, bool) { + if p.agent != nil { + return p.agent, true } return nil, false } -func (p *UnmanagedNetworkServiceGetResponse) MustNetwork() *UnmanagedNetwork { - if p.network == nil { - panic("network in response does not exist") +func (p *FenceAgentServiceGetResponse) MustAgent() *Agent { + if p.agent == nil { + panic("agent in response does not exist") } - return p.network + return p.agent } // +// Gets details of this fence agent. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123/fenceagents/0 +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// name1=value1, name2=value2 +// +// ---- // -func (p *UnmanagedNetworkService) Get() *UnmanagedNetworkServiceGetRequest { - return &UnmanagedNetworkServiceGetRequest{UnmanagedNetworkService: p} +func (p *FenceAgentService) Get() *FenceAgentServiceGetRequest { + return &FenceAgentServiceGetRequest{FenceAgentService: p} } // +// Removes a fence agent for a specific host. +// [source] +// ---- +// DELETE /ovirt-engine/api/hosts/123/fenceagents/0 +// ---- // -type UnmanagedNetworkServiceRemoveRequest struct { - UnmanagedNetworkService *UnmanagedNetworkService - header map[string]string - query map[string]string - async *bool +type FenceAgentServiceRemoveRequest struct { + FenceAgentService *FenceAgentService + header map[string]string + query map[string]string + async *bool } -func (p *UnmanagedNetworkServiceRemoveRequest) Header(key, value string) *UnmanagedNetworkServiceRemoveRequest { +func (p *FenceAgentServiceRemoveRequest) Header(key, value string) *FenceAgentServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -31586,7 +30591,7 @@ func (p *UnmanagedNetworkServiceRemoveRequest) Header(key, value string) *Unmana return p } -func (p *UnmanagedNetworkServiceRemoveRequest) Query(key, value string) *UnmanagedNetworkServiceRemoveRequest { +func (p *FenceAgentServiceRemoveRequest) Query(key, value string) *FenceAgentServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -31594,13 +30599,13 @@ func (p *UnmanagedNetworkServiceRemoveRequest) Query(key, value string) *Unmanag return p } -func (p *UnmanagedNetworkServiceRemoveRequest) Async(async bool) *UnmanagedNetworkServiceRemoveRequest { +func (p *FenceAgentServiceRemoveRequest) Async(async bool) *FenceAgentServiceRemoveRequest { p.async = &async return p } -func (p *UnmanagedNetworkServiceRemoveRequest) Send() (*UnmanagedNetworkServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UnmanagedNetworkService.connection.URL(), p.UnmanagedNetworkService.path) +func (p *FenceAgentServiceRemoveRequest) Send() (*FenceAgentServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FenceAgentService.connection.URL(), p.FenceAgentService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -31619,7 +30624,7 @@ func (p *UnmanagedNetworkServiceRemoveRequest) Send() (*UnmanagedNetworkServiceR return nil, err } - for hk, hv := range p.UnmanagedNetworkService.connection.headers { + for hk, hv := range p.FenceAgentService.connection.headers { req.Header.Add(hk, hv) } @@ -31634,18 +30639,18 @@ func (p *UnmanagedNetworkServiceRemoveRequest) Send() (*UnmanagedNetworkServiceR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UnmanagedNetworkService.connection.authenticate() + token, err := p.FenceAgentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UnmanagedNetworkService.connection.client.Do(req) + resp, err := p.FenceAgentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UnmanagedNetworkService.connection.logFunc != nil { + if p.FenceAgentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -31654,7 +30659,7 @@ func (p *UnmanagedNetworkServiceRemoveRequest) Send() (*UnmanagedNetworkServiceR if err != nil { return nil, err } - p.UnmanagedNetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FenceAgentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -31663,10 +30668,10 @@ func (p *UnmanagedNetworkServiceRemoveRequest) Send() (*UnmanagedNetworkServiceR if errReadBody != nil { return nil, errReadBody } - return new(UnmanagedNetworkServiceRemoveResponse), nil + return new(FenceAgentServiceRemoveResponse), nil } -func (p *UnmanagedNetworkServiceRemoveRequest) MustSend() *UnmanagedNetworkServiceRemoveResponse { +func (p *FenceAgentServiceRemoveRequest) MustSend() *FenceAgentServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -31675,65 +30680,38 @@ func (p *UnmanagedNetworkServiceRemoveRequest) MustSend() *UnmanagedNetworkServi } // +// Removes a fence agent for a specific host. +// [source] +// ---- +// DELETE /ovirt-engine/api/hosts/123/fenceagents/0 +// ---- // -type UnmanagedNetworkServiceRemoveResponse struct { -} - -// -// -func (p *UnmanagedNetworkService) Remove() *UnmanagedNetworkServiceRemoveRequest { - return &UnmanagedNetworkServiceRemoveRequest{UnmanagedNetworkService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *UnmanagedNetworkService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *UnmanagedNetworkService) String() string { - return fmt.Sprintf("UnmanagedNetworkService:%s", op.path) +type FenceAgentServiceRemoveResponse struct { } // +// Removes a fence agent for a specific host. +// [source] +// ---- +// DELETE /ovirt-engine/api/hosts/123/fenceagents/0 +// ---- // -type AttachedStorageDomainService struct { - BaseService -} - -func NewAttachedStorageDomainService(connection *Connection, path string) *AttachedStorageDomainService { - var result AttachedStorageDomainService - result.connection = connection - result.path = path - return &result +func (p *FenceAgentService) Remove() *FenceAgentServiceRemoveRequest { + return &FenceAgentServiceRemoveRequest{FenceAgentService: p} } // -// This operation activates an attached storage domain. -// Once the storage domain is activated it is ready for use with the data center. -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate -// ---- -// The activate action does not take any action specific parameters, -// so the request body should contain an empty `action`: -// [source,xml] -// ---- -// -// ---- +// Update a fencing-agent. // -type AttachedStorageDomainServiceActivateRequest struct { - AttachedStorageDomainService *AttachedStorageDomainService - header map[string]string - query map[string]string - async *bool +type FenceAgentServiceUpdateRequest struct { + FenceAgentService *FenceAgentService + header map[string]string + query map[string]string + agent *Agent + async *bool } -func (p *AttachedStorageDomainServiceActivateRequest) Header(key, value string) *AttachedStorageDomainServiceActivateRequest { +func (p *FenceAgentServiceUpdateRequest) Header(key, value string) *FenceAgentServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -31741,7 +30719,7 @@ func (p *AttachedStorageDomainServiceActivateRequest) Header(key, value string) return p } -func (p *AttachedStorageDomainServiceActivateRequest) Query(key, value string) *AttachedStorageDomainServiceActivateRequest { +func (p *FenceAgentServiceUpdateRequest) Query(key, value string) *FenceAgentServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -31749,22 +30727,23 @@ func (p *AttachedStorageDomainServiceActivateRequest) Query(key, value string) * return p } -func (p *AttachedStorageDomainServiceActivateRequest) Async(async bool) *AttachedStorageDomainServiceActivateRequest { +func (p *FenceAgentServiceUpdateRequest) Agent(agent *Agent) *FenceAgentServiceUpdateRequest { + p.agent = agent + return p +} + +func (p *FenceAgentServiceUpdateRequest) Async(async bool) *FenceAgentServiceUpdateRequest { p.async = &async return p } -func (p *AttachedStorageDomainServiceActivateRequest) Send() (*AttachedStorageDomainServiceActivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/activate", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) - actionBuilder := NewActionBuilder() +func (p *FenceAgentServiceUpdateRequest) Send() (*FenceAgentServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FenceAgentService.connection.URL(), p.FenceAgentService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -31775,14 +30754,17 @@ func (p *AttachedStorageDomainServiceActivateRequest) Send() (*AttachedStorageDo } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLAgentWriteOne(writer, p.agent, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainService.connection.headers { + for hk, hv := range p.FenceAgentService.connection.headers { req.Header.Add(hk, hv) } @@ -31797,18 +30779,18 @@ func (p *AttachedStorageDomainServiceActivateRequest) Send() (*AttachedStorageDo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainService.connection.authenticate() + token, err := p.FenceAgentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainService.connection.client.Do(req) + resp, err := p.FenceAgentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainService.connection.logFunc != nil { + if p.FenceAgentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -31817,16 +30799,24 @@ func (p *AttachedStorageDomainServiceActivateRequest) Send() (*AttachedStorageDo if err != nil { return nil, err } - p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FenceAgentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(AttachedStorageDomainServiceActivateResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLAgentReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &FenceAgentServiceUpdateResponse{agent: result}, nil } -func (p *AttachedStorageDomainServiceActivateRequest) MustSend() *AttachedStorageDomainServiceActivateResponse { +func (p *FenceAgentServiceUpdateRequest) MustSend() *FenceAgentServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -31835,66 +30825,123 @@ func (p *AttachedStorageDomainServiceActivateRequest) MustSend() *AttachedStorag } // -// This operation activates an attached storage domain. -// Once the storage domain is activated it is ready for use with the data center. -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate -// ---- -// The activate action does not take any action specific parameters, -// so the request body should contain an empty `action`: -// [source,xml] -// ---- -// -// ---- +// Update a fencing-agent. // -type AttachedStorageDomainServiceActivateResponse struct { +type FenceAgentServiceUpdateResponse struct { + agent *Agent +} + +func (p *FenceAgentServiceUpdateResponse) Agent() (*Agent, bool) { + if p.agent != nil { + return p.agent, true + } + return nil, false +} + +func (p *FenceAgentServiceUpdateResponse) MustAgent() *Agent { + if p.agent == nil { + panic("agent in response does not exist") + } + return p.agent } // -// This operation activates an attached storage domain. -// Once the storage domain is activated it is ready for use with the data center. -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/storagedomains/456/activate -// ---- -// The activate action does not take any action specific parameters, -// so the request body should contain an empty `action`: -// [source,xml] -// ---- -// -// ---- +// Update a fencing-agent. // -func (p *AttachedStorageDomainService) Activate() *AttachedStorageDomainServiceActivateRequest { - return &AttachedStorageDomainServiceActivateRequest{AttachedStorageDomainService: p} +func (p *FenceAgentService) Update() *FenceAgentServiceUpdateRequest { + return &FenceAgentServiceUpdateRequest{FenceAgentService: p} } // -// This operation deactivates an attached storage domain. -// Once the storage domain is deactivated it will not be used with the data center. -// For example, to deactivate storage domain `456`, send the following request: +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *FenceAgentService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *FenceAgentService) String() string { + return fmt.Sprintf("FenceAgentService:%s", op.path) +} + +// +// A service to manage fence agents for a specific host. +// +type FenceAgentsService struct { + BaseService +} + +func NewFenceAgentsService(connection *Connection, path string) *FenceAgentsService { + var result FenceAgentsService + result.connection = connection + result.path = path + return &result +} + +// +// Add a new fencing-agent to the host. // [source] // ---- -// POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate +// POST /ovirt-engine/api/hosts/123/fenceagents +// You should consult the /usr/sbin/fence_ manual page for +// the legal parameters to [name1=value1, name2=value2,...] in the options field. +// If any parameter in options appears by name that means that it is mandatory. +// For example in slot=7[,name1=value1, name2=value2,...] +// slot is mandatory. // ---- -// With a request body like this: +// apc, bladecenter, wti fencing agent/s sample request: // [source,xml] -// ---- -// -// ---- -// If the `force` parameter is `true` then the operation will succeed, even if the OVF update which takes place -// before the deactivation of the storage domain failed. If the `force` parameter is `false` and the OVF update failed, -// the deactivation of the storage domain will also fail. +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// slot=7[,name1=value1, name2=value2,...] +// +// apc_snmp, hpblade, ilo, ilo2, ilo_ssh, redfish, rsa fencing agent/s sample request: +// [source,xml] +// +// apc_snmp +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// [name1=value1, name2=value2,...] +// +// cisco_ucs, drac5, eps fencing agent/s sample request: +// [source,xml] +// +// cisco_ucs +// 1 +// 192.168.1.101 +// user +// xxx +// slot=7[,name1=value1, name2=value2,...] +// +// drac7, ilo3, ilo4, ipmilan, rsb fencing agent/s sample request: +// [source,xml] +// +// drac7 +// 1 +// 192.168.1.101 +// user +// xxx +// [name1=value1, name2=value2,...] +// // -type AttachedStorageDomainServiceDeactivateRequest struct { - AttachedStorageDomainService *AttachedStorageDomainService - header map[string]string - query map[string]string - async *bool - force *bool +type FenceAgentsServiceAddRequest struct { + FenceAgentsService *FenceAgentsService + header map[string]string + query map[string]string + agent *Agent } -func (p *AttachedStorageDomainServiceDeactivateRequest) Header(key, value string) *AttachedStorageDomainServiceDeactivateRequest { +func (p *FenceAgentsServiceAddRequest) Header(key, value string) *FenceAgentsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -31902,7 +30949,7 @@ func (p *AttachedStorageDomainServiceDeactivateRequest) Header(key, value string return p } -func (p *AttachedStorageDomainServiceDeactivateRequest) Query(key, value string) *AttachedStorageDomainServiceDeactivateRequest { +func (p *FenceAgentsServiceAddRequest) Query(key, value string) *FenceAgentsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -31910,29 +30957,13 @@ func (p *AttachedStorageDomainServiceDeactivateRequest) Query(key, value string) return p } -func (p *AttachedStorageDomainServiceDeactivateRequest) Async(async bool) *AttachedStorageDomainServiceDeactivateRequest { - p.async = &async - return p -} - -func (p *AttachedStorageDomainServiceDeactivateRequest) Force(force bool) *AttachedStorageDomainServiceDeactivateRequest { - p.force = &force +func (p *FenceAgentsServiceAddRequest) Agent(agent *Agent) *FenceAgentsServiceAddRequest { + p.agent = agent return p } -func (p *AttachedStorageDomainServiceDeactivateRequest) Send() (*AttachedStorageDomainServiceDeactivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/deactivate", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.force != nil { - actionBuilder.Force(*p.force) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *FenceAgentsServiceAddRequest) Send() (*FenceAgentsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FenceAgentsService.connection.URL(), p.FenceAgentsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -31944,14 +30975,17 @@ func (p *AttachedStorageDomainServiceDeactivateRequest) Send() (*AttachedStorage } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLAgentWriteOne(writer, p.agent, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainService.connection.headers { + for hk, hv := range p.FenceAgentsService.connection.headers { req.Header.Add(hk, hv) } @@ -31966,18 +31000,18 @@ func (p *AttachedStorageDomainServiceDeactivateRequest) Send() (*AttachedStorage req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainService.connection.authenticate() + token, err := p.FenceAgentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainService.connection.client.Do(req) + resp, err := p.FenceAgentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainService.connection.logFunc != nil { + if p.FenceAgentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -31986,16 +31020,24 @@ func (p *AttachedStorageDomainServiceDeactivateRequest) Send() (*AttachedStorage if err != nil { return nil, err } - p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FenceAgentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(AttachedStorageDomainServiceDeactivateResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLAgentReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &FenceAgentsServiceAddResponse{agent: result}, nil } -func (p *AttachedStorageDomainServiceDeactivateRequest) MustSend() *AttachedStorageDomainServiceDeactivateResponse { +func (p *FenceAgentsServiceAddRequest) MustSend() *FenceAgentsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -32004,56 +31046,167 @@ func (p *AttachedStorageDomainServiceDeactivateRequest) MustSend() *AttachedStor } // -// This operation deactivates an attached storage domain. -// Once the storage domain is deactivated it will not be used with the data center. -// For example, to deactivate storage domain `456`, send the following request: +// Add a new fencing-agent to the host. // [source] // ---- -// POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate +// POST /ovirt-engine/api/hosts/123/fenceagents +// You should consult the /usr/sbin/fence_ manual page for +// the legal parameters to [name1=value1, name2=value2,...] in the options field. +// If any parameter in options appears by name that means that it is mandatory. +// For example in slot=7[,name1=value1, name2=value2,...] +// slot is mandatory. // ---- -// With a request body like this: +// apc, bladecenter, wti fencing agent/s sample request: // [source,xml] -// ---- -// -// ---- -// If the `force` parameter is `true` then the operation will succeed, even if the OVF update which takes place -// before the deactivation of the storage domain failed. If the `force` parameter is `false` and the OVF update failed, -// the deactivation of the storage domain will also fail. +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// slot=7[,name1=value1, name2=value2,...] +// +// apc_snmp, hpblade, ilo, ilo2, ilo_ssh, redfish, rsa fencing agent/s sample request: +// [source,xml] +// +// apc_snmp +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// [name1=value1, name2=value2,...] +// +// cisco_ucs, drac5, eps fencing agent/s sample request: +// [source,xml] +// +// cisco_ucs +// 1 +// 192.168.1.101 +// user +// xxx +// slot=7[,name1=value1, name2=value2,...] +// +// drac7, ilo3, ilo4, ipmilan, rsb fencing agent/s sample request: +// [source,xml] +// +// drac7 +// 1 +// 192.168.1.101 +// user +// xxx +// [name1=value1, name2=value2,...] +// // -type AttachedStorageDomainServiceDeactivateResponse struct { +type FenceAgentsServiceAddResponse struct { + agent *Agent +} + +func (p *FenceAgentsServiceAddResponse) Agent() (*Agent, bool) { + if p.agent != nil { + return p.agent, true + } + return nil, false +} + +func (p *FenceAgentsServiceAddResponse) MustAgent() *Agent { + if p.agent == nil { + panic("agent in response does not exist") + } + return p.agent } // -// This operation deactivates an attached storage domain. -// Once the storage domain is deactivated it will not be used with the data center. -// For example, to deactivate storage domain `456`, send the following request: +// Add a new fencing-agent to the host. // [source] // ---- -// POST /ovirt-engine/api/datacenters/123/storagedomains/456/deactivate -// ---- -// With a request body like this: -// [source,xml] -// ---- -// +// POST /ovirt-engine/api/hosts/123/fenceagents +// You should consult the /usr/sbin/fence_ manual page for +// the legal parameters to [name1=value1, name2=value2,...] in the options field. +// If any parameter in options appears by name that means that it is mandatory. +// For example in slot=7[,name1=value1, name2=value2,...] +// slot is mandatory. // ---- -// If the `force` parameter is `true` then the operation will succeed, even if the OVF update which takes place -// before the deactivation of the storage domain failed. If the `force` parameter is `false` and the OVF update failed, -// the deactivation of the storage domain will also fail. +// apc, bladecenter, wti fencing agent/s sample request: +// [source,xml] +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// slot=7[,name1=value1, name2=value2,...] +// +// apc_snmp, hpblade, ilo, ilo2, ilo_ssh, redfish, rsa fencing agent/s sample request: +// [source,xml] +// +// apc_snmp +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// [name1=value1, name2=value2,...] +// +// cisco_ucs, drac5, eps fencing agent/s sample request: +// [source,xml] +// +// cisco_ucs +// 1 +// 192.168.1.101 +// user +// xxx +// slot=7[,name1=value1, name2=value2,...] +// +// drac7, ilo3, ilo4, ipmilan, rsb fencing agent/s sample request: +// [source,xml] +// +// drac7 +// 1 +// 192.168.1.101 +// user +// xxx +// [name1=value1, name2=value2,...] +// // -func (p *AttachedStorageDomainService) Deactivate() *AttachedStorageDomainServiceDeactivateRequest { - return &AttachedStorageDomainServiceDeactivateRequest{AttachedStorageDomainService: p} +func (p *FenceAgentsService) Add() *FenceAgentsServiceAddRequest { + return &FenceAgentsServiceAddRequest{FenceAgentsService: p} } // +// Returns the list of fencing agents configured for the host. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123/fenceagents +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// name1=value1, name2=value2 +// +// +// ---- +// The order of the returned list of fencing agents isn't guaranteed. // -type AttachedStorageDomainServiceGetRequest struct { - AttachedStorageDomainService *AttachedStorageDomainService - header map[string]string - query map[string]string - follow *string +type FenceAgentsServiceListRequest struct { + FenceAgentsService *FenceAgentsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *AttachedStorageDomainServiceGetRequest) Header(key, value string) *AttachedStorageDomainServiceGetRequest { +func (p *FenceAgentsServiceListRequest) Header(key, value string) *FenceAgentsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -32061,7 +31214,7 @@ func (p *AttachedStorageDomainServiceGetRequest) Header(key, value string) *Atta return p } -func (p *AttachedStorageDomainServiceGetRequest) Query(key, value string) *AttachedStorageDomainServiceGetRequest { +func (p *FenceAgentsServiceListRequest) Query(key, value string) *FenceAgentsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -32069,18 +31222,27 @@ func (p *AttachedStorageDomainServiceGetRequest) Query(key, value string) *Attac return p } -func (p *AttachedStorageDomainServiceGetRequest) Follow(follow string) *AttachedStorageDomainServiceGetRequest { +func (p *FenceAgentsServiceListRequest) Follow(follow string) *FenceAgentsServiceListRequest { p.follow = &follow return p } -func (p *AttachedStorageDomainServiceGetRequest) Send() (*AttachedStorageDomainServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) +func (p *FenceAgentsServiceListRequest) Max(max int64) *FenceAgentsServiceListRequest { + p.max = &max + return p +} + +func (p *FenceAgentsServiceListRequest) Send() (*FenceAgentsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FenceAgentsService.connection.URL(), p.FenceAgentsService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -32094,7 +31256,7 @@ func (p *AttachedStorageDomainServiceGetRequest) Send() (*AttachedStorageDomainS return nil, err } - for hk, hv := range p.AttachedStorageDomainService.connection.headers { + for hk, hv := range p.FenceAgentsService.connection.headers { req.Header.Add(hk, hv) } @@ -32109,18 +31271,18 @@ func (p *AttachedStorageDomainServiceGetRequest) Send() (*AttachedStorageDomainS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainService.connection.authenticate() + token, err := p.FenceAgentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainService.connection.client.Do(req) + resp, err := p.FenceAgentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainService.connection.logFunc != nil { + if p.FenceAgentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -32129,7 +31291,7 @@ func (p *AttachedStorageDomainServiceGetRequest) Send() (*AttachedStorageDomainS if err != nil { return nil, err } - p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FenceAgentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -32139,14 +31301,14 @@ func (p *AttachedStorageDomainServiceGetRequest) Send() (*AttachedStorageDomainS return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageDomainReadOne(reader, nil, "") + result, err := XMLAgentReadMany(reader, nil) if err != nil { return nil, err } - return &AttachedStorageDomainServiceGetResponse{storageDomain: result}, nil + return &FenceAgentsServiceListResponse{agents: result}, nil } -func (p *AttachedStorageDomainServiceGetRequest) MustSend() *AttachedStorageDomainServiceGetResponse { +func (p *FenceAgentsServiceListRequest) MustSend() *FenceAgentsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -32155,41 +31317,122 @@ func (p *AttachedStorageDomainServiceGetRequest) MustSend() *AttachedStorageDoma } // +// Returns the list of fencing agents configured for the host. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123/fenceagents +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// name1=value1, name2=value2 +// +// +// ---- +// The order of the returned list of fencing agents isn't guaranteed. // -type AttachedStorageDomainServiceGetResponse struct { - storageDomain *StorageDomain +type FenceAgentsServiceListResponse struct { + agents *AgentSlice } -func (p *AttachedStorageDomainServiceGetResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true +func (p *FenceAgentsServiceListResponse) Agents() (*AgentSlice, bool) { + if p.agents != nil { + return p.agents, true } return nil, false } -func (p *AttachedStorageDomainServiceGetResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") +func (p *FenceAgentsServiceListResponse) MustAgents() *AgentSlice { + if p.agents == nil { + panic("agents in response does not exist") } - return p.storageDomain + return p.agents } // +// Returns the list of fencing agents configured for the host. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123/fenceagents +// ---- +// And here is sample response: +// [source,xml] +// ---- +// +// +// apc +// 1 +// 192.168.1.101 +// user +// xxx +// 9 +// name1=value1, name2=value2 +// +// +// ---- +// The order of the returned list of fencing agents isn't guaranteed. // -func (p *AttachedStorageDomainService) Get() *AttachedStorageDomainServiceGetRequest { - return &AttachedStorageDomainServiceGetRequest{AttachedStorageDomainService: p} +func (p *FenceAgentsService) List() *FenceAgentsServiceListRequest { + return &FenceAgentsServiceListRequest{FenceAgentsService: p} +} + +// +// Reference to service that manages a specific fence agent +// for this host. +// +func (op *FenceAgentsService) AgentService(id string) *FenceAgentService { + return NewFenceAgentService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // +// Service locator method, returns individual service on which the URI is dispatched. // -type AttachedStorageDomainServiceRemoveRequest struct { - AttachedStorageDomainService *AttachedStorageDomainService - header map[string]string - query map[string]string - async *bool +func (op *FenceAgentsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.AgentService(path), nil + } + return op.AgentService(path[:index]).Service(path[index+1:]) } -func (p *AttachedStorageDomainServiceRemoveRequest) Header(key, value string) *AttachedStorageDomainServiceRemoveRequest { +func (op *FenceAgentsService) String() string { + return fmt.Sprintf("FenceAgentsService:%s", op.path) +} + +// +// +type FileService struct { + BaseService +} + +func NewFileService(connection *Connection, path string) *FileService { + var result FileService + result.connection = connection + result.path = path + return &result +} + +// +// +type FileServiceGetRequest struct { + FileService *FileService + header map[string]string + query map[string]string + follow *string +} + +func (p *FileServiceGetRequest) Header(key, value string) *FileServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -32197,7 +31440,7 @@ func (p *AttachedStorageDomainServiceRemoveRequest) Header(key, value string) *A return p } -func (p *AttachedStorageDomainServiceRemoveRequest) Query(key, value string) *AttachedStorageDomainServiceRemoveRequest { +func (p *FileServiceGetRequest) Query(key, value string) *FileServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -32205,16 +31448,16 @@ func (p *AttachedStorageDomainServiceRemoveRequest) Query(key, value string) *At return p } -func (p *AttachedStorageDomainServiceRemoveRequest) Async(async bool) *AttachedStorageDomainServiceRemoveRequest { - p.async = &async +func (p *FileServiceGetRequest) Follow(follow string) *FileServiceGetRequest { + p.follow = &follow return p } -func (p *AttachedStorageDomainServiceRemoveRequest) Send() (*AttachedStorageDomainServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AttachedStorageDomainService.connection.URL(), p.AttachedStorageDomainService.path) +func (p *FileServiceGetRequest) Send() (*FileServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FileService.connection.URL(), p.FileService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -32225,12 +31468,12 @@ func (p *AttachedStorageDomainServiceRemoveRequest) Send() (*AttachedStorageDoma if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.AttachedStorageDomainService.connection.headers { + for hk, hv := range p.FileService.connection.headers { req.Header.Add(hk, hv) } @@ -32245,18 +31488,18 @@ func (p *AttachedStorageDomainServiceRemoveRequest) Send() (*AttachedStorageDoma req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AttachedStorageDomainService.connection.authenticate() + token, err := p.FileService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AttachedStorageDomainService.connection.client.Do(req) + resp, err := p.FileService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AttachedStorageDomainService.connection.logFunc != nil { + if p.FileService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -32265,19 +31508,24 @@ func (p *AttachedStorageDomainServiceRemoveRequest) Send() (*AttachedStorageDoma if err != nil { return nil, err } - p.AttachedStorageDomainService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FileService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(AttachedStorageDomainServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLFileReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &FileServiceGetResponse{file: result}, nil } -func (p *AttachedStorageDomainServiceRemoveRequest) MustSend() *AttachedStorageDomainServiceRemoveResponse { +func (p *FileServiceGetRequest) MustSend() *FileServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -32287,77 +31535,89 @@ func (p *AttachedStorageDomainServiceRemoveRequest) MustSend() *AttachedStorageD // // -type AttachedStorageDomainServiceRemoveResponse struct { +type FileServiceGetResponse struct { + file *File } -// -// -func (p *AttachedStorageDomainService) Remove() *AttachedStorageDomainServiceRemoveRequest { - return &AttachedStorageDomainServiceRemoveRequest{AttachedStorageDomainService: p} +func (p *FileServiceGetResponse) File() (*File, bool) { + if p.file != nil { + return p.file, true + } + return nil, false +} + +func (p *FileServiceGetResponse) MustFile() *File { + if p.file == nil { + panic("file in response does not exist") + } + return p.file } // // -func (op *AttachedStorageDomainService) DisksService() *AttachedStorageDomainDisksService { - return NewAttachedStorageDomainDisksService(op.connection, fmt.Sprintf("%s/disks", op.path)) +func (p *FileService) Get() *FileServiceGetRequest { + return &FileServiceGetRequest{FileService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *AttachedStorageDomainService) Service(path string) (Service, error) { +func (op *FileService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "disks" { - return op.DisksService(), nil - } - if strings.HasPrefix(path, "disks/") { - return op.DisksService().Service(path[6:]) - } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *AttachedStorageDomainService) String() string { - return fmt.Sprintf("AttachedStorageDomainService:%s", op.path) +func (op *FileService) String() string { + return fmt.Sprintf("FileService:%s", op.path) } // -// Represents a permits sub-collection of the specific role. +// Provides a way for clients to list available files. +// This service is specifically targeted to ISO storage domains, which contain ISO images and virtual floppy disks +// (VFDs) that an administrator uploads. +// The addition of a CD-ROM device to a virtual machine requires an ISO image from the files of an ISO storage domain. // -type PermitsService struct { +type FilesService struct { BaseService } -func NewPermitsService(connection *Connection, path string) *PermitsService { - var result PermitsService +func NewFilesService(connection *Connection, path string) *FilesService { + var result FilesService result.connection = connection result.path = path return &result } // -// Adds a permit to the role. The permit name can be retrieved from the <> service. -// For example to assign a permit `create_vm` to the role with id `123` send a request like this: -// .... -// POST /ovirt-engine/api/roles/123/permits -// .... -// With a request body like this: -// [source,xml] +// Returns the list of ISO images and virtual floppy disks available in the storage domain. The order of +// the returned list is not guaranteed. +// If the `refresh` parameter is `false`, the returned list may not reflect recent changes to the storage domain; +// for example, it may not contain a new ISO file that was recently added. This is because the +// server caches the list of files to improve performance. To get the very latest results, set the `refresh` +// parameter to `true`. +// The default value of the `refresh` parameter is `true`, but it can be changed using the configuration value +// `ForceRefreshDomainFilesByDefault`: +// [source] // ---- -// -// create_vm -// +// # engine-config -s ForceRefreshDomainFilesByDefault=false // ---- +// IMPORTANT: Setting the value of the `refresh` parameter to `true` has an impact on the performance of the +// server. Use it only if necessary. // -type PermitsServiceAddRequest struct { - PermitsService *PermitsService - header map[string]string - query map[string]string - permit *Permit +type FilesServiceListRequest struct { + FilesService *FilesService + header map[string]string + query map[string]string + caseSensitive *bool + follow *string + max *int64 + refresh *bool + search *string } -func (p *PermitsServiceAddRequest) Header(key, value string) *PermitsServiceAddRequest { +func (p *FilesServiceListRequest) Header(key, value string) *FilesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -32365,7 +31625,7 @@ func (p *PermitsServiceAddRequest) Header(key, value string) *PermitsServiceAddR return p } -func (p *PermitsServiceAddRequest) Query(key, value string) *PermitsServiceAddRequest { +func (p *FilesServiceListRequest) Query(key, value string) *FilesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -32373,14 +31633,54 @@ func (p *PermitsServiceAddRequest) Query(key, value string) *PermitsServiceAddRe return p } -func (p *PermitsServiceAddRequest) Permit(permit *Permit) *PermitsServiceAddRequest { - p.permit = permit +func (p *FilesServiceListRequest) CaseSensitive(caseSensitive bool) *FilesServiceListRequest { + p.caseSensitive = &caseSensitive return p } -func (p *PermitsServiceAddRequest) Send() (*PermitsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.PermitsService.connection.URL(), p.PermitsService.path) +func (p *FilesServiceListRequest) Follow(follow string) *FilesServiceListRequest { + p.follow = &follow + return p +} + +func (p *FilesServiceListRequest) Max(max int64) *FilesServiceListRequest { + p.max = &max + return p +} + +func (p *FilesServiceListRequest) Refresh(refresh bool) *FilesServiceListRequest { + p.refresh = &refresh + return p +} + +func (p *FilesServiceListRequest) Search(search string) *FilesServiceListRequest { + p.search = &search + return p +} + +func (p *FilesServiceListRequest) Send() (*FilesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FilesService.connection.URL(), p.FilesService.path) values := make(url.Values) + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.refresh != nil { + values["refresh"] = []string{fmt.Sprintf("%v", *p.refresh)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -32389,19 +31689,12 @@ func (p *PermitsServiceAddRequest) Send() (*PermitsServiceAddResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLPermitWriteOne(writer, p.permit, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.PermitsService.connection.headers { + for hk, hv := range p.FilesService.connection.headers { req.Header.Add(hk, hv) } @@ -32416,18 +31709,18 @@ func (p *PermitsServiceAddRequest) Send() (*PermitsServiceAddResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.PermitsService.connection.authenticate() + token, err := p.FilesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.PermitsService.connection.client.Do(req) + resp, err := p.FilesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.PermitsService.connection.logFunc != nil { + if p.FilesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -32436,9 +31729,9 @@ func (p *PermitsServiceAddRequest) Send() (*PermitsServiceAddResponse, error) { if err != nil { return nil, err } - p.PermitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -32446,14 +31739,14 @@ func (p *PermitsServiceAddRequest) Send() (*PermitsServiceAddResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLPermitReadOne(reader, nil, "") + result, err := XMLFileReadMany(reader, nil) if err != nil { return nil, err } - return &PermitsServiceAddResponse{permit: result}, nil + return &FilesServiceListResponse{file: result}, nil } -func (p *PermitsServiceAddRequest) MustSend() *PermitsServiceAddResponse { +func (p *FilesServiceListRequest) MustSend() *FilesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -32462,87 +31755,107 @@ func (p *PermitsServiceAddRequest) MustSend() *PermitsServiceAddResponse { } // -// Adds a permit to the role. The permit name can be retrieved from the <> service. -// For example to assign a permit `create_vm` to the role with id `123` send a request like this: -// .... -// POST /ovirt-engine/api/roles/123/permits -// .... -// With a request body like this: -// [source,xml] +// Returns the list of ISO images and virtual floppy disks available in the storage domain. The order of +// the returned list is not guaranteed. +// If the `refresh` parameter is `false`, the returned list may not reflect recent changes to the storage domain; +// for example, it may not contain a new ISO file that was recently added. This is because the +// server caches the list of files to improve performance. To get the very latest results, set the `refresh` +// parameter to `true`. +// The default value of the `refresh` parameter is `true`, but it can be changed using the configuration value +// `ForceRefreshDomainFilesByDefault`: +// [source] // ---- -// -// create_vm -// +// # engine-config -s ForceRefreshDomainFilesByDefault=false // ---- +// IMPORTANT: Setting the value of the `refresh` parameter to `true` has an impact on the performance of the +// server. Use it only if necessary. // -type PermitsServiceAddResponse struct { - permit *Permit +type FilesServiceListResponse struct { + file *FileSlice } -func (p *PermitsServiceAddResponse) Permit() (*Permit, bool) { - if p.permit != nil { - return p.permit, true +func (p *FilesServiceListResponse) File() (*FileSlice, bool) { + if p.file != nil { + return p.file, true } return nil, false } -func (p *PermitsServiceAddResponse) MustPermit() *Permit { - if p.permit == nil { - panic("permit in response does not exist") +func (p *FilesServiceListResponse) MustFile() *FileSlice { + if p.file == nil { + panic("file in response does not exist") } - return p.permit + return p.file } // -// Adds a permit to the role. The permit name can be retrieved from the <> service. -// For example to assign a permit `create_vm` to the role with id `123` send a request like this: -// .... -// POST /ovirt-engine/api/roles/123/permits -// .... -// With a request body like this: -// [source,xml] +// Returns the list of ISO images and virtual floppy disks available in the storage domain. The order of +// the returned list is not guaranteed. +// If the `refresh` parameter is `false`, the returned list may not reflect recent changes to the storage domain; +// for example, it may not contain a new ISO file that was recently added. This is because the +// server caches the list of files to improve performance. To get the very latest results, set the `refresh` +// parameter to `true`. +// The default value of the `refresh` parameter is `true`, but it can be changed using the configuration value +// `ForceRefreshDomainFilesByDefault`: +// [source] // ---- -// -// create_vm -// +// # engine-config -s ForceRefreshDomainFilesByDefault=false // ---- +// IMPORTANT: Setting the value of the `refresh` parameter to `true` has an impact on the performance of the +// server. Use it only if necessary. // -func (p *PermitsService) Add() *PermitsServiceAddRequest { - return &PermitsServiceAddRequest{PermitsService: p} +func (p *FilesService) List() *FilesServiceListRequest { + return &FilesServiceListRequest{FilesService: p} } // -// List the permits of the role. -// For example to list the permits of the role with the id `123` send a request like this: -// .... -// GET /ovirt-engine/api/roles/123/permits -// .... -// [source,xml] -// ---- -// -// -// change_vm_cd -// false -// -// -// -// connect_to_vm -// false -// -// -// -// ---- -// The order of the returned list of permits isn't guaranteed. // -type PermitsServiceListRequest struct { - PermitsService *PermitsService - header map[string]string - query map[string]string - follow *string - max *int64 +func (op *FilesService) FileService(id string) *FileService { + return NewFileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *PermitsServiceListRequest) Header(key, value string) *PermitsServiceListRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *FilesService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.FileService(path), nil + } + return op.FileService(path[:index]).Service(path[index+1:]) +} + +func (op *FilesService) String() string { + return fmt.Sprintf("FilesService:%s", op.path) +} + +// +// +type FilterService struct { + BaseService +} + +func NewFilterService(connection *Connection, path string) *FilterService { + var result FilterService + result.connection = connection + result.path = path + return &result +} + +// +// +type FilterServiceGetRequest struct { + FilterService *FilterService + header map[string]string + query map[string]string + filter *bool + follow *string +} + +func (p *FilterServiceGetRequest) Header(key, value string) *FilterServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -32550,7 +31863,7 @@ func (p *PermitsServiceListRequest) Header(key, value string) *PermitsServiceLis return p } -func (p *PermitsServiceListRequest) Query(key, value string) *PermitsServiceListRequest { +func (p *FilterServiceGetRequest) Query(key, value string) *FilterServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -32558,25 +31871,25 @@ func (p *PermitsServiceListRequest) Query(key, value string) *PermitsServiceList return p } -func (p *PermitsServiceListRequest) Follow(follow string) *PermitsServiceListRequest { - p.follow = &follow +func (p *FilterServiceGetRequest) Filter(filter bool) *FilterServiceGetRequest { + p.filter = &filter return p } -func (p *PermitsServiceListRequest) Max(max int64) *PermitsServiceListRequest { - p.max = &max +func (p *FilterServiceGetRequest) Follow(follow string) *FilterServiceGetRequest { + p.follow = &follow return p } -func (p *PermitsServiceListRequest) Send() (*PermitsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.PermitsService.connection.URL(), p.PermitsService.path) +func (p *FilterServiceGetRequest) Send() (*FilterServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FilterService.connection.URL(), p.FilterService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -32592,7 +31905,7 @@ func (p *PermitsServiceListRequest) Send() (*PermitsServiceListResponse, error) return nil, err } - for hk, hv := range p.PermitsService.connection.headers { + for hk, hv := range p.FilterService.connection.headers { req.Header.Add(hk, hv) } @@ -32607,18 +31920,18 @@ func (p *PermitsServiceListRequest) Send() (*PermitsServiceListResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.PermitsService.connection.authenticate() + token, err := p.FilterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.PermitsService.connection.client.Do(req) + resp, err := p.FilterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.PermitsService.connection.logFunc != nil { + if p.FilterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -32627,7 +31940,7 @@ func (p *PermitsServiceListRequest) Send() (*PermitsServiceListResponse, error) if err != nil { return nil, err } - p.PermitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FilterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -32637,14 +31950,14 @@ func (p *PermitsServiceListRequest) Send() (*PermitsServiceListResponse, error) return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLPermitReadMany(reader, nil) + result, err := XMLFilterReadOne(reader, nil, "") if err != nil { return nil, err } - return &PermitsServiceListResponse{permits: result}, nil + return &FilterServiceGetResponse{result: result}, nil } -func (p *PermitsServiceListRequest) MustSend() *PermitsServiceListResponse { +func (p *FilterServiceGetRequest) MustSend() *FilterServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -32653,122 +31966,186 @@ func (p *PermitsServiceListRequest) MustSend() *PermitsServiceListResponse { } // -// List the permits of the role. -// For example to list the permits of the role with the id `123` send a request like this: -// .... -// GET /ovirt-engine/api/roles/123/permits -// .... -// [source,xml] -// ---- -// -// -// change_vm_cd -// false -// -// -// -// connect_to_vm -// false -// -// -// -// ---- -// The order of the returned list of permits isn't guaranteed. // -type PermitsServiceListResponse struct { - permits *PermitSlice +type FilterServiceGetResponse struct { + result *Filter } -func (p *PermitsServiceListResponse) Permits() (*PermitSlice, bool) { - if p.permits != nil { - return p.permits, true +func (p *FilterServiceGetResponse) Result() (*Filter, bool) { + if p.result != nil { + return p.result, true } return nil, false } -func (p *PermitsServiceListResponse) MustPermits() *PermitSlice { - if p.permits == nil { - panic("permits in response does not exist") +func (p *FilterServiceGetResponse) MustResult() *Filter { + if p.result == nil { + panic("result in response does not exist") } - return p.permits + return p.result } // -// List the permits of the role. -// For example to list the permits of the role with the id `123` send a request like this: -// .... -// GET /ovirt-engine/api/roles/123/permits -// .... -// [source,xml] -// ---- -// -// -// change_vm_cd -// false -// -// -// -// connect_to_vm -// false -// -// -// -// ---- -// The order of the returned list of permits isn't guaranteed. // -func (p *PermitsService) List() *PermitsServiceListRequest { - return &PermitsServiceListRequest{PermitsService: p} +func (p *FilterService) Get() *FilterServiceGetRequest { + return &FilterServiceGetRequest{FilterService: p} } // -// Sub-resource locator method, returns individual permit resource on which the remainder of the URI is dispatched. // -func (op *PermitsService) PermitService(id string) *PermitService { - return NewPermitService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +type FilterServiceRemoveRequest struct { + FilterService *FilterService + header map[string]string + query map[string]string + async *bool +} + +func (p *FilterServiceRemoveRequest) Header(key, value string) *FilterServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value + return p +} + +func (p *FilterServiceRemoveRequest) Query(key, value string) *FilterServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p +} + +func (p *FilterServiceRemoveRequest) Async(async bool) *FilterServiceRemoveRequest { + p.async = &async + return p +} + +func (p *FilterServiceRemoveRequest) Send() (*FilterServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FilterService.connection.URL(), p.FilterService.path) + values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + + if p.query != nil { + for k, v := range p.query { + values[k] = []string{v} + } + } + if len(values) > 0 { + rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) + } + req, err := http.NewRequest("DELETE", rawURL, nil) + if err != nil { + return nil, err + } + + for hk, hv := range p.FilterService.connection.headers { + req.Header.Add(hk, hv) + } + + if p.header != nil { + for hk, hv := range p.header { + req.Header.Add(hk, hv) + } + } + + req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) + req.Header.Add("Version", "4") + req.Header.Add("Content-Type", "application/xml") + req.Header.Add("Accept", "application/xml") + // get OAuth access token + token, err := p.FilterService.connection.authenticate() + if err != nil { + return nil, err + } + req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) + // Send the request and wait for the response + resp, err := p.FilterService.connection.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if p.FilterService.connection.logFunc != nil { + dumpReq, err := httputil.DumpRequestOut(req, true) + if err != nil { + return nil, err + } + dumpResp, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, err + } + p.FilterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + } + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(FilterServiceRemoveResponse), nil +} + +func (p *FilterServiceRemoveRequest) MustSend() *FilterServiceRemoveResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// +type FilterServiceRemoveResponse struct { +} + +// +// +func (p *FilterService) Remove() *FilterServiceRemoveRequest { + return &FilterServiceRemoveRequest{FilterService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *PermitsService) Service(path string) (Service, error) { +func (op *FilterService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.PermitService(path), nil - } - return op.PermitService(path[:index]).Service(path[index+1:]) + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *PermitsService) String() string { - return fmt.Sprintf("PermitsService:%s", op.path) +func (op *FilterService) String() string { + return fmt.Sprintf("FilterService:%s", op.path) } // -// Manages the set of connections to storage servers that exist in a storage domain. +// Manages the filters used by an scheduling policy. // -type StorageDomainServerConnectionsService struct { +type FiltersService struct { BaseService } -func NewStorageDomainServerConnectionsService(connection *Connection, path string) *StorageDomainServerConnectionsService { - var result StorageDomainServerConnectionsService +func NewFiltersService(connection *Connection, path string) *FiltersService { + var result FiltersService result.connection = connection result.path = path return &result } // +// Add a filter to a specified user defined scheduling policy. // -type StorageDomainServerConnectionsServiceAddRequest struct { - StorageDomainServerConnectionsService *StorageDomainServerConnectionsService - header map[string]string - query map[string]string - connection *StorageConnection +type FiltersServiceAddRequest struct { + FiltersService *FiltersService + header map[string]string + query map[string]string + filter *Filter } -func (p *StorageDomainServerConnectionsServiceAddRequest) Header(key, value string) *StorageDomainServerConnectionsServiceAddRequest { +func (p *FiltersServiceAddRequest) Header(key, value string) *FiltersServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -32776,7 +32153,7 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Header(key, value stri return p } -func (p *StorageDomainServerConnectionsServiceAddRequest) Query(key, value string) *StorageDomainServerConnectionsServiceAddRequest { +func (p *FiltersServiceAddRequest) Query(key, value string) *FiltersServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -32784,13 +32161,13 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Query(key, value strin return p } -func (p *StorageDomainServerConnectionsServiceAddRequest) Connection(connection *StorageConnection) *StorageDomainServerConnectionsServiceAddRequest { - p.connection = connection +func (p *FiltersServiceAddRequest) Filter(filter *Filter) *FiltersServiceAddRequest { + p.filter = filter return p } -func (p *StorageDomainServerConnectionsServiceAddRequest) Send() (*StorageDomainServerConnectionsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainServerConnectionsService.connection.URL(), p.StorageDomainServerConnectionsService.path) +func (p *FiltersServiceAddRequest) Send() (*FiltersServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FiltersService.connection.URL(), p.FiltersService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -32802,7 +32179,7 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Send() (*StorageDomain } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLStorageConnectionWriteOne(writer, p.connection, "") + err := XMLFilterWriteOne(writer, p.filter, "") if err != nil { return nil, err } @@ -32812,7 +32189,7 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Send() (*StorageDomain return nil, err } - for hk, hv := range p.StorageDomainServerConnectionsService.connection.headers { + for hk, hv := range p.FiltersService.connection.headers { req.Header.Add(hk, hv) } @@ -32827,18 +32204,18 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Send() (*StorageDomain req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainServerConnectionsService.connection.authenticate() + token, err := p.FiltersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainServerConnectionsService.connection.client.Do(req) + resp, err := p.FiltersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainServerConnectionsService.connection.logFunc != nil { + if p.FiltersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -32847,7 +32224,7 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Send() (*StorageDomain if err != nil { return nil, err } - p.StorageDomainServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FiltersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -32857,14 +32234,14 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) Send() (*StorageDomain return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionReadOne(reader, nil, "") + result, err := XMLFilterReadOne(reader, nil, "") if err != nil { return nil, err } - return &StorageDomainServerConnectionsServiceAddResponse{connection: result}, nil + return &FiltersServiceAddResponse{filter: result}, nil } -func (p *StorageDomainServerConnectionsServiceAddRequest) MustSend() *StorageDomainServerConnectionsServiceAddResponse { +func (p *FiltersServiceAddRequest) MustSend() *FiltersServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -32873,44 +32250,47 @@ func (p *StorageDomainServerConnectionsServiceAddRequest) MustSend() *StorageDom } // +// Add a filter to a specified user defined scheduling policy. // -type StorageDomainServerConnectionsServiceAddResponse struct { - connection *StorageConnection +type FiltersServiceAddResponse struct { + filter *Filter } -func (p *StorageDomainServerConnectionsServiceAddResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true +func (p *FiltersServiceAddResponse) Filter() (*Filter, bool) { + if p.filter != nil { + return p.filter, true } return nil, false } -func (p *StorageDomainServerConnectionsServiceAddResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") +func (p *FiltersServiceAddResponse) MustFilter() *Filter { + if p.filter == nil { + panic("filter in response does not exist") } - return p.connection + return p.filter } // +// Add a filter to a specified user defined scheduling policy. // -func (p *StorageDomainServerConnectionsService) Add() *StorageDomainServerConnectionsServiceAddRequest { - return &StorageDomainServerConnectionsServiceAddRequest{StorageDomainServerConnectionsService: p} +func (p *FiltersService) Add() *FiltersServiceAddRequest { + return &FiltersServiceAddRequest{FiltersService: p} } // -// Returns the list of connections to storage servers that existin the storage domain. -// The order of the returned list of connections isn't guaranteed. +// Returns the list of filters used by the scheduling policy. +// The order of the returned list of filters isn't guaranteed. // -type StorageDomainServerConnectionsServiceListRequest struct { - StorageDomainServerConnectionsService *StorageDomainServerConnectionsService - header map[string]string - query map[string]string - follow *string - max *int64 +type FiltersServiceListRequest struct { + FiltersService *FiltersService + header map[string]string + query map[string]string + filter *bool + follow *string + max *int64 } -func (p *StorageDomainServerConnectionsServiceListRequest) Header(key, value string) *StorageDomainServerConnectionsServiceListRequest { +func (p *FiltersServiceListRequest) Header(key, value string) *FiltersServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -32918,7 +32298,7 @@ func (p *StorageDomainServerConnectionsServiceListRequest) Header(key, value str return p } -func (p *StorageDomainServerConnectionsServiceListRequest) Query(key, value string) *StorageDomainServerConnectionsServiceListRequest { +func (p *FiltersServiceListRequest) Query(key, value string) *FiltersServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -32926,19 +32306,28 @@ func (p *StorageDomainServerConnectionsServiceListRequest) Query(key, value stri return p } -func (p *StorageDomainServerConnectionsServiceListRequest) Follow(follow string) *StorageDomainServerConnectionsServiceListRequest { +func (p *FiltersServiceListRequest) Filter(filter bool) *FiltersServiceListRequest { + p.filter = &filter + return p +} + +func (p *FiltersServiceListRequest) Follow(follow string) *FiltersServiceListRequest { p.follow = &follow return p } -func (p *StorageDomainServerConnectionsServiceListRequest) Max(max int64) *StorageDomainServerConnectionsServiceListRequest { +func (p *FiltersServiceListRequest) Max(max int64) *FiltersServiceListRequest { p.max = &max return p } -func (p *StorageDomainServerConnectionsServiceListRequest) Send() (*StorageDomainServerConnectionsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainServerConnectionsService.connection.URL(), p.StorageDomainServerConnectionsService.path) +func (p *FiltersServiceListRequest) Send() (*FiltersServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.FiltersService.connection.URL(), p.FiltersService.path) values := make(url.Values) + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } @@ -32960,7 +32349,7 @@ func (p *StorageDomainServerConnectionsServiceListRequest) Send() (*StorageDomai return nil, err } - for hk, hv := range p.StorageDomainServerConnectionsService.connection.headers { + for hk, hv := range p.FiltersService.connection.headers { req.Header.Add(hk, hv) } @@ -32975,18 +32364,18 @@ func (p *StorageDomainServerConnectionsServiceListRequest) Send() (*StorageDomai req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainServerConnectionsService.connection.authenticate() + token, err := p.FiltersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainServerConnectionsService.connection.client.Do(req) + resp, err := p.FiltersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainServerConnectionsService.connection.logFunc != nil { + if p.FiltersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -32995,7 +32384,7 @@ func (p *StorageDomainServerConnectionsServiceListRequest) Send() (*StorageDomai if err != nil { return nil, err } - p.StorageDomainServerConnectionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.FiltersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -33005,14 +32394,14 @@ func (p *StorageDomainServerConnectionsServiceListRequest) Send() (*StorageDomai return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionReadMany(reader, nil) + result, err := XMLFilterReadMany(reader, nil) if err != nil { return nil, err } - return &StorageDomainServerConnectionsServiceListResponse{connections: result}, nil + return &FiltersServiceListResponse{filters: result}, nil } -func (p *StorageDomainServerConnectionsServiceListRequest) MustSend() *StorageDomainServerConnectionsServiceListResponse { +func (p *FiltersServiceListRequest) MustSend() *FiltersServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -33021,145 +32410,100 @@ func (p *StorageDomainServerConnectionsServiceListRequest) MustSend() *StorageDo } // -// Returns the list of connections to storage servers that existin the storage domain. -// The order of the returned list of connections isn't guaranteed. +// Returns the list of filters used by the scheduling policy. +// The order of the returned list of filters isn't guaranteed. // -type StorageDomainServerConnectionsServiceListResponse struct { - connections *StorageConnectionSlice +type FiltersServiceListResponse struct { + filters *FilterSlice } -func (p *StorageDomainServerConnectionsServiceListResponse) Connections() (*StorageConnectionSlice, bool) { - if p.connections != nil { - return p.connections, true +func (p *FiltersServiceListResponse) Filters() (*FilterSlice, bool) { + if p.filters != nil { + return p.filters, true } return nil, false } -func (p *StorageDomainServerConnectionsServiceListResponse) MustConnections() *StorageConnectionSlice { - if p.connections == nil { - panic("connections in response does not exist") +func (p *FiltersServiceListResponse) MustFilters() *FilterSlice { + if p.filters == nil { + panic("filters in response does not exist") } - return p.connections + return p.filters } // -// Returns the list of connections to storage servers that existin the storage domain. -// The order of the returned list of connections isn't guaranteed. +// Returns the list of filters used by the scheduling policy. +// The order of the returned list of filters isn't guaranteed. // -func (p *StorageDomainServerConnectionsService) List() *StorageDomainServerConnectionsServiceListRequest { - return &StorageDomainServerConnectionsServiceListRequest{StorageDomainServerConnectionsService: p} +func (p *FiltersService) List() *FiltersServiceListRequest { + return &FiltersServiceListRequest{FiltersService: p} } // // -func (op *StorageDomainServerConnectionsService) ConnectionService(id string) *StorageDomainServerConnectionService { - return NewStorageDomainServerConnectionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *FiltersService) FilterService(id string) *FilterService { + return NewFilterService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *StorageDomainServerConnectionsService) Service(path string) (Service, error) { +func (op *FiltersService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.ConnectionService(path), nil + return op.FilterService(path), nil } - return op.ConnectionService(path[:index]).Service(path[index+1:]) + return op.FilterService(path[:index]).Service(path[index+1:]) } -func (op *StorageDomainServerConnectionsService) String() string { - return fmt.Sprintf("StorageDomainServerConnectionsService:%s", op.path) +func (op *FiltersService) String() string { + return fmt.Sprintf("FiltersService:%s", op.path) } // -// Manages the set of storage domains in the system. +// A service to access a particular device of a host. // -type StorageDomainsService struct { +type HostDeviceService struct { BaseService } -func NewStorageDomainsService(connection *Connection, path string) *StorageDomainsService { - var result StorageDomainsService +func NewHostDeviceService(connection *Connection, path string) *HostDeviceService { + var result HostDeviceService result.connection = connection result.path = path return &result } // -// Adds a new storage domain. -// Creation of a new <> requires the `name`, `type`, `host`, and `storage` -// attributes. Identify the `host` attribute with the `id` or `name` attributes. In {product-name} 3.6 and -// later you can enable the wipe after delete option by default on the storage domain. To configure this, specify -// `wipe_after_delete` in the POST request. This option can be edited after the domain is created, but doing so will -// not change the wipe after delete property of disks that already exist. -// To add a new storage domain with specified `name`, `type`, `storage.type`, `storage.address`, and `storage.path`, -// and using a host with an id `123`, send a request like this: +// Retrieve information about a particular host's device. +// An example of getting a host device: // [source] // ---- -// POST /ovirt-engine/api/storageDomains +// GET /ovirt-engine/api/hosts/123/devices/456 // ---- -// With a request body like this: // [source,xml] // ---- -// -// mydata -// data -// -// nfs -//
mynfs.example.com
-// /exports/mydata -//
-// -// myhost -// -//
-// ---- -// To create a new NFS ISO storage domain send a request like this: -// [source,xml] -// ---- -// -// myisos -// iso -// -// nfs -//
mynfs.example.com
-// /export/myisos -//
-// -// myhost -// -//
-// ---- -// To create a new iSCSI storage domain send a request like this: -// [source,xml] -// ---- -// -// myiscsi -// data -// -// iscsi -// -// -// -// -// -// -// myhost -// -// +// +// usb_1_9_1_1_0 +// usb +// +// +// usb_1_9_1 +// +// // ---- // -type StorageDomainsServiceAddRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - storageDomain *StorageDomain +type HostDeviceServiceGetRequest struct { + HostDeviceService *HostDeviceService + header map[string]string + query map[string]string + follow *string } -func (p *StorageDomainsServiceAddRequest) Header(key, value string) *StorageDomainsServiceAddRequest { +func (p *HostDeviceServiceGetRequest) Header(key, value string) *HostDeviceServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -33167,7 +32511,7 @@ func (p *StorageDomainsServiceAddRequest) Header(key, value string) *StorageDoma return p } -func (p *StorageDomainsServiceAddRequest) Query(key, value string) *StorageDomainsServiceAddRequest { +func (p *HostDeviceServiceGetRequest) Query(key, value string) *HostDeviceServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -33175,14 +32519,18 @@ func (p *StorageDomainsServiceAddRequest) Query(key, value string) *StorageDomai return p } -func (p *StorageDomainsServiceAddRequest) StorageDomain(storageDomain *StorageDomain) *StorageDomainsServiceAddRequest { - p.storageDomain = storageDomain +func (p *HostDeviceServiceGetRequest) Follow(follow string) *HostDeviceServiceGetRequest { + p.follow = &follow return p } -func (p *StorageDomainsServiceAddRequest) Send() (*StorageDomainsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) +func (p *HostDeviceServiceGetRequest) Send() (*HostDeviceServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostDeviceService.connection.URL(), p.HostDeviceService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -33191,19 +32539,12 @@ func (p *StorageDomainsServiceAddRequest) Send() (*StorageDomainsServiceAddRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLStorageDomainWriteOne(writer, p.storageDomain, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainsService.connection.headers { + for hk, hv := range p.HostDeviceService.connection.headers { req.Header.Add(hk, hv) } @@ -33218,18 +32559,18 @@ func (p *StorageDomainsServiceAddRequest) Send() (*StorageDomainsServiceAddRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() + token, err := p.HostDeviceService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) + resp, err := p.HostDeviceService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { + if p.HostDeviceService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -33238,9 +32579,9 @@ func (p *StorageDomainsServiceAddRequest) Send() (*StorageDomainsServiceAddRespo if err != nil { return nil, err } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostDeviceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -33248,14 +32589,14 @@ func (p *StorageDomainsServiceAddRequest) Send() (*StorageDomainsServiceAddRespo return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageDomainReadOne(reader, nil, "") + result, err := XMLHostDeviceReadOne(reader, nil, "") if err != nil { return nil, err } - return &StorageDomainsServiceAddResponse{storageDomain: result}, nil + return &HostDeviceServiceGetResponse{device: result}, nil } -func (p *StorageDomainsServiceAddRequest) MustSend() *StorageDomainsServiceAddResponse { +func (p *HostDeviceServiceGetRequest) MustSend() *HostDeviceServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -33264,166 +32605,106 @@ func (p *StorageDomainsServiceAddRequest) MustSend() *StorageDomainsServiceAddRe } // -// Adds a new storage domain. -// Creation of a new <> requires the `name`, `type`, `host`, and `storage` -// attributes. Identify the `host` attribute with the `id` or `name` attributes. In {product-name} 3.6 and -// later you can enable the wipe after delete option by default on the storage domain. To configure this, specify -// `wipe_after_delete` in the POST request. This option can be edited after the domain is created, but doing so will -// not change the wipe after delete property of disks that already exist. -// To add a new storage domain with specified `name`, `type`, `storage.type`, `storage.address`, and `storage.path`, -// and using a host with an id `123`, send a request like this: +// Retrieve information about a particular host's device. +// An example of getting a host device: // [source] // ---- -// POST /ovirt-engine/api/storageDomains -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// mydata -// data -// -// nfs -//
mynfs.example.com
-// /exports/mydata -//
-// -// myhost -// -//
-// ---- -// To create a new NFS ISO storage domain send a request like this: -// [source,xml] -// ---- -// -// myisos -// iso -// -// nfs -//
mynfs.example.com
-// /export/myisos -//
-// -// myhost -// -//
+// GET /ovirt-engine/api/hosts/123/devices/456 // ---- -// To create a new iSCSI storage domain send a request like this: // [source,xml] // ---- -// -// myiscsi -// data -// -// iscsi -// -// -// -// -// -// -// myhost -// -// +// +// usb_1_9_1_1_0 +// usb +// +// +// usb_1_9_1 +// +// // ---- // -type StorageDomainsServiceAddResponse struct { - storageDomain *StorageDomain +type HostDeviceServiceGetResponse struct { + device *HostDevice } -func (p *StorageDomainsServiceAddResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true +func (p *HostDeviceServiceGetResponse) Device() (*HostDevice, bool) { + if p.device != nil { + return p.device, true } return nil, false } -func (p *StorageDomainsServiceAddResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") +func (p *HostDeviceServiceGetResponse) MustDevice() *HostDevice { + if p.device == nil { + panic("device in response does not exist") } - return p.storageDomain + return p.device } // -// Adds a new storage domain. -// Creation of a new <> requires the `name`, `type`, `host`, and `storage` -// attributes. Identify the `host` attribute with the `id` or `name` attributes. In {product-name} 3.6 and -// later you can enable the wipe after delete option by default on the storage domain. To configure this, specify -// `wipe_after_delete` in the POST request. This option can be edited after the domain is created, but doing so will -// not change the wipe after delete property of disks that already exist. -// To add a new storage domain with specified `name`, `type`, `storage.type`, `storage.address`, and `storage.path`, -// and using a host with an id `123`, send a request like this: +// Retrieve information about a particular host's device. +// An example of getting a host device: // [source] // ---- -// POST /ovirt-engine/api/storageDomains -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// mydata -// data -// -// nfs -//
mynfs.example.com
-// /exports/mydata -//
-// -// myhost -// -//
-// ---- -// To create a new NFS ISO storage domain send a request like this: -// [source,xml] -// ---- -// -// myisos -// iso -// -// nfs -//
mynfs.example.com
-// /export/myisos -//
-// -// myhost -// -//
+// GET /ovirt-engine/api/hosts/123/devices/456 // ---- -// To create a new iSCSI storage domain send a request like this: // [source,xml] // ---- -// -// myiscsi -// data -// -// iscsi -// -// -// -// -// -// -// myhost -// -// +// +// usb_1_9_1_1_0 +// usb +// +// +// usb_1_9_1 +// +// // ---- // -func (p *StorageDomainsService) Add() *StorageDomainsServiceAddRequest { - return &StorageDomainsServiceAddRequest{StorageDomainsService: p} +func (p *HostDeviceService) Get() *HostDeviceServiceGetRequest { + return &HostDeviceServiceGetRequest{HostDeviceService: p} } // -// Import an existing block storage domain to the system using the targets already connected to the host. +// Service locator method, returns individual service on which the URI is dispatched. // -type StorageDomainsServiceAddBlockDomainRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - storageDomain *StorageDomain +func (op *HostDeviceService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *StorageDomainsServiceAddBlockDomainRequest) Header(key, value string) *StorageDomainsServiceAddBlockDomainRequest { +func (op *HostDeviceService) String() string { + return fmt.Sprintf("HostDeviceService:%s", op.path) +} + +// +// A service to access host devices. +// +type HostDevicesService struct { + BaseService +} + +func NewHostDevicesService(connection *Connection, path string) *HostDevicesService { + var result HostDevicesService + result.connection = connection + result.path = path + return &result +} + +// +// List the devices of a host. +// The order of the returned list of devices isn't guaranteed. +// +type HostDevicesServiceListRequest struct { + HostDevicesService *HostDevicesService + header map[string]string + query map[string]string + follow *string + max *int64 +} + +func (p *HostDevicesServiceListRequest) Header(key, value string) *HostDevicesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -33431,7 +32712,7 @@ func (p *StorageDomainsServiceAddBlockDomainRequest) Header(key, value string) * return p } -func (p *StorageDomainsServiceAddBlockDomainRequest) Query(key, value string) *StorageDomainsServiceAddBlockDomainRequest { +func (p *HostDevicesServiceListRequest) Query(key, value string) *HostDevicesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -33439,20 +32720,27 @@ func (p *StorageDomainsServiceAddBlockDomainRequest) Query(key, value string) *S return p } -func (p *StorageDomainsServiceAddBlockDomainRequest) StorageDomain(storageDomain *StorageDomain) *StorageDomainsServiceAddBlockDomainRequest { - p.storageDomain = storageDomain +func (p *HostDevicesServiceListRequest) Follow(follow string) *HostDevicesServiceListRequest { + p.follow = &follow return p } -func (p *StorageDomainsServiceAddBlockDomainRequest) Send() (*StorageDomainsServiceAddBlockDomainResponse, error) { - rawURL := fmt.Sprintf("%s%s/blockdomain", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *HostDevicesServiceListRequest) Max(max int64) *HostDevicesServiceListRequest { + p.max = &max + return p +} + +func (p *HostDevicesServiceListRequest) Send() (*HostDevicesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostDevicesService.connection.URL(), p.HostDevicesService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -33461,16 +32749,12 @@ func (p *StorageDomainsServiceAddBlockDomainRequest) Send() (*StorageDomainsServ if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainsService.connection.headers { + for hk, hv := range p.HostDevicesService.connection.headers { req.Header.Add(hk, hv) } @@ -33485,18 +32769,18 @@ func (p *StorageDomainsServiceAddBlockDomainRequest) Send() (*StorageDomainsServ req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() + token, err := p.HostDevicesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) + resp, err := p.HostDevicesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { + if p.HostDevicesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -33505,17 +32789,24 @@ func (p *StorageDomainsServiceAddBlockDomainRequest) Send() (*StorageDomainsServ if err != nil { return nil, err } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostDevicesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustStorageDomain() - return &StorageDomainsServiceAddBlockDomainResponse{storageDomain: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLHostDeviceReadMany(reader, nil) + if err != nil { + return nil, err + } + return &HostDevicesServiceListResponse{devices: result}, nil } -func (p *StorageDomainsServiceAddBlockDomainRequest) MustSend() *StorageDomainsServiceAddBlockDomainResponse { +func (p *HostDevicesServiceListRequest) MustSend() *HostDevicesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -33524,44 +32815,83 @@ func (p *StorageDomainsServiceAddBlockDomainRequest) MustSend() *StorageDomainsS } // -// Import an existing block storage domain to the system using the targets already connected to the host. +// List the devices of a host. +// The order of the returned list of devices isn't guaranteed. // -type StorageDomainsServiceAddBlockDomainResponse struct { - storageDomain *StorageDomain +type HostDevicesServiceListResponse struct { + devices *HostDeviceSlice } -func (p *StorageDomainsServiceAddBlockDomainResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true +func (p *HostDevicesServiceListResponse) Devices() (*HostDeviceSlice, bool) { + if p.devices != nil { + return p.devices, true } return nil, false } -func (p *StorageDomainsServiceAddBlockDomainResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") +func (p *HostDevicesServiceListResponse) MustDevices() *HostDeviceSlice { + if p.devices == nil { + panic("devices in response does not exist") } - return p.storageDomain + return p.devices } // -// Import an existing block storage domain to the system using the targets already connected to the host. +// List the devices of a host. +// The order of the returned list of devices isn't guaranteed. // -func (p *StorageDomainsService) AddBlockDomain() *StorageDomainsServiceAddBlockDomainRequest { - return &StorageDomainsServiceAddBlockDomainRequest{StorageDomainsService: p} +func (p *HostDevicesService) List() *HostDevicesServiceListRequest { + return &HostDevicesServiceListRequest{HostDevicesService: p} } // -// Add a new storage domain to the system using the storage on the given host and path. +// Reference to the service that can be used to access a specific host device. // -type StorageDomainsServiceAddByPathRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - storageDomain *StorageDomain +func (op *HostDevicesService) DeviceService(id string) *HostDeviceService { + return NewHostDeviceService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *StorageDomainsServiceAddByPathRequest) Header(key, value string) *StorageDomainsServiceAddByPathRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *HostDevicesService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.DeviceService(path), nil + } + return op.DeviceService(path[:index]).Service(path[index+1:]) +} + +func (op *HostDevicesService) String() string { + return fmt.Sprintf("HostDevicesService:%s", op.path) +} + +// +// +type HostHookService struct { + BaseService +} + +func NewHostHookService(connection *Connection, path string) *HostHookService { + var result HostHookService + result.connection = connection + result.path = path + return &result +} + +// +// +type HostHookServiceGetRequest struct { + HostHookService *HostHookService + header map[string]string + query map[string]string + follow *string +} + +func (p *HostHookServiceGetRequest) Header(key, value string) *HostHookServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -33569,7 +32899,7 @@ func (p *StorageDomainsServiceAddByPathRequest) Header(key, value string) *Stora return p } -func (p *StorageDomainsServiceAddByPathRequest) Query(key, value string) *StorageDomainsServiceAddByPathRequest { +func (p *HostHookServiceGetRequest) Query(key, value string) *HostHookServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -33577,20 +32907,18 @@ func (p *StorageDomainsServiceAddByPathRequest) Query(key, value string) *Storag return p } -func (p *StorageDomainsServiceAddByPathRequest) StorageDomain(storageDomain *StorageDomain) *StorageDomainsServiceAddByPathRequest { - p.storageDomain = storageDomain +func (p *HostHookServiceGetRequest) Follow(follow string) *HostHookServiceGetRequest { + p.follow = &follow return p } -func (p *StorageDomainsServiceAddByPathRequest) Send() (*StorageDomainsServiceAddByPathResponse, error) { - rawURL := fmt.Sprintf("%s%s/bypath", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *HostHookServiceGetRequest) Send() (*HostHookServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostHookService.connection.URL(), p.HostHookService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -33599,16 +32927,12 @@ func (p *StorageDomainsServiceAddByPathRequest) Send() (*StorageDomainsServiceAd if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainsService.connection.headers { + for hk, hv := range p.HostHookService.connection.headers { req.Header.Add(hk, hv) } @@ -33623,18 +32947,18 @@ func (p *StorageDomainsServiceAddByPathRequest) Send() (*StorageDomainsServiceAd req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() + token, err := p.HostHookService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) + resp, err := p.HostHookService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { + if p.HostHookService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -33643,17 +32967,24 @@ func (p *StorageDomainsServiceAddByPathRequest) Send() (*StorageDomainsServiceAd if err != nil { return nil, err } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostHookService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustStorageDomain() - return &StorageDomainsServiceAddByPathResponse{storageDomain: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLHookReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &HostHookServiceGetResponse{hook: result}, nil } -func (p *StorageDomainsServiceAddByPathRequest) MustSend() *StorageDomainsServiceAddByPathResponse { +func (p *HostHookServiceGetRequest) MustSend() *HostHookServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -33662,44 +32993,71 @@ func (p *StorageDomainsServiceAddByPathRequest) MustSend() *StorageDomainsServic } // -// Add a new storage domain to the system using the storage on the given host and path. // -type StorageDomainsServiceAddByPathResponse struct { - storageDomain *StorageDomain +type HostHookServiceGetResponse struct { + hook *Hook } -func (p *StorageDomainsServiceAddByPathResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true +func (p *HostHookServiceGetResponse) Hook() (*Hook, bool) { + if p.hook != nil { + return p.hook, true } return nil, false } -func (p *StorageDomainsServiceAddByPathResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") +func (p *HostHookServiceGetResponse) MustHook() *Hook { + if p.hook == nil { + panic("hook in response does not exist") } - return p.storageDomain + return p.hook } // -// Add a new storage domain to the system using the storage on the given host and path. // -func (p *StorageDomainsService) AddByPath() *StorageDomainsServiceAddByPathRequest { - return &StorageDomainsServiceAddByPathRequest{StorageDomainsService: p} +func (p *HostHookService) Get() *HostHookServiceGetRequest { + return &HostHookServiceGetRequest{HostHookService: p} } // -// Add a new storage domain to the system using a direct LUN. +// Service locator method, returns individual service on which the URI is dispatched. // -type StorageDomainsServiceAddDirectLunRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - storageDomain *StorageDomain -} - -func (p *StorageDomainsServiceAddDirectLunRequest) Header(key, value string) *StorageDomainsServiceAddDirectLunRequest { +func (op *HostHookService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *HostHookService) String() string { + return fmt.Sprintf("HostHookService:%s", op.path) +} + +// +// +type HostHooksService struct { + BaseService +} + +func NewHostHooksService(connection *Connection, path string) *HostHooksService { + var result HostHooksService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the list of hooks configured for the host. +// The order of the returned list of hooks is random. +// +type HostHooksServiceListRequest struct { + HostHooksService *HostHooksService + header map[string]string + query map[string]string + follow *string + max *int64 +} + +func (p *HostHooksServiceListRequest) Header(key, value string) *HostHooksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -33707,7 +33065,7 @@ func (p *StorageDomainsServiceAddDirectLunRequest) Header(key, value string) *St return p } -func (p *StorageDomainsServiceAddDirectLunRequest) Query(key, value string) *StorageDomainsServiceAddDirectLunRequest { +func (p *HostHooksServiceListRequest) Query(key, value string) *HostHooksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -33715,20 +33073,27 @@ func (p *StorageDomainsServiceAddDirectLunRequest) Query(key, value string) *Sto return p } -func (p *StorageDomainsServiceAddDirectLunRequest) StorageDomain(storageDomain *StorageDomain) *StorageDomainsServiceAddDirectLunRequest { - p.storageDomain = storageDomain +func (p *HostHooksServiceListRequest) Follow(follow string) *HostHooksServiceListRequest { + p.follow = &follow return p } -func (p *StorageDomainsServiceAddDirectLunRequest) Send() (*StorageDomainsServiceAddDirectLunResponse, error) { - rawURL := fmt.Sprintf("%s%s/directlun", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *HostHooksServiceListRequest) Max(max int64) *HostHooksServiceListRequest { + p.max = &max + return p +} + +func (p *HostHooksServiceListRequest) Send() (*HostHooksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostHooksService.connection.URL(), p.HostHooksService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -33737,16 +33102,12 @@ func (p *StorageDomainsServiceAddDirectLunRequest) Send() (*StorageDomainsServic if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainsService.connection.headers { + for hk, hv := range p.HostHooksService.connection.headers { req.Header.Add(hk, hv) } @@ -33761,18 +33122,18 @@ func (p *StorageDomainsServiceAddDirectLunRequest) Send() (*StorageDomainsServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() + token, err := p.HostHooksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) + resp, err := p.HostHooksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { + if p.HostHooksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -33781,17 +33142,24 @@ func (p *StorageDomainsServiceAddDirectLunRequest) Send() (*StorageDomainsServic if err != nil { return nil, err } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostHooksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustStorageDomain() - return &StorageDomainsServiceAddDirectLunResponse{storageDomain: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLHookReadMany(reader, nil) + if err != nil { + return nil, err + } + return &HostHooksServiceListResponse{hooks: result}, nil } -func (p *StorageDomainsServiceAddDirectLunRequest) MustSend() *StorageDomainsServiceAddDirectLunResponse { +func (p *HostHooksServiceListRequest) MustSend() *HostHooksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -33800,188 +33168,84 @@ func (p *StorageDomainsServiceAddDirectLunRequest) MustSend() *StorageDomainsSer } // -// Add a new storage domain to the system using a direct LUN. +// Returns the list of hooks configured for the host. +// The order of the returned list of hooks is random. // -type StorageDomainsServiceAddDirectLunResponse struct { - storageDomain *StorageDomain +type HostHooksServiceListResponse struct { + hooks *HookSlice } -func (p *StorageDomainsServiceAddDirectLunResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true +func (p *HostHooksServiceListResponse) Hooks() (*HookSlice, bool) { + if p.hooks != nil { + return p.hooks, true } return nil, false } -func (p *StorageDomainsServiceAddDirectLunResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") +func (p *HostHooksServiceListResponse) MustHooks() *HookSlice { + if p.hooks == nil { + panic("hooks in response does not exist") } - return p.storageDomain + return p.hooks } // -// Add a new storage domain to the system using a direct LUN. +// Returns the list of hooks configured for the host. +// The order of the returned list of hooks is random. // -func (p *StorageDomainsService) AddDirectLun() *StorageDomainsServiceAddDirectLunRequest { - return &StorageDomainsServiceAddDirectLunRequest{StorageDomainsService: p} +func (p *HostHooksService) List() *HostHooksServiceListRequest { + return &HostHooksServiceListRequest{HostHooksService: p} } // -// Add a new storage domain to the system using Gluster or POSIX FS storage. // -type StorageDomainsServiceAddGlusterOrPostfsRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - storageDomain *StorageDomain -} - -func (p *StorageDomainsServiceAddGlusterOrPostfsRequest) Header(key, value string) *StorageDomainsServiceAddGlusterOrPostfsRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *StorageDomainsServiceAddGlusterOrPostfsRequest) Query(key, value string) *StorageDomainsServiceAddGlusterOrPostfsRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *StorageDomainsServiceAddGlusterOrPostfsRequest) StorageDomain(storageDomain *StorageDomain) *StorageDomainsServiceAddGlusterOrPostfsRequest { - p.storageDomain = storageDomain - return p +func (op *HostHooksService) HookService(id string) *HostHookService { + return NewHostHookService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *StorageDomainsServiceAddGlusterOrPostfsRequest) Send() (*StorageDomainsServiceAddGlusterOrPostfsResponse, error) { - rawURL := fmt.Sprintf("%s%s/glusterorpostfs", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) - if err != nil { - return nil, err - } - - for hk, hv := range p.StorageDomainsService.connection.headers { - req.Header.Add(hk, hv) - } - - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } - - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *HostHooksService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + index := strings.Index(path, "/") + if index == -1 { + return op.HookService(path), nil } - result := action.MustStorageDomain() - return &StorageDomainsServiceAddGlusterOrPostfsResponse{storageDomain: result}, nil + return op.HookService(path[:index]).Service(path[index+1:]) } -func (p *StorageDomainsServiceAddGlusterOrPostfsRequest) MustSend() *StorageDomainsServiceAddGlusterOrPostfsResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v - } +func (op *HostHooksService) String() string { + return fmt.Sprintf("HostHooksService:%s", op.path) } // -// Add a new storage domain to the system using Gluster or POSIX FS storage. +// A service to manage a network interface of a host. // -type StorageDomainsServiceAddGlusterOrPostfsResponse struct { - storageDomain *StorageDomain -} - -func (p *StorageDomainsServiceAddGlusterOrPostfsResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true - } - return nil, false -} - -func (p *StorageDomainsServiceAddGlusterOrPostfsResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") - } - return p.storageDomain +type HostNicService struct { + BaseService } -// -// Add a new storage domain to the system using Gluster or POSIX FS storage. -// -func (p *StorageDomainsService) AddGlusterOrPostfs() *StorageDomainsServiceAddGlusterOrPostfsRequest { - return &StorageDomainsServiceAddGlusterOrPostfsRequest{StorageDomainsService: p} +func NewHostNicService(connection *Connection, path string) *HostNicService { + var result HostNicService + result.connection = connection + result.path = path + return &result } // -// Returns the list of storage domains in the system. -// The order of the returned list of storage domains is guaranteed only if the `sortby` clause is included -// in the `search` parameter. // -type StorageDomainsServiceListRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - caseSensitive *bool - filter *bool - follow *string - max *int64 - search *string +type HostNicServiceGetRequest struct { + HostNicService *HostNicService + header map[string]string + query map[string]string + allContent *bool + follow *string } -func (p *StorageDomainsServiceListRequest) Header(key, value string) *StorageDomainsServiceListRequest { +func (p *HostNicServiceGetRequest) Header(key, value string) *HostNicServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -33989,7 +33253,7 @@ func (p *StorageDomainsServiceListRequest) Header(key, value string) *StorageDom return p } -func (p *StorageDomainsServiceListRequest) Query(key, value string) *StorageDomainsServiceListRequest { +func (p *HostNicServiceGetRequest) Query(key, value string) *HostNicServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -33997,54 +33261,27 @@ func (p *StorageDomainsServiceListRequest) Query(key, value string) *StorageDoma return p } -func (p *StorageDomainsServiceListRequest) CaseSensitive(caseSensitive bool) *StorageDomainsServiceListRequest { - p.caseSensitive = &caseSensitive - return p -} - -func (p *StorageDomainsServiceListRequest) Filter(filter bool) *StorageDomainsServiceListRequest { - p.filter = &filter +func (p *HostNicServiceGetRequest) AllContent(allContent bool) *HostNicServiceGetRequest { + p.allContent = &allContent return p } -func (p *StorageDomainsServiceListRequest) Follow(follow string) *StorageDomainsServiceListRequest { +func (p *HostNicServiceGetRequest) Follow(follow string) *HostNicServiceGetRequest { p.follow = &follow return p } -func (p *StorageDomainsServiceListRequest) Max(max int64) *StorageDomainsServiceListRequest { - p.max = &max - return p -} - -func (p *StorageDomainsServiceListRequest) Search(search string) *StorageDomainsServiceListRequest { - p.search = &search - return p -} - -func (p *StorageDomainsServiceListRequest) Send() (*StorageDomainsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) +func (p *HostNicServiceGetRequest) Send() (*HostNicServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostNicService.connection.URL(), p.HostNicService.path) values := make(url.Values) - if p.caseSensitive != nil { - values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} - } - - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + if p.allContent != nil { + values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} } if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - - if p.search != nil { - values["search"] = []string{fmt.Sprintf("%v", *p.search)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -34058,7 +33295,7 @@ func (p *StorageDomainsServiceListRequest) Send() (*StorageDomainsServiceListRes return nil, err } - for hk, hv := range p.StorageDomainsService.connection.headers { + for hk, hv := range p.HostNicService.connection.headers { req.Header.Add(hk, hv) } @@ -34073,18 +33310,18 @@ func (p *StorageDomainsServiceListRequest) Send() (*StorageDomainsServiceListRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() + token, err := p.HostNicService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) + resp, err := p.HostNicService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { + if p.HostNicService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -34093,7 +33330,7 @@ func (p *StorageDomainsServiceListRequest) Send() (*StorageDomainsServiceListRes if err != nil { return nil, err } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -34103,14 +33340,14 @@ func (p *StorageDomainsServiceListRequest) Send() (*StorageDomainsServiceListRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageDomainReadMany(reader, nil) + result, err := XMLHostNicReadOne(reader, nil, "") if err != nil { return nil, err } - return &StorageDomainsServiceListResponse{storageDomains: result}, nil + return &HostNicServiceGetResponse{nic: result}, nil } -func (p *StorageDomainsServiceListRequest) MustSend() *StorageDomainsServiceListResponse { +func (p *HostNicServiceGetRequest) MustSend() *HostNicServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -34119,48 +33356,47 @@ func (p *StorageDomainsServiceListRequest) MustSend() *StorageDomainsServiceList } // -// Returns the list of storage domains in the system. -// The order of the returned list of storage domains is guaranteed only if the `sortby` clause is included -// in the `search` parameter. // -type StorageDomainsServiceListResponse struct { - storageDomains *StorageDomainSlice +type HostNicServiceGetResponse struct { + nic *HostNic } -func (p *StorageDomainsServiceListResponse) StorageDomains() (*StorageDomainSlice, bool) { - if p.storageDomains != nil { - return p.storageDomains, true +func (p *HostNicServiceGetResponse) Nic() (*HostNic, bool) { + if p.nic != nil { + return p.nic, true } return nil, false } -func (p *StorageDomainsServiceListResponse) MustStorageDomains() *StorageDomainSlice { - if p.storageDomains == nil { - panic("storageDomains in response does not exist") +func (p *HostNicServiceGetResponse) MustNic() *HostNic { + if p.nic == nil { + panic("nic in response does not exist") } - return p.storageDomains + return p.nic } // -// Returns the list of storage domains in the system. -// The order of the returned list of storage domains is guaranteed only if the `sortby` clause is included -// in the `search` parameter. // -func (p *StorageDomainsService) List() *StorageDomainsServiceListRequest { - return &StorageDomainsServiceListRequest{StorageDomainsService: p} +func (p *HostNicService) Get() *HostNicServiceGetRequest { + return &HostNicServiceGetRequest{HostNicService: p} } // -// Add a new storage domain to the system using the storage on the local host at the given path. +// The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. +// The input should be consisted of at least one of the following properties: +// - `allNetworksAllowed` +// - `numberOfVirtualFunctions` +// Please see the `HostNicVirtualFunctionsConfiguration` type for the meaning of the properties. // -type StorageDomainsServiceAddLocalRequest struct { - StorageDomainsService *StorageDomainsService - header map[string]string - query map[string]string - storageDomain *StorageDomain +type HostNicServiceUpdateVirtualFunctionsConfigurationRequest struct { + HostNicService *HostNicService + header map[string]string + query map[string]string + async *bool + virtualFunctionsConfiguration *HostNicVirtualFunctionsConfiguration } -func (p *StorageDomainsServiceAddLocalRequest) Header(key, value string) *StorageDomainsServiceAddLocalRequest { +func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Header(key, value string) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { if p.header == nil { p.header = make(map[string]string) } @@ -34168,7 +33404,7 @@ func (p *StorageDomainsServiceAddLocalRequest) Header(key, value string) *Storag return p } -func (p *StorageDomainsServiceAddLocalRequest) Query(key, value string) *StorageDomainsServiceAddLocalRequest { +func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Query(key, value string) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { if p.query == nil { p.query = make(map[string]string) } @@ -34176,15 +33412,23 @@ func (p *StorageDomainsServiceAddLocalRequest) Query(key, value string) *Storage return p } -func (p *StorageDomainsServiceAddLocalRequest) StorageDomain(storageDomain *StorageDomain) *StorageDomainsServiceAddLocalRequest { - p.storageDomain = storageDomain +func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Async(async bool) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { + p.async = &async return p } -func (p *StorageDomainsServiceAddLocalRequest) Send() (*StorageDomainsServiceAddLocalResponse, error) { - rawURL := fmt.Sprintf("%s%s/local", p.StorageDomainsService.connection.URL(), p.StorageDomainsService.path) +func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) VirtualFunctionsConfiguration(virtualFunctionsConfiguration *HostNicVirtualFunctionsConfiguration) *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { + p.virtualFunctionsConfiguration = virtualFunctionsConfiguration + return p +} + +func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) Send() (*HostNicServiceUpdateVirtualFunctionsConfigurationResponse, error) { + rawURL := fmt.Sprintf("%s%s/updatevirtualfunctionsconfiguration", p.HostNicService.connection.URL(), p.HostNicService.path) actionBuilder := NewActionBuilder() - actionBuilder.StorageDomain(p.storageDomain) + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.VirtualFunctionsConfiguration(p.virtualFunctionsConfiguration) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -34207,7 +33451,7 @@ func (p *StorageDomainsServiceAddLocalRequest) Send() (*StorageDomainsServiceAdd return nil, err } - for hk, hv := range p.StorageDomainsService.connection.headers { + for hk, hv := range p.HostNicService.connection.headers { req.Header.Add(hk, hv) } @@ -34222,18 +33466,18 @@ func (p *StorageDomainsServiceAddLocalRequest) Send() (*StorageDomainsServiceAdd req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainsService.connection.authenticate() + token, err := p.HostNicService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainsService.connection.client.Do(req) + resp, err := p.HostNicService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainsService.connection.logFunc != nil { + if p.HostNicService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -34242,17 +33486,16 @@ func (p *StorageDomainsServiceAddLocalRequest) Send() (*StorageDomainsServiceAdd if err != nil { return nil, err } - p.StorageDomainsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustStorageDomain() - return &StorageDomainsServiceAddLocalResponse{storageDomain: result}, nil + return new(HostNicServiceUpdateVirtualFunctionsConfigurationResponse), nil } -func (p *StorageDomainsServiceAddLocalRequest) MustSend() *StorageDomainsServiceAddLocalResponse { +func (p *HostNicServiceUpdateVirtualFunctionsConfigurationRequest) MustSend() *HostNicServiceUpdateVirtualFunctionsConfigurationResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -34261,94 +33504,147 @@ func (p *StorageDomainsServiceAddLocalRequest) MustSend() *StorageDomainsService } // -// Add a new storage domain to the system using the storage on the local host at the given path. +// The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. +// The input should be consisted of at least one of the following properties: +// - `allNetworksAllowed` +// - `numberOfVirtualFunctions` +// Please see the `HostNicVirtualFunctionsConfiguration` type for the meaning of the properties. // -type StorageDomainsServiceAddLocalResponse struct { - storageDomain *StorageDomain +type HostNicServiceUpdateVirtualFunctionsConfigurationResponse struct { } -func (p *StorageDomainsServiceAddLocalResponse) StorageDomain() (*StorageDomain, bool) { - if p.storageDomain != nil { - return p.storageDomain, true - } - return nil, false +// +// The action updates virtual function configuration in case the current resource represents an SR-IOV enabled NIC. +// The input should be consisted of at least one of the following properties: +// - `allNetworksAllowed` +// - `numberOfVirtualFunctions` +// Please see the `HostNicVirtualFunctionsConfiguration` type for the meaning of the properties. +// +func (p *HostNicService) UpdateVirtualFunctionsConfiguration() *HostNicServiceUpdateVirtualFunctionsConfigurationRequest { + return &HostNicServiceUpdateVirtualFunctionsConfigurationRequest{HostNicService: p} } -func (p *StorageDomainsServiceAddLocalResponse) MustStorageDomain() *StorageDomain { - if p.storageDomain == nil { - panic("storageDomain in response does not exist") - } - return p.storageDomain +// +// A reference to information elements received by LLDP on the NIC. +// +func (op *HostNicService) LinkLayerDiscoveryProtocolElementsService() *LinkLayerDiscoveryProtocolService { + return NewLinkLayerDiscoveryProtocolService(op.connection, fmt.Sprintf("%s/linklayerdiscoveryprotocolelements", op.path)) } // -// Add a new storage domain to the system using the storage on the local host at the given path. +// Reference to the service that manages the network attachments assigned to this network interface. // -func (p *StorageDomainsService) AddLocal() *StorageDomainsServiceAddLocalRequest { - return &StorageDomainsServiceAddLocalRequest{StorageDomainsService: p} +func (op *HostNicService) NetworkAttachmentsService() *NetworkAttachmentsService { + return NewNetworkAttachmentsService(op.connection, fmt.Sprintf("%s/networkattachments", op.path)) } // +// Reference to the service that manages the network labels assigned to this network interface. // -func (op *StorageDomainsService) StorageDomainService(id string) *StorageDomainService { - return NewStorageDomainService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *HostNicService) NetworkLabelsService() *NetworkLabelsService { + return NewNetworkLabelsService(op.connection, fmt.Sprintf("%s/networklabels", op.path)) } // -// Service locator method, returns individual service on which the URI is dispatched. // -func (op *StorageDomainsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.StorageDomainService(path), nil - } - return op.StorageDomainService(path[:index]).Service(path[index+1:]) +func (op *HostNicService) StatisticsService() *StatisticsService { + return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) } -func (op *StorageDomainsService) String() string { - return fmt.Sprintf("StorageDomainsService:%s", op.path) +// +// Retrieves sub-collection resource of network labels that are allowed on an the virtual functions +// in case that the current resource represents an SR-IOV physical function NIC. +// +func (op *HostNicService) VirtualFunctionAllowedLabelsService() *NetworkLabelsService { + return NewNetworkLabelsService(op.connection, fmt.Sprintf("%s/virtualfunctionallowedlabels", op.path)) } // -// A service to manage data center networks. +// Retrieves sub-collection resource of networks that are allowed on an the virtual functions +// in case that the current resource represents an SR-IOV physical function NIC. // -type DataCenterNetworksService struct { - BaseService +func (op *HostNicService) VirtualFunctionAllowedNetworksService() *VirtualFunctionAllowedNetworksService { + return NewVirtualFunctionAllowedNetworksService(op.connection, fmt.Sprintf("%s/virtualfunctionallowednetworks", op.path)) } -func NewDataCenterNetworksService(connection *Connection, path string) *DataCenterNetworksService { - var result DataCenterNetworksService - result.connection = connection - result.path = path +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *HostNicService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "linklayerdiscoveryprotocolelements" { + return op.LinkLayerDiscoveryProtocolElementsService(), nil + } + if strings.HasPrefix(path, "linklayerdiscoveryprotocolelements/") { + return op.LinkLayerDiscoveryProtocolElementsService().Service(path[35:]) + } + if path == "networkattachments" { + return op.NetworkAttachmentsService(), nil + } + if strings.HasPrefix(path, "networkattachments/") { + return op.NetworkAttachmentsService().Service(path[19:]) + } + if path == "networklabels" { + return op.NetworkLabelsService(), nil + } + if strings.HasPrefix(path, "networklabels/") { + return op.NetworkLabelsService().Service(path[14:]) + } + if path == "statistics" { + return op.StatisticsService(), nil + } + if strings.HasPrefix(path, "statistics/") { + return op.StatisticsService().Service(path[11:]) + } + if path == "virtualfunctionallowedlabels" { + return op.VirtualFunctionAllowedLabelsService(), nil + } + if strings.HasPrefix(path, "virtualfunctionallowedlabels/") { + return op.VirtualFunctionAllowedLabelsService().Service(path[29:]) + } + if path == "virtualfunctionallowednetworks" { + return op.VirtualFunctionAllowedNetworksService(), nil + } + if strings.HasPrefix(path, "virtualfunctionallowednetworks/") { + return op.VirtualFunctionAllowedNetworksService().Service(path[31:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *HostNicService) String() string { + return fmt.Sprintf("HostNicService:%s", op.path) +} + +// +// A service to manage the network interfaces of a host. +// +type HostNicsService struct { + BaseService +} + +func NewHostNicsService(connection *Connection, path string) *HostNicsService { + var result HostNicsService + result.connection = connection + result.path = path return &result } // -// Create a new network in a data center. -// Post a request like in the example below to create a new network in a data center with an ID of `123`. -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/networks -// ---- -// Use the following example in its body: -// [source,xml] -// ---- -// -// mynetwork -// -// ---- +// Returns the list of network interfaces of the host. +// The order of the returned list of network interfaces isn't guaranteed. // -type DataCenterNetworksServiceAddRequest struct { - DataCenterNetworksService *DataCenterNetworksService - header map[string]string - query map[string]string - network *Network +type HostNicsServiceListRequest struct { + HostNicsService *HostNicsService + header map[string]string + query map[string]string + allContent *bool + follow *string + max *int64 } -func (p *DataCenterNetworksServiceAddRequest) Header(key, value string) *DataCenterNetworksServiceAddRequest { +func (p *HostNicsServiceListRequest) Header(key, value string) *HostNicsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -34356,7 +33652,7 @@ func (p *DataCenterNetworksServiceAddRequest) Header(key, value string) *DataCen return p } -func (p *DataCenterNetworksServiceAddRequest) Query(key, value string) *DataCenterNetworksServiceAddRequest { +func (p *HostNicsServiceListRequest) Query(key, value string) *HostNicsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -34364,14 +33660,36 @@ func (p *DataCenterNetworksServiceAddRequest) Query(key, value string) *DataCent return p } -func (p *DataCenterNetworksServiceAddRequest) Network(network *Network) *DataCenterNetworksServiceAddRequest { - p.network = network +func (p *HostNicsServiceListRequest) AllContent(allContent bool) *HostNicsServiceListRequest { + p.allContent = &allContent return p } -func (p *DataCenterNetworksServiceAddRequest) Send() (*DataCenterNetworksServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworksService.connection.URL(), p.DataCenterNetworksService.path) +func (p *HostNicsServiceListRequest) Follow(follow string) *HostNicsServiceListRequest { + p.follow = &follow + return p +} + +func (p *HostNicsServiceListRequest) Max(max int64) *HostNicsServiceListRequest { + p.max = &max + return p +} + +func (p *HostNicsServiceListRequest) Send() (*HostNicsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostNicsService.connection.URL(), p.HostNicsService.path) values := make(url.Values) + if p.allContent != nil { + values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -34380,19 +33698,12 @@ func (p *DataCenterNetworksServiceAddRequest) Send() (*DataCenterNetworksService if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLNetworkWriteOne(writer, p.network, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.DataCenterNetworksService.connection.headers { + for hk, hv := range p.HostNicsService.connection.headers { req.Header.Add(hk, hv) } @@ -34407,18 +33718,18 @@ func (p *DataCenterNetworksServiceAddRequest) Send() (*DataCenterNetworksService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DataCenterNetworksService.connection.authenticate() + token, err := p.HostNicsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DataCenterNetworksService.connection.client.Do(req) + resp, err := p.HostNicsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DataCenterNetworksService.connection.logFunc != nil { + if p.HostNicsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -34427,9 +33738,9 @@ func (p *DataCenterNetworksServiceAddRequest) Send() (*DataCenterNetworksService if err != nil { return nil, err } - p.DataCenterNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostNicsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -34437,14 +33748,14 @@ func (p *DataCenterNetworksServiceAddRequest) Send() (*DataCenterNetworksService return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkReadOne(reader, nil, "") + result, err := XMLHostNicReadMany(reader, nil) if err != nil { return nil, err } - return &DataCenterNetworksServiceAddResponse{network: result}, nil + return &HostNicsServiceListResponse{nics: result}, nil } -func (p *DataCenterNetworksServiceAddRequest) MustSend() *DataCenterNetworksServiceAddResponse { +func (p *HostNicsServiceListRequest) MustSend() *HostNicsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -34453,70 +33764,83 @@ func (p *DataCenterNetworksServiceAddRequest) MustSend() *DataCenterNetworksServ } // -// Create a new network in a data center. -// Post a request like in the example below to create a new network in a data center with an ID of `123`. -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/networks -// ---- -// Use the following example in its body: -// [source,xml] -// ---- -// -// mynetwork -// -// ---- +// Returns the list of network interfaces of the host. +// The order of the returned list of network interfaces isn't guaranteed. // -type DataCenterNetworksServiceAddResponse struct { - network *Network +type HostNicsServiceListResponse struct { + nics *HostNicSlice } -func (p *DataCenterNetworksServiceAddResponse) Network() (*Network, bool) { - if p.network != nil { - return p.network, true +func (p *HostNicsServiceListResponse) Nics() (*HostNicSlice, bool) { + if p.nics != nil { + return p.nics, true } return nil, false } -func (p *DataCenterNetworksServiceAddResponse) MustNetwork() *Network { - if p.network == nil { - panic("network in response does not exist") +func (p *HostNicsServiceListResponse) MustNics() *HostNicSlice { + if p.nics == nil { + panic("nics in response does not exist") } - return p.network + return p.nics } // -// Create a new network in a data center. -// Post a request like in the example below to create a new network in a data center with an ID of `123`. -// [source] -// ---- -// POST /ovirt-engine/api/datacenters/123/networks -// ---- -// Use the following example in its body: -// [source,xml] -// ---- -// -// mynetwork -// -// ---- +// Returns the list of network interfaces of the host. +// The order of the returned list of network interfaces isn't guaranteed. // -func (p *DataCenterNetworksService) Add() *DataCenterNetworksServiceAddRequest { - return &DataCenterNetworksServiceAddRequest{DataCenterNetworksService: p} +func (p *HostNicsService) List() *HostNicsServiceListRequest { + return &HostNicsServiceListRequest{HostNicsService: p} } // -// Lists networks in the data center. -// The order of the returned list of networks isn't guaranteed. +// Reference to the service that manages a single network interface. // -type DataCenterNetworksServiceListRequest struct { - DataCenterNetworksService *DataCenterNetworksService - header map[string]string - query map[string]string - follow *string - max *int64 +func (op *HostNicsService) NicService(id string) *HostNicService { + return NewHostNicService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *DataCenterNetworksServiceListRequest) Header(key, value string) *DataCenterNetworksServiceListRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *HostNicsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.NicService(path), nil + } + return op.NicService(path[:index]).Service(path[index+1:]) +} + +func (op *HostNicsService) String() string { + return fmt.Sprintf("HostNicsService:%s", op.path) +} + +// +// +type HostNumaNodeService struct { + BaseService +} + +func NewHostNumaNodeService(connection *Connection, path string) *HostNumaNodeService { + var result HostNumaNodeService + result.connection = connection + result.path = path + return &result +} + +// +// +type HostNumaNodeServiceGetRequest struct { + HostNumaNodeService *HostNumaNodeService + header map[string]string + query map[string]string + follow *string +} + +func (p *HostNumaNodeServiceGetRequest) Header(key, value string) *HostNumaNodeServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -34524,7 +33848,7 @@ func (p *DataCenterNetworksServiceListRequest) Header(key, value string) *DataCe return p } -func (p *DataCenterNetworksServiceListRequest) Query(key, value string) *DataCenterNetworksServiceListRequest { +func (p *HostNumaNodeServiceGetRequest) Query(key, value string) *HostNumaNodeServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -34532,27 +33856,18 @@ func (p *DataCenterNetworksServiceListRequest) Query(key, value string) *DataCen return p } -func (p *DataCenterNetworksServiceListRequest) Follow(follow string) *DataCenterNetworksServiceListRequest { +func (p *HostNumaNodeServiceGetRequest) Follow(follow string) *HostNumaNodeServiceGetRequest { p.follow = &follow return p } -func (p *DataCenterNetworksServiceListRequest) Max(max int64) *DataCenterNetworksServiceListRequest { - p.max = &max - return p -} - -func (p *DataCenterNetworksServiceListRequest) Send() (*DataCenterNetworksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.DataCenterNetworksService.connection.URL(), p.DataCenterNetworksService.path) +func (p *HostNumaNodeServiceGetRequest) Send() (*HostNumaNodeServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostNumaNodeService.connection.URL(), p.HostNumaNodeService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -34566,7 +33881,7 @@ func (p *DataCenterNetworksServiceListRequest) Send() (*DataCenterNetworksServic return nil, err } - for hk, hv := range p.DataCenterNetworksService.connection.headers { + for hk, hv := range p.HostNumaNodeService.connection.headers { req.Header.Add(hk, hv) } @@ -34581,18 +33896,18 @@ func (p *DataCenterNetworksServiceListRequest) Send() (*DataCenterNetworksServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.DataCenterNetworksService.connection.authenticate() + token, err := p.HostNumaNodeService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.DataCenterNetworksService.connection.client.Do(req) + resp, err := p.HostNumaNodeService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.DataCenterNetworksService.connection.logFunc != nil { + if p.HostNumaNodeService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -34601,7 +33916,7 @@ func (p *DataCenterNetworksServiceListRequest) Send() (*DataCenterNetworksServic if err != nil { return nil, err } - p.DataCenterNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostNumaNodeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -34611,14 +33926,14 @@ func (p *DataCenterNetworksServiceListRequest) Send() (*DataCenterNetworksServic return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkReadMany(reader, nil) + result, err := XMLNumaNodeReadOne(reader, nil, "") if err != nil { return nil, err } - return &DataCenterNetworksServiceListResponse{networks: result}, nil + return &HostNumaNodeServiceGetResponse{node: result}, nil } -func (p *DataCenterNetworksServiceListRequest) MustSend() *DataCenterNetworksServiceListResponse { +func (p *HostNumaNodeServiceGetRequest) MustSend() *HostNumaNodeServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -34627,83 +33942,83 @@ func (p *DataCenterNetworksServiceListRequest) MustSend() *DataCenterNetworksSer } // -// Lists networks in the data center. -// The order of the returned list of networks isn't guaranteed. // -type DataCenterNetworksServiceListResponse struct { - networks *NetworkSlice +type HostNumaNodeServiceGetResponse struct { + node *NumaNode } -func (p *DataCenterNetworksServiceListResponse) Networks() (*NetworkSlice, bool) { - if p.networks != nil { - return p.networks, true +func (p *HostNumaNodeServiceGetResponse) Node() (*NumaNode, bool) { + if p.node != nil { + return p.node, true } return nil, false } -func (p *DataCenterNetworksServiceListResponse) MustNetworks() *NetworkSlice { - if p.networks == nil { - panic("networks in response does not exist") +func (p *HostNumaNodeServiceGetResponse) MustNode() *NumaNode { + if p.node == nil { + panic("node in response does not exist") } - return p.networks + return p.node } // -// Lists networks in the data center. -// The order of the returned list of networks isn't guaranteed. // -func (p *DataCenterNetworksService) List() *DataCenterNetworksServiceListRequest { - return &DataCenterNetworksServiceListRequest{DataCenterNetworksService: p} +func (p *HostNumaNodeService) Get() *HostNumaNodeServiceGetRequest { + return &HostNumaNodeServiceGetRequest{HostNumaNodeService: p} } // -// Access the data center network service that manages the data center network specified by an ID. // -func (op *DataCenterNetworksService) NetworkService(id string) *DataCenterNetworkService { - return NewDataCenterNetworkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *HostNumaNodeService) StatisticsService() *StatisticsService { + return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *DataCenterNetworksService) Service(path string) (Service, error) { +func (op *HostNumaNodeService) Service(path string) (Service, error) { if path == "" { return op, nil } - index := strings.Index(path, "/") - if index == -1 { - return op.NetworkService(path), nil + if path == "statistics" { + return op.StatisticsService(), nil } - return op.NetworkService(path[:index]).Service(path[index+1:]) + if strings.HasPrefix(path, "statistics/") { + return op.StatisticsService().Service(path[11:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *DataCenterNetworksService) String() string { - return fmt.Sprintf("DataCenterNetworksService:%s", op.path) +func (op *HostNumaNodeService) String() string { + return fmt.Sprintf("HostNumaNodeService:%s", op.path) } // // -type QuotaStorageLimitService struct { +type HostNumaNodesService struct { BaseService } -func NewQuotaStorageLimitService(connection *Connection, path string) *QuotaStorageLimitService { - var result QuotaStorageLimitService +func NewHostNumaNodesService(connection *Connection, path string) *HostNumaNodesService { + var result HostNumaNodesService result.connection = connection result.path = path return &result } // +// Returns the list of NUMA nodes of the host. +// The order of the returned list of NUMA nodes isn't guaranteed. // -type QuotaStorageLimitServiceGetRequest struct { - QuotaStorageLimitService *QuotaStorageLimitService - header map[string]string - query map[string]string - follow *string +type HostNumaNodesServiceListRequest struct { + HostNumaNodesService *HostNumaNodesService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *QuotaStorageLimitServiceGetRequest) Header(key, value string) *QuotaStorageLimitServiceGetRequest { +func (p *HostNumaNodesServiceListRequest) Header(key, value string) *HostNumaNodesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -34711,7 +34026,7 @@ func (p *QuotaStorageLimitServiceGetRequest) Header(key, value string) *QuotaSto return p } -func (p *QuotaStorageLimitServiceGetRequest) Query(key, value string) *QuotaStorageLimitServiceGetRequest { +func (p *HostNumaNodesServiceListRequest) Query(key, value string) *HostNumaNodesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -34719,18 +34034,27 @@ func (p *QuotaStorageLimitServiceGetRequest) Query(key, value string) *QuotaStor return p } -func (p *QuotaStorageLimitServiceGetRequest) Follow(follow string) *QuotaStorageLimitServiceGetRequest { +func (p *HostNumaNodesServiceListRequest) Follow(follow string) *HostNumaNodesServiceListRequest { p.follow = &follow return p } -func (p *QuotaStorageLimitServiceGetRequest) Send() (*QuotaStorageLimitServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QuotaStorageLimitService.connection.URL(), p.QuotaStorageLimitService.path) +func (p *HostNumaNodesServiceListRequest) Max(max int64) *HostNumaNodesServiceListRequest { + p.max = &max + return p +} + +func (p *HostNumaNodesServiceListRequest) Send() (*HostNumaNodesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostNumaNodesService.connection.URL(), p.HostNumaNodesService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -34744,7 +34068,7 @@ func (p *QuotaStorageLimitServiceGetRequest) Send() (*QuotaStorageLimitServiceGe return nil, err } - for hk, hv := range p.QuotaStorageLimitService.connection.headers { + for hk, hv := range p.HostNumaNodesService.connection.headers { req.Header.Add(hk, hv) } @@ -34759,18 +34083,18 @@ func (p *QuotaStorageLimitServiceGetRequest) Send() (*QuotaStorageLimitServiceGe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QuotaStorageLimitService.connection.authenticate() + token, err := p.HostNumaNodesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QuotaStorageLimitService.connection.client.Do(req) + resp, err := p.HostNumaNodesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QuotaStorageLimitService.connection.logFunc != nil { + if p.HostNumaNodesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -34779,7 +34103,7 @@ func (p *QuotaStorageLimitServiceGetRequest) Send() (*QuotaStorageLimitServiceGe if err != nil { return nil, err } - p.QuotaStorageLimitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostNumaNodesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -34789,14 +34113,14 @@ func (p *QuotaStorageLimitServiceGetRequest) Send() (*QuotaStorageLimitServiceGe return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLQuotaStorageLimitReadOne(reader, nil, "") + result, err := XMLNumaNodeReadMany(reader, nil) if err != nil { return nil, err } - return &QuotaStorageLimitServiceGetResponse{limit: result}, nil + return &HostNumaNodesServiceListResponse{nodes: result}, nil } -func (p *QuotaStorageLimitServiceGetRequest) MustSend() *QuotaStorageLimitServiceGetResponse { +func (p *HostNumaNodesServiceListRequest) MustSend() *HostNumaNodesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -34805,41 +34129,84 @@ func (p *QuotaStorageLimitServiceGetRequest) MustSend() *QuotaStorageLimitServic } // +// Returns the list of NUMA nodes of the host. +// The order of the returned list of NUMA nodes isn't guaranteed. // -type QuotaStorageLimitServiceGetResponse struct { - limit *QuotaStorageLimit +type HostNumaNodesServiceListResponse struct { + nodes *NumaNodeSlice } -func (p *QuotaStorageLimitServiceGetResponse) Limit() (*QuotaStorageLimit, bool) { - if p.limit != nil { - return p.limit, true +func (p *HostNumaNodesServiceListResponse) Nodes() (*NumaNodeSlice, bool) { + if p.nodes != nil { + return p.nodes, true } return nil, false } -func (p *QuotaStorageLimitServiceGetResponse) MustLimit() *QuotaStorageLimit { - if p.limit == nil { - panic("limit in response does not exist") +func (p *HostNumaNodesServiceListResponse) MustNodes() *NumaNodeSlice { + if p.nodes == nil { + panic("nodes in response does not exist") } - return p.limit + return p.nodes } // +// Returns the list of NUMA nodes of the host. +// The order of the returned list of NUMA nodes isn't guaranteed. // -func (p *QuotaStorageLimitService) Get() *QuotaStorageLimitServiceGetRequest { - return &QuotaStorageLimitServiceGetRequest{QuotaStorageLimitService: p} +func (p *HostNumaNodesService) List() *HostNumaNodesServiceListRequest { + return &HostNumaNodesServiceListRequest{HostNumaNodesService: p} } // // -type QuotaStorageLimitServiceRemoveRequest struct { - QuotaStorageLimitService *QuotaStorageLimitService - header map[string]string - query map[string]string - async *bool +func (op *HostNumaNodesService) NodeService(id string) *HostNumaNodeService { + return NewHostNumaNodeService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *QuotaStorageLimitServiceRemoveRequest) Header(key, value string) *QuotaStorageLimitServiceRemoveRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *HostNumaNodesService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.NodeService(path), nil + } + return op.NodeService(path[:index]).Service(path[index+1:]) +} + +func (op *HostNumaNodesService) String() string { + return fmt.Sprintf("HostNumaNodesService:%s", op.path) +} + +// +// A service to manage a host. +// +type HostService struct { + BaseService +} + +func NewHostService(connection *Connection, path string) *HostService { + var result HostService + result.connection = connection + result.path = path + return &result +} + +// +// Activates the host for use, for example to run virtual machines. +// +type HostServiceActivateRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool +} + +func (p *HostServiceActivateRequest) Header(key, value string) *HostServiceActivateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -34847,7 +34214,7 @@ func (p *QuotaStorageLimitServiceRemoveRequest) Header(key, value string) *Quota return p } -func (p *QuotaStorageLimitServiceRemoveRequest) Query(key, value string) *QuotaStorageLimitServiceRemoveRequest { +func (p *HostServiceActivateRequest) Query(key, value string) *HostServiceActivateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -34855,18 +34222,22 @@ func (p *QuotaStorageLimitServiceRemoveRequest) Query(key, value string) *QuotaS return p } -func (p *QuotaStorageLimitServiceRemoveRequest) Async(async bool) *QuotaStorageLimitServiceRemoveRequest { +func (p *HostServiceActivateRequest) Async(async bool) *HostServiceActivateRequest { p.async = &async return p } -func (p *QuotaStorageLimitServiceRemoveRequest) Send() (*QuotaStorageLimitServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QuotaStorageLimitService.connection.URL(), p.QuotaStorageLimitService.path) - values := make(url.Values) +func (p *HostServiceActivateRequest) Send() (*HostServiceActivateResponse, error) { + rawURL := fmt.Sprintf("%s%s/activate", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -34875,12 +34246,16 @@ func (p *QuotaStorageLimitServiceRemoveRequest) Send() (*QuotaStorageLimitServic if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.QuotaStorageLimitService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -34895,18 +34270,18 @@ func (p *QuotaStorageLimitServiceRemoveRequest) Send() (*QuotaStorageLimitServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QuotaStorageLimitService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QuotaStorageLimitService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QuotaStorageLimitService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -34915,19 +34290,16 @@ func (p *QuotaStorageLimitServiceRemoveRequest) Send() (*QuotaStorageLimitServic if err != nil { return nil, err } - p.QuotaStorageLimitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(QuotaStorageLimitServiceRemoveResponse), nil + return new(HostServiceActivateResponse), nil } -func (p *QuotaStorageLimitServiceRemoveRequest) MustSend() *QuotaStorageLimitServiceRemoveResponse { +func (p *HostServiceActivateRequest) MustSend() *HostServiceActivateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -34936,53 +34308,33 @@ func (p *QuotaStorageLimitServiceRemoveRequest) MustSend() *QuotaStorageLimitSer } // +// Activates the host for use, for example to run virtual machines. // -type QuotaStorageLimitServiceRemoveResponse struct { -} - -// -// -func (p *QuotaStorageLimitService) Remove() *QuotaStorageLimitServiceRemoveRequest { - return &QuotaStorageLimitServiceRemoveRequest{QuotaStorageLimitService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *QuotaStorageLimitService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *QuotaStorageLimitService) String() string { - return fmt.Sprintf("QuotaStorageLimitService:%s", op.path) +type HostServiceActivateResponse struct { } // +// Activates the host for use, for example to run virtual machines. // -type StorageDomainServerConnectionService struct { - BaseService -} - -func NewStorageDomainServerConnectionService(connection *Connection, path string) *StorageDomainServerConnectionService { - var result StorageDomainServerConnectionService - result.connection = connection - result.path = path - return &result +func (p *HostService) Activate() *HostServiceActivateRequest { + return &HostServiceActivateRequest{HostService: p} } // +// Approve a pre-installed Hypervisor host for usage in the virtualization environment. +// This action also accepts an optional cluster element to define the target cluster for this host. // -type StorageDomainServerConnectionServiceGetRequest struct { - StorageDomainServerConnectionService *StorageDomainServerConnectionService - header map[string]string - query map[string]string - follow *string +type HostServiceApproveRequest struct { + HostService *HostService + header map[string]string + query map[string]string + activate *bool + async *bool + cluster *Cluster + host *Host } -func (p *StorageDomainServerConnectionServiceGetRequest) Header(key, value string) *StorageDomainServerConnectionServiceGetRequest { +func (p *HostServiceApproveRequest) Header(key, value string) *HostServiceApproveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -34990,7 +34342,7 @@ func (p *StorageDomainServerConnectionServiceGetRequest) Header(key, value strin return p } -func (p *StorageDomainServerConnectionServiceGetRequest) Query(key, value string) *StorageDomainServerConnectionServiceGetRequest { +func (p *HostServiceApproveRequest) Query(key, value string) *HostServiceApproveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -34998,18 +34350,42 @@ func (p *StorageDomainServerConnectionServiceGetRequest) Query(key, value string return p } -func (p *StorageDomainServerConnectionServiceGetRequest) Follow(follow string) *StorageDomainServerConnectionServiceGetRequest { - p.follow = &follow +func (p *HostServiceApproveRequest) Activate(activate bool) *HostServiceApproveRequest { + p.activate = &activate return p } -func (p *StorageDomainServerConnectionServiceGetRequest) Send() (*StorageDomainServerConnectionServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainServerConnectionService.connection.URL(), p.StorageDomainServerConnectionService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *HostServiceApproveRequest) Async(async bool) *HostServiceApproveRequest { + p.async = &async + return p +} + +func (p *HostServiceApproveRequest) Cluster(cluster *Cluster) *HostServiceApproveRequest { + p.cluster = cluster + return p +} + +func (p *HostServiceApproveRequest) Host(host *Host) *HostServiceApproveRequest { + p.host = host + return p +} +func (p *HostServiceApproveRequest) Send() (*HostServiceApproveResponse, error) { + rawURL := fmt.Sprintf("%s%s/approve", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.activate != nil { + actionBuilder.Activate(*p.activate) + } + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Cluster(p.cluster) + actionBuilder.Host(p.host) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35018,12 +34394,16 @@ func (p *StorageDomainServerConnectionServiceGetRequest) Send() (*StorageDomainS if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainServerConnectionService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35038,18 +34418,18 @@ func (p *StorageDomainServerConnectionServiceGetRequest) Send() (*StorageDomainS req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainServerConnectionService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainServerConnectionService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainServerConnectionService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35058,24 +34438,16 @@ func (p *StorageDomainServerConnectionServiceGetRequest) Send() (*StorageDomainS if err != nil { return nil, err } - p.StorageDomainServerConnectionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLStorageConnectionReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &StorageDomainServerConnectionServiceGetResponse{connection: result}, nil + return new(HostServiceApproveResponse), nil } -func (p *StorageDomainServerConnectionServiceGetRequest) MustSend() *StorageDomainServerConnectionServiceGetResponse { +func (p *HostServiceApproveRequest) MustSend() *HostServiceApproveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35084,42 +34456,51 @@ func (p *StorageDomainServerConnectionServiceGetRequest) MustSend() *StorageDoma } // +// Approve a pre-installed Hypervisor host for usage in the virtualization environment. +// This action also accepts an optional cluster element to define the target cluster for this host. // -type StorageDomainServerConnectionServiceGetResponse struct { - connection *StorageConnection -} - -func (p *StorageDomainServerConnectionServiceGetResponse) Connection() (*StorageConnection, bool) { - if p.connection != nil { - return p.connection, true - } - return nil, false -} - -func (p *StorageDomainServerConnectionServiceGetResponse) MustConnection() *StorageConnection { - if p.connection == nil { - panic("connection in response does not exist") - } - return p.connection +type HostServiceApproveResponse struct { } // +// Approve a pre-installed Hypervisor host for usage in the virtualization environment. +// This action also accepts an optional cluster element to define the target cluster for this host. // -func (p *StorageDomainServerConnectionService) Get() *StorageDomainServerConnectionServiceGetRequest { - return &StorageDomainServerConnectionServiceGetRequest{StorageDomainServerConnectionService: p} +func (p *HostService) Approve() *HostServiceApproveRequest { + return &HostServiceApproveRequest{HostService: p} } // -// Detaches a storage connection from storage. +// Marks the network configuration as good and persists it inside the host. +// An API user commits the network configuration to persist a host network interface attachment or detachment, or +// persist the creation and deletion of a bonded interface. +// IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is +// not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and +// automatically reverts to the previous networking configuration. +// For example, to commit the network configuration of host with id `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/commitnetconfig +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- +// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in +// the <> request, in which case the new +// configuration is automatically saved in the {hypervisor-name} upon completing the setup and +// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without +// waiting for a separate <> request. // -type StorageDomainServerConnectionServiceRemoveRequest struct { - StorageDomainServerConnectionService *StorageDomainServerConnectionService - header map[string]string - query map[string]string - async *bool +type HostServiceCommitNetConfigRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool } -func (p *StorageDomainServerConnectionServiceRemoveRequest) Header(key, value string) *StorageDomainServerConnectionServiceRemoveRequest { +func (p *HostServiceCommitNetConfigRequest) Header(key, value string) *HostServiceCommitNetConfigRequest { if p.header == nil { p.header = make(map[string]string) } @@ -35127,7 +34508,7 @@ func (p *StorageDomainServerConnectionServiceRemoveRequest) Header(key, value st return p } -func (p *StorageDomainServerConnectionServiceRemoveRequest) Query(key, value string) *StorageDomainServerConnectionServiceRemoveRequest { +func (p *HostServiceCommitNetConfigRequest) Query(key, value string) *HostServiceCommitNetConfigRequest { if p.query == nil { p.query = make(map[string]string) } @@ -35135,18 +34516,22 @@ func (p *StorageDomainServerConnectionServiceRemoveRequest) Query(key, value str return p } -func (p *StorageDomainServerConnectionServiceRemoveRequest) Async(async bool) *StorageDomainServerConnectionServiceRemoveRequest { +func (p *HostServiceCommitNetConfigRequest) Async(async bool) *HostServiceCommitNetConfigRequest { p.async = &async return p } -func (p *StorageDomainServerConnectionServiceRemoveRequest) Send() (*StorageDomainServerConnectionServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.StorageDomainServerConnectionService.connection.URL(), p.StorageDomainServerConnectionService.path) - values := make(url.Values) +func (p *HostServiceCommitNetConfigRequest) Send() (*HostServiceCommitNetConfigResponse, error) { + rawURL := fmt.Sprintf("%s%s/commitnetconfig", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35155,12 +34540,16 @@ func (p *StorageDomainServerConnectionServiceRemoveRequest) Send() (*StorageDoma if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.StorageDomainServerConnectionService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35175,18 +34564,18 @@ func (p *StorageDomainServerConnectionServiceRemoveRequest) Send() (*StorageDoma req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.StorageDomainServerConnectionService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.StorageDomainServerConnectionService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.StorageDomainServerConnectionService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35195,19 +34584,16 @@ func (p *StorageDomainServerConnectionServiceRemoveRequest) Send() (*StorageDoma if err != nil { return nil, err } - p.StorageDomainServerConnectionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(StorageDomainServerConnectionServiceRemoveResponse), nil + return new(HostServiceCommitNetConfigResponse), nil } -func (p *StorageDomainServerConnectionServiceRemoveRequest) MustSend() *StorageDomainServerConnectionServiceRemoveResponse { +func (p *HostServiceCommitNetConfigRequest) MustSend() *HostServiceCommitNetConfigResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35216,57 +34602,84 @@ func (p *StorageDomainServerConnectionServiceRemoveRequest) MustSend() *StorageD } // -// Detaches a storage connection from storage. -// -type StorageDomainServerConnectionServiceRemoveResponse struct { -} - -// -// Detaches a storage connection from storage. -// -func (p *StorageDomainServerConnectionService) Remove() *StorageDomainServerConnectionServiceRemoveRequest { - return &StorageDomainServerConnectionServiceRemoveRequest{StorageDomainServerConnectionService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Marks the network configuration as good and persists it inside the host. +// An API user commits the network configuration to persist a host network interface attachment or detachment, or +// persist the creation and deletion of a bonded interface. +// IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is +// not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and +// automatically reverts to the previous networking configuration. +// For example, to commit the network configuration of host with id `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/commitnetconfig +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- +// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in +// the <> request, in which case the new +// configuration is automatically saved in the {hypervisor-name} upon completing the setup and +// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without +// waiting for a separate <> request. // -func (op *StorageDomainServerConnectionService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *StorageDomainServerConnectionService) String() string { - return fmt.Sprintf("StorageDomainServerConnectionService:%s", op.path) +type HostServiceCommitNetConfigResponse struct { } // +// Marks the network configuration as good and persists it inside the host. +// An API user commits the network configuration to persist a host network interface attachment or detachment, or +// persist the creation and deletion of a bonded interface. +// IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is +// not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and +// automatically reverts to the previous networking configuration. +// For example, to commit the network configuration of host with id `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/commitnetconfig +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- +// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in +// the <> request, in which case the new +// configuration is automatically saved in the {hypervisor-name} upon completing the setup and +// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without +// waiting for a separate <> request. // -type VmBackupDisksService struct { - BaseService -} - -func NewVmBackupDisksService(connection *Connection, path string) *VmBackupDisksService { - var result VmBackupDisksService - result.connection = connection - result.path = path - return &result +func (p *HostService) CommitNetConfig() *HostServiceCommitNetConfigRequest { + return &HostServiceCommitNetConfigRequest{HostService: p} } // -// Returns the list of disks in backup. +// Copy the network configuration of the specified host to current host. +// IMPORTANT: Any network attachments that are not present on the source host will be erased from the target host +// by the copy operation. +// To copy networks from another host, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/copyhostnetworks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// +// ---- // -type VmBackupDisksServiceListRequest struct { - VmBackupDisksService *VmBackupDisksService - header map[string]string - query map[string]string - follow *string - max *int64 +type HostServiceCopyHostNetworksRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + sourceHost *Host } -func (p *VmBackupDisksServiceListRequest) Header(key, value string) *VmBackupDisksServiceListRequest { +func (p *HostServiceCopyHostNetworksRequest) Header(key, value string) *HostServiceCopyHostNetworksRequest { if p.header == nil { p.header = make(map[string]string) } @@ -35274,7 +34687,7 @@ func (p *VmBackupDisksServiceListRequest) Header(key, value string) *VmBackupDis return p } -func (p *VmBackupDisksServiceListRequest) Query(key, value string) *VmBackupDisksServiceListRequest { +func (p *HostServiceCopyHostNetworksRequest) Query(key, value string) *HostServiceCopyHostNetworksRequest { if p.query == nil { p.query = make(map[string]string) } @@ -35282,27 +34695,28 @@ func (p *VmBackupDisksServiceListRequest) Query(key, value string) *VmBackupDisk return p } -func (p *VmBackupDisksServiceListRequest) Follow(follow string) *VmBackupDisksServiceListRequest { - p.follow = &follow +func (p *HostServiceCopyHostNetworksRequest) Async(async bool) *HostServiceCopyHostNetworksRequest { + p.async = &async return p } -func (p *VmBackupDisksServiceListRequest) Max(max int64) *VmBackupDisksServiceListRequest { - p.max = &max +func (p *HostServiceCopyHostNetworksRequest) SourceHost(sourceHost *Host) *HostServiceCopyHostNetworksRequest { + p.sourceHost = sourceHost return p } -func (p *VmBackupDisksServiceListRequest) Send() (*VmBackupDisksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmBackupDisksService.connection.URL(), p.VmBackupDisksService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *HostServiceCopyHostNetworksRequest) Send() (*HostServiceCopyHostNetworksResponse, error) { + rawURL := fmt.Sprintf("%s%s/copyhostnetworks", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + actionBuilder.SourceHost(p.sourceHost) + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35311,12 +34725,16 @@ func (p *VmBackupDisksServiceListRequest) Send() (*VmBackupDisksServiceListRespo if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmBackupDisksService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35331,18 +34749,18 @@ func (p *VmBackupDisksServiceListRequest) Send() (*VmBackupDisksServiceListRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmBackupDisksService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmBackupDisksService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmBackupDisksService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35351,24 +34769,16 @@ func (p *VmBackupDisksServiceListRequest) Send() (*VmBackupDisksServiceListRespo if err != nil { return nil, err } - p.VmBackupDisksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &VmBackupDisksServiceListResponse{disks: result}, nil + return new(HostServiceCopyHostNetworksResponse), nil } -func (p *VmBackupDisksServiceListRequest) MustSend() *VmBackupDisksServiceListResponse { +func (p *HostServiceCopyHostNetworksRequest) MustSend() *HostServiceCopyHostNetworksResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35377,81 +34787,59 @@ func (p *VmBackupDisksServiceListRequest) MustSend() *VmBackupDisksServiceListRe } // -// Returns the list of disks in backup. -// -type VmBackupDisksServiceListResponse struct { - disks *DiskSlice -} - -func (p *VmBackupDisksServiceListResponse) Disks() (*DiskSlice, bool) { - if p.disks != nil { - return p.disks, true - } - return nil, false -} - -func (p *VmBackupDisksServiceListResponse) MustDisks() *DiskSlice { - if p.disks == nil { - panic("disks in response does not exist") - } - return p.disks -} - -// -// Returns the list of disks in backup. -// -func (p *VmBackupDisksService) List() *VmBackupDisksServiceListRequest { - return &VmBackupDisksServiceListRequest{VmBackupDisksService: p} -} - -// -// A reference to the service that manages a specific disk. -// -func (op *VmBackupDisksService) DiskService(id string) *VmBackupDiskService { - return NewVmBackupDiskService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Copy the network configuration of the specified host to current host. +// IMPORTANT: Any network attachments that are not present on the source host will be erased from the target host +// by the copy operation. +// To copy networks from another host, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/copyhostnetworks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// +// ---- // -func (op *VmBackupDisksService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.DiskService(path), nil - } - return op.DiskService(path[:index]).Service(path[index+1:]) -} - -func (op *VmBackupDisksService) String() string { - return fmt.Sprintf("VmBackupDisksService:%s", op.path) +type HostServiceCopyHostNetworksResponse struct { } // +// Copy the network configuration of the specified host to current host. +// IMPORTANT: Any network attachments that are not present on the source host will be erased from the target host +// by the copy operation. +// To copy networks from another host, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/copyhostnetworks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +// +// ---- // -type TemplateWatchdogService struct { - BaseService -} - -func NewTemplateWatchdogService(connection *Connection, path string) *TemplateWatchdogService { - var result TemplateWatchdogService - result.connection = connection - result.path = path - return &result +func (p *HostService) CopyHostNetworks() *HostServiceCopyHostNetworksRequest { + return &HostServiceCopyHostNetworksRequest{HostService: p} } // +// Deactivates the host to perform maintenance tasks. // -type TemplateWatchdogServiceGetRequest struct { - TemplateWatchdogService *TemplateWatchdogService - header map[string]string - query map[string]string - follow *string +type HostServiceDeactivateRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + reason *string + stopGlusterService *bool } -func (p *TemplateWatchdogServiceGetRequest) Header(key, value string) *TemplateWatchdogServiceGetRequest { +func (p *HostServiceDeactivateRequest) Header(key, value string) *HostServiceDeactivateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -35459,7 +34847,7 @@ func (p *TemplateWatchdogServiceGetRequest) Header(key, value string) *TemplateW return p } -func (p *TemplateWatchdogServiceGetRequest) Query(key, value string) *TemplateWatchdogServiceGetRequest { +func (p *HostServiceDeactivateRequest) Query(key, value string) *HostServiceDeactivateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -35467,18 +34855,38 @@ func (p *TemplateWatchdogServiceGetRequest) Query(key, value string) *TemplateWa return p } -func (p *TemplateWatchdogServiceGetRequest) Follow(follow string) *TemplateWatchdogServiceGetRequest { - p.follow = &follow +func (p *HostServiceDeactivateRequest) Async(async bool) *HostServiceDeactivateRequest { + p.async = &async return p } -func (p *TemplateWatchdogServiceGetRequest) Send() (*TemplateWatchdogServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateWatchdogService.connection.URL(), p.TemplateWatchdogService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *HostServiceDeactivateRequest) Reason(reason string) *HostServiceDeactivateRequest { + p.reason = &reason + return p +} + +func (p *HostServiceDeactivateRequest) StopGlusterService(stopGlusterService bool) *HostServiceDeactivateRequest { + p.stopGlusterService = &stopGlusterService + return p +} +func (p *HostServiceDeactivateRequest) Send() (*HostServiceDeactivateResponse, error) { + rawURL := fmt.Sprintf("%s%s/deactivate", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) + } + if p.reason != nil { + actionBuilder.Reason(*p.reason) + } + if p.stopGlusterService != nil { + actionBuilder.StopGlusterService(*p.stopGlusterService) + } + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35487,12 +34895,16 @@ func (p *TemplateWatchdogServiceGetRequest) Send() (*TemplateWatchdogServiceGetR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateWatchdogService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35507,18 +34919,18 @@ func (p *TemplateWatchdogServiceGetRequest) Send() (*TemplateWatchdogServiceGetR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateWatchdogService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateWatchdogService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateWatchdogService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35527,24 +34939,16 @@ func (p *TemplateWatchdogServiceGetRequest) Send() (*TemplateWatchdogServiceGetR if err != nil { return nil, err } - p.TemplateWatchdogService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLWatchdogReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &TemplateWatchdogServiceGetResponse{watchdog: result}, nil + return new(HostServiceDeactivateResponse), nil } -func (p *TemplateWatchdogServiceGetRequest) MustSend() *TemplateWatchdogServiceGetResponse { +func (p *HostServiceDeactivateRequest) MustSend() *HostServiceDeactivateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35553,41 +34957,30 @@ func (p *TemplateWatchdogServiceGetRequest) MustSend() *TemplateWatchdogServiceG } // +// Deactivates the host to perform maintenance tasks. // -type TemplateWatchdogServiceGetResponse struct { - watchdog *Watchdog -} - -func (p *TemplateWatchdogServiceGetResponse) Watchdog() (*Watchdog, bool) { - if p.watchdog != nil { - return p.watchdog, true - } - return nil, false -} - -func (p *TemplateWatchdogServiceGetResponse) MustWatchdog() *Watchdog { - if p.watchdog == nil { - panic("watchdog in response does not exist") - } - return p.watchdog +type HostServiceDeactivateResponse struct { } // +// Deactivates the host to perform maintenance tasks. // -func (p *TemplateWatchdogService) Get() *TemplateWatchdogServiceGetRequest { - return &TemplateWatchdogServiceGetRequest{TemplateWatchdogService: p} +func (p *HostService) Deactivate() *HostServiceDeactivateRequest { + return &HostServiceDeactivateRequest{HostService: p} } // +// Enrolls the certificate of the host. Useful in case you get a warning that it is about to expire or has already +// expired. // -type TemplateWatchdogServiceRemoveRequest struct { - TemplateWatchdogService *TemplateWatchdogService - header map[string]string - query map[string]string - async *bool +type HostServiceEnrollCertificateRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool } -func (p *TemplateWatchdogServiceRemoveRequest) Header(key, value string) *TemplateWatchdogServiceRemoveRequest { +func (p *HostServiceEnrollCertificateRequest) Header(key, value string) *HostServiceEnrollCertificateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -35595,7 +34988,7 @@ func (p *TemplateWatchdogServiceRemoveRequest) Header(key, value string) *Templa return p } -func (p *TemplateWatchdogServiceRemoveRequest) Query(key, value string) *TemplateWatchdogServiceRemoveRequest { +func (p *HostServiceEnrollCertificateRequest) Query(key, value string) *HostServiceEnrollCertificateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -35603,18 +34996,22 @@ func (p *TemplateWatchdogServiceRemoveRequest) Query(key, value string) *Templat return p } -func (p *TemplateWatchdogServiceRemoveRequest) Async(async bool) *TemplateWatchdogServiceRemoveRequest { +func (p *HostServiceEnrollCertificateRequest) Async(async bool) *HostServiceEnrollCertificateRequest { p.async = &async return p } -func (p *TemplateWatchdogServiceRemoveRequest) Send() (*TemplateWatchdogServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateWatchdogService.connection.URL(), p.TemplateWatchdogService.path) - values := make(url.Values) +func (p *HostServiceEnrollCertificateRequest) Send() (*HostServiceEnrollCertificateResponse, error) { + rawURL := fmt.Sprintf("%s%s/enrollcertificate", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + actionBuilder.Async(*p.async) } - + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35623,12 +35020,16 @@ func (p *TemplateWatchdogServiceRemoveRequest) Send() (*TemplateWatchdogServiceR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateWatchdogService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35643,18 +35044,18 @@ func (p *TemplateWatchdogServiceRemoveRequest) Send() (*TemplateWatchdogServiceR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateWatchdogService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateWatchdogService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateWatchdogService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35663,19 +35064,16 @@ func (p *TemplateWatchdogServiceRemoveRequest) Send() (*TemplateWatchdogServiceR if err != nil { return nil, err } - p.TemplateWatchdogService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return new(TemplateWatchdogServiceRemoveResponse), nil + return new(HostServiceEnrollCertificateResponse), nil } -func (p *TemplateWatchdogServiceRemoveRequest) MustSend() *TemplateWatchdogServiceRemoveResponse { +func (p *HostServiceEnrollCertificateRequest) MustSend() *HostServiceEnrollCertificateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35684,28 +35082,55 @@ func (p *TemplateWatchdogServiceRemoveRequest) MustSend() *TemplateWatchdogServi } // +// Enrolls the certificate of the host. Useful in case you get a warning that it is about to expire or has already +// expired. // -type TemplateWatchdogServiceRemoveResponse struct { +type HostServiceEnrollCertificateResponse struct { } // +// Enrolls the certificate of the host. Useful in case you get a warning that it is about to expire or has already +// expired. // -func (p *TemplateWatchdogService) Remove() *TemplateWatchdogServiceRemoveRequest { - return &TemplateWatchdogServiceRemoveRequest{TemplateWatchdogService: p} +func (p *HostService) EnrollCertificate() *HostServiceEnrollCertificateRequest { + return &HostServiceEnrollCertificateRequest{HostService: p} } // -// Update the watchdog for the template identified by the given id. +// Controls the host's power management device. +// For example, to start the host. This can be done via: +// [source] +// ---- +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request POST \ +// --header "Version: 4" \ +// --header "Content-Type: application/xml" \ +// --header "Accept: application/xml" \ +// --data ' +// +// start +// +// ' \ +// "${url}/hosts/123/fence" +// ---- // -type TemplateWatchdogServiceUpdateRequest struct { - TemplateWatchdogService *TemplateWatchdogService +type HostServiceFenceRequest struct { + HostService *HostService header map[string]string query map[string]string async *bool - watchdog *Watchdog + fenceType *string + maintenanceAfterRestart *bool } -func (p *TemplateWatchdogServiceUpdateRequest) Header(key, value string) *TemplateWatchdogServiceUpdateRequest { +func (p *HostServiceFenceRequest) Header(key, value string) *HostServiceFenceRequest { if p.header == nil { p.header = make(map[string]string) } @@ -35713,7 +35138,7 @@ func (p *TemplateWatchdogServiceUpdateRequest) Header(key, value string) *Templa return p } -func (p *TemplateWatchdogServiceUpdateRequest) Query(key, value string) *TemplateWatchdogServiceUpdateRequest { +func (p *HostServiceFenceRequest) Query(key, value string) *HostServiceFenceRequest { if p.query == nil { p.query = make(map[string]string) } @@ -35721,23 +35146,38 @@ func (p *TemplateWatchdogServiceUpdateRequest) Query(key, value string) *Templat return p } -func (p *TemplateWatchdogServiceUpdateRequest) Async(async bool) *TemplateWatchdogServiceUpdateRequest { +func (p *HostServiceFenceRequest) Async(async bool) *HostServiceFenceRequest { p.async = &async return p } -func (p *TemplateWatchdogServiceUpdateRequest) Watchdog(watchdog *Watchdog) *TemplateWatchdogServiceUpdateRequest { - p.watchdog = watchdog +func (p *HostServiceFenceRequest) FenceType(fenceType string) *HostServiceFenceRequest { + p.fenceType = &fenceType return p } -func (p *TemplateWatchdogServiceUpdateRequest) Send() (*TemplateWatchdogServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateWatchdogService.connection.URL(), p.TemplateWatchdogService.path) - values := make(url.Values) +func (p *HostServiceFenceRequest) MaintenanceAfterRestart(maintenanceAfterRestart bool) *HostServiceFenceRequest { + p.maintenanceAfterRestart = &maintenanceAfterRestart + return p +} + +func (p *HostServiceFenceRequest) Send() (*HostServiceFenceResponse, error) { + rawURL := fmt.Sprintf("%s%s/fence", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + actionBuilder.Async(*p.async) } - + if p.fenceType != nil { + actionBuilder.FenceType(*p.fenceType) + } + if p.maintenanceAfterRestart != nil { + actionBuilder.MaintenanceAfterRestart(*p.maintenanceAfterRestart) + } + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35748,17 +35188,14 @@ func (p *TemplateWatchdogServiceUpdateRequest) Send() (*TemplateWatchdogServiceU } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLWatchdogWriteOne(writer, p.watchdog, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateWatchdogService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35773,18 +35210,18 @@ func (p *TemplateWatchdogServiceUpdateRequest) Send() (*TemplateWatchdogServiceU req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateWatchdogService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateWatchdogService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateWatchdogService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35793,24 +35230,17 @@ func (p *TemplateWatchdogServiceUpdateRequest) Send() (*TemplateWatchdogServiceU if err != nil { return nil, err } - p.TemplateWatchdogService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLWatchdogReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &TemplateWatchdogServiceUpdateResponse{watchdog: result}, nil + result := action.MustPowerManagement() + return &HostServiceFenceResponse{powerManagement: result}, nil } -func (p *TemplateWatchdogServiceUpdateRequest) MustSend() *TemplateWatchdogServiceUpdateResponse { +func (p *HostServiceFenceRequest) MustSend() *HostServiceFenceResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35819,71 +35249,97 @@ func (p *TemplateWatchdogServiceUpdateRequest) MustSend() *TemplateWatchdogServi } // -// Update the watchdog for the template identified by the given id. +// Controls the host's power management device. +// For example, to start the host. This can be done via: +// [source] +// ---- +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request POST \ +// --header "Version: 4" \ +// --header "Content-Type: application/xml" \ +// --header "Accept: application/xml" \ +// --data ' +// +// start +// +// ' \ +// "${url}/hosts/123/fence" +// ---- // -type TemplateWatchdogServiceUpdateResponse struct { - watchdog *Watchdog +type HostServiceFenceResponse struct { + powerManagement *PowerManagement } -func (p *TemplateWatchdogServiceUpdateResponse) Watchdog() (*Watchdog, bool) { - if p.watchdog != nil { - return p.watchdog, true +func (p *HostServiceFenceResponse) PowerManagement() (*PowerManagement, bool) { + if p.powerManagement != nil { + return p.powerManagement, true } return nil, false } -func (p *TemplateWatchdogServiceUpdateResponse) MustWatchdog() *Watchdog { - if p.watchdog == nil { - panic("watchdog in response does not exist") - } - return p.watchdog -} - -// -// Update the watchdog for the template identified by the given id. -// -func (p *TemplateWatchdogService) Update() *TemplateWatchdogServiceUpdateRequest { - return &TemplateWatchdogServiceUpdateRequest{TemplateWatchdogService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *TemplateWatchdogService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *HostServiceFenceResponse) MustPowerManagement() *PowerManagement { + if p.powerManagement == nil { + panic("powerManagement in response does not exist") } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *TemplateWatchdogService) String() string { - return fmt.Sprintf("TemplateWatchdogService:%s", op.path) + return p.powerManagement } // +// Controls the host's power management device. +// For example, to start the host. This can be done via: +// [source] +// ---- +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request POST \ +// --header "Version: 4" \ +// --header "Content-Type: application/xml" \ +// --header "Accept: application/xml" \ +// --data ' +// +// start +// +// ' \ +// "${url}/hosts/123/fence" +// ---- // -type BalanceService struct { - BaseService -} - -func NewBalanceService(connection *Connection, path string) *BalanceService { - var result BalanceService - result.connection = connection - result.path = path - return &result +func (p *HostService) Fence() *HostServiceFenceRequest { + return &HostServiceFenceRequest{HostService: p} } // +// To manually set a host as the storage pool manager (SPM). +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/forceselectspm +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -type BalanceServiceGetRequest struct { - BalanceService *BalanceService - header map[string]string - query map[string]string - filter *bool - follow *string +type HostServiceForceSelectSpmRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool } -func (p *BalanceServiceGetRequest) Header(key, value string) *BalanceServiceGetRequest { +func (p *HostServiceForceSelectSpmRequest) Header(key, value string) *HostServiceForceSelectSpmRequest { if p.header == nil { p.header = make(map[string]string) } @@ -35891,7 +35347,7 @@ func (p *BalanceServiceGetRequest) Header(key, value string) *BalanceServiceGetR return p } -func (p *BalanceServiceGetRequest) Query(key, value string) *BalanceServiceGetRequest { +func (p *HostServiceForceSelectSpmRequest) Query(key, value string) *HostServiceForceSelectSpmRequest { if p.query == nil { p.query = make(map[string]string) } @@ -35899,27 +35355,22 @@ func (p *BalanceServiceGetRequest) Query(key, value string) *BalanceServiceGetRe return p } -func (p *BalanceServiceGetRequest) Filter(filter bool) *BalanceServiceGetRequest { - p.filter = &filter - return p -} - -func (p *BalanceServiceGetRequest) Follow(follow string) *BalanceServiceGetRequest { - p.follow = &follow +func (p *HostServiceForceSelectSpmRequest) Async(async bool) *HostServiceForceSelectSpmRequest { + p.async = &async return p } -func (p *BalanceServiceGetRequest) Send() (*BalanceServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.BalanceService.connection.URL(), p.BalanceService.path) - values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} +func (p *HostServiceForceSelectSpmRequest) Send() (*HostServiceForceSelectSpmResponse, error) { + rawURL := fmt.Sprintf("%s%s/forceselectspm", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -35928,12 +35379,16 @@ func (p *BalanceServiceGetRequest) Send() (*BalanceServiceGetResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.BalanceService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -35948,18 +35403,18 @@ func (p *BalanceServiceGetRequest) Send() (*BalanceServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.BalanceService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.BalanceService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.BalanceService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -35968,24 +35423,16 @@ func (p *BalanceServiceGetRequest) Send() (*BalanceServiceGetResponse, error) { if err != nil { return nil, err } - p.BalanceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLBalanceReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &BalanceServiceGetResponse{balance: result}, nil + return new(HostServiceForceSelectSpmResponse), nil } -func (p *BalanceServiceGetRequest) MustSend() *BalanceServiceGetResponse { +func (p *HostServiceForceSelectSpmRequest) MustSend() *HostServiceForceSelectSpmResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -35994,41 +35441,53 @@ func (p *BalanceServiceGetRequest) MustSend() *BalanceServiceGetResponse { } // +// To manually set a host as the storage pool manager (SPM). +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/forceselectspm +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -type BalanceServiceGetResponse struct { - balance *Balance -} - -func (p *BalanceServiceGetResponse) Balance() (*Balance, bool) { - if p.balance != nil { - return p.balance, true - } - return nil, false -} - -func (p *BalanceServiceGetResponse) MustBalance() *Balance { - if p.balance == nil { - panic("balance in response does not exist") - } - return p.balance +type HostServiceForceSelectSpmResponse struct { } // +// To manually set a host as the storage pool manager (SPM). +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/forceselectspm +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -func (p *BalanceService) Get() *BalanceServiceGetRequest { - return &BalanceServiceGetRequest{BalanceService: p} +func (p *HostService) ForceSelectSpm() *HostServiceForceSelectSpmRequest { + return &HostServiceForceSelectSpmRequest{HostService: p} } // +// Gets the host details. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123 +// ---- // -type BalanceServiceRemoveRequest struct { - BalanceService *BalanceService - header map[string]string - query map[string]string - async *bool +type HostServiceGetRequest struct { + HostService *HostService + header map[string]string + query map[string]string + allContent *bool + filter *bool + follow *string } -func (p *BalanceServiceRemoveRequest) Header(key, value string) *BalanceServiceRemoveRequest { +func (p *HostServiceGetRequest) Header(key, value string) *HostServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -36036,7 +35495,7 @@ func (p *BalanceServiceRemoveRequest) Header(key, value string) *BalanceServiceR return p } -func (p *BalanceServiceRemoveRequest) Query(key, value string) *BalanceServiceRemoveRequest { +func (p *HostServiceGetRequest) Query(key, value string) *HostServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -36044,17 +35503,35 @@ func (p *BalanceServiceRemoveRequest) Query(key, value string) *BalanceServiceRe return p } -func (p *BalanceServiceRemoveRequest) Async(async bool) *BalanceServiceRemoveRequest { - p.async = &async +func (p *HostServiceGetRequest) AllContent(allContent bool) *HostServiceGetRequest { + p.allContent = &allContent return p } -func (p *BalanceServiceRemoveRequest) Send() (*BalanceServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.BalanceService.connection.URL(), p.BalanceService.path) - values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } +func (p *HostServiceGetRequest) Filter(filter bool) *HostServiceGetRequest { + p.filter = &filter + return p +} + +func (p *HostServiceGetRequest) Follow(follow string) *HostServiceGetRequest { + p.follow = &follow + return p +} + +func (p *HostServiceGetRequest) Send() (*HostServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostService.connection.URL(), p.HostService.path) + values := make(url.Values) + if p.allContent != nil { + values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} + } + + if p.filter != nil { + values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } if p.query != nil { for k, v := range p.query { @@ -36064,12 +35541,12 @@ func (p *BalanceServiceRemoveRequest) Send() (*BalanceServiceRemoveResponse, err if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.BalanceService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -36084,18 +35561,18 @@ func (p *BalanceServiceRemoveRequest) Send() (*BalanceServiceRemoveResponse, err req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.BalanceService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.BalanceService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.BalanceService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -36104,19 +35581,24 @@ func (p *BalanceServiceRemoveRequest) Send() (*BalanceServiceRemoveResponse, err if err != nil { return nil, err } - p.BalanceService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(BalanceServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLHostReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &HostServiceGetResponse{host: result}, nil } -func (p *BalanceServiceRemoveRequest) MustSend() *BalanceServiceRemoveResponse { +func (p *HostServiceGetRequest) MustSend() *HostServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -36125,53 +35607,102 @@ func (p *BalanceServiceRemoveRequest) MustSend() *BalanceServiceRemoveResponse { } // +// Gets the host details. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123 +// ---- // -type BalanceServiceRemoveResponse struct { -} - -// -// -func (p *BalanceService) Remove() *BalanceServiceRemoveRequest { - return &BalanceServiceRemoveRequest{BalanceService: p} +type HostServiceGetResponse struct { + host *Host } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *BalanceService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *HostServiceGetResponse) Host() (*Host, bool) { + if p.host != nil { + return p.host, true } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return nil, false } -func (op *BalanceService) String() string { - return fmt.Sprintf("BalanceService:%s", op.path) +func (p *HostServiceGetResponse) MustHost() *Host { + if p.host == nil { + panic("host in response does not exist") + } + return p.host } // +// Gets the host details. +// [source] +// ---- +// GET /ovirt-engine/api/hosts/123 +// ---- // -type SnapshotNicService struct { - BaseService -} - -func NewSnapshotNicService(connection *Connection, path string) *SnapshotNicService { - var result SnapshotNicService - result.connection = connection - result.path = path - return &result +func (p *HostService) Get() *HostServiceGetRequest { + return &HostServiceGetRequest{HostService: p} } // +// Installs the latest version of VDSM and related software on the host. +// The action also performs every configuration steps on the host which is done during adding host to the engine: +// kdump configuration, hosted-engine deploy, kernel options changes, etc. +// The host type defines additional parameters for the action. +// Example of installing a host, using `curl` and JSON, plain: +// [source,bash] +// ---- +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --request PUT \ +// --header "Content-Type: application/json" \ +// --header "Accept: application/json" \ +// --header "Version: 4" \ +// --user "admin@internal:..." \ +// --data ' +// { +// "root_password": "myrootpassword" +// } +// ' \ +// "https://engine.example.com/ovirt-engine/api/hosts/123" +// ---- +// Example of installing a host using `curl` and JSON with hosted engine components: +// [source,bash] +// ---- +// curl \ +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --request PUT \ +// --header "Content-Type: application/json" \ +// --header "Accept: application/json" \ +// --header "Version: 4" \ +// --user "admin@internal:..." \ +// --data ' +// { +// "root_password": "myrootpassword" +// "deploy_hosted_engine" : "true" +// } +// ' \ +// "https://engine.example.com/ovirt-engine/api/hosts/123" +// ---- +// IMPORTANT: Since version 4.1.2 of the engine, when a host is reinstalled we override the host firewall +// definitions by default. // -type SnapshotNicServiceGetRequest struct { - SnapshotNicService *SnapshotNicService - header map[string]string - query map[string]string - follow *string +type HostServiceInstallRequest struct { + HostService *HostService + header map[string]string + query map[string]string + activate *bool + async *bool + deployHostedEngine *bool + host *Host + image *string + rootPassword *string + ssh *Ssh + undeployHostedEngine *bool } -func (p *SnapshotNicServiceGetRequest) Header(key, value string) *SnapshotNicServiceGetRequest { +func (p *HostServiceInstallRequest) Header(key, value string) *HostServiceInstallRequest { if p.header == nil { p.header = make(map[string]string) } @@ -36179,7 +35710,7 @@ func (p *SnapshotNicServiceGetRequest) Header(key, value string) *SnapshotNicSer return p } -func (p *SnapshotNicServiceGetRequest) Query(key, value string) *SnapshotNicServiceGetRequest { +func (p *HostServiceInstallRequest) Query(key, value string) *HostServiceInstallRequest { if p.query == nil { p.query = make(map[string]string) } @@ -36187,18 +35718,74 @@ func (p *SnapshotNicServiceGetRequest) Query(key, value string) *SnapshotNicServ return p } -func (p *SnapshotNicServiceGetRequest) Follow(follow string) *SnapshotNicServiceGetRequest { - p.follow = &follow +func (p *HostServiceInstallRequest) Activate(activate bool) *HostServiceInstallRequest { + p.activate = &activate return p } -func (p *SnapshotNicServiceGetRequest) Send() (*SnapshotNicServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.SnapshotNicService.connection.URL(), p.SnapshotNicService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *HostServiceInstallRequest) Async(async bool) *HostServiceInstallRequest { + p.async = &async + return p +} + +func (p *HostServiceInstallRequest) DeployHostedEngine(deployHostedEngine bool) *HostServiceInstallRequest { + p.deployHostedEngine = &deployHostedEngine + return p +} + +func (p *HostServiceInstallRequest) Host(host *Host) *HostServiceInstallRequest { + p.host = host + return p +} + +func (p *HostServiceInstallRequest) Image(image string) *HostServiceInstallRequest { + p.image = &image + return p +} + +func (p *HostServiceInstallRequest) RootPassword(rootPassword string) *HostServiceInstallRequest { + p.rootPassword = &rootPassword + return p +} + +func (p *HostServiceInstallRequest) Ssh(ssh *Ssh) *HostServiceInstallRequest { + p.ssh = ssh + return p +} + +func (p *HostServiceInstallRequest) UndeployHostedEngine(undeployHostedEngine bool) *HostServiceInstallRequest { + p.undeployHostedEngine = &undeployHostedEngine + return p +} +func (p *HostServiceInstallRequest) Send() (*HostServiceInstallResponse, error) { + rawURL := fmt.Sprintf("%s%s/install", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.activate != nil { + actionBuilder.Activate(*p.activate) + } + if p.async != nil { + actionBuilder.Async(*p.async) + } + if p.deployHostedEngine != nil { + actionBuilder.DeployHostedEngine(*p.deployHostedEngine) + } + actionBuilder.Host(p.host) + if p.image != nil { + actionBuilder.Image(*p.image) + } + if p.rootPassword != nil { + actionBuilder.RootPassword(*p.rootPassword) + } + actionBuilder.Ssh(p.ssh) + if p.undeployHostedEngine != nil { + actionBuilder.UndeployHostedEngine(*p.undeployHostedEngine) + } + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -36207,12 +35794,16 @@ func (p *SnapshotNicServiceGetRequest) Send() (*SnapshotNicServiceGetResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.SnapshotNicService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -36227,18 +35818,18 @@ func (p *SnapshotNicServiceGetRequest) Send() (*SnapshotNicServiceGetResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.SnapshotNicService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.SnapshotNicService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.SnapshotNicService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -36247,24 +35838,16 @@ func (p *SnapshotNicServiceGetRequest) Send() (*SnapshotNicServiceGetResponse, e if err != nil { return nil, err } - p.SnapshotNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadOne(reader, nil, "") - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &SnapshotNicServiceGetResponse{nic: result}, nil + return new(HostServiceInstallResponse), nil } -func (p *SnapshotNicServiceGetRequest) MustSend() *SnapshotNicServiceGetResponse { +func (p *HostServiceInstallRequest) MustSend() *HostServiceInstallResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -36273,71 +35856,143 @@ func (p *SnapshotNicServiceGetRequest) MustSend() *SnapshotNicServiceGetResponse } // +// Installs the latest version of VDSM and related software on the host. +// The action also performs every configuration steps on the host which is done during adding host to the engine: +// kdump configuration, hosted-engine deploy, kernel options changes, etc. +// The host type defines additional parameters for the action. +// Example of installing a host, using `curl` and JSON, plain: +// [source,bash] +// ---- +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --request PUT \ +// --header "Content-Type: application/json" \ +// --header "Accept: application/json" \ +// --header "Version: 4" \ +// --user "admin@internal:..." \ +// --data ' +// { +// "root_password": "myrootpassword" +// } +// ' \ +// "https://engine.example.com/ovirt-engine/api/hosts/123" +// ---- +// Example of installing a host using `curl` and JSON with hosted engine components: +// [source,bash] +// ---- +// curl \ +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --request PUT \ +// --header "Content-Type: application/json" \ +// --header "Accept: application/json" \ +// --header "Version: 4" \ +// --user "admin@internal:..." \ +// --data ' +// { +// "root_password": "myrootpassword" +// "deploy_hosted_engine" : "true" +// } +// ' \ +// "https://engine.example.com/ovirt-engine/api/hosts/123" +// ---- +// IMPORTANT: Since version 4.1.2 of the engine, when a host is reinstalled we override the host firewall +// definitions by default. // -type SnapshotNicServiceGetResponse struct { - nic *Nic -} - -func (p *SnapshotNicServiceGetResponse) Nic() (*Nic, bool) { - if p.nic != nil { - return p.nic, true - } - return nil, false -} - -func (p *SnapshotNicServiceGetResponse) MustNic() *Nic { - if p.nic == nil { - panic("nic in response does not exist") - } - return p.nic -} - -// -// -func (p *SnapshotNicService) Get() *SnapshotNicServiceGetRequest { - return &SnapshotNicServiceGetRequest{SnapshotNicService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *SnapshotNicService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *SnapshotNicService) String() string { - return fmt.Sprintf("SnapshotNicService:%s", op.path) +type HostServiceInstallResponse struct { } // -// This service is used to list and manipulate affinity labels that are -// assigned to supported entities when accessed using entities/affinitylabels. +// Installs the latest version of VDSM and related software on the host. +// The action also performs every configuration steps on the host which is done during adding host to the engine: +// kdump configuration, hosted-engine deploy, kernel options changes, etc. +// The host type defines additional parameters for the action. +// Example of installing a host, using `curl` and JSON, plain: +// [source,bash] +// ---- +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --request PUT \ +// --header "Content-Type: application/json" \ +// --header "Accept: application/json" \ +// --header "Version: 4" \ +// --user "admin@internal:..." \ +// --data ' +// { +// "root_password": "myrootpassword" +// } +// ' \ +// "https://engine.example.com/ovirt-engine/api/hosts/123" +// ---- +// Example of installing a host using `curl` and JSON with hosted engine components: +// [source,bash] +// ---- +// curl \ +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --request PUT \ +// --header "Content-Type: application/json" \ +// --header "Accept: application/json" \ +// --header "Version: 4" \ +// --user "admin@internal:..." \ +// --data ' +// { +// "root_password": "myrootpassword" +// "deploy_hosted_engine" : "true" +// } +// ' \ +// "https://engine.example.com/ovirt-engine/api/hosts/123" +// ---- +// IMPORTANT: Since version 4.1.2 of the engine, when a host is reinstalled we override the host firewall +// definitions by default. // -type AssignedAffinityLabelsService struct { - BaseService -} - -func NewAssignedAffinityLabelsService(connection *Connection, path string) *AssignedAffinityLabelsService { - var result AssignedAffinityLabelsService - result.connection = connection - result.path = path - return &result +func (p *HostService) Install() *HostServiceInstallRequest { + return &HostServiceInstallRequest{HostService: p} } // -// Attaches a label to an entity. +// Discovers iSCSI targets on the host, using the initiator details. +// For example, to discover iSCSI targets available in `myiscsi.example.com`, +// from host `123`, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/iscsidiscover +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +//
myiscsi.example.com
+//
+//
+// ---- +// The result will be like this: +// [source,xml] +// ---- +// +// +//
10.35.1.72
+// 3260 +// 10.35.1.72:3260,1 +// iqn.2015-08.com.tgt:444 +//
+//
+// ---- // -type AssignedAffinityLabelsServiceAddRequest struct { - AssignedAffinityLabelsService *AssignedAffinityLabelsService - header map[string]string - query map[string]string - label *AffinityLabel +type HostServiceIscsiDiscoverRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + iscsi *IscsiDetails } -func (p *AssignedAffinityLabelsServiceAddRequest) Header(key, value string) *AssignedAffinityLabelsServiceAddRequest { +func (p *HostServiceIscsiDiscoverRequest) Header(key, value string) *HostServiceIscsiDiscoverRequest { if p.header == nil { p.header = make(map[string]string) } @@ -36345,7 +36000,7 @@ func (p *AssignedAffinityLabelsServiceAddRequest) Header(key, value string) *Ass return p } -func (p *AssignedAffinityLabelsServiceAddRequest) Query(key, value string) *AssignedAffinityLabelsServiceAddRequest { +func (p *HostServiceIscsiDiscoverRequest) Query(key, value string) *HostServiceIscsiDiscoverRequest { if p.query == nil { p.query = make(map[string]string) } @@ -36353,13 +36008,27 @@ func (p *AssignedAffinityLabelsServiceAddRequest) Query(key, value string) *Assi return p } -func (p *AssignedAffinityLabelsServiceAddRequest) Label(label *AffinityLabel) *AssignedAffinityLabelsServiceAddRequest { - p.label = label +func (p *HostServiceIscsiDiscoverRequest) Async(async bool) *HostServiceIscsiDiscoverRequest { + p.async = &async return p } -func (p *AssignedAffinityLabelsServiceAddRequest) Send() (*AssignedAffinityLabelsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelsService.connection.URL(), p.AssignedAffinityLabelsService.path) +func (p *HostServiceIscsiDiscoverRequest) Iscsi(iscsi *IscsiDetails) *HostServiceIscsiDiscoverRequest { + p.iscsi = iscsi + return p +} + +func (p *HostServiceIscsiDiscoverRequest) Send() (*HostServiceIscsiDiscoverResponse, error) { + rawURL := fmt.Sprintf("%s%s/iscsidiscover", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Iscsi(p.iscsi) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -36371,17 +36040,14 @@ func (p *AssignedAffinityLabelsServiceAddRequest) Send() (*AssignedAffinityLabel } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLAffinityLabelWriteOne(writer, p.label, "") - if err != nil { - return nil, err - } + err = XMLActionWriteOne(writer, action, "") writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AssignedAffinityLabelsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -36396,18 +36062,18 @@ func (p *AssignedAffinityLabelsServiceAddRequest) Send() (*AssignedAffinityLabel req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedAffinityLabelsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedAffinityLabelsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedAffinityLabelsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -36416,24 +36082,17 @@ func (p *AssignedAffinityLabelsServiceAddRequest) Send() (*AssignedAffinityLabel if err != nil { return nil, err } - p.AssignedAffinityLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLAffinityLabelReadOne(reader, nil, "") - if err != nil { - return nil, err + action, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &AssignedAffinityLabelsServiceAddResponse{label: result}, nil + result := action.MustIscsiTargets() + return &HostServiceIscsiDiscoverResponse{iscsiTargets: result}, nil } -func (p *AssignedAffinityLabelsServiceAddRequest) MustSend() *AssignedAffinityLabelsServiceAddResponse { +func (p *HostServiceIscsiDiscoverRequest) MustSend() *HostServiceIscsiDiscoverResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -36442,45 +36101,114 @@ func (p *AssignedAffinityLabelsServiceAddRequest) MustSend() *AssignedAffinityLa } // -// Attaches a label to an entity. -// -type AssignedAffinityLabelsServiceAddResponse struct { - label *AffinityLabel -} - -func (p *AssignedAffinityLabelsServiceAddResponse) Label() (*AffinityLabel, bool) { - if p.label != nil { - return p.label, true - } - return nil, false +// Discovers iSCSI targets on the host, using the initiator details. +// For example, to discover iSCSI targets available in `myiscsi.example.com`, +// from host `123`, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/iscsidiscover +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +//
myiscsi.example.com
+//
+//
+// ---- +// The result will be like this: +// [source,xml] +// ---- +// +// +//
10.35.1.72
+// 3260 +// 10.35.1.72:3260,1 +// iqn.2015-08.com.tgt:444 +//
+//
+// ---- +// +type HostServiceIscsiDiscoverResponse struct { + discoveredTargets *IscsiDetailsSlice + iscsiTargets []string } -func (p *AssignedAffinityLabelsServiceAddResponse) MustLabel() *AffinityLabel { - if p.label == nil { - panic("label in response does not exist") +func (p *HostServiceIscsiDiscoverResponse) DiscoveredTargets() (*IscsiDetailsSlice, bool) { + if p.discoveredTargets != nil { + return p.discoveredTargets, true } - return p.label + return nil, false +} + +func (p *HostServiceIscsiDiscoverResponse) MustDiscoveredTargets() *IscsiDetailsSlice { + if p.discoveredTargets == nil { + panic("discoveredTargets in response does not exist") + } + return p.discoveredTargets +} + +func (p *HostServiceIscsiDiscoverResponse) IscsiTargets() ([]string, bool) { + if p.iscsiTargets != nil { + return p.iscsiTargets, true + } + return nil, false +} + +func (p *HostServiceIscsiDiscoverResponse) MustIscsiTargets() []string { + if p.iscsiTargets == nil { + panic("iscsiTargets in response does not exist") + } + return p.iscsiTargets } // -// Attaches a label to an entity. +// Discovers iSCSI targets on the host, using the initiator details. +// For example, to discover iSCSI targets available in `myiscsi.example.com`, +// from host `123`, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/iscsidiscover +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// +//
myiscsi.example.com
+//
+//
+// ---- +// The result will be like this: +// [source,xml] +// ---- +// +// +//
10.35.1.72
+// 3260 +// 10.35.1.72:3260,1 +// iqn.2015-08.com.tgt:444 +//
+//
+// ---- // -func (p *AssignedAffinityLabelsService) Add() *AssignedAffinityLabelsServiceAddRequest { - return &AssignedAffinityLabelsServiceAddRequest{AssignedAffinityLabelsService: p} +func (p *HostService) IscsiDiscover() *HostServiceIscsiDiscoverRequest { + return &HostServiceIscsiDiscoverRequest{HostService: p} } // -// Lists all labels that are attached to an entity. -// The order of the returned entities isn't guaranteed. +// Login to iSCSI targets on the host, using the target details. // -type AssignedAffinityLabelsServiceListRequest struct { - AssignedAffinityLabelsService *AssignedAffinityLabelsService - header map[string]string - query map[string]string - follow *string +type HostServiceIscsiLoginRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + iscsi *IscsiDetails } -func (p *AssignedAffinityLabelsServiceListRequest) Header(key, value string) *AssignedAffinityLabelsServiceListRequest { +func (p *HostServiceIscsiLoginRequest) Header(key, value string) *HostServiceIscsiLoginRequest { if p.header == nil { p.header = make(map[string]string) } @@ -36488,7 +36216,7 @@ func (p *AssignedAffinityLabelsServiceListRequest) Header(key, value string) *As return p } -func (p *AssignedAffinityLabelsServiceListRequest) Query(key, value string) *AssignedAffinityLabelsServiceListRequest { +func (p *HostServiceIscsiLoginRequest) Query(key, value string) *HostServiceIscsiLoginRequest { if p.query == nil { p.query = make(map[string]string) } @@ -36496,18 +36224,28 @@ func (p *AssignedAffinityLabelsServiceListRequest) Query(key, value string) *Ass return p } -func (p *AssignedAffinityLabelsServiceListRequest) Follow(follow string) *AssignedAffinityLabelsServiceListRequest { - p.follow = &follow +func (p *HostServiceIscsiLoginRequest) Async(async bool) *HostServiceIscsiLoginRequest { + p.async = &async return p } -func (p *AssignedAffinityLabelsServiceListRequest) Send() (*AssignedAffinityLabelsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedAffinityLabelsService.connection.URL(), p.AssignedAffinityLabelsService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *HostServiceIscsiLoginRequest) Iscsi(iscsi *IscsiDetails) *HostServiceIscsiLoginRequest { + p.iscsi = iscsi + return p +} +func (p *HostServiceIscsiLoginRequest) Send() (*HostServiceIscsiLoginResponse, error) { + rawURL := fmt.Sprintf("%s%s/iscsilogin", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Iscsi(p.iscsi) + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -36516,12 +36254,16 @@ func (p *AssignedAffinityLabelsServiceListRequest) Send() (*AssignedAffinityLabe if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AssignedAffinityLabelsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -36536,18 +36278,18 @@ func (p *AssignedAffinityLabelsServiceListRequest) Send() (*AssignedAffinityLabe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedAffinityLabelsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedAffinityLabelsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedAffinityLabelsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -36556,24 +36298,16 @@ func (p *AssignedAffinityLabelsServiceListRequest) Send() (*AssignedAffinityLabe if err != nil { return nil, err } - p.AssignedAffinityLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLAffinityLabelReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &AssignedAffinityLabelsServiceListResponse{label: result}, nil + return new(HostServiceIscsiLoginResponse), nil } -func (p *AssignedAffinityLabelsServiceListRequest) MustSend() *AssignedAffinityLabelsServiceListResponse { +func (p *HostServiceIscsiLoginRequest) MustSend() *HostServiceIscsiLoginResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -36582,88 +36316,29 @@ func (p *AssignedAffinityLabelsServiceListRequest) MustSend() *AssignedAffinityL } // -// Lists all labels that are attached to an entity. -// The order of the returned entities isn't guaranteed. -// -type AssignedAffinityLabelsServiceListResponse struct { - label *AffinityLabelSlice -} - -func (p *AssignedAffinityLabelsServiceListResponse) Label() (*AffinityLabelSlice, bool) { - if p.label != nil { - return p.label, true - } - return nil, false -} - -func (p *AssignedAffinityLabelsServiceListResponse) MustLabel() *AffinityLabelSlice { - if p.label == nil { - panic("label in response does not exist") - } - return p.label -} - -// -// Lists all labels that are attached to an entity. -// The order of the returned entities isn't guaranteed. -// -func (p *AssignedAffinityLabelsService) List() *AssignedAffinityLabelsServiceListRequest { - return &AssignedAffinityLabelsServiceListRequest{AssignedAffinityLabelsService: p} -} - -// -// Link to the specific entity-label assignment to allow -// removal. -// -func (op *AssignedAffinityLabelsService) LabelService(id string) *AssignedAffinityLabelService { - return NewAssignedAffinityLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Login to iSCSI targets on the host, using the target details. // -func (op *AssignedAffinityLabelsService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.LabelService(path), nil - } - return op.LabelService(path[:index]).Service(path[index+1:]) -} - -func (op *AssignedAffinityLabelsService) String() string { - return fmt.Sprintf("AssignedAffinityLabelsService:%s", op.path) +type HostServiceIscsiLoginResponse struct { } // -// A service to access host devices. +// Login to iSCSI targets on the host, using the target details. // -type HostDevicesService struct { - BaseService -} - -func NewHostDevicesService(connection *Connection, path string) *HostDevicesService { - var result HostDevicesService - result.connection = connection - result.path = path - return &result +func (p *HostService) IscsiLogin() *HostServiceIscsiLoginRequest { + return &HostServiceIscsiLoginRequest{HostService: p} } // -// List the devices of a host. -// The order of the returned list of devices isn't guaranteed. +// Refresh the host devices and capabilities. // -type HostDevicesServiceListRequest struct { - HostDevicesService *HostDevicesService - header map[string]string - query map[string]string - follow *string - max *int64 +type HostServiceRefreshRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool } -func (p *HostDevicesServiceListRequest) Header(key, value string) *HostDevicesServiceListRequest { +func (p *HostServiceRefreshRequest) Header(key, value string) *HostServiceRefreshRequest { if p.header == nil { p.header = make(map[string]string) } @@ -36671,7 +36346,7 @@ func (p *HostDevicesServiceListRequest) Header(key, value string) *HostDevicesSe return p } -func (p *HostDevicesServiceListRequest) Query(key, value string) *HostDevicesServiceListRequest { +func (p *HostServiceRefreshRequest) Query(key, value string) *HostServiceRefreshRequest { if p.query == nil { p.query = make(map[string]string) } @@ -36679,27 +36354,22 @@ func (p *HostDevicesServiceListRequest) Query(key, value string) *HostDevicesSer return p } -func (p *HostDevicesServiceListRequest) Follow(follow string) *HostDevicesServiceListRequest { - p.follow = &follow - return p -} - -func (p *HostDevicesServiceListRequest) Max(max int64) *HostDevicesServiceListRequest { - p.max = &max +func (p *HostServiceRefreshRequest) Async(async bool) *HostServiceRefreshRequest { + p.async = &async return p } -func (p *HostDevicesServiceListRequest) Send() (*HostDevicesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostDevicesService.connection.URL(), p.HostDevicesService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} +func (p *HostServiceRefreshRequest) Send() (*HostServiceRefreshResponse, error) { + rawURL := fmt.Sprintf("%s%s/refresh", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + action, err := actionBuilder.Build() + if err != nil { + return nil, err } - + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -36708,12 +36378,16 @@ func (p *HostDevicesServiceListRequest) Send() (*HostDevicesServiceListResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostDevicesService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -36728,18 +36402,18 @@ func (p *HostDevicesServiceListRequest) Send() (*HostDevicesServiceListResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostDevicesService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostDevicesService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostDevicesService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -36748,24 +36422,16 @@ func (p *HostDevicesServiceListRequest) Send() (*HostDevicesServiceListResponse, if err != nil { return nil, err } - p.HostDevicesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLHostDeviceReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &HostDevicesServiceListResponse{devices: result}, nil + return new(HostServiceRefreshResponse), nil } -func (p *HostDevicesServiceListRequest) MustSend() *HostDevicesServiceListResponse { +func (p *HostServiceRefreshRequest) MustSend() *HostServiceRefreshResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -36774,130 +36440,44 @@ func (p *HostDevicesServiceListRequest) MustSend() *HostDevicesServiceListRespon } // -// List the devices of a host. -// The order of the returned list of devices isn't guaranteed. -// -type HostDevicesServiceListResponse struct { - devices *HostDeviceSlice -} - -func (p *HostDevicesServiceListResponse) Devices() (*HostDeviceSlice, bool) { - if p.devices != nil { - return p.devices, true - } - return nil, false -} - -func (p *HostDevicesServiceListResponse) MustDevices() *HostDeviceSlice { - if p.devices == nil { - panic("devices in response does not exist") - } - return p.devices -} - -// -// List the devices of a host. -// The order of the returned list of devices isn't guaranteed. -// -func (p *HostDevicesService) List() *HostDevicesServiceListRequest { - return &HostDevicesServiceListRequest{HostDevicesService: p} -} - -// -// Reference to the service that can be used to access a specific host device. -// -func (op *HostDevicesService) DeviceService(id string) *HostDeviceService { - return NewHostDeviceService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. +// Refresh the host devices and capabilities. // -func (op *HostDevicesService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.DeviceService(path), nil - } - return op.DeviceService(path[:index]).Service(path[index+1:]) -} - -func (op *HostDevicesService) String() string { - return fmt.Sprintf("HostDevicesService:%s", op.path) +type HostServiceRefreshResponse struct { } // -// Represents a permission sub-collection, scoped by user, group or some entity type. +// Refresh the host devices and capabilities. // -type AssignedPermissionsService struct { - BaseService -} - -func NewAssignedPermissionsService(connection *Connection, path string) *AssignedPermissionsService { - var result AssignedPermissionsService - result.connection = connection - result.path = path - return &result +func (p *HostService) Refresh() *HostServiceRefreshRequest { + return &HostServiceRefreshRequest{HostService: p} } // -// Assign a new permission to a user or group for specific entity. -// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` -// send a request like this: -// .... -// POST /ovirt-engine/api/vms/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserVmManager -// -// -// -// ---- -// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: -// .... -// POST /ovirt-engine/api/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// SuperUser -// -// -// -// ---- -// If you want to assign permission to the group instead of the user please replace the `user` element with the -// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with -// id `123` to the group with id `789` send a request like this: -// .... -// POST /ovirt-engine/api/clusters/123/permissions -// .... -// With a request body like this: -// [source,xml] +// Remove the host from the system. +// [source] // ---- -// -// -// UserRole -// -// -// +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request DELETE \ +// --header "Version: 4" \ +// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc" // ---- // -type AssignedPermissionsServiceAddRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceRemoveRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + force *bool } -func (p *AssignedPermissionsServiceAddRequest) Header(key, value string) *AssignedPermissionsServiceAddRequest { +func (p *HostServiceRemoveRequest) Header(key, value string) *HostServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -36905,7 +36485,7 @@ func (p *AssignedPermissionsServiceAddRequest) Header(key, value string) *Assign return p } -func (p *AssignedPermissionsServiceAddRequest) Query(key, value string) *AssignedPermissionsServiceAddRequest { +func (p *HostServiceRemoveRequest) Query(key, value string) *HostServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -36913,14 +36493,27 @@ func (p *AssignedPermissionsServiceAddRequest) Query(key, value string) *Assigne return p } -func (p *AssignedPermissionsServiceAddRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddRequest { - p.permission = permission +func (p *HostServiceRemoveRequest) Async(async bool) *HostServiceRemoveRequest { + p.async = &async return p } -func (p *AssignedPermissionsServiceAddRequest) Send() (*AssignedPermissionsServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceRemoveRequest) Force(force bool) *HostServiceRemoveRequest { + p.force = &force + return p +} + +func (p *HostServiceRemoveRequest) Send() (*HostServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostService.connection.URL(), p.HostService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + + if p.force != nil { + values["force"] = []string{fmt.Sprintf("%v", *p.force)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -36929,19 +36522,12 @@ func (p *AssignedPermissionsServiceAddRequest) Send() (*AssignedPermissionsServi if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLPermissionWriteOne(writer, p.permission, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -36956,18 +36542,18 @@ func (p *AssignedPermissionsServiceAddRequest) Send() (*AssignedPermissionsServi req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -36976,24 +36562,19 @@ func (p *AssignedPermissionsServiceAddRequest) Send() (*AssignedPermissionsServi if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLPermissionReadOne(reader, nil, "") - if err != nil { - return nil, err - } - return &AssignedPermissionsServiceAddResponse{permission: result}, nil + return new(HostServiceRemoveResponse), nil } -func (p *AssignedPermissionsServiceAddRequest) MustSend() *AssignedPermissionsServiceAddResponse { +func (p *HostServiceRemoveRequest) MustSend() *HostServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37002,134 +36583,222 @@ func (p *AssignedPermissionsServiceAddRequest) MustSend() *AssignedPermissionsSe } // -// Assign a new permission to a user or group for specific entity. -// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` -// send a request like this: -// .... -// POST /ovirt-engine/api/vms/123/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// UserVmManager -// -// -// -// ---- -// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: -// .... -// POST /ovirt-engine/api/permissions -// .... -// With a request body like this: -// [source,xml] -// ---- -// -// -// SuperUser -// -// -// -// ---- -// If you want to assign permission to the group instead of the user please replace the `user` element with the -// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with -// id `123` to the group with id `789` send a request like this: -// .... -// POST /ovirt-engine/api/clusters/123/permissions -// .... -// With a request body like this: -// [source,xml] +// Remove the host from the system. +// [source] // ---- -// -// -// UserRole -// -// -// +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request DELETE \ +// --header "Version: 4" \ +// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc" // ---- // -type AssignedPermissionsServiceAddResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false +type HostServiceRemoveResponse struct { } -func (p *AssignedPermissionsServiceAddResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +// +// Remove the host from the system. +// [source] +// ---- +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request DELETE \ +// --header "Version: 4" \ +// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc" +// ---- +// +func (p *HostService) Remove() *HostServiceRemoveRequest { + return &HostServiceRemoveRequest{HostService: p} } // -// Assign a new permission to a user or group for specific entity. -// For example, to assign the `UserVmManager` role to the virtual machine with id `123` to the user with id `456` -// send a request like this: -// .... -// POST /ovirt-engine/api/vms/123/permissions -// .... -// With a request body like this: -// [source,xml] +// This method is used to change the configuration of the network interfaces of a host. +// For example, if you have a host with three network interfaces `eth0`, `eth1` and `eth2` and you want to configure +// a new bond using `eth0` and `eth1`, and put a VLAN on top of it. Using a simple shell script and the `curl` +// command line HTTP client that can be done as follows: +// [source] // ---- -// -// -// UserVmManager -// -// -// +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request POST \ +// --header "Version: 4" \ +// --header "Content-Type: application/xml" \ +// --header "Accept: application/xml" \ +// --data ' +// +// +// +// bond0 +// +// +// +// +// +// +// +// eth1 +// +// +// eth2 +// +// +// +// +// +// +// +// +// myvlan +// +// +// bond0 +// +// +// static +// +// +//
192.168.122.10
+// 255.255.255.0 +//
+//
+//
+// +// +// 1.1.1.1 +// 2.2.2.2 +// +// +//
+//
+//
+// ' \ +// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" // ---- -// To assign the `SuperUser` role to the system to the user with id `456` send a request like this: -// .... -// POST /ovirt-engine/api/permissions -// .... -// With a request body like this: +// NOTE: This is valid for version 4 of the API. In previous versions some elements were represented as XML +// attributes instead of XML elements. In particular the `options` and `ip` elements were represented as follows: // [source,xml] // ---- -// -// -// SuperUser -// -// -// +// +// +// // ---- -// If you want to assign permission to the group instead of the user please replace the `user` element with the -// `group` element with proper `id` of the group. For example to assign the `UserRole` role to the cluster with -// id `123` to the group with id `789` send a request like this: -// .... -// POST /ovirt-engine/api/clusters/123/permissions -// .... -// With a request body like this: -// [source,xml] +// The same thing can be done using the Python SDK with the following code: +// [source,python] // ---- -// -// -// UserRole -// -// -// +// # Find the service that manages the collection of hosts: +// hosts_service = connection.system_service().hosts_service() +// # Find the host: +// host = hosts_service.list(search='name=myhost')[0] +// # Find the service that manages the host: +// host_service = hosts_service.host_service(host.id) +// # Configure the network adding a bond with two slaves and attaching it to a +// # network with an static IP address: +// host_service.setup_networks( +// modified_bonds=[ +// types.HostNic( +// name='bond0', +// bonding=types.Bonding( +// options=[ +// types.Option( +// name='mode', +// value='4', +// ), +// types.Option( +// name='miimon', +// value='100', +// ), +// ], +// slaves=[ +// types.HostNic( +// name='eth1', +// ), +// types.HostNic( +// name='eth2', +// ), +// ], +// ), +// ), +// ], +// modified_network_attachments=[ +// types.NetworkAttachment( +// network=types.Network( +// name='myvlan', +// ), +// host_nic=types.HostNic( +// name='bond0', +// ), +// ip_address_assignments=[ +// types.IpAddressAssignment( +// assignment_method=types.BootProtocol.STATIC, +// ip=types.Ip( +// address='192.168.122.10', +// netmask='255.255.255.0', +// ), +// ), +// ], +// dns_resolver_configuration=types.DnsResolverConfiguration( +// name_servers=[ +// '1.1.1.1', +// '2.2.2.2', +// ], +// ), +// ), +// ], +// ) +// # After modifying the network configuration it is very important to make it +// # persistent: +// host_service.commit_net_config() // ---- +// IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied +// when the host is rebooted, remember to call <>. +// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in +// the <> request, in which case the new +// configuration is automatically saved in the {hypervisor-name} upon completing the setup and +// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without +// waiting for a separate <> request. // -func (p *AssignedPermissionsService) Add() *AssignedPermissionsServiceAddRequest { - return &AssignedPermissionsServiceAddRequest{AssignedPermissionsService: p} -} - -// -// Add a new permission on the cluster to the group in the system. -// -type AssignedPermissionsServiceAddClusterPermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceSetupNetworksRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + checkConnectivity *bool + commitOnSuccess *bool + connectivityTimeout *int64 + modifiedBonds *HostNicSlice + modifiedLabels *NetworkLabelSlice + modifiedNetworkAttachments *NetworkAttachmentSlice + removedBonds *HostNicSlice + removedLabels *NetworkLabelSlice + removedNetworkAttachments *NetworkAttachmentSlice + synchronizedNetworkAttachments *NetworkAttachmentSlice } -func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddClusterPermissionRequest { +func (p *HostServiceSetupNetworksRequest) Header(key, value string) *HostServiceSetupNetworksRequest { if p.header == nil { p.header = make(map[string]string) } @@ -37137,7 +36806,7 @@ func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Header(key, valu return p } -func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddClusterPermissionRequest { +func (p *HostServiceSetupNetworksRequest) Query(key, value string) *HostServiceSetupNetworksRequest { if p.query == nil { p.query = make(map[string]string) } @@ -37145,15 +36814,139 @@ func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Query(key, value return p } -func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddClusterPermissionRequest { - p.permission = permission +func (p *HostServiceSetupNetworksRequest) Async(async bool) *HostServiceSetupNetworksRequest { + p.async = &async return p } -func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Send() (*AssignedPermissionsServiceAddClusterPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/clusterpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceSetupNetworksRequest) CheckConnectivity(checkConnectivity bool) *HostServiceSetupNetworksRequest { + p.checkConnectivity = &checkConnectivity + return p +} + +func (p *HostServiceSetupNetworksRequest) CommitOnSuccess(commitOnSuccess bool) *HostServiceSetupNetworksRequest { + p.commitOnSuccess = &commitOnSuccess + return p +} + +func (p *HostServiceSetupNetworksRequest) ConnectivityTimeout(connectivityTimeout int64) *HostServiceSetupNetworksRequest { + p.connectivityTimeout = &connectivityTimeout + return p +} + +func (p *HostServiceSetupNetworksRequest) ModifiedBonds(modifiedBonds *HostNicSlice) *HostServiceSetupNetworksRequest { + p.modifiedBonds = modifiedBonds + return p +} + +func (p *HostServiceSetupNetworksRequest) ModifiedBondsOfAny(anys ...*HostNic) *HostServiceSetupNetworksRequest { + if p.modifiedBonds == nil { + p.modifiedBonds = new(HostNicSlice) + } + p.modifiedBonds.slice = append(p.modifiedBonds.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) ModifiedLabels(modifiedLabels *NetworkLabelSlice) *HostServiceSetupNetworksRequest { + p.modifiedLabels = modifiedLabels + return p +} + +func (p *HostServiceSetupNetworksRequest) ModifiedLabelsOfAny(anys ...*NetworkLabel) *HostServiceSetupNetworksRequest { + if p.modifiedLabels == nil { + p.modifiedLabels = new(NetworkLabelSlice) + } + p.modifiedLabels.slice = append(p.modifiedLabels.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) ModifiedNetworkAttachments(modifiedNetworkAttachments *NetworkAttachmentSlice) *HostServiceSetupNetworksRequest { + p.modifiedNetworkAttachments = modifiedNetworkAttachments + return p +} + +func (p *HostServiceSetupNetworksRequest) ModifiedNetworkAttachmentsOfAny(anys ...*NetworkAttachment) *HostServiceSetupNetworksRequest { + if p.modifiedNetworkAttachments == nil { + p.modifiedNetworkAttachments = new(NetworkAttachmentSlice) + } + p.modifiedNetworkAttachments.slice = append(p.modifiedNetworkAttachments.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) RemovedBonds(removedBonds *HostNicSlice) *HostServiceSetupNetworksRequest { + p.removedBonds = removedBonds + return p +} + +func (p *HostServiceSetupNetworksRequest) RemovedBondsOfAny(anys ...*HostNic) *HostServiceSetupNetworksRequest { + if p.removedBonds == nil { + p.removedBonds = new(HostNicSlice) + } + p.removedBonds.slice = append(p.removedBonds.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) RemovedLabels(removedLabels *NetworkLabelSlice) *HostServiceSetupNetworksRequest { + p.removedLabels = removedLabels + return p +} + +func (p *HostServiceSetupNetworksRequest) RemovedLabelsOfAny(anys ...*NetworkLabel) *HostServiceSetupNetworksRequest { + if p.removedLabels == nil { + p.removedLabels = new(NetworkLabelSlice) + } + p.removedLabels.slice = append(p.removedLabels.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) RemovedNetworkAttachments(removedNetworkAttachments *NetworkAttachmentSlice) *HostServiceSetupNetworksRequest { + p.removedNetworkAttachments = removedNetworkAttachments + return p +} + +func (p *HostServiceSetupNetworksRequest) RemovedNetworkAttachmentsOfAny(anys ...*NetworkAttachment) *HostServiceSetupNetworksRequest { + if p.removedNetworkAttachments == nil { + p.removedNetworkAttachments = new(NetworkAttachmentSlice) + } + p.removedNetworkAttachments.slice = append(p.removedNetworkAttachments.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) SynchronizedNetworkAttachments(synchronizedNetworkAttachments *NetworkAttachmentSlice) *HostServiceSetupNetworksRequest { + p.synchronizedNetworkAttachments = synchronizedNetworkAttachments + return p +} + +func (p *HostServiceSetupNetworksRequest) SynchronizedNetworkAttachmentsOfAny(anys ...*NetworkAttachment) *HostServiceSetupNetworksRequest { + if p.synchronizedNetworkAttachments == nil { + p.synchronizedNetworkAttachments = new(NetworkAttachmentSlice) + } + p.synchronizedNetworkAttachments.slice = append(p.synchronizedNetworkAttachments.slice, anys...) + return p +} + +func (p *HostServiceSetupNetworksRequest) Send() (*HostServiceSetupNetworksResponse, error) { + rawURL := fmt.Sprintf("%s%s/setupnetworks", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.async != nil { + actionBuilder.Async(*p.async) + } + if p.checkConnectivity != nil { + actionBuilder.CheckConnectivity(*p.checkConnectivity) + } + if p.commitOnSuccess != nil { + actionBuilder.CommitOnSuccess(*p.commitOnSuccess) + } + if p.connectivityTimeout != nil { + actionBuilder.ConnectivityTimeout(*p.connectivityTimeout) + } + actionBuilder.ModifiedBonds(p.modifiedBonds) + actionBuilder.ModifiedLabels(p.modifiedLabels) + actionBuilder.ModifiedNetworkAttachments(p.modifiedNetworkAttachments) + actionBuilder.RemovedBonds(p.removedBonds) + actionBuilder.RemovedLabels(p.removedLabels) + actionBuilder.RemovedNetworkAttachments(p.removedNetworkAttachments) + actionBuilder.SynchronizedNetworkAttachments(p.synchronizedNetworkAttachments) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -37176,7 +36969,7 @@ func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Send() (*Assigne return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -37191,18 +36984,18 @@ func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Send() (*Assigne req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -37211,17 +37004,16 @@ func (p *AssignedPermissionsServiceAddClusterPermissionRequest) Send() (*Assigne if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddClusterPermissionResponse{permission: result}, nil + return new(HostServiceSetupNetworksResponse), nil } -func (p *AssignedPermissionsServiceAddClusterPermissionRequest) MustSend() *AssignedPermissionsServiceAddClusterPermissionResponse { +func (p *HostServiceSetupNetworksRequest) MustSend() *HostServiceSetupNetworksResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37230,68 +37022,374 @@ func (p *AssignedPermissionsServiceAddClusterPermissionRequest) MustSend() *Assi } // -// Add a new permission on the cluster to the group in the system. -// -type AssignedPermissionsServiceAddClusterPermissionResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddClusterPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceAddClusterPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission -} - -// -// Add a new permission on the cluster to the group in the system. -// -func (p *AssignedPermissionsService) AddClusterPermission() *AssignedPermissionsServiceAddClusterPermissionRequest { - return &AssignedPermissionsServiceAddClusterPermissionRequest{AssignedPermissionsService: p} -} - -// -// Add a new permission on the data center to the group in the system. -// -type AssignedPermissionsServiceAddDataCenterPermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission -} - -func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddDataCenterPermissionRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddDataCenterPermissionRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddDataCenterPermissionRequest { - p.permission = permission +// This method is used to change the configuration of the network interfaces of a host. +// For example, if you have a host with three network interfaces `eth0`, `eth1` and `eth2` and you want to configure +// a new bond using `eth0` and `eth1`, and put a VLAN on top of it. Using a simple shell script and the `curl` +// command line HTTP client that can be done as follows: +// [source] +// ---- +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request POST \ +// --header "Version: 4" \ +// --header "Content-Type: application/xml" \ +// --header "Accept: application/xml" \ +// --data ' +// +// +// +// bond0 +// +// +// +// +// +// +// +// eth1 +// +// +// eth2 +// +// +// +// +// +// +// +// +// myvlan +// +// +// bond0 +// +// +// static +// +// +//
192.168.122.10
+// 255.255.255.0 +//
+//
+//
+// +// +// 1.1.1.1 +// 2.2.2.2 +// +// +//
+//
+//
+// ' \ +// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" +// ---- +// NOTE: This is valid for version 4 of the API. In previous versions some elements were represented as XML +// attributes instead of XML elements. In particular the `options` and `ip` elements were represented as follows: +// [source,xml] +// ---- +// +// +// +// ---- +// The same thing can be done using the Python SDK with the following code: +// [source,python] +// ---- +// # Find the service that manages the collection of hosts: +// hosts_service = connection.system_service().hosts_service() +// # Find the host: +// host = hosts_service.list(search='name=myhost')[0] +// # Find the service that manages the host: +// host_service = hosts_service.host_service(host.id) +// # Configure the network adding a bond with two slaves and attaching it to a +// # network with an static IP address: +// host_service.setup_networks( +// modified_bonds=[ +// types.HostNic( +// name='bond0', +// bonding=types.Bonding( +// options=[ +// types.Option( +// name='mode', +// value='4', +// ), +// types.Option( +// name='miimon', +// value='100', +// ), +// ], +// slaves=[ +// types.HostNic( +// name='eth1', +// ), +// types.HostNic( +// name='eth2', +// ), +// ], +// ), +// ), +// ], +// modified_network_attachments=[ +// types.NetworkAttachment( +// network=types.Network( +// name='myvlan', +// ), +// host_nic=types.HostNic( +// name='bond0', +// ), +// ip_address_assignments=[ +// types.IpAddressAssignment( +// assignment_method=types.BootProtocol.STATIC, +// ip=types.Ip( +// address='192.168.122.10', +// netmask='255.255.255.0', +// ), +// ), +// ], +// dns_resolver_configuration=types.DnsResolverConfiguration( +// name_servers=[ +// '1.1.1.1', +// '2.2.2.2', +// ], +// ), +// ), +// ], +// ) +// # After modifying the network configuration it is very important to make it +// # persistent: +// host_service.commit_net_config() +// ---- +// IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied +// when the host is rebooted, remember to call <>. +// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in +// the <> request, in which case the new +// configuration is automatically saved in the {hypervisor-name} upon completing the setup and +// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without +// waiting for a separate <> request. +// +type HostServiceSetupNetworksResponse struct { +} + +// +// This method is used to change the configuration of the network interfaces of a host. +// For example, if you have a host with three network interfaces `eth0`, `eth1` and `eth2` and you want to configure +// a new bond using `eth0` and `eth1`, and put a VLAN on top of it. Using a simple shell script and the `curl` +// command line HTTP client that can be done as follows: +// [source] +// ---- +// #!/bin/sh -ex +// url="https://engine.example.com/ovirt-engine/api" +// user="admin@internal" +// password="..." +// curl \ +// --verbose \ +// --cacert /etc/pki/ovirt-engine/ca.pem \ +// --user "${user}:${password}" \ +// --request POST \ +// --header "Version: 4" \ +// --header "Content-Type: application/xml" \ +// --header "Accept: application/xml" \ +// --data ' +// +// +// +// bond0 +// +// +// +// +// +// +// +// eth1 +// +// +// eth2 +// +// +// +// +// +// +// +// +// myvlan +// +// +// bond0 +// +// +// static +// +// +//
192.168.122.10
+// 255.255.255.0 +//
+//
+//
+// +// +// 1.1.1.1 +// 2.2.2.2 +// +// +//
+//
+//
+// ' \ +// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" +// ---- +// NOTE: This is valid for version 4 of the API. In previous versions some elements were represented as XML +// attributes instead of XML elements. In particular the `options` and `ip` elements were represented as follows: +// [source,xml] +// ---- +// +// +// +// ---- +// The same thing can be done using the Python SDK with the following code: +// [source,python] +// ---- +// # Find the service that manages the collection of hosts: +// hosts_service = connection.system_service().hosts_service() +// # Find the host: +// host = hosts_service.list(search='name=myhost')[0] +// # Find the service that manages the host: +// host_service = hosts_service.host_service(host.id) +// # Configure the network adding a bond with two slaves and attaching it to a +// # network with an static IP address: +// host_service.setup_networks( +// modified_bonds=[ +// types.HostNic( +// name='bond0', +// bonding=types.Bonding( +// options=[ +// types.Option( +// name='mode', +// value='4', +// ), +// types.Option( +// name='miimon', +// value='100', +// ), +// ], +// slaves=[ +// types.HostNic( +// name='eth1', +// ), +// types.HostNic( +// name='eth2', +// ), +// ], +// ), +// ), +// ], +// modified_network_attachments=[ +// types.NetworkAttachment( +// network=types.Network( +// name='myvlan', +// ), +// host_nic=types.HostNic( +// name='bond0', +// ), +// ip_address_assignments=[ +// types.IpAddressAssignment( +// assignment_method=types.BootProtocol.STATIC, +// ip=types.Ip( +// address='192.168.122.10', +// netmask='255.255.255.0', +// ), +// ), +// ], +// dns_resolver_configuration=types.DnsResolverConfiguration( +// name_servers=[ +// '1.1.1.1', +// '2.2.2.2', +// ], +// ), +// ), +// ], +// ) +// # After modifying the network configuration it is very important to make it +// # persistent: +// host_service.commit_net_config() +// ---- +// IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied +// when the host is rebooted, remember to call <>. +// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in +// the <> request, in which case the new +// configuration is automatically saved in the {hypervisor-name} upon completing the setup and +// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without +// waiting for a separate <> request. +// +func (p *HostService) SetupNetworks() *HostServiceSetupNetworksRequest { + return &HostServiceSetupNetworksRequest{HostService: p} +} + +// +// To synchronize all networks on the host, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/syncallnetworks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- +// +type HostServiceSyncAllNetworksRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool +} + +func (p *HostServiceSyncAllNetworksRequest) Header(key, value string) *HostServiceSyncAllNetworksRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value return p } -func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Send() (*AssignedPermissionsServiceAddDataCenterPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/datacenterpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceSyncAllNetworksRequest) Query(key, value string) *HostServiceSyncAllNetworksRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value + return p +} + +func (p *HostServiceSyncAllNetworksRequest) Async(async bool) *HostServiceSyncAllNetworksRequest { + p.async = &async + return p +} + +func (p *HostServiceSyncAllNetworksRequest) Send() (*HostServiceSyncAllNetworksResponse, error) { + rawURL := fmt.Sprintf("%s%s/syncallnetworks", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.async != nil { + actionBuilder.Async(*p.async) + } action, err := actionBuilder.Build() if err != nil { return nil, err @@ -37314,7 +37412,7 @@ func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Send() (*Assi return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -37329,18 +37427,18 @@ func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Send() (*Assi req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -37349,17 +37447,16 @@ func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) Send() (*Assi if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddDataCenterPermissionResponse{permission: result}, nil + return new(HostServiceSyncAllNetworksResponse), nil } -func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) MustSend() *AssignedPermissionsServiceAddDataCenterPermissionResponse { +func (p *HostServiceSyncAllNetworksRequest) MustSend() *HostServiceSyncAllNetworksResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37368,44 +37465,49 @@ func (p *AssignedPermissionsServiceAddDataCenterPermissionRequest) MustSend() *A } // -// Add a new permission on the data center to the group in the system. +// To synchronize all networks on the host, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/syncallnetworks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -type AssignedPermissionsServiceAddDataCenterPermissionResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddDataCenterPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceAddDataCenterPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type HostServiceSyncAllNetworksResponse struct { } // -// Add a new permission on the data center to the group in the system. +// To synchronize all networks on the host, send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/hosts/123/syncallnetworks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ---- // -func (p *AssignedPermissionsService) AddDataCenterPermission() *AssignedPermissionsServiceAddDataCenterPermissionRequest { - return &AssignedPermissionsServiceAddDataCenterPermissionRequest{AssignedPermissionsService: p} +func (p *HostService) SyncAllNetworks() *HostServiceSyncAllNetworksRequest { + return &HostServiceSyncAllNetworksRequest{HostService: p} } // -// Add a new group level permission for a given virtual machine. +// Discovers the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are +// required. // -type AssignedPermissionsServiceAddGroupLevelRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceUnregisteredStorageDomainsDiscoverRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + iscsi *IscsiDetails } -func (p *AssignedPermissionsServiceAddGroupLevelRequest) Header(key, value string) *AssignedPermissionsServiceAddGroupLevelRequest { +func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Header(key, value string) *HostServiceUnregisteredStorageDomainsDiscoverRequest { if p.header == nil { p.header = make(map[string]string) } @@ -37413,7 +37515,7 @@ func (p *AssignedPermissionsServiceAddGroupLevelRequest) Header(key, value strin return p } -func (p *AssignedPermissionsServiceAddGroupLevelRequest) Query(key, value string) *AssignedPermissionsServiceAddGroupLevelRequest { +func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Query(key, value string) *HostServiceUnregisteredStorageDomainsDiscoverRequest { if p.query == nil { p.query = make(map[string]string) } @@ -37421,15 +37523,23 @@ func (p *AssignedPermissionsServiceAddGroupLevelRequest) Query(key, value string return p } -func (p *AssignedPermissionsServiceAddGroupLevelRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddGroupLevelRequest { - p.permission = permission +func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Async(async bool) *HostServiceUnregisteredStorageDomainsDiscoverRequest { + p.async = &async return p } -func (p *AssignedPermissionsServiceAddGroupLevelRequest) Send() (*AssignedPermissionsServiceAddGroupLevelResponse, error) { - rawURL := fmt.Sprintf("%s%s/grouplevel", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Iscsi(iscsi *IscsiDetails) *HostServiceUnregisteredStorageDomainsDiscoverRequest { + p.iscsi = iscsi + return p +} + +func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Send() (*HostServiceUnregisteredStorageDomainsDiscoverResponse, error) { + rawURL := fmt.Sprintf("%s%s/unregisteredstoragedomainsdiscover", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Iscsi(p.iscsi) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -37452,7 +37562,7 @@ func (p *AssignedPermissionsServiceAddGroupLevelRequest) Send() (*AssignedPermis return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -37467,18 +37577,18 @@ func (p *AssignedPermissionsServiceAddGroupLevelRequest) Send() (*AssignedPermis req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -37487,17 +37597,17 @@ func (p *AssignedPermissionsServiceAddGroupLevelRequest) Send() (*AssignedPermis if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } action, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddGroupLevelResponse{permission: result}, nil + result := action.MustStorageDomains() + return &HostServiceUnregisteredStorageDomainsDiscoverResponse{storageDomains: result}, nil } -func (p *AssignedPermissionsServiceAddGroupLevelRequest) MustSend() *AssignedPermissionsServiceAddGroupLevelResponse { +func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) MustSend() *HostServiceUnregisteredStorageDomainsDiscoverResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37506,44 +37616,61 @@ func (p *AssignedPermissionsServiceAddGroupLevelRequest) MustSend() *AssignedPer } // -// Add a new group level permission for a given virtual machine. +// Discovers the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are +// required. // -type AssignedPermissionsServiceAddGroupLevelResponse struct { - permission *Permission +type HostServiceUnregisteredStorageDomainsDiscoverResponse struct { + storageDomains *StorageDomainSlice } -func (p *AssignedPermissionsServiceAddGroupLevelResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *HostServiceUnregisteredStorageDomainsDiscoverResponse) StorageDomains() (*StorageDomainSlice, bool) { + if p.storageDomains != nil { + return p.storageDomains, true } return nil, false } -func (p *AssignedPermissionsServiceAddGroupLevelResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *HostServiceUnregisteredStorageDomainsDiscoverResponse) MustStorageDomains() *StorageDomainSlice { + if p.storageDomains == nil { + panic("storageDomains in response does not exist") } - return p.permission + return p.storageDomains } // -// Add a new group level permission for a given virtual machine. +// Discovers the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are +// required. // -func (p *AssignedPermissionsService) AddGroupLevel() *AssignedPermissionsServiceAddGroupLevelRequest { - return &AssignedPermissionsServiceAddGroupLevelRequest{AssignedPermissionsService: p} +func (p *HostService) UnregisteredStorageDomainsDiscover() *HostServiceUnregisteredStorageDomainsDiscoverRequest { + return &HostServiceUnregisteredStorageDomainsDiscoverRequest{HostService: p} } // -// Add a new permission on the host to the group in the system. -// -type AssignedPermissionsServiceAddHostPermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +// Update the host properties. +// For example, to update a the kernel command line of a host send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/hosts/123 +// ---- +// With request body like this: +// [source, xml] +// ---- +// +// +// vfio_iommu_type1.allow_unsafe_interrupts=1 +// +// +// ---- +// +type HostServiceUpdateRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + host *Host } -func (p *AssignedPermissionsServiceAddHostPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddHostPermissionRequest { +func (p *HostServiceUpdateRequest) Header(key, value string) *HostServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -37551,7 +37678,7 @@ func (p *AssignedPermissionsServiceAddHostPermissionRequest) Header(key, value s return p } -func (p *AssignedPermissionsServiceAddHostPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddHostPermissionRequest { +func (p *HostServiceUpdateRequest) Query(key, value string) *HostServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -37559,20 +37686,23 @@ func (p *AssignedPermissionsServiceAddHostPermissionRequest) Query(key, value st return p } -func (p *AssignedPermissionsServiceAddHostPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddHostPermissionRequest { - p.permission = permission +func (p *HostServiceUpdateRequest) Async(async bool) *HostServiceUpdateRequest { + p.async = &async return p } -func (p *AssignedPermissionsServiceAddHostPermissionRequest) Send() (*AssignedPermissionsServiceAddHostPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/hostpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) - actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *HostServiceUpdateRequest) Host(host *Host) *HostServiceUpdateRequest { + p.host = host + return p +} + +func (p *HostServiceUpdateRequest) Send() (*HostServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.HostService.connection.URL(), p.HostService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -37583,14 +37713,17 @@ func (p *AssignedPermissionsServiceAddHostPermissionRequest) Send() (*AssignedPe } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLHostWriteOne(writer, p.host, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -37605,18 +37738,18 @@ func (p *AssignedPermissionsServiceAddHostPermissionRequest) Send() (*AssignedPe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -37625,17 +37758,24 @@ func (p *AssignedPermissionsServiceAddHostPermissionRequest) Send() (*AssignedPe if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPermission() - return &AssignedPermissionsServiceAddHostPermissionResponse{permission: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLHostReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &HostServiceUpdateResponse{host: result}, nil } -func (p *AssignedPermissionsServiceAddHostPermissionRequest) MustSend() *AssignedPermissionsServiceAddHostPermissionResponse { +func (p *HostServiceUpdateRequest) MustSend() *HostServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37644,64 +37784,75 @@ func (p *AssignedPermissionsServiceAddHostPermissionRequest) MustSend() *Assigne } // -// Add a new permission on the host to the group in the system. +// Update the host properties. +// For example, to update a the kernel command line of a host send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/hosts/123 +// ---- +// With request body like this: +// [source, xml] +// ---- +// +// +// vfio_iommu_type1.allow_unsafe_interrupts=1 +// +// +// ---- // -type AssignedPermissionsServiceAddHostPermissionResponse struct { - permission *Permission +type HostServiceUpdateResponse struct { + host *Host } -func (p *AssignedPermissionsServiceAddHostPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *HostServiceUpdateResponse) Host() (*Host, bool) { + if p.host != nil { + return p.host, true } return nil, false } -func (p *AssignedPermissionsServiceAddHostPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *HostServiceUpdateResponse) MustHost() *Host { + if p.host == nil { + panic("host in response does not exist") } - return p.permission + return p.host } // -// Add a new permission on the host to the group in the system. +// Update the host properties. +// For example, to update a the kernel command line of a host send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/hosts/123 +// ---- +// With request body like this: +// [source, xml] +// ---- +// +// +// vfio_iommu_type1.allow_unsafe_interrupts=1 +// +// +// ---- // -func (p *AssignedPermissionsService) AddHostPermission() *AssignedPermissionsServiceAddHostPermissionRequest { - return &AssignedPermissionsServiceAddHostPermissionRequest{AssignedPermissionsService: p} +func (p *HostService) Update() *HostServiceUpdateRequest { + return &HostServiceUpdateRequest{HostService: p} } // -// List all the permissions of the specific entity. -// For example to list all the permissions of the cluster with id `123` send a request like this: -// .... -// GET /ovirt-engine/api/clusters/123/permissions -// .... -// [source,xml] -// ---- -// -// -// -// -// -// -// -// -// -// -// -// -// ---- -// The order of the returned permissions isn't guaranteed. +// Upgrades VDSM and selected software on the host. // -type AssignedPermissionsServiceListRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - follow *string +type HostServiceUpgradeRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + image *string + reboot *bool + timeout *int64 } -func (p *AssignedPermissionsServiceListRequest) Header(key, value string) *AssignedPermissionsServiceListRequest { +func (p *HostServiceUpgradeRequest) Header(key, value string) *HostServiceUpgradeRequest { if p.header == nil { p.header = make(map[string]string) } @@ -37709,7 +37860,7 @@ func (p *AssignedPermissionsServiceListRequest) Header(key, value string) *Assig return p } -func (p *AssignedPermissionsServiceListRequest) Query(key, value string) *AssignedPermissionsServiceListRequest { +func (p *HostServiceUpgradeRequest) Query(key, value string) *HostServiceUpgradeRequest { if p.query == nil { p.query = make(map[string]string) } @@ -37717,18 +37868,46 @@ func (p *AssignedPermissionsServiceListRequest) Query(key, value string) *Assign return p } -func (p *AssignedPermissionsServiceListRequest) Follow(follow string) *AssignedPermissionsServiceListRequest { - p.follow = &follow +func (p *HostServiceUpgradeRequest) Async(async bool) *HostServiceUpgradeRequest { + p.async = &async return p } -func (p *AssignedPermissionsServiceListRequest) Send() (*AssignedPermissionsServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) - values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } +func (p *HostServiceUpgradeRequest) Image(image string) *HostServiceUpgradeRequest { + p.image = &image + return p +} + +func (p *HostServiceUpgradeRequest) Reboot(reboot bool) *HostServiceUpgradeRequest { + p.reboot = &reboot + return p +} +func (p *HostServiceUpgradeRequest) Timeout(timeout int64) *HostServiceUpgradeRequest { + p.timeout = &timeout + return p +} + +func (p *HostServiceUpgradeRequest) Send() (*HostServiceUpgradeResponse, error) { + rawURL := fmt.Sprintf("%s%s/upgrade", p.HostService.connection.URL(), p.HostService.path) + actionBuilder := NewActionBuilder() + if p.async != nil { + actionBuilder.Async(*p.async) + } + if p.image != nil { + actionBuilder.Image(*p.image) + } + if p.reboot != nil { + actionBuilder.Reboot(*p.reboot) + } + if p.timeout != nil { + actionBuilder.Timeout(*p.timeout) + } + action, err := actionBuilder.Build() + if err != nil { + return nil, err + } + values := make(url.Values) if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -37737,12 +37916,16 @@ func (p *AssignedPermissionsServiceListRequest) Send() (*AssignedPermissionsServ if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err = XMLActionWriteOne(writer, action, "") + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -37757,18 +37940,18 @@ func (p *AssignedPermissionsServiceListRequest) Send() (*AssignedPermissionsServ req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -37777,24 +37960,16 @@ func (p *AssignedPermissionsServiceListRequest) Send() (*AssignedPermissionsServ if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - if !Contains(resp.StatusCode, []int{200}) { - return nil, CheckFault(resp) - } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) - if errReadBody != nil { - return nil, errReadBody + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - reader := NewXMLReader(respBodyBytes) - result, err := XMLPermissionReadMany(reader, nil) - if err != nil { - return nil, err + _, errCheckAction := CheckAction(resp) + if errCheckAction != nil { + return nil, errCheckAction } - return &AssignedPermissionsServiceListResponse{permissions: result}, nil + return new(HostServiceUpgradeResponse), nil } -func (p *AssignedPermissionsServiceListRequest) MustSend() *AssignedPermissionsServiceListResponse { +func (p *HostServiceUpgradeRequest) MustSend() *HostServiceUpgradeResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37803,84 +37978,31 @@ func (p *AssignedPermissionsServiceListRequest) MustSend() *AssignedPermissionsS } // -// List all the permissions of the specific entity. -// For example to list all the permissions of the cluster with id `123` send a request like this: -// .... -// GET /ovirt-engine/api/clusters/123/permissions -// .... -// [source,xml] -// ---- -// -// -// -// -// -// -// -// -// -// -// -// -// ---- -// The order of the returned permissions isn't guaranteed. +// Upgrades VDSM and selected software on the host. // -type AssignedPermissionsServiceListResponse struct { - permissions *PermissionSlice -} - -func (p *AssignedPermissionsServiceListResponse) Permissions() (*PermissionSlice, bool) { - if p.permissions != nil { - return p.permissions, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceListResponse) MustPermissions() *PermissionSlice { - if p.permissions == nil { - panic("permissions in response does not exist") - } - return p.permissions +type HostServiceUpgradeResponse struct { } // -// List all the permissions of the specific entity. -// For example to list all the permissions of the cluster with id `123` send a request like this: -// .... -// GET /ovirt-engine/api/clusters/123/permissions -// .... -// [source,xml] -// ---- -// -// -// -// -// -// -// -// -// -// -// -// -// ---- -// The order of the returned permissions isn't guaranteed. +// Upgrades VDSM and selected software on the host. // -func (p *AssignedPermissionsService) List() *AssignedPermissionsServiceListRequest { - return &AssignedPermissionsServiceListRequest{AssignedPermissionsService: p} +func (p *HostService) Upgrade() *HostServiceUpgradeRequest { + return &HostServiceUpgradeRequest{HostService: p} } // -// Add a new permission on the storage domain to the group in the system. +// Check if there are upgrades available for the host. If there are upgrades available an icon will be displayed +// next to host status icon in the Administration Portal. Audit log messages are also added to indicate the +// availability of upgrades. The upgrade can be started from the webadmin or by using the +// <> host action. // -type AssignedPermissionsServiceAddStorageDomainPermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceUpgradeCheckRequest struct { + HostService *HostService + header map[string]string + query map[string]string } -func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddStorageDomainPermissionRequest { +func (p *HostServiceUpgradeCheckRequest) Header(key, value string) *HostServiceUpgradeCheckRequest { if p.header == nil { p.header = make(map[string]string) } @@ -37888,7 +38010,7 @@ func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Header(key return p } -func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddStorageDomainPermissionRequest { +func (p *HostServiceUpgradeCheckRequest) Query(key, value string) *HostServiceUpgradeCheckRequest { if p.query == nil { p.query = make(map[string]string) } @@ -37896,15 +38018,9 @@ func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Query(key, return p } -func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddStorageDomainPermissionRequest { - p.permission = permission - return p -} - -func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Send() (*AssignedPermissionsServiceAddStorageDomainPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/storagedomainpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceUpgradeCheckRequest) Send() (*HostServiceUpgradeCheckResponse, error) { + rawURL := fmt.Sprintf("%s%s/upgradecheck", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -37927,7 +38043,7 @@ func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Send() (*A return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -37942,18 +38058,18 @@ func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Send() (*A req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -37962,17 +38078,16 @@ func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) Send() (*A if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddStorageDomainPermissionResponse{permission: result}, nil + return new(HostServiceUpgradeCheckResponse), nil } -func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) MustSend() *AssignedPermissionsServiceAddStorageDomainPermissionResponse { +func (p *HostServiceUpgradeCheckRequest) MustSend() *HostServiceUpgradeCheckResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -37981,44 +38096,37 @@ func (p *AssignedPermissionsServiceAddStorageDomainPermissionRequest) MustSend() } // -// Add a new permission on the storage domain to the group in the system. +// Check if there are upgrades available for the host. If there are upgrades available an icon will be displayed +// next to host status icon in the Administration Portal. Audit log messages are also added to indicate the +// availability of upgrades. The upgrade can be started from the webadmin or by using the +// <> host action. // -type AssignedPermissionsServiceAddStorageDomainPermissionResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddStorageDomainPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceAddStorageDomainPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type HostServiceUpgradeCheckResponse struct { } // -// Add a new permission on the storage domain to the group in the system. +// Check if there are upgrades available for the host. If there are upgrades available an icon will be displayed +// next to host status icon in the Administration Portal. Audit log messages are also added to indicate the +// availability of upgrades. The upgrade can be started from the webadmin or by using the +// <> host action. // -func (p *AssignedPermissionsService) AddStorageDomainPermission() *AssignedPermissionsServiceAddStorageDomainPermissionRequest { - return &AssignedPermissionsServiceAddStorageDomainPermissionRequest{AssignedPermissionsService: p} +func (p *HostService) UpgradeCheck() *HostServiceUpgradeCheckRequest { + return &HostServiceUpgradeCheckRequest{HostService: p} } // -// Add a new permission on the template to the group in the system. // -type AssignedPermissionsServiceAddTemplatePermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceApproveUsingRootPasswordRequest struct { + HostService *HostService + header map[string]string + query map[string]string + activate *bool + async *bool + cluster *Cluster + host *Host } -func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddTemplatePermissionRequest { +func (p *HostServiceApproveUsingRootPasswordRequest) Header(key, value string) *HostServiceApproveUsingRootPasswordRequest { if p.header == nil { p.header = make(map[string]string) } @@ -38026,7 +38134,7 @@ func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Header(key, val return p } -func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddTemplatePermissionRequest { +func (p *HostServiceApproveUsingRootPasswordRequest) Query(key, value string) *HostServiceApproveUsingRootPasswordRequest { if p.query == nil { p.query = make(map[string]string) } @@ -38034,15 +38142,37 @@ func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Query(key, valu return p } -func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddTemplatePermissionRequest { - p.permission = permission +func (p *HostServiceApproveUsingRootPasswordRequest) Activate(activate bool) *HostServiceApproveUsingRootPasswordRequest { + p.activate = &activate return p } -func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Send() (*AssignedPermissionsServiceAddTemplatePermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/templatepermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceApproveUsingRootPasswordRequest) Async(async bool) *HostServiceApproveUsingRootPasswordRequest { + p.async = &async + return p +} + +func (p *HostServiceApproveUsingRootPasswordRequest) Cluster(cluster *Cluster) *HostServiceApproveUsingRootPasswordRequest { + p.cluster = cluster + return p +} + +func (p *HostServiceApproveUsingRootPasswordRequest) Host(host *Host) *HostServiceApproveUsingRootPasswordRequest { + p.host = host + return p +} + +func (p *HostServiceApproveUsingRootPasswordRequest) Send() (*HostServiceApproveUsingRootPasswordResponse, error) { + rawURL := fmt.Sprintf("%s%s/usingrootpassword", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.activate != nil { + actionBuilder.Activate(*p.activate) + } + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Cluster(p.cluster) + actionBuilder.Host(p.host) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -38065,7 +38195,7 @@ func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Send() (*Assign return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -38080,18 +38210,18 @@ func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Send() (*Assign req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -38100,17 +38230,16 @@ func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) Send() (*Assign if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddTemplatePermissionResponse{permission: result}, nil + return new(HostServiceApproveUsingRootPasswordResponse), nil } -func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) MustSend() *AssignedPermissionsServiceAddTemplatePermissionResponse { +func (p *HostServiceApproveUsingRootPasswordRequest) MustSend() *HostServiceApproveUsingRootPasswordResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -38119,44 +38248,35 @@ func (p *AssignedPermissionsServiceAddTemplatePermissionRequest) MustSend() *Ass } // -// Add a new permission on the template to the group in the system. // -type AssignedPermissionsServiceAddTemplatePermissionResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddTemplatePermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceAddTemplatePermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type HostServiceApproveUsingRootPasswordResponse struct { } // -// Add a new permission on the template to the group in the system. // -func (p *AssignedPermissionsService) AddTemplatePermission() *AssignedPermissionsServiceAddTemplatePermissionRequest { - return &AssignedPermissionsServiceAddTemplatePermissionRequest{AssignedPermissionsService: p} +func (p *HostService) ApproveUsingRootPassword() *HostServiceApproveUsingRootPasswordRequest { + return &HostServiceApproveUsingRootPasswordRequest{HostService: p} } // -// Add a new user level permission for a given virtual machine. +// Install VDSM and other packages required to get the host ready to be used in the engine providing the root +// password. This has been deprecated. // -type AssignedPermissionsServiceAddUserLevelRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceInstallUsingRootPasswordRequest struct { + HostService *HostService + header map[string]string + query map[string]string + activate *bool + async *bool + deployHostedEngine *bool + host *Host + image *string + rootPassword *string + ssh *Ssh + undeployHostedEngine *bool } -func (p *AssignedPermissionsServiceAddUserLevelRequest) Header(key, value string) *AssignedPermissionsServiceAddUserLevelRequest { +func (p *HostServiceInstallUsingRootPasswordRequest) Header(key, value string) *HostServiceInstallUsingRootPasswordRequest { if p.header == nil { p.header = make(map[string]string) } @@ -38164,7 +38284,7 @@ func (p *AssignedPermissionsServiceAddUserLevelRequest) Header(key, value string return p } -func (p *AssignedPermissionsServiceAddUserLevelRequest) Query(key, value string) *AssignedPermissionsServiceAddUserLevelRequest { +func (p *HostServiceInstallUsingRootPasswordRequest) Query(key, value string) *HostServiceInstallUsingRootPasswordRequest { if p.query == nil { p.query = make(map[string]string) } @@ -38172,15 +38292,69 @@ func (p *AssignedPermissionsServiceAddUserLevelRequest) Query(key, value string) return p } -func (p *AssignedPermissionsServiceAddUserLevelRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddUserLevelRequest { - p.permission = permission +func (p *HostServiceInstallUsingRootPasswordRequest) Activate(activate bool) *HostServiceInstallUsingRootPasswordRequest { + p.activate = &activate return p } -func (p *AssignedPermissionsServiceAddUserLevelRequest) Send() (*AssignedPermissionsServiceAddUserLevelResponse, error) { - rawURL := fmt.Sprintf("%s%s/userlevel", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceInstallUsingRootPasswordRequest) Async(async bool) *HostServiceInstallUsingRootPasswordRequest { + p.async = &async + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) DeployHostedEngine(deployHostedEngine bool) *HostServiceInstallUsingRootPasswordRequest { + p.deployHostedEngine = &deployHostedEngine + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) Host(host *Host) *HostServiceInstallUsingRootPasswordRequest { + p.host = host + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) Image(image string) *HostServiceInstallUsingRootPasswordRequest { + p.image = &image + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) RootPassword(rootPassword string) *HostServiceInstallUsingRootPasswordRequest { + p.rootPassword = &rootPassword + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) Ssh(ssh *Ssh) *HostServiceInstallUsingRootPasswordRequest { + p.ssh = ssh + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) UndeployHostedEngine(undeployHostedEngine bool) *HostServiceInstallUsingRootPasswordRequest { + p.undeployHostedEngine = &undeployHostedEngine + return p +} + +func (p *HostServiceInstallUsingRootPasswordRequest) Send() (*HostServiceInstallUsingRootPasswordResponse, error) { + rawURL := fmt.Sprintf("%s%s/usingrootpassword", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.activate != nil { + actionBuilder.Activate(*p.activate) + } + if p.async != nil { + actionBuilder.Async(*p.async) + } + if p.deployHostedEngine != nil { + actionBuilder.DeployHostedEngine(*p.deployHostedEngine) + } + actionBuilder.Host(p.host) + if p.image != nil { + actionBuilder.Image(*p.image) + } + if p.rootPassword != nil { + actionBuilder.RootPassword(*p.rootPassword) + } + actionBuilder.Ssh(p.ssh) + if p.undeployHostedEngine != nil { + actionBuilder.UndeployHostedEngine(*p.undeployHostedEngine) + } action, err := actionBuilder.Build() if err != nil { return nil, err @@ -38203,7 +38377,7 @@ func (p *AssignedPermissionsServiceAddUserLevelRequest) Send() (*AssignedPermiss return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -38218,18 +38392,18 @@ func (p *AssignedPermissionsServiceAddUserLevelRequest) Send() (*AssignedPermiss req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -38238,17 +38412,16 @@ func (p *AssignedPermissionsServiceAddUserLevelRequest) Send() (*AssignedPermiss if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddUserLevelResponse{permission: result}, nil + return new(HostServiceInstallUsingRootPasswordResponse), nil } -func (p *AssignedPermissionsServiceAddUserLevelRequest) MustSend() *AssignedPermissionsServiceAddUserLevelResponse { +func (p *HostServiceInstallUsingRootPasswordRequest) MustSend() *HostServiceInstallUsingRootPasswordResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -38257,44 +38430,32 @@ func (p *AssignedPermissionsServiceAddUserLevelRequest) MustSend() *AssignedPerm } // -// Add a new user level permission for a given virtual machine. +// Install VDSM and other packages required to get the host ready to be used in the engine providing the root +// password. This has been deprecated. // -type AssignedPermissionsServiceAddUserLevelResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddUserLevelResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceAddUserLevelResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type HostServiceInstallUsingRootPasswordResponse struct { } // -// Add a new user level permission for a given virtual machine. +// Install VDSM and other packages required to get the host ready to be used in the engine providing the root +// password. This has been deprecated. // -func (p *AssignedPermissionsService) AddUserLevel() *AssignedPermissionsServiceAddUserLevelRequest { - return &AssignedPermissionsServiceAddUserLevelRequest{AssignedPermissionsService: p} +func (p *HostService) InstallUsingRootPassword() *HostServiceInstallUsingRootPasswordRequest { + return &HostServiceInstallUsingRootPasswordRequest{HostService: p} } // -// Add a new permission on the vm to the group in the system. +// Update the specified host in the system. This is deprecated and is provided only for backwards compatibility. // -type AssignedPermissionsServiceAddVmPermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceUpdateUsingRootPasswordRequest struct { + HostService *HostService + header map[string]string + query map[string]string + async *bool + host *Host } -func (p *AssignedPermissionsServiceAddVmPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddVmPermissionRequest { +func (p *HostServiceUpdateUsingRootPasswordRequest) Header(key, value string) *HostServiceUpdateUsingRootPasswordRequest { if p.header == nil { p.header = make(map[string]string) } @@ -38302,7 +38463,7 @@ func (p *AssignedPermissionsServiceAddVmPermissionRequest) Header(key, value str return p } -func (p *AssignedPermissionsServiceAddVmPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddVmPermissionRequest { +func (p *HostServiceUpdateUsingRootPasswordRequest) Query(key, value string) *HostServiceUpdateUsingRootPasswordRequest { if p.query == nil { p.query = make(map[string]string) } @@ -38310,15 +38471,23 @@ func (p *AssignedPermissionsServiceAddVmPermissionRequest) Query(key, value stri return p } -func (p *AssignedPermissionsServiceAddVmPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddVmPermissionRequest { - p.permission = permission +func (p *HostServiceUpdateUsingRootPasswordRequest) Async(async bool) *HostServiceUpdateUsingRootPasswordRequest { + p.async = &async return p } -func (p *AssignedPermissionsServiceAddVmPermissionRequest) Send() (*AssignedPermissionsServiceAddVmPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/vmpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceUpdateUsingRootPasswordRequest) Host(host *Host) *HostServiceUpdateUsingRootPasswordRequest { + p.host = host + return p +} + +func (p *HostServiceUpdateUsingRootPasswordRequest) Send() (*HostServiceUpdateUsingRootPasswordResponse, error) { + rawURL := fmt.Sprintf("%s%s/usingrootpassword", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Host(p.host) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -38341,7 +38510,7 @@ func (p *AssignedPermissionsServiceAddVmPermissionRequest) Send() (*AssignedPerm return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -38356,18 +38525,18 @@ func (p *AssignedPermissionsServiceAddVmPermissionRequest) Send() (*AssignedPerm req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -38376,17 +38545,17 @@ func (p *AssignedPermissionsServiceAddVmPermissionRequest) Send() (*AssignedPerm if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } action, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddVmPermissionResponse{permission: result}, nil + result := action.MustHost() + return &HostServiceUpdateUsingRootPasswordResponse{host: result}, nil } -func (p *AssignedPermissionsServiceAddVmPermissionRequest) MustSend() *AssignedPermissionsServiceAddVmPermissionResponse { +func (p *HostServiceUpdateUsingRootPasswordRequest) MustSend() *HostServiceUpdateUsingRootPasswordResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -38395,44 +38564,48 @@ func (p *AssignedPermissionsServiceAddVmPermissionRequest) MustSend() *AssignedP } // -// Add a new permission on the vm to the group in the system. +// Update the specified host in the system. This is deprecated and is provided only for backwards compatibility. // -type AssignedPermissionsServiceAddVmPermissionResponse struct { - permission *Permission +type HostServiceUpdateUsingRootPasswordResponse struct { + host *Host } -func (p *AssignedPermissionsServiceAddVmPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true +func (p *HostServiceUpdateUsingRootPasswordResponse) Host() (*Host, bool) { + if p.host != nil { + return p.host, true } return nil, false } -func (p *AssignedPermissionsServiceAddVmPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") +func (p *HostServiceUpdateUsingRootPasswordResponse) MustHost() *Host { + if p.host == nil { + panic("host in response does not exist") } - return p.permission + return p.host } // -// Add a new permission on the vm to the group in the system. +// Update the specified host in the system. This is deprecated and is provided only for backwards compatibility. // -func (p *AssignedPermissionsService) AddVmPermission() *AssignedPermissionsServiceAddVmPermissionRequest { - return &AssignedPermissionsServiceAddVmPermissionRequest{AssignedPermissionsService: p} +func (p *HostService) UpdateUsingRootPassword() *HostServiceUpdateUsingRootPasswordRequest { + return &HostServiceUpdateUsingRootPasswordRequest{HostService: p} } // -// Add a new permission on the vm pool to the group in the system. +// Approve the specified host to be added to the engine by using ssh authentication. This occurs when the host +// registers itself with the engine. // -type AssignedPermissionsServiceAddVmPoolPermissionRequest struct { - AssignedPermissionsService *AssignedPermissionsService - header map[string]string - query map[string]string - permission *Permission +type HostServiceApproveUsingSshRequest struct { + HostService *HostService + header map[string]string + query map[string]string + activate *bool + async *bool + cluster *Cluster + host *Host } -func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Header(key, value string) *AssignedPermissionsServiceAddVmPoolPermissionRequest { +func (p *HostServiceApproveUsingSshRequest) Header(key, value string) *HostServiceApproveUsingSshRequest { if p.header == nil { p.header = make(map[string]string) } @@ -38440,7 +38613,7 @@ func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Header(key, value return p } -func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Query(key, value string) *AssignedPermissionsServiceAddVmPoolPermissionRequest { +func (p *HostServiceApproveUsingSshRequest) Query(key, value string) *HostServiceApproveUsingSshRequest { if p.query == nil { p.query = make(map[string]string) } @@ -38448,15 +38621,37 @@ func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Query(key, value return p } -func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Permission(permission *Permission) *AssignedPermissionsServiceAddVmPoolPermissionRequest { - p.permission = permission +func (p *HostServiceApproveUsingSshRequest) Activate(activate bool) *HostServiceApproveUsingSshRequest { + p.activate = &activate return p } -func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Send() (*AssignedPermissionsServiceAddVmPoolPermissionResponse, error) { - rawURL := fmt.Sprintf("%s%s/vmpoolpermission", p.AssignedPermissionsService.connection.URL(), p.AssignedPermissionsService.path) +func (p *HostServiceApproveUsingSshRequest) Async(async bool) *HostServiceApproveUsingSshRequest { + p.async = &async + return p +} + +func (p *HostServiceApproveUsingSshRequest) Cluster(cluster *Cluster) *HostServiceApproveUsingSshRequest { + p.cluster = cluster + return p +} + +func (p *HostServiceApproveUsingSshRequest) Host(host *Host) *HostServiceApproveUsingSshRequest { + p.host = host + return p +} + +func (p *HostServiceApproveUsingSshRequest) Send() (*HostServiceApproveUsingSshResponse, error) { + rawURL := fmt.Sprintf("%s%s/usingssh", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() - actionBuilder.Permission(p.permission) + if p.activate != nil { + actionBuilder.Activate(*p.activate) + } + if p.async != nil { + actionBuilder.Async(*p.async) + } + actionBuilder.Cluster(p.cluster) + actionBuilder.Host(p.host) action, err := actionBuilder.Build() if err != nil { return nil, err @@ -38479,7 +38674,7 @@ func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Send() (*Assigned return nil, err } - for hk, hv := range p.AssignedPermissionsService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -38494,18 +38689,18 @@ func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Send() (*Assigned req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedPermissionsService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedPermissionsService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedPermissionsService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -38514,17 +38709,16 @@ func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) Send() (*Assigned if err != nil { return nil, err } - p.AssignedPermissionsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) + _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - result := action.MustPermission() - return &AssignedPermissionsServiceAddVmPoolPermissionResponse{permission: result}, nil + return new(HostServiceApproveUsingSshResponse), nil } -func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) MustSend() *AssignedPermissionsServiceAddVmPoolPermissionResponse { +func (p *HostServiceApproveUsingSshRequest) MustSend() *HostServiceApproveUsingSshResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -38533,120 +38727,117 @@ func (p *AssignedPermissionsServiceAddVmPoolPermissionRequest) MustSend() *Assig } // -// Add a new permission on the vm pool to the group in the system. +// Approve the specified host to be added to the engine by using ssh authentication. This occurs when the host +// registers itself with the engine. // -type AssignedPermissionsServiceAddVmPoolPermissionResponse struct { - permission *Permission -} - -func (p *AssignedPermissionsServiceAddVmPoolPermissionResponse) Permission() (*Permission, bool) { - if p.permission != nil { - return p.permission, true - } - return nil, false -} - -func (p *AssignedPermissionsServiceAddVmPoolPermissionResponse) MustPermission() *Permission { - if p.permission == nil { - panic("permission in response does not exist") - } - return p.permission +type HostServiceApproveUsingSshResponse struct { } // -// Add a new permission on the vm pool to the group in the system. +// Approve the specified host to be added to the engine by using ssh authentication. This occurs when the host +// registers itself with the engine. // -func (p *AssignedPermissionsService) AddVmPoolPermission() *AssignedPermissionsServiceAddVmPoolPermissionRequest { - return &AssignedPermissionsServiceAddVmPoolPermissionRequest{AssignedPermissionsService: p} +func (p *HostService) ApproveUsingSsh() *HostServiceApproveUsingSshRequest { + return &HostServiceApproveUsingSshRequest{HostService: p} } // -// Sub-resource locator method, returns individual permission resource on which the remainder of the URI is -// dispatched. +// Install VDSM and other packages required to get the host ready to be used in the engine providing the SSH +// password. // -func (op *AssignedPermissionsService) PermissionService(id string) *PermissionService { - return NewPermissionService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +type HostServiceInstallUsingSshRequest struct { + HostService *HostService + header map[string]string + query map[string]string + activate *bool + async *bool + deployHostedEngine *bool + host *Host + image *string + rootPassword *string + ssh *Ssh + undeployHostedEngine *bool } -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *AssignedPermissionsService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *HostServiceInstallUsingSshRequest) Header(key, value string) *HostServiceInstallUsingSshRequest { + if p.header == nil { + p.header = make(map[string]string) } - index := strings.Index(path, "/") - if index == -1 { - return op.PermissionService(path), nil + p.header[key] = value + return p +} + +func (p *HostServiceInstallUsingSshRequest) Query(key, value string) *HostServiceInstallUsingSshRequest { + if p.query == nil { + p.query = make(map[string]string) } - return op.PermissionService(path[:index]).Service(path[index+1:]) + p.query[key] = value + return p } -func (op *AssignedPermissionsService) String() string { - return fmt.Sprintf("AssignedPermissionsService:%s", op.path) +func (p *HostServiceInstallUsingSshRequest) Activate(activate bool) *HostServiceInstallUsingSshRequest { + p.activate = &activate + return p } -// -// A service to manage a virtual machines pool. -// -type VmPoolService struct { - BaseService +func (p *HostServiceInstallUsingSshRequest) Async(async bool) *HostServiceInstallUsingSshRequest { + p.async = &async + return p } -func NewVmPoolService(connection *Connection, path string) *VmPoolService { - var result VmPoolService - result.connection = connection - result.path = path - return &result +func (p *HostServiceInstallUsingSshRequest) DeployHostedEngine(deployHostedEngine bool) *HostServiceInstallUsingSshRequest { + p.deployHostedEngine = &deployHostedEngine + return p } -// -// This operation allocates a virtual machine in the virtual machine pool. -// [source] -// ---- -// POST /ovirt-engine/api/vmpools/123/allocatevm -// ---- -// The allocate virtual machine action does not take any action specific parameters, so the request body should -// contain an empty `action`: -// [source,xml] -// ---- -// -// ---- -// -type VmPoolServiceAllocateVmRequest struct { - VmPoolService *VmPoolService - header map[string]string - query map[string]string - async *bool +func (p *HostServiceInstallUsingSshRequest) Host(host *Host) *HostServiceInstallUsingSshRequest { + p.host = host + return p } -func (p *VmPoolServiceAllocateVmRequest) Header(key, value string) *VmPoolServiceAllocateVmRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value +func (p *HostServiceInstallUsingSshRequest) Image(image string) *HostServiceInstallUsingSshRequest { + p.image = &image return p } -func (p *VmPoolServiceAllocateVmRequest) Query(key, value string) *VmPoolServiceAllocateVmRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value +func (p *HostServiceInstallUsingSshRequest) RootPassword(rootPassword string) *HostServiceInstallUsingSshRequest { + p.rootPassword = &rootPassword return p } -func (p *VmPoolServiceAllocateVmRequest) Async(async bool) *VmPoolServiceAllocateVmRequest { - p.async = &async +func (p *HostServiceInstallUsingSshRequest) Ssh(ssh *Ssh) *HostServiceInstallUsingSshRequest { + p.ssh = ssh return p } -func (p *VmPoolServiceAllocateVmRequest) Send() (*VmPoolServiceAllocateVmResponse, error) { - rawURL := fmt.Sprintf("%s%s/allocatevm", p.VmPoolService.connection.URL(), p.VmPoolService.path) +func (p *HostServiceInstallUsingSshRequest) UndeployHostedEngine(undeployHostedEngine bool) *HostServiceInstallUsingSshRequest { + p.undeployHostedEngine = &undeployHostedEngine + return p +} + +func (p *HostServiceInstallUsingSshRequest) Send() (*HostServiceInstallUsingSshResponse, error) { + rawURL := fmt.Sprintf("%s%s/usingssh", p.HostService.connection.URL(), p.HostService.path) actionBuilder := NewActionBuilder() + if p.activate != nil { + actionBuilder.Activate(*p.activate) + } if p.async != nil { actionBuilder.Async(*p.async) } + if p.deployHostedEngine != nil { + actionBuilder.DeployHostedEngine(*p.deployHostedEngine) + } + actionBuilder.Host(p.host) + if p.image != nil { + actionBuilder.Image(*p.image) + } + if p.rootPassword != nil { + actionBuilder.RootPassword(*p.rootPassword) + } + actionBuilder.Ssh(p.ssh) + if p.undeployHostedEngine != nil { + actionBuilder.UndeployHostedEngine(*p.undeployHostedEngine) + } action, err := actionBuilder.Build() if err != nil { return nil, err @@ -38669,7 +38860,7 @@ func (p *VmPoolServiceAllocateVmRequest) Send() (*VmPoolServiceAllocateVmRespons return nil, err } - for hk, hv := range p.VmPoolService.connection.headers { + for hk, hv := range p.HostService.connection.headers { req.Header.Add(hk, hv) } @@ -38684,18 +38875,18 @@ func (p *VmPoolServiceAllocateVmRequest) Send() (*VmPoolServiceAllocateVmRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmPoolService.connection.authenticate() + token, err := p.HostService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmPoolService.connection.client.Do(req) + resp, err := p.HostService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmPoolService.connection.logFunc != nil { + if p.HostService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -38704,16 +38895,16 @@ func (p *VmPoolServiceAllocateVmRequest) Send() (*VmPoolServiceAllocateVmRespons if err != nil { return nil, err } - p.VmPoolService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(VmPoolServiceAllocateVmResponse), nil + return new(HostServiceInstallUsingSshResponse), nil } -func (p *VmPoolServiceAllocateVmRequest) MustSend() *VmPoolServiceAllocateVmResponse { +func (p *HostServiceInstallUsingSshRequest) MustSend() *HostServiceInstallUsingSshResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -38722,74 +38913,32 @@ func (p *VmPoolServiceAllocateVmRequest) MustSend() *VmPoolServiceAllocateVmResp } // -// This operation allocates a virtual machine in the virtual machine pool. -// [source] -// ---- -// POST /ovirt-engine/api/vmpools/123/allocatevm -// ---- -// The allocate virtual machine action does not take any action specific parameters, so the request body should -// contain an empty `action`: -// [source,xml] -// ---- -// -// ---- +// Install VDSM and other packages required to get the host ready to be used in the engine providing the SSH +// password. // -type VmPoolServiceAllocateVmResponse struct { +type HostServiceInstallUsingSshResponse struct { } // -// This operation allocates a virtual machine in the virtual machine pool. -// [source] -// ---- -// POST /ovirt-engine/api/vmpools/123/allocatevm -// ---- -// The allocate virtual machine action does not take any action specific parameters, so the request body should -// contain an empty `action`: -// [source,xml] -// ---- -// -// ---- +// Install VDSM and other packages required to get the host ready to be used in the engine providing the SSH +// password. // -func (p *VmPoolService) AllocateVm() *VmPoolServiceAllocateVmRequest { - return &VmPoolServiceAllocateVmRequest{VmPoolService: p} +func (p *HostService) InstallUsingSsh() *HostServiceInstallUsingSshRequest { + return &HostServiceInstallUsingSshRequest{HostService: p} } // -// Get the virtual machine pool. -// [source] -// ---- -// GET /ovirt-engine/api/vmpools/123 -// ---- -// You will get a XML response like that one: -// [source,xml] -// ---- -// -// ... -// MyVmPool -// MyVmPool description -// -// 1 -// 0 -// 100 -// false -// automatic -// false -// -// // ---- -// You will receive response like this: +// Creating an instance type with all hardware configurations with a request body like this: // [source,xml] // ---- -// -// 321 -// 321 -// 10 -// 1 -// storage -// -// +// +// myinstancetype +// +// true +// +// +// +// 2 +// 2 +// 1 +// +// +// AMD Opteron_G2 +// q35 +// +// 1 +// true +// true +// spice +// +// +// true +// 1 +// +// +// 2 +// +// 4294967296 +// +// true +// 268435456 +// +// +// inherit +// inherit +// +// +// 2 +// +// +// +// hd +// +// +// +// +// +// 200 +// 2 +// +// urandom +// +// true +// +// true +// native +// +// +// true +// +// // ---- // -type QosServiceUpdateRequest struct { - QosService *QosService - header map[string]string - query map[string]string - async *bool - qos *Qos +func (p *InstanceTypesService) Add() *InstanceTypesServiceAddRequest { + return &InstanceTypesServiceAddRequest{InstanceTypesService: p} } -func (p *QosServiceUpdateRequest) Header(key, value string) *QosServiceUpdateRequest { +// +// Lists all existing instance types in the system. +// The order of the returned list of instance types isn't guaranteed. +// +type InstanceTypesServiceListRequest struct { + InstanceTypesService *InstanceTypesService + header map[string]string + query map[string]string + caseSensitive *bool + follow *string + max *int64 + search *string +} + +func (p *InstanceTypesServiceListRequest) Header(key, value string) *InstanceTypesServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -43795,7 +46405,7 @@ func (p *QosServiceUpdateRequest) Header(key, value string) *QosServiceUpdateReq return p } -func (p *QosServiceUpdateRequest) Query(key, value string) *QosServiceUpdateRequest { +func (p *InstanceTypesServiceListRequest) Query(key, value string) *InstanceTypesServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -43803,21 +46413,43 @@ func (p *QosServiceUpdateRequest) Query(key, value string) *QosServiceUpdateRequ return p } -func (p *QosServiceUpdateRequest) Async(async bool) *QosServiceUpdateRequest { - p.async = &async +func (p *InstanceTypesServiceListRequest) CaseSensitive(caseSensitive bool) *InstanceTypesServiceListRequest { + p.caseSensitive = &caseSensitive return p } -func (p *QosServiceUpdateRequest) Qos(qos *Qos) *QosServiceUpdateRequest { - p.qos = qos +func (p *InstanceTypesServiceListRequest) Follow(follow string) *InstanceTypesServiceListRequest { + p.follow = &follow return p } -func (p *QosServiceUpdateRequest) Send() (*QosServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.QosService.connection.URL(), p.QosService.path) +func (p *InstanceTypesServiceListRequest) Max(max int64) *InstanceTypesServiceListRequest { + p.max = &max + return p +} + +func (p *InstanceTypesServiceListRequest) Search(search string) *InstanceTypesServiceListRequest { + p.search = &search + return p +} + +func (p *InstanceTypesServiceListRequest) Send() (*InstanceTypesServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.InstanceTypesService.connection.URL(), p.InstanceTypesService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} } if p.query != nil { @@ -43828,19 +46460,12 @@ func (p *QosServiceUpdateRequest) Send() (*QosServiceUpdateResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLQosWriteOne(writer, p.qos, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.QosService.connection.headers { + for hk, hv := range p.InstanceTypesService.connection.headers { req.Header.Add(hk, hv) } @@ -43855,18 +46480,18 @@ func (p *QosServiceUpdateRequest) Send() (*QosServiceUpdateResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.QosService.connection.authenticate() + token, err := p.InstanceTypesService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.QosService.connection.client.Do(req) + resp, err := p.InstanceTypesService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.QosService.connection.logFunc != nil { + if p.InstanceTypesService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -43875,7 +46500,7 @@ func (p *QosServiceUpdateRequest) Send() (*QosServiceUpdateResponse, error) { if err != nil { return nil, err } - p.QosService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.InstanceTypesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -43885,14 +46510,14 @@ func (p *QosServiceUpdateRequest) Send() (*QosServiceUpdateResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLQosReadOne(reader, nil, "") + result, err := XMLInstanceTypeReadMany(reader, nil) if err != nil { return nil, err } - return &QosServiceUpdateResponse{qos: result}, nil + return &InstanceTypesServiceListResponse{instanceType: result}, nil } -func (p *QosServiceUpdateRequest) MustSend() *QosServiceUpdateResponse { +func (p *InstanceTypesServiceListRequest) MustSend() *InstanceTypesServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -43901,117 +46526,82 @@ func (p *QosServiceUpdateRequest) MustSend() *QosServiceUpdateResponse { } // -// Update the specified QoS in the dataCenter. -// [source] -// ---- -// PUT /ovirt-engine/api/datacenters/123/qoss/123 -// ---- -// For example with curl: -// [source] -// ---- -// curl -u admin@internal:123456 -X PUT -H "content-type: application/xml" -d \ -// "32132110" \ -// https://engine/ovirt-engine/api/datacenters/123/qoss/123 -// ---- -// You will receive response like this: -// [source,xml] -// ---- -// -// 321 -// 321 -// 10 -// 1 -// storage -// -// -// ---- +// Lists all existing instance types in the system. +// The order of the returned list of instance types isn't guaranteed. // -type QosServiceUpdateResponse struct { - qos *Qos +type InstanceTypesServiceListResponse struct { + instanceType *InstanceTypeSlice } -func (p *QosServiceUpdateResponse) Qos() (*Qos, bool) { - if p.qos != nil { - return p.qos, true +func (p *InstanceTypesServiceListResponse) InstanceType() (*InstanceTypeSlice, bool) { + if p.instanceType != nil { + return p.instanceType, true } return nil, false } -func (p *QosServiceUpdateResponse) MustQos() *Qos { - if p.qos == nil { - panic("qos in response does not exist") +func (p *InstanceTypesServiceListResponse) MustInstanceType() *InstanceTypeSlice { + if p.instanceType == nil { + panic("instanceType in response does not exist") } - return p.qos + return p.instanceType } // -// Update the specified QoS in the dataCenter. -// [source] -// ---- -// PUT /ovirt-engine/api/datacenters/123/qoss/123 -// ---- -// For example with curl: -// [source] -// ---- -// curl -u admin@internal:123456 -X PUT -H "content-type: application/xml" -d \ -// "32132110" \ -// https://engine/ovirt-engine/api/datacenters/123/qoss/123 -// ---- -// You will receive response like this: -// [source,xml] -// ---- -// -// 321 -// 321 -// 10 -// 1 -// storage -// -// -// ---- +// Lists all existing instance types in the system. +// The order of the returned list of instance types isn't guaranteed. // -func (p *QosService) Update() *QosServiceUpdateRequest { - return &QosServiceUpdateRequest{QosService: p} +func (p *InstanceTypesService) List() *InstanceTypesServiceListRequest { + return &InstanceTypesServiceListRequest{InstanceTypesService: p} +} + +// +// +func (op *InstanceTypesService) InstanceTypeService(id string) *InstanceTypeService { + return NewInstanceTypeService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *QosService) Service(path string) (Service, error) { +func (op *InstanceTypesService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.InstanceTypeService(path), nil + } + return op.InstanceTypeService(path[:index]).Service(path[index+1:]) } -func (op *QosService) String() string { - return fmt.Sprintf("QosService:%s", op.path) +func (op *InstanceTypesService) String() string { + return fmt.Sprintf("InstanceTypesService:%s", op.path) } // // -type InstanceTypeNicService struct { +type IscsiBondService struct { BaseService } -func NewInstanceTypeNicService(connection *Connection, path string) *InstanceTypeNicService { - var result InstanceTypeNicService +func NewIscsiBondService(connection *Connection, path string) *IscsiBondService { + var result IscsiBondService result.connection = connection result.path = path return &result } // -// Gets network interface configuration of the instance type. // -type InstanceTypeNicServiceGetRequest struct { - InstanceTypeNicService *InstanceTypeNicService - header map[string]string - query map[string]string - follow *string +type IscsiBondServiceGetRequest struct { + IscsiBondService *IscsiBondService + header map[string]string + query map[string]string + follow *string } -func (p *InstanceTypeNicServiceGetRequest) Header(key, value string) *InstanceTypeNicServiceGetRequest { +func (p *IscsiBondServiceGetRequest) Header(key, value string) *IscsiBondServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44019,7 +46609,7 @@ func (p *InstanceTypeNicServiceGetRequest) Header(key, value string) *InstanceTy return p } -func (p *InstanceTypeNicServiceGetRequest) Query(key, value string) *InstanceTypeNicServiceGetRequest { +func (p *IscsiBondServiceGetRequest) Query(key, value string) *IscsiBondServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44027,13 +46617,13 @@ func (p *InstanceTypeNicServiceGetRequest) Query(key, value string) *InstanceTyp return p } -func (p *InstanceTypeNicServiceGetRequest) Follow(follow string) *InstanceTypeNicServiceGetRequest { +func (p *IscsiBondServiceGetRequest) Follow(follow string) *IscsiBondServiceGetRequest { p.follow = &follow return p } -func (p *InstanceTypeNicServiceGetRequest) Send() (*InstanceTypeNicServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.InstanceTypeNicService.connection.URL(), p.InstanceTypeNicService.path) +func (p *IscsiBondServiceGetRequest) Send() (*IscsiBondServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.IscsiBondService.connection.URL(), p.IscsiBondService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -44052,7 +46642,7 @@ func (p *InstanceTypeNicServiceGetRequest) Send() (*InstanceTypeNicServiceGetRes return nil, err } - for hk, hv := range p.InstanceTypeNicService.connection.headers { + for hk, hv := range p.IscsiBondService.connection.headers { req.Header.Add(hk, hv) } @@ -44067,18 +46657,18 @@ func (p *InstanceTypeNicServiceGetRequest) Send() (*InstanceTypeNicServiceGetRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.InstanceTypeNicService.connection.authenticate() + token, err := p.IscsiBondService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.InstanceTypeNicService.connection.client.Do(req) + resp, err := p.IscsiBondService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.InstanceTypeNicService.connection.logFunc != nil { + if p.IscsiBondService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44087,7 +46677,7 @@ func (p *InstanceTypeNicServiceGetRequest) Send() (*InstanceTypeNicServiceGetRes if err != nil { return nil, err } - p.InstanceTypeNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.IscsiBondService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -44097,14 +46687,14 @@ func (p *InstanceTypeNicServiceGetRequest) Send() (*InstanceTypeNicServiceGetRes return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadOne(reader, nil, "") + result, err := XMLIscsiBondReadOne(reader, nil, "") if err != nil { return nil, err } - return &InstanceTypeNicServiceGetResponse{nic: result}, nil + return &IscsiBondServiceGetResponse{bond: result}, nil } -func (p *InstanceTypeNicServiceGetRequest) MustSend() *InstanceTypeNicServiceGetResponse { +func (p *IscsiBondServiceGetRequest) MustSend() *IscsiBondServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -44113,44 +46703,47 @@ func (p *InstanceTypeNicServiceGetRequest) MustSend() *InstanceTypeNicServiceGet } // -// Gets network interface configuration of the instance type. // -type InstanceTypeNicServiceGetResponse struct { - nic *Nic +type IscsiBondServiceGetResponse struct { + bond *IscsiBond } -func (p *InstanceTypeNicServiceGetResponse) Nic() (*Nic, bool) { - if p.nic != nil { - return p.nic, true +func (p *IscsiBondServiceGetResponse) Bond() (*IscsiBond, bool) { + if p.bond != nil { + return p.bond, true } return nil, false } -func (p *InstanceTypeNicServiceGetResponse) MustNic() *Nic { - if p.nic == nil { - panic("nic in response does not exist") +func (p *IscsiBondServiceGetResponse) MustBond() *IscsiBond { + if p.bond == nil { + panic("bond in response does not exist") } - return p.nic + return p.bond } // -// Gets network interface configuration of the instance type. // -func (p *InstanceTypeNicService) Get() *InstanceTypeNicServiceGetRequest { - return &InstanceTypeNicServiceGetRequest{InstanceTypeNicService: p} +func (p *IscsiBondService) Get() *IscsiBondServiceGetRequest { + return &IscsiBondServiceGetRequest{IscsiBondService: p} } // -// Remove the network interface from the instance type. -// -type InstanceTypeNicServiceRemoveRequest struct { - InstanceTypeNicService *InstanceTypeNicService - header map[string]string - query map[string]string - async *bool +// Removes of an existing iSCSI bond. +// For example, to remove the iSCSI bond `456` send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/iscsibonds/456 +// ---- +// +type IscsiBondServiceRemoveRequest struct { + IscsiBondService *IscsiBondService + header map[string]string + query map[string]string + async *bool } -func (p *InstanceTypeNicServiceRemoveRequest) Header(key, value string) *InstanceTypeNicServiceRemoveRequest { +func (p *IscsiBondServiceRemoveRequest) Header(key, value string) *IscsiBondServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44158,7 +46751,7 @@ func (p *InstanceTypeNicServiceRemoveRequest) Header(key, value string) *Instanc return p } -func (p *InstanceTypeNicServiceRemoveRequest) Query(key, value string) *InstanceTypeNicServiceRemoveRequest { +func (p *IscsiBondServiceRemoveRequest) Query(key, value string) *IscsiBondServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44166,13 +46759,13 @@ func (p *InstanceTypeNicServiceRemoveRequest) Query(key, value string) *Instance return p } -func (p *InstanceTypeNicServiceRemoveRequest) Async(async bool) *InstanceTypeNicServiceRemoveRequest { +func (p *IscsiBondServiceRemoveRequest) Async(async bool) *IscsiBondServiceRemoveRequest { p.async = &async return p } -func (p *InstanceTypeNicServiceRemoveRequest) Send() (*InstanceTypeNicServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.InstanceTypeNicService.connection.URL(), p.InstanceTypeNicService.path) +func (p *IscsiBondServiceRemoveRequest) Send() (*IscsiBondServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.IscsiBondService.connection.URL(), p.IscsiBondService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -44191,7 +46784,7 @@ func (p *InstanceTypeNicServiceRemoveRequest) Send() (*InstanceTypeNicServiceRem return nil, err } - for hk, hv := range p.InstanceTypeNicService.connection.headers { + for hk, hv := range p.IscsiBondService.connection.headers { req.Header.Add(hk, hv) } @@ -44206,18 +46799,18 @@ func (p *InstanceTypeNicServiceRemoveRequest) Send() (*InstanceTypeNicServiceRem req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.InstanceTypeNicService.connection.authenticate() + token, err := p.IscsiBondService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.InstanceTypeNicService.connection.client.Do(req) + resp, err := p.IscsiBondService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.InstanceTypeNicService.connection.logFunc != nil { + if p.IscsiBondService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44226,7 +46819,7 @@ func (p *InstanceTypeNicServiceRemoveRequest) Send() (*InstanceTypeNicServiceRem if err != nil { return nil, err } - p.InstanceTypeNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.IscsiBondService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -44235,10 +46828,10 @@ func (p *InstanceTypeNicServiceRemoveRequest) Send() (*InstanceTypeNicServiceRem if errReadBody != nil { return nil, errReadBody } - return new(InstanceTypeNicServiceRemoveResponse), nil + return new(IscsiBondServiceRemoveResponse), nil } -func (p *InstanceTypeNicServiceRemoveRequest) MustSend() *InstanceTypeNicServiceRemoveResponse { +func (p *IscsiBondServiceRemoveRequest) MustSend() *IscsiBondServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -44247,30 +46840,54 @@ func (p *InstanceTypeNicServiceRemoveRequest) MustSend() *InstanceTypeNicService } // -// Remove the network interface from the instance type. +// Removes of an existing iSCSI bond. +// For example, to remove the iSCSI bond `456` send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/iscsibonds/456 +// ---- // -type InstanceTypeNicServiceRemoveResponse struct { +type IscsiBondServiceRemoveResponse struct { } // -// Remove the network interface from the instance type. +// Removes of an existing iSCSI bond. +// For example, to remove the iSCSI bond `456` send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/iscsibonds/456 +// ---- // -func (p *InstanceTypeNicService) Remove() *InstanceTypeNicServiceRemoveRequest { - return &InstanceTypeNicServiceRemoveRequest{InstanceTypeNicService: p} +func (p *IscsiBondService) Remove() *IscsiBondServiceRemoveRequest { + return &IscsiBondServiceRemoveRequest{IscsiBondService: p} } // -// Updates the network interface configuration of the instance type. +// Updates an iSCSI bond. +// Updating of an iSCSI bond can be done on the `name` and the `description` attributes only. For example, to +// update the iSCSI bond `456` of data center `123`, send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123/iscsibonds/1234 +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// mybond +// My iSCSI bond +// +// ---- // -type InstanceTypeNicServiceUpdateRequest struct { - InstanceTypeNicService *InstanceTypeNicService - header map[string]string - query map[string]string - async *bool - nic *Nic +type IscsiBondServiceUpdateRequest struct { + IscsiBondService *IscsiBondService + header map[string]string + query map[string]string + async *bool + bond *IscsiBond } -func (p *InstanceTypeNicServiceUpdateRequest) Header(key, value string) *InstanceTypeNicServiceUpdateRequest { +func (p *IscsiBondServiceUpdateRequest) Header(key, value string) *IscsiBondServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44278,7 +46895,7 @@ func (p *InstanceTypeNicServiceUpdateRequest) Header(key, value string) *Instanc return p } -func (p *InstanceTypeNicServiceUpdateRequest) Query(key, value string) *InstanceTypeNicServiceUpdateRequest { +func (p *IscsiBondServiceUpdateRequest) Query(key, value string) *IscsiBondServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44286,18 +46903,18 @@ func (p *InstanceTypeNicServiceUpdateRequest) Query(key, value string) *Instance return p } -func (p *InstanceTypeNicServiceUpdateRequest) Async(async bool) *InstanceTypeNicServiceUpdateRequest { +func (p *IscsiBondServiceUpdateRequest) Async(async bool) *IscsiBondServiceUpdateRequest { p.async = &async return p } -func (p *InstanceTypeNicServiceUpdateRequest) Nic(nic *Nic) *InstanceTypeNicServiceUpdateRequest { - p.nic = nic +func (p *IscsiBondServiceUpdateRequest) Bond(bond *IscsiBond) *IscsiBondServiceUpdateRequest { + p.bond = bond return p } -func (p *InstanceTypeNicServiceUpdateRequest) Send() (*InstanceTypeNicServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.InstanceTypeNicService.connection.URL(), p.InstanceTypeNicService.path) +func (p *IscsiBondServiceUpdateRequest) Send() (*IscsiBondServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.IscsiBondService.connection.URL(), p.IscsiBondService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -44313,7 +46930,7 @@ func (p *InstanceTypeNicServiceUpdateRequest) Send() (*InstanceTypeNicServiceUpd } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLNicWriteOne(writer, p.nic, "") + err := XMLIscsiBondWriteOne(writer, p.bond, "") if err != nil { return nil, err } @@ -44323,7 +46940,7 @@ func (p *InstanceTypeNicServiceUpdateRequest) Send() (*InstanceTypeNicServiceUpd return nil, err } - for hk, hv := range p.InstanceTypeNicService.connection.headers { + for hk, hv := range p.IscsiBondService.connection.headers { req.Header.Add(hk, hv) } @@ -44338,18 +46955,18 @@ func (p *InstanceTypeNicServiceUpdateRequest) Send() (*InstanceTypeNicServiceUpd req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.InstanceTypeNicService.connection.authenticate() + token, err := p.IscsiBondService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.InstanceTypeNicService.connection.client.Do(req) + resp, err := p.IscsiBondService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.InstanceTypeNicService.connection.logFunc != nil { + if p.IscsiBondService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44358,7 +46975,7 @@ func (p *InstanceTypeNicServiceUpdateRequest) Send() (*InstanceTypeNicServiceUpd if err != nil { return nil, err } - p.InstanceTypeNicService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.IscsiBondService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -44368,14 +46985,14 @@ func (p *InstanceTypeNicServiceUpdateRequest) Send() (*InstanceTypeNicServiceUpd return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNicReadOne(reader, nil, "") + result, err := XMLIscsiBondReadOne(reader, nil, "") if err != nil { return nil, err } - return &InstanceTypeNicServiceUpdateResponse{nic: result}, nil + return &IscsiBondServiceUpdateResponse{bond: result}, nil } -func (p *InstanceTypeNicServiceUpdateRequest) MustSend() *InstanceTypeNicServiceUpdateResponse { +func (p *IscsiBondServiceUpdateRequest) MustSend() *IscsiBondServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -44384,73 +47001,143 @@ func (p *InstanceTypeNicServiceUpdateRequest) MustSend() *InstanceTypeNicService } // -// Updates the network interface configuration of the instance type. +// Updates an iSCSI bond. +// Updating of an iSCSI bond can be done on the `name` and the `description` attributes only. For example, to +// update the iSCSI bond `456` of data center `123`, send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123/iscsibonds/1234 +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// mybond +// My iSCSI bond +// +// ---- // -type InstanceTypeNicServiceUpdateResponse struct { - nic *Nic +type IscsiBondServiceUpdateResponse struct { + bond *IscsiBond } -func (p *InstanceTypeNicServiceUpdateResponse) Nic() (*Nic, bool) { - if p.nic != nil { - return p.nic, true +func (p *IscsiBondServiceUpdateResponse) Bond() (*IscsiBond, bool) { + if p.bond != nil { + return p.bond, true } return nil, false } -func (p *InstanceTypeNicServiceUpdateResponse) MustNic() *Nic { - if p.nic == nil { - panic("nic in response does not exist") +func (p *IscsiBondServiceUpdateResponse) MustBond() *IscsiBond { + if p.bond == nil { + panic("bond in response does not exist") } - return p.nic + return p.bond } // -// Updates the network interface configuration of the instance type. +// Updates an iSCSI bond. +// Updating of an iSCSI bond can be done on the `name` and the `description` attributes only. For example, to +// update the iSCSI bond `456` of data center `123`, send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123/iscsibonds/1234 +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// mybond +// My iSCSI bond +// +// ---- // -func (p *InstanceTypeNicService) Update() *InstanceTypeNicServiceUpdateRequest { - return &InstanceTypeNicServiceUpdateRequest{InstanceTypeNicService: p} +func (p *IscsiBondService) Update() *IscsiBondServiceUpdateRequest { + return &IscsiBondServiceUpdateRequest{IscsiBondService: p} +} + +// +// +func (op *IscsiBondService) NetworksService() *NetworksService { + return NewNetworksService(op.connection, fmt.Sprintf("%s/networks", op.path)) +} + +// +// +func (op *IscsiBondService) StorageServerConnectionsService() *StorageServerConnectionsService { + return NewStorageServerConnectionsService(op.connection, fmt.Sprintf("%s/storageserverconnections", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *InstanceTypeNicService) Service(path string) (Service, error) { +func (op *IscsiBondService) Service(path string) (Service, error) { if path == "" { return op, nil } + if path == "networks" { + return op.NetworksService(), nil + } + if strings.HasPrefix(path, "networks/") { + return op.NetworksService().Service(path[9:]) + } + if path == "storageserverconnections" { + return op.StorageServerConnectionsService(), nil + } + if strings.HasPrefix(path, "storageserverconnections/") { + return op.StorageServerConnectionsService().Service(path[25:]) + } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *InstanceTypeNicService) String() string { - return fmt.Sprintf("InstanceTypeNicService:%s", op.path) +func (op *IscsiBondService) String() string { + return fmt.Sprintf("IscsiBondService:%s", op.path) } // // -type UnmanagedNetworksService struct { +type IscsiBondsService struct { BaseService } -func NewUnmanagedNetworksService(connection *Connection, path string) *UnmanagedNetworksService { - var result UnmanagedNetworksService +func NewIscsiBondsService(connection *Connection, path string) *IscsiBondsService { + var result IscsiBondsService result.connection = connection result.path = path return &result } // -// Returns the list of unmanaged networks of the host. -// The order of the returned list of networks isn't guaranteed. +// Create a new iSCSI bond on a data center. +// For example, to create a new iSCSI bond on data center `123` using storage connections `456` and `789`, send a +// request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/iscsibonds +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// mybond +// +// +// +// +// +// +// +// +// ---- // -type UnmanagedNetworksServiceListRequest struct { - UnmanagedNetworksService *UnmanagedNetworksService - header map[string]string - query map[string]string - follow *string - max *int64 +type IscsiBondsServiceAddRequest struct { + IscsiBondsService *IscsiBondsService + header map[string]string + query map[string]string + bond *IscsiBond } -func (p *UnmanagedNetworksServiceListRequest) Header(key, value string) *UnmanagedNetworksServiceListRequest { +func (p *IscsiBondsServiceAddRequest) Header(key, value string) *IscsiBondsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44458,7 +47145,7 @@ func (p *UnmanagedNetworksServiceListRequest) Header(key, value string) *Unmanag return p } -func (p *UnmanagedNetworksServiceListRequest) Query(key, value string) *UnmanagedNetworksServiceListRequest { +func (p *IscsiBondsServiceAddRequest) Query(key, value string) *IscsiBondsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44466,27 +47153,14 @@ func (p *UnmanagedNetworksServiceListRequest) Query(key, value string) *Unmanage return p } -func (p *UnmanagedNetworksServiceListRequest) Follow(follow string) *UnmanagedNetworksServiceListRequest { - p.follow = &follow - return p -} - -func (p *UnmanagedNetworksServiceListRequest) Max(max int64) *UnmanagedNetworksServiceListRequest { - p.max = &max +func (p *IscsiBondsServiceAddRequest) Bond(bond *IscsiBond) *IscsiBondsServiceAddRequest { + p.bond = bond return p } -func (p *UnmanagedNetworksServiceListRequest) Send() (*UnmanagedNetworksServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.UnmanagedNetworksService.connection.URL(), p.UnmanagedNetworksService.path) +func (p *IscsiBondsServiceAddRequest) Send() (*IscsiBondsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.IscsiBondsService.connection.URL(), p.IscsiBondsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -44495,12 +47169,19 @@ func (p *UnmanagedNetworksServiceListRequest) Send() (*UnmanagedNetworksServiceL if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLIscsiBondWriteOne(writer, p.bond, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.UnmanagedNetworksService.connection.headers { + for hk, hv := range p.IscsiBondsService.connection.headers { req.Header.Add(hk, hv) } @@ -44515,18 +47196,18 @@ func (p *UnmanagedNetworksServiceListRequest) Send() (*UnmanagedNetworksServiceL req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.UnmanagedNetworksService.connection.authenticate() + token, err := p.IscsiBondsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.UnmanagedNetworksService.connection.client.Do(req) + resp, err := p.IscsiBondsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.UnmanagedNetworksService.connection.logFunc != nil { + if p.IscsiBondsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44535,9 +47216,9 @@ func (p *UnmanagedNetworksServiceListRequest) Send() (*UnmanagedNetworksServiceL if err != nil { return nil, err } - p.UnmanagedNetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.IscsiBondsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -44545,14 +47226,14 @@ func (p *UnmanagedNetworksServiceListRequest) Send() (*UnmanagedNetworksServiceL return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLUnmanagedNetworkReadMany(reader, nil) + result, err := XMLIscsiBondReadOne(reader, nil, "") if err != nil { return nil, err } - return &UnmanagedNetworksServiceListResponse{networks: result}, nil + return &IscsiBondsServiceAddResponse{bond: result}, nil } -func (p *UnmanagedNetworksServiceListRequest) MustSend() *UnmanagedNetworksServiceListResponse { +func (p *IscsiBondsServiceAddRequest) MustSend() *IscsiBondsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -44561,82 +47242,86 @@ func (p *UnmanagedNetworksServiceListRequest) MustSend() *UnmanagedNetworksServi } // -// Returns the list of unmanaged networks of the host. -// The order of the returned list of networks isn't guaranteed. +// Create a new iSCSI bond on a data center. +// For example, to create a new iSCSI bond on data center `123` using storage connections `456` and `789`, send a +// request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/iscsibonds +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// mybond +// +// +// +// +// +// +// +// +// ---- // -type UnmanagedNetworksServiceListResponse struct { - networks *UnmanagedNetworkSlice +type IscsiBondsServiceAddResponse struct { + bond *IscsiBond } -func (p *UnmanagedNetworksServiceListResponse) Networks() (*UnmanagedNetworkSlice, bool) { - if p.networks != nil { - return p.networks, true +func (p *IscsiBondsServiceAddResponse) Bond() (*IscsiBond, bool) { + if p.bond != nil { + return p.bond, true } return nil, false } -func (p *UnmanagedNetworksServiceListResponse) MustNetworks() *UnmanagedNetworkSlice { - if p.networks == nil { - panic("networks in response does not exist") - } - return p.networks -} - -// -// Returns the list of unmanaged networks of the host. -// The order of the returned list of networks isn't guaranteed. -// -func (p *UnmanagedNetworksService) List() *UnmanagedNetworksServiceListRequest { - return &UnmanagedNetworksServiceListRequest{UnmanagedNetworksService: p} -} - -// -// -func (op *UnmanagedNetworksService) UnmanagedNetworkService(id string) *UnmanagedNetworkService { - return NewUnmanagedNetworkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *UnmanagedNetworksService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.UnmanagedNetworkService(path), nil +func (p *IscsiBondsServiceAddResponse) MustBond() *IscsiBond { + if p.bond == nil { + panic("bond in response does not exist") } - return op.UnmanagedNetworkService(path[:index]).Service(path[index+1:]) -} - -func (op *UnmanagedNetworksService) String() string { - return fmt.Sprintf("UnmanagedNetworksService:%s", op.path) + return p.bond } // +// Create a new iSCSI bond on a data center. +// For example, to create a new iSCSI bond on data center `123` using storage connections `456` and `789`, send a +// request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/iscsibonds +// ---- +// The request body should look like this: +// [source,xml] +// ---- +// +// mybond +// +// +// +// +// +// +// +// +// ---- // -type VmDiskService struct { - BaseService -} - -func NewVmDiskService(connection *Connection, path string) *VmDiskService { - var result VmDiskService - result.connection = connection - result.path = path - return &result +func (p *IscsiBondsService) Add() *IscsiBondsServiceAddRequest { + return &IscsiBondsServiceAddRequest{IscsiBondsService: p} } // +// Returns the list of iSCSI bonds configured in the data center. +// The order of the returned list of iSCSI bonds isn't guaranteed. // -type VmDiskServiceActivateRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - async *bool +type IscsiBondsServiceListRequest struct { + IscsiBondsService *IscsiBondsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *VmDiskServiceActivateRequest) Header(key, value string) *VmDiskServiceActivateRequest { +func (p *IscsiBondsServiceListRequest) Header(key, value string) *IscsiBondsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44644,7 +47329,7 @@ func (p *VmDiskServiceActivateRequest) Header(key, value string) *VmDiskServiceA return p } -func (p *VmDiskServiceActivateRequest) Query(key, value string) *VmDiskServiceActivateRequest { +func (p *IscsiBondsServiceListRequest) Query(key, value string) *IscsiBondsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44652,22 +47337,27 @@ func (p *VmDiskServiceActivateRequest) Query(key, value string) *VmDiskServiceAc return p } -func (p *VmDiskServiceActivateRequest) Async(async bool) *VmDiskServiceActivateRequest { - p.async = &async +func (p *IscsiBondsServiceListRequest) Follow(follow string) *IscsiBondsServiceListRequest { + p.follow = &follow return p } -func (p *VmDiskServiceActivateRequest) Send() (*VmDiskServiceActivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/activate", p.VmDiskService.connection.URL(), p.VmDiskService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *IscsiBondsServiceListRequest) Max(max int64) *IscsiBondsServiceListRequest { + p.max = &max + return p +} + +func (p *IscsiBondsServiceListRequest) Send() (*IscsiBondsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.IscsiBondsService.connection.URL(), p.IscsiBondsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -44676,16 +47366,12 @@ func (p *VmDiskServiceActivateRequest) Send() (*VmDiskServiceActivateResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.VmDiskService.connection.headers { + for hk, hv := range p.IscsiBondsService.connection.headers { req.Header.Add(hk, hv) } @@ -44700,18 +47386,18 @@ func (p *VmDiskServiceActivateRequest) Send() (*VmDiskServiceActivateResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() + token, err := p.IscsiBondsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) + resp, err := p.IscsiBondsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { + if p.IscsiBondsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44720,44 +47406,120 @@ func (p *VmDiskServiceActivateRequest) Send() (*VmDiskServiceActivateResponse, e if err != nil { return nil, err } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.IscsiBondsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + } + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLIscsiBondReadMany(reader, nil) + if err != nil { + return nil, err + } + return &IscsiBondsServiceListResponse{bonds: result}, nil +} + +func (p *IscsiBondsServiceListRequest) MustSend() *IscsiBondsServiceListResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// Returns the list of iSCSI bonds configured in the data center. +// The order of the returned list of iSCSI bonds isn't guaranteed. +// +type IscsiBondsServiceListResponse struct { + bonds *IscsiBondSlice +} + +func (p *IscsiBondsServiceListResponse) Bonds() (*IscsiBondSlice, bool) { + if p.bonds != nil { + return p.bonds, true + } + return nil, false +} + +func (p *IscsiBondsServiceListResponse) MustBonds() *IscsiBondSlice { + if p.bonds == nil { + panic("bonds in response does not exist") + } + return p.bonds +} + +// +// Returns the list of iSCSI bonds configured in the data center. +// The order of the returned list of iSCSI bonds isn't guaranteed. +// +func (p *IscsiBondsService) List() *IscsiBondsServiceListRequest { + return &IscsiBondsServiceListRequest{IscsiBondsService: p} +} + +// +// +func (op *IscsiBondsService) IscsiBondService(id string) *IscsiBondService { + return NewIscsiBondService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *IscsiBondsService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + index := strings.Index(path, "/") + if index == -1 { + return op.IscsiBondService(path), nil } - return new(VmDiskServiceActivateResponse), nil + return op.IscsiBondService(path[:index]).Service(path[index+1:]) } -func (p *VmDiskServiceActivateRequest) MustSend() *VmDiskServiceActivateResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v - } +func (op *IscsiBondsService) String() string { + return fmt.Sprintf("IscsiBondsService:%s", op.path) } // +// A service to manage a job. // -type VmDiskServiceActivateResponse struct { +type JobService struct { + BaseService } -// -// -func (p *VmDiskService) Activate() *VmDiskServiceActivateRequest { - return &VmDiskServiceActivateRequest{VmDiskService: p} +func NewJobService(connection *Connection, path string) *JobService { + var result JobService + result.connection = connection + result.path = path + return &result } // +// Set an external job execution to be cleared by the system. +// For example, to set a job with identifier `123` send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs/clear +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// ---- // -type VmDiskServiceDeactivateRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - async *bool +type JobServiceClearRequest struct { + JobService *JobService + header map[string]string + query map[string]string + async *bool } -func (p *VmDiskServiceDeactivateRequest) Header(key, value string) *VmDiskServiceDeactivateRequest { +func (p *JobServiceClearRequest) Header(key, value string) *JobServiceClearRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44765,7 +47527,7 @@ func (p *VmDiskServiceDeactivateRequest) Header(key, value string) *VmDiskServic return p } -func (p *VmDiskServiceDeactivateRequest) Query(key, value string) *VmDiskServiceDeactivateRequest { +func (p *JobServiceClearRequest) Query(key, value string) *JobServiceClearRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44773,13 +47535,13 @@ func (p *VmDiskServiceDeactivateRequest) Query(key, value string) *VmDiskService return p } -func (p *VmDiskServiceDeactivateRequest) Async(async bool) *VmDiskServiceDeactivateRequest { +func (p *JobServiceClearRequest) Async(async bool) *JobServiceClearRequest { p.async = &async return p } -func (p *VmDiskServiceDeactivateRequest) Send() (*VmDiskServiceDeactivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/deactivate", p.VmDiskService.connection.URL(), p.VmDiskService.path) +func (p *JobServiceClearRequest) Send() (*JobServiceClearResponse, error) { + rawURL := fmt.Sprintf("%s%s/clear", p.JobService.connection.URL(), p.JobService.path) actionBuilder := NewActionBuilder() if p.async != nil { actionBuilder.Async(*p.async) @@ -44806,7 +47568,7 @@ func (p *VmDiskServiceDeactivateRequest) Send() (*VmDiskServiceDeactivateRespons return nil, err } - for hk, hv := range p.VmDiskService.connection.headers { + for hk, hv := range p.JobService.connection.headers { req.Header.Add(hk, hv) } @@ -44821,18 +47583,18 @@ func (p *VmDiskServiceDeactivateRequest) Send() (*VmDiskServiceDeactivateRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() + token, err := p.JobService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) + resp, err := p.JobService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { + if p.JobService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44841,16 +47603,16 @@ func (p *VmDiskServiceDeactivateRequest) Send() (*VmDiskServiceDeactivateRespons if err != nil { return nil, err } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.JobService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(VmDiskServiceDeactivateResponse), nil + return new(JobServiceClearResponse), nil } -func (p *VmDiskServiceDeactivateRequest) MustSend() *VmDiskServiceDeactivateResponse { +func (p *JobServiceClearRequest) MustSend() *JobServiceClearResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -44859,27 +47621,64 @@ func (p *VmDiskServiceDeactivateRequest) MustSend() *VmDiskServiceDeactivateResp } // +// Set an external job execution to be cleared by the system. +// For example, to set a job with identifier `123` send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs/clear +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// ---- // -type VmDiskServiceDeactivateResponse struct { +type JobServiceClearResponse struct { } // +// Set an external job execution to be cleared by the system. +// For example, to set a job with identifier `123` send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs/clear +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// ---- // -func (p *VmDiskService) Deactivate() *VmDiskServiceDeactivateRequest { - return &VmDiskServiceDeactivateRequest{VmDiskService: p} +func (p *JobService) Clear() *JobServiceClearRequest { + return &JobServiceClearRequest{JobService: p} } // +// Marks an external job execution as ended. +// For example, to terminate a job with identifier `123` send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs/end +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// true +// finished +// +// ---- // -type VmDiskServiceExportRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - async *bool - filter *bool +type JobServiceEndRequest struct { + JobService *JobService + header map[string]string + query map[string]string + async *bool + force *bool + succeeded *bool } -func (p *VmDiskServiceExportRequest) Header(key, value string) *VmDiskServiceExportRequest { +func (p *JobServiceEndRequest) Header(key, value string) *JobServiceEndRequest { if p.header == nil { p.header = make(map[string]string) } @@ -44887,7 +47686,7 @@ func (p *VmDiskServiceExportRequest) Header(key, value string) *VmDiskServiceExp return p } -func (p *VmDiskServiceExportRequest) Query(key, value string) *VmDiskServiceExportRequest { +func (p *JobServiceEndRequest) Query(key, value string) *JobServiceEndRequest { if p.query == nil { p.query = make(map[string]string) } @@ -44895,24 +47694,32 @@ func (p *VmDiskServiceExportRequest) Query(key, value string) *VmDiskServiceExpo return p } -func (p *VmDiskServiceExportRequest) Async(async bool) *VmDiskServiceExportRequest { +func (p *JobServiceEndRequest) Async(async bool) *JobServiceEndRequest { p.async = &async return p } -func (p *VmDiskServiceExportRequest) Filter(filter bool) *VmDiskServiceExportRequest { - p.filter = &filter +func (p *JobServiceEndRequest) Force(force bool) *JobServiceEndRequest { + p.force = &force return p } -func (p *VmDiskServiceExportRequest) Send() (*VmDiskServiceExportResponse, error) { - rawURL := fmt.Sprintf("%s%s/export", p.VmDiskService.connection.URL(), p.VmDiskService.path) +func (p *JobServiceEndRequest) Succeeded(succeeded bool) *JobServiceEndRequest { + p.succeeded = &succeeded + return p +} + +func (p *JobServiceEndRequest) Send() (*JobServiceEndResponse, error) { + rawURL := fmt.Sprintf("%s%s/end", p.JobService.connection.URL(), p.JobService.path) actionBuilder := NewActionBuilder() if p.async != nil { actionBuilder.Async(*p.async) } - if p.filter != nil { - actionBuilder.Filter(*p.filter) + if p.force != nil { + actionBuilder.Force(*p.force) + } + if p.succeeded != nil { + actionBuilder.Succeeded(*p.succeeded) } action, err := actionBuilder.Build() if err != nil { @@ -44936,7 +47743,7 @@ func (p *VmDiskServiceExportRequest) Send() (*VmDiskServiceExportResponse, error return nil, err } - for hk, hv := range p.VmDiskService.connection.headers { + for hk, hv := range p.JobService.connection.headers { req.Header.Add(hk, hv) } @@ -44951,18 +47758,18 @@ func (p *VmDiskServiceExportRequest) Send() (*VmDiskServiceExportResponse, error req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() + token, err := p.JobService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) + resp, err := p.JobService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { + if p.JobService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -44971,16 +47778,16 @@ func (p *VmDiskServiceExportRequest) Send() (*VmDiskServiceExportResponse, error if err != nil { return nil, err } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.JobService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(VmDiskServiceExportResponse), nil + return new(JobServiceEndResponse), nil } -func (p *VmDiskServiceExportRequest) MustSend() *VmDiskServiceExportResponse { +func (p *JobServiceEndRequest) MustSend() *JobServiceEndResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -44989,26 +47796,78 @@ func (p *VmDiskServiceExportRequest) MustSend() *VmDiskServiceExportResponse { } // +// Marks an external job execution as ended. +// For example, to terminate a job with identifier `123` send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs/end +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// true +// finished +// +// ---- // -type VmDiskServiceExportResponse struct { +type JobServiceEndResponse struct { } // +// Marks an external job execution as ended. +// For example, to terminate a job with identifier `123` send the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs/end +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// true +// finished +// +// ---- // -func (p *VmDiskService) Export() *VmDiskServiceExportRequest { - return &VmDiskServiceExportRequest{VmDiskService: p} +func (p *JobService) End() *JobServiceEndRequest { + return &JobServiceEndRequest{JobService: p} } // +// Retrieves a job. +// [source] +// ---- +// GET /ovirt-engine/api/jobs/123 +// ---- +// You will receive response in XML like this one: +// [source,xml] +// ---- +// +// +// +// +// +// Adding Disk +// +// true +// 2016-12-12T23:07:29.758+02:00 +// false +// 2016-12-12T23:07:29.758+02:00 +// 2016-12-12T23:07:26.593+02:00 +// failed +// +// +// ---- // -type VmDiskServiceGetRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - follow *string +type JobServiceGetRequest struct { + JobService *JobService + header map[string]string + query map[string]string + follow *string } -func (p *VmDiskServiceGetRequest) Header(key, value string) *VmDiskServiceGetRequest { +func (p *JobServiceGetRequest) Header(key, value string) *JobServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -45016,7 +47875,7 @@ func (p *VmDiskServiceGetRequest) Header(key, value string) *VmDiskServiceGetReq return p } -func (p *VmDiskServiceGetRequest) Query(key, value string) *VmDiskServiceGetRequest { +func (p *JobServiceGetRequest) Query(key, value string) *JobServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -45024,13 +47883,13 @@ func (p *VmDiskServiceGetRequest) Query(key, value string) *VmDiskServiceGetRequ return p } -func (p *VmDiskServiceGetRequest) Follow(follow string) *VmDiskServiceGetRequest { +func (p *JobServiceGetRequest) Follow(follow string) *JobServiceGetRequest { p.follow = &follow return p } -func (p *VmDiskServiceGetRequest) Send() (*VmDiskServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmDiskService.connection.URL(), p.VmDiskService.path) +func (p *JobServiceGetRequest) Send() (*JobServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.JobService.connection.URL(), p.JobService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -45049,7 +47908,7 @@ func (p *VmDiskServiceGetRequest) Send() (*VmDiskServiceGetResponse, error) { return nil, err } - for hk, hv := range p.VmDiskService.connection.headers { + for hk, hv := range p.JobService.connection.headers { req.Header.Add(hk, hv) } @@ -45064,18 +47923,18 @@ func (p *VmDiskServiceGetRequest) Send() (*VmDiskServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() + token, err := p.JobService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) + resp, err := p.JobService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { + if p.JobService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -45084,7 +47943,7 @@ func (p *VmDiskServiceGetRequest) Send() (*VmDiskServiceGetResponse, error) { if err != nil { return nil, err } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.JobService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -45094,14 +47953,14 @@ func (p *VmDiskServiceGetRequest) Send() (*VmDiskServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") + result, err := XMLJobReadOne(reader, nil, "") if err != nil { return nil, err } - return &VmDiskServiceGetResponse{disk: result}, nil + return &JobServiceGetResponse{job: result}, nil } -func (p *VmDiskServiceGetRequest) MustSend() *VmDiskServiceGetResponse { +func (p *JobServiceGetRequest) MustSend() *JobServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -45110,308 +47969,163 @@ func (p *VmDiskServiceGetRequest) MustSend() *VmDiskServiceGetResponse { } // +// Retrieves a job. +// [source] +// ---- +// GET /ovirt-engine/api/jobs/123 +// ---- +// You will receive response in XML like this one: +// [source,xml] +// ---- +// +// +// +// +// +// Adding Disk +// +// true +// 2016-12-12T23:07:29.758+02:00 +// false +// 2016-12-12T23:07:29.758+02:00 +// 2016-12-12T23:07:26.593+02:00 +// failed +// +// +// ---- // -type VmDiskServiceGetResponse struct { - disk *Disk +type JobServiceGetResponse struct { + job *Job } -func (p *VmDiskServiceGetResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true +func (p *JobServiceGetResponse) Job() (*Job, bool) { + if p.job != nil { + return p.job, true } return nil, false } -func (p *VmDiskServiceGetResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") - } - return p.disk -} - -// -// -func (p *VmDiskService) Get() *VmDiskServiceGetRequest { - return &VmDiskServiceGetRequest{VmDiskService: p} -} - -// -// -type VmDiskServiceMoveRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - async *bool - filter *bool -} - -func (p *VmDiskServiceMoveRequest) Header(key, value string) *VmDiskServiceMoveRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *VmDiskServiceMoveRequest) Query(key, value string) *VmDiskServiceMoveRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *VmDiskServiceMoveRequest) Async(async bool) *VmDiskServiceMoveRequest { - p.async = &async - return p -} - -func (p *VmDiskServiceMoveRequest) Filter(filter bool) *VmDiskServiceMoveRequest { - p.filter = &filter - return p -} - -func (p *VmDiskServiceMoveRequest) Send() (*VmDiskServiceMoveResponse, error) { - rawURL := fmt.Sprintf("%s%s/move", p.VmDiskService.connection.URL(), p.VmDiskService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.filter != nil { - actionBuilder.Filter(*p.filter) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) - if err != nil { - return nil, err - } - - for hk, hv := range p.VmDiskService.connection.headers { - req.Header.Add(hk, hv) - } - - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } - - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) - } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction - } - return new(VmDiskServiceMoveResponse), nil -} - -func (p *VmDiskServiceMoveRequest) MustSend() *VmDiskServiceMoveResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v - } -} - -// -// -type VmDiskServiceMoveResponse struct { -} - -// -// -func (p *VmDiskService) Move() *VmDiskServiceMoveRequest { - return &VmDiskServiceMoveRequest{VmDiskService: p} -} - -// -// Reduces the size of the disk image. -// Invokes _reduce_ on the logical volume (i.e. this is only applicable for block storage domains). -// This is applicable for floating disks and disks attached to non-running virtual machines. -// There is no need to specify the size as the optimal size is calculated automatically. -// -type VmDiskServiceReduceRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - async *bool -} - -func (p *VmDiskServiceReduceRequest) Header(key, value string) *VmDiskServiceReduceRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *VmDiskServiceReduceRequest) Query(key, value string) *VmDiskServiceReduceRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *VmDiskServiceReduceRequest) Async(async bool) *VmDiskServiceReduceRequest { - p.async = &async - return p -} - -func (p *VmDiskServiceReduceRequest) Send() (*VmDiskServiceReduceResponse, error) { - rawURL := fmt.Sprintf("%s%s/reduce", p.VmDiskService.connection.URL(), p.VmDiskService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } - values := make(url.Values) - if p.query != nil { - for k, v := range p.query { - values[k] = []string{v} - } - } - if len(values) > 0 { - rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) - } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) - if err != nil { - return nil, err - } - - for hk, hv := range p.VmDiskService.connection.headers { - req.Header.Add(hk, hv) +func (p *JobServiceGetResponse) MustJob() *Job { + if p.job == nil { + panic("job in response does not exist") } + return p.job +} - if p.header != nil { - for hk, hv := range p.header { - req.Header.Add(hk, hv) - } - } +// +// Retrieves a job. +// [source] +// ---- +// GET /ovirt-engine/api/jobs/123 +// ---- +// You will receive response in XML like this one: +// [source,xml] +// ---- +// +// +// +// +// +// Adding Disk +// +// true +// 2016-12-12T23:07:29.758+02:00 +// false +// 2016-12-12T23:07:29.758+02:00 +// 2016-12-12T23:07:26.593+02:00 +// failed +// +// +// ---- +// +func (p *JobService) Get() *JobServiceGetRequest { + return &JobServiceGetRequest{JobService: p} +} - req.Header.Add("User-Agent", fmt.Sprintf("GoSDK/%s", SDK_VERSION)) - req.Header.Add("Version", "4") - req.Header.Add("Content-Type", "application/xml") - req.Header.Add("Accept", "application/xml") - // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() - if err != nil { - return nil, err - } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) - // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) - if err != nil { - return nil, err +// +// List all the steps of the job. +// The order of the returned list of steps isn't guaranteed. +// +func (op *JobService) StepsService() *StepsService { + return NewStepsService(op.connection, fmt.Sprintf("%s/steps", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *JobService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { - dumpReq, err := httputil.DumpRequestOut(req, true) - if err != nil { - return nil, err - } - dumpResp, err := httputil.DumpResponse(resp, true) - if err != nil { - return nil, err - } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + if path == "steps" { + return op.StepsService(), nil } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if strings.HasPrefix(path, "steps/") { + return op.StepsService().Service(path[6:]) } - return new(VmDiskServiceReduceResponse), nil + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *VmDiskServiceReduceRequest) MustSend() *VmDiskServiceReduceResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v - } +func (op *JobService) String() string { + return fmt.Sprintf("JobService:%s", op.path) } // -// Reduces the size of the disk image. -// Invokes _reduce_ on the logical volume (i.e. this is only applicable for block storage domains). -// This is applicable for floating disks and disks attached to non-running virtual machines. -// There is no need to specify the size as the optimal size is calculated automatically. +// A service to manage jobs. // -type VmDiskServiceReduceResponse struct { +type JobsService struct { + BaseService } -// -// Reduces the size of the disk image. -// Invokes _reduce_ on the logical volume (i.e. this is only applicable for block storage domains). -// This is applicable for floating disks and disks attached to non-running virtual machines. -// There is no need to specify the size as the optimal size is calculated automatically. -// -func (p *VmDiskService) Reduce() *VmDiskServiceReduceRequest { - return &VmDiskServiceReduceRequest{VmDiskService: p} +func NewJobsService(connection *Connection, path string) *JobsService { + var result JobsService + result.connection = connection + result.path = path + return &result } // -// Detach the disk from the virtual machine. -// NOTE: In version 3 of the API this used to also remove the disk completely from the system, but starting with -// version 4 it doesn't. If you need to remove it completely use the <>. +// Add an external job. +// For example, to add a job with the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// Doing some work +// true +// +// ---- +// The response should look like: +// [source,xml] +// ---- +// +// +// +// +// +// Doing some work +// +// true +// true +// 2016-12-13T02:15:42.130+02:00 +// 2016-12-13T02:15:42.130+02:00 +// started +// +// +// ---- // -type VmDiskServiceRemoveRequest struct { - VmDiskService *VmDiskService - header map[string]string - query map[string]string - async *bool +type JobsServiceAddRequest struct { + JobsService *JobsService + header map[string]string + query map[string]string + job *Job } -func (p *VmDiskServiceRemoveRequest) Header(key, value string) *VmDiskServiceRemoveRequest { +func (p *JobsServiceAddRequest) Header(key, value string) *JobsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -45419,7 +48133,7 @@ func (p *VmDiskServiceRemoveRequest) Header(key, value string) *VmDiskServiceRem return p } -func (p *VmDiskServiceRemoveRequest) Query(key, value string) *VmDiskServiceRemoveRequest { +func (p *JobsServiceAddRequest) Query(key, value string) *JobsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -45427,18 +48141,14 @@ func (p *VmDiskServiceRemoveRequest) Query(key, value string) *VmDiskServiceRemo return p } -func (p *VmDiskServiceRemoveRequest) Async(async bool) *VmDiskServiceRemoveRequest { - p.async = &async +func (p *JobsServiceAddRequest) Job(job *Job) *JobsServiceAddRequest { + p.job = job return p } -func (p *VmDiskServiceRemoveRequest) Send() (*VmDiskServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmDiskService.connection.URL(), p.VmDiskService.path) +func (p *JobsServiceAddRequest) Send() (*JobsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.JobsService.connection.URL(), p.JobsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -45447,12 +48157,19 @@ func (p *VmDiskServiceRemoveRequest) Send() (*VmDiskServiceRemoveResponse, error if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLJobWriteOne(writer, p.job, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmDiskService.connection.headers { + for hk, hv := range p.JobsService.connection.headers { req.Header.Add(hk, hv) } @@ -45467,18 +48184,18 @@ func (p *VmDiskServiceRemoveRequest) Send() (*VmDiskServiceRemoveResponse, error req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() + token, err := p.JobsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) + resp, err := p.JobsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { + if p.JobsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -45487,19 +48204,24 @@ func (p *VmDiskServiceRemoveRequest) Send() (*VmDiskServiceRemoveResponse, error if err != nil { return nil, err } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.JobsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(VmDiskServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLJobReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &JobsServiceAddResponse{job: result}, nil } -func (p *VmDiskServiceRemoveRequest) MustSend() *VmDiskServiceRemoveResponse { +func (p *JobsServiceAddRequest) MustSend() *JobsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -45508,35 +48230,136 @@ func (p *VmDiskServiceRemoveRequest) MustSend() *VmDiskServiceRemoveResponse { } // -// Detach the disk from the virtual machine. -// NOTE: In version 3 of the API this used to also remove the disk completely from the system, but starting with -// version 4 it doesn't. If you need to remove it completely use the <>. +// Add an external job. +// For example, to add a job with the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// Doing some work +// true +// +// ---- +// The response should look like: +// [source,xml] +// ---- +// +// +// +// +// +// Doing some work +// +// true +// true +// 2016-12-13T02:15:42.130+02:00 +// 2016-12-13T02:15:42.130+02:00 +// started +// +// +// ---- // -type VmDiskServiceRemoveResponse struct { +type JobsServiceAddResponse struct { + job *Job +} + +func (p *JobsServiceAddResponse) Job() (*Job, bool) { + if p.job != nil { + return p.job, true + } + return nil, false +} + +func (p *JobsServiceAddResponse) MustJob() *Job { + if p.job == nil { + panic("job in response does not exist") + } + return p.job } // -// Detach the disk from the virtual machine. -// NOTE: In version 3 of the API this used to also remove the disk completely from the system, but starting with -// version 4 it doesn't. If you need to remove it completely use the <>. +// Add an external job. +// For example, to add a job with the following request: +// [source] +// ---- +// POST /ovirt-engine/api/jobs +// ---- +// With the following request body: +// [source,xml] +// ---- +// +// Doing some work +// true +// +// ---- +// The response should look like: +// [source,xml] +// ---- +// +// +// +// +// +// Doing some work +// +// true +// true +// 2016-12-13T02:15:42.130+02:00 +// 2016-12-13T02:15:42.130+02:00 +// started +// +// +// ---- // -func (p *VmDiskService) Remove() *VmDiskServiceRemoveRequest { - return &VmDiskServiceRemoveRequest{VmDiskService: p} +func (p *JobsService) Add() *JobsServiceAddRequest { + return &JobsServiceAddRequest{JobsService: p} } // +// Retrieves the representation of the jobs. +// [source] +// ---- +// GET /ovirt-engine/api/jobs +// ---- +// You will receive response in XML like this one: +// [source,xml] +// ---- +// +// +// +// +// +// +// Adding Disk +// +// true +// 2016-12-12T23:07:29.758+02:00 +// false +// 2016-12-12T23:07:29.758+02:00 +// 2016-12-12T23:07:26.593+02:00 +// failed +// +// +// ... +// +// ---- +// The order of the returned list of jobs isn't guaranteed. // -type VmDiskServiceUpdateRequest struct { - VmDiskService *VmDiskService +type JobsServiceListRequest struct { + JobsService *JobsService header map[string]string query map[string]string - async *bool - disk *Disk + caseSensitive *bool + follow *string + max *int64 + search *string } -func (p *VmDiskServiceUpdateRequest) Header(key, value string) *VmDiskServiceUpdateRequest { +func (p *JobsServiceListRequest) Header(key, value string) *JobsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -45544,7 +48367,7 @@ func (p *VmDiskServiceUpdateRequest) Header(key, value string) *VmDiskServiceUpd return p } -func (p *VmDiskServiceUpdateRequest) Query(key, value string) *VmDiskServiceUpdateRequest { +func (p *JobsServiceListRequest) Query(key, value string) *JobsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -45552,21 +48375,43 @@ func (p *VmDiskServiceUpdateRequest) Query(key, value string) *VmDiskServiceUpda return p } -func (p *VmDiskServiceUpdateRequest) Async(async bool) *VmDiskServiceUpdateRequest { - p.async = &async +func (p *JobsServiceListRequest) CaseSensitive(caseSensitive bool) *JobsServiceListRequest { + p.caseSensitive = &caseSensitive return p } -func (p *VmDiskServiceUpdateRequest) Disk(disk *Disk) *VmDiskServiceUpdateRequest { - p.disk = disk +func (p *JobsServiceListRequest) Follow(follow string) *JobsServiceListRequest { + p.follow = &follow return p } -func (p *VmDiskServiceUpdateRequest) Send() (*VmDiskServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmDiskService.connection.URL(), p.VmDiskService.path) +func (p *JobsServiceListRequest) Max(max int64) *JobsServiceListRequest { + p.max = &max + return p +} + +func (p *JobsServiceListRequest) Search(search string) *JobsServiceListRequest { + p.search = &search + return p +} + +func (p *JobsServiceListRequest) Send() (*JobsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.JobsService.connection.URL(), p.JobsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} + } + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} } if p.query != nil { @@ -45577,19 +48422,12 @@ func (p *VmDiskServiceUpdateRequest) Send() (*VmDiskServiceUpdateResponse, error if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLDiskWriteOne(writer, p.disk, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.VmDiskService.connection.headers { + for hk, hv := range p.JobsService.connection.headers { req.Header.Add(hk, hv) } @@ -45604,18 +48442,18 @@ func (p *VmDiskServiceUpdateRequest) Send() (*VmDiskServiceUpdateResponse, error req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmDiskService.connection.authenticate() + token, err := p.JobsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmDiskService.connection.client.Do(req) + resp, err := p.JobsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmDiskService.connection.logFunc != nil { + if p.JobsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -45624,7 +48462,7 @@ func (p *VmDiskServiceUpdateRequest) Send() (*VmDiskServiceUpdateResponse, error if err != nil { return nil, err } - p.VmDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.JobsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -45634,14 +48472,14 @@ func (p *VmDiskServiceUpdateRequest) Send() (*VmDiskServiceUpdateResponse, error return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") + result, err := XMLJobReadMany(reader, nil) if err != nil { return nil, err } - return &VmDiskServiceUpdateResponse{disk: result}, nil + return &JobsServiceListResponse{jobs: result}, nil } -func (p *VmDiskServiceUpdateRequest) MustSend() *VmDiskServiceUpdateResponse { +func (p *JobsServiceListRequest) MustSend() *JobsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -45650,108 +48488,137 @@ func (p *VmDiskServiceUpdateRequest) MustSend() *VmDiskServiceUpdateResponse { } // +// Retrieves the representation of the jobs. +// [source] +// ---- +// GET /ovirt-engine/api/jobs +// ---- +// You will receive response in XML like this one: +// [source,xml] +// ---- +// +// +// +// +// +// +// Adding Disk +// +// true +// 2016-12-12T23:07:29.758+02:00 +// false +// 2016-12-12T23:07:29.758+02:00 +// 2016-12-12T23:07:26.593+02:00 +// failed +// +// +// ... +// +// ---- +// The order of the returned list of jobs isn't guaranteed. // -type VmDiskServiceUpdateResponse struct { - disk *Disk +type JobsServiceListResponse struct { + jobs *JobSlice } -func (p *VmDiskServiceUpdateResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true +func (p *JobsServiceListResponse) Jobs() (*JobSlice, bool) { + if p.jobs != nil { + return p.jobs, true } return nil, false } -func (p *VmDiskServiceUpdateResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") +func (p *JobsServiceListResponse) MustJobs() *JobSlice { + if p.jobs == nil { + panic("jobs in response does not exist") } - return p.disk -} - -// -// -func (p *VmDiskService) Update() *VmDiskServiceUpdateRequest { - return &VmDiskServiceUpdateRequest{VmDiskService: p} + return p.jobs } // +// Retrieves the representation of the jobs. +// [source] +// ---- +// GET /ovirt-engine/api/jobs +// ---- +// You will receive response in XML like this one: +// [source,xml] +// ---- +// +// +// +// +// +// +// Adding Disk +// +// true +// 2016-12-12T23:07:29.758+02:00 +// false +// 2016-12-12T23:07:29.758+02:00 +// 2016-12-12T23:07:26.593+02:00 +// failed +// +// +// ... +// +// ---- +// The order of the returned list of jobs isn't guaranteed. // -func (op *VmDiskService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +func (p *JobsService) List() *JobsServiceListRequest { + return &JobsServiceListRequest{JobsService: p} } // +// Reference to the job service. // -func (op *VmDiskService) StatisticsService() *StatisticsService { - return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) +func (op *JobsService) JobService(id string) *JobService { + return NewJobService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *VmDiskService) Service(path string) (Service, error) { +func (op *JobsService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) - } - if path == "statistics" { - return op.StatisticsService(), nil - } - if strings.HasPrefix(path, "statistics/") { - return op.StatisticsService().Service(path[11:]) + index := strings.Index(path, "/") + if index == -1 { + return op.JobService(path), nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + return op.JobService(path[:index]).Service(path[index+1:]) } -func (op *VmDiskService) String() string { - return fmt.Sprintf("VmDiskService:%s", op.path) +func (op *JobsService) String() string { + return fmt.Sprintf("JobsService:%s", op.path) } // -// Manages the virtual machine template and template versions. +// A service to fetch information elements received by Link Layer Discovery Protocol (LLDP). // -type TemplateService struct { +type LinkLayerDiscoveryProtocolService struct { BaseService } -func NewTemplateService(connection *Connection, path string) *TemplateService { - var result TemplateService +func NewLinkLayerDiscoveryProtocolService(connection *Connection, path string) *LinkLayerDiscoveryProtocolService { + var result LinkLayerDiscoveryProtocolService result.connection = connection result.path = path return &result } // -// Exports a template to the data center export domain. -// For example, send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/templates/123/export -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// true -// -// ---- +// Fetches information elements received by LLDP. // -type TemplateServiceExportRequest struct { - TemplateService *TemplateService - header map[string]string - query map[string]string - exclusive *bool - storageDomain *StorageDomain +type LinkLayerDiscoveryProtocolServiceListRequest struct { + LinkLayerDiscoveryProtocolService *LinkLayerDiscoveryProtocolService + header map[string]string + query map[string]string + follow *string } -func (p *TemplateServiceExportRequest) Header(key, value string) *TemplateServiceExportRequest { +func (p *LinkLayerDiscoveryProtocolServiceListRequest) Header(key, value string) *LinkLayerDiscoveryProtocolServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -45759,7 +48626,7 @@ func (p *TemplateServiceExportRequest) Header(key, value string) *TemplateServic return p } -func (p *TemplateServiceExportRequest) Query(key, value string) *TemplateServiceExportRequest { +func (p *LinkLayerDiscoveryProtocolServiceListRequest) Query(key, value string) *LinkLayerDiscoveryProtocolServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -45767,28 +48634,18 @@ func (p *TemplateServiceExportRequest) Query(key, value string) *TemplateService return p } -func (p *TemplateServiceExportRequest) Exclusive(exclusive bool) *TemplateServiceExportRequest { - p.exclusive = &exclusive - return p -} - -func (p *TemplateServiceExportRequest) StorageDomain(storageDomain *StorageDomain) *TemplateServiceExportRequest { - p.storageDomain = storageDomain +func (p *LinkLayerDiscoveryProtocolServiceListRequest) Follow(follow string) *LinkLayerDiscoveryProtocolServiceListRequest { + p.follow = &follow return p } -func (p *TemplateServiceExportRequest) Send() (*TemplateServiceExportResponse, error) { - rawURL := fmt.Sprintf("%s%s/export", p.TemplateService.connection.URL(), p.TemplateService.path) - actionBuilder := NewActionBuilder() - if p.exclusive != nil { - actionBuilder.Exclusive(*p.exclusive) - } - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *LinkLayerDiscoveryProtocolServiceListRequest) Send() (*LinkLayerDiscoveryProtocolServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.LinkLayerDiscoveryProtocolService.connection.URL(), p.LinkLayerDiscoveryProtocolService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -45797,16 +48654,12 @@ func (p *TemplateServiceExportRequest) Send() (*TemplateServiceExportResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.TemplateService.connection.headers { + for hk, hv := range p.LinkLayerDiscoveryProtocolService.connection.headers { req.Header.Add(hk, hv) } @@ -45821,18 +48674,18 @@ func (p *TemplateServiceExportRequest) Send() (*TemplateServiceExportResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateService.connection.authenticate() + token, err := p.LinkLayerDiscoveryProtocolService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateService.connection.client.Do(req) + resp, err := p.LinkLayerDiscoveryProtocolService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateService.connection.logFunc != nil { + if p.LinkLayerDiscoveryProtocolService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -45841,16 +48694,24 @@ func (p *TemplateServiceExportRequest) Send() (*TemplateServiceExportResponse, e if err != nil { return nil, err } - p.TemplateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.LinkLayerDiscoveryProtocolService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(TemplateServiceExportResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLLinkLayerDiscoveryProtocolElementReadMany(reader, nil) + if err != nil { + return nil, err + } + return &LinkLayerDiscoveryProtocolServiceListResponse{elements: result}, nil } -func (p *TemplateServiceExportRequest) MustSend() *TemplateServiceExportResponse { +func (p *LinkLayerDiscoveryProtocolServiceListRequest) MustSend() *LinkLayerDiscoveryProtocolServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -45859,56 +48720,70 @@ func (p *TemplateServiceExportRequest) MustSend() *TemplateServiceExportResponse } // -// Exports a template to the data center export domain. -// For example, send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/templates/123/export -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// true -// -// ---- +// Fetches information elements received by LLDP. // -type TemplateServiceExportResponse struct { +type LinkLayerDiscoveryProtocolServiceListResponse struct { + elements *LinkLayerDiscoveryProtocolElementSlice +} + +func (p *LinkLayerDiscoveryProtocolServiceListResponse) Elements() (*LinkLayerDiscoveryProtocolElementSlice, bool) { + if p.elements != nil { + return p.elements, true + } + return nil, false +} + +func (p *LinkLayerDiscoveryProtocolServiceListResponse) MustElements() *LinkLayerDiscoveryProtocolElementSlice { + if p.elements == nil { + panic("elements in response does not exist") + } + return p.elements } // -// Exports a template to the data center export domain. -// For example, send the following request: -// [source] -// ---- -// POST /ovirt-engine/api/templates/123/export -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// true -// -// ---- +// Fetches information elements received by LLDP. // -func (p *TemplateService) Export() *TemplateServiceExportRequest { - return &TemplateServiceExportRequest{TemplateService: p} +func (p *LinkLayerDiscoveryProtocolService) List() *LinkLayerDiscoveryProtocolServiceListRequest { + return &LinkLayerDiscoveryProtocolServiceListRequest{LinkLayerDiscoveryProtocolService: p} } // -// Returns the information about this template or template version. +// Service locator method, returns individual service on which the URI is dispatched. // -type TemplateServiceGetRequest struct { - TemplateService *TemplateService - header map[string]string - query map[string]string - filter *bool - follow *string +func (op *LinkLayerDiscoveryProtocolService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *TemplateServiceGetRequest) Header(key, value string) *TemplateServiceGetRequest { +func (op *LinkLayerDiscoveryProtocolService) String() string { + return fmt.Sprintf("LinkLayerDiscoveryProtocolService:%s", op.path) +} + +// +// +type MacPoolService struct { + BaseService +} + +func NewMacPoolService(connection *Connection, path string) *MacPoolService { + var result MacPoolService + result.connection = connection + result.path = path + return &result +} + +// +// +type MacPoolServiceGetRequest struct { + MacPoolService *MacPoolService + header map[string]string + query map[string]string + follow *string +} + +func (p *MacPoolServiceGetRequest) Header(key, value string) *MacPoolServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -45916,7 +48791,7 @@ func (p *TemplateServiceGetRequest) Header(key, value string) *TemplateServiceGe return p } -func (p *TemplateServiceGetRequest) Query(key, value string) *TemplateServiceGetRequest { +func (p *MacPoolServiceGetRequest) Query(key, value string) *MacPoolServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -45924,23 +48799,14 @@ func (p *TemplateServiceGetRequest) Query(key, value string) *TemplateServiceGet return p } -func (p *TemplateServiceGetRequest) Filter(filter bool) *TemplateServiceGetRequest { - p.filter = &filter - return p -} - -func (p *TemplateServiceGetRequest) Follow(follow string) *TemplateServiceGetRequest { +func (p *MacPoolServiceGetRequest) Follow(follow string) *MacPoolServiceGetRequest { p.follow = &follow return p } -func (p *TemplateServiceGetRequest) Send() (*TemplateServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateService.connection.URL(), p.TemplateService.path) +func (p *MacPoolServiceGetRequest) Send() (*MacPoolServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.MacPoolService.connection.URL(), p.MacPoolService.path) values := make(url.Values) - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } @@ -45958,7 +48824,7 @@ func (p *TemplateServiceGetRequest) Send() (*TemplateServiceGetResponse, error) return nil, err } - for hk, hv := range p.TemplateService.connection.headers { + for hk, hv := range p.MacPoolService.connection.headers { req.Header.Add(hk, hv) } @@ -45973,18 +48839,18 @@ func (p *TemplateServiceGetRequest) Send() (*TemplateServiceGetResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateService.connection.authenticate() + token, err := p.MacPoolService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateService.connection.client.Do(req) + resp, err := p.MacPoolService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateService.connection.logFunc != nil { + if p.MacPoolService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -45993,7 +48859,7 @@ func (p *TemplateServiceGetRequest) Send() (*TemplateServiceGetResponse, error) if err != nil { return nil, err } - p.TemplateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.MacPoolService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -46003,14 +48869,14 @@ func (p *TemplateServiceGetRequest) Send() (*TemplateServiceGetResponse, error) return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLTemplateReadOne(reader, nil, "") + result, err := XMLMacPoolReadOne(reader, nil, "") if err != nil { return nil, err } - return &TemplateServiceGetResponse{template: result}, nil + return &MacPoolServiceGetResponse{pool: result}, nil } -func (p *TemplateServiceGetRequest) MustSend() *TemplateServiceGetResponse { +func (p *MacPoolServiceGetRequest) MustSend() *MacPoolServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -46019,48 +48885,47 @@ func (p *TemplateServiceGetRequest) MustSend() *TemplateServiceGetResponse { } // -// Returns the information about this template or template version. // -type TemplateServiceGetResponse struct { - template *Template +type MacPoolServiceGetResponse struct { + pool *MacPool } -func (p *TemplateServiceGetResponse) Template() (*Template, bool) { - if p.template != nil { - return p.template, true +func (p *MacPoolServiceGetResponse) Pool() (*MacPool, bool) { + if p.pool != nil { + return p.pool, true } return nil, false } -func (p *TemplateServiceGetResponse) MustTemplate() *Template { - if p.template == nil { - panic("template in response does not exist") +func (p *MacPoolServiceGetResponse) MustPool() *MacPool { + if p.pool == nil { + panic("pool in response does not exist") } - return p.template + return p.pool } // -// Returns the information about this template or template version. // -func (p *TemplateService) Get() *TemplateServiceGetRequest { - return &TemplateServiceGetRequest{TemplateService: p} +func (p *MacPoolService) Get() *MacPoolServiceGetRequest { + return &MacPoolServiceGetRequest{MacPoolService: p} } // -// Removes a virtual machine template. +// Removes a MAC address pool. +// For example, to remove the MAC address pool having id `123` send a request like this: // [source] // ---- -// DELETE /ovirt-engine/api/templates/123 +// DELETE /ovirt-engine/api/macpools/123 // ---- // -type TemplateServiceRemoveRequest struct { - TemplateService *TemplateService - header map[string]string - query map[string]string - async *bool +type MacPoolServiceRemoveRequest struct { + MacPoolService *MacPoolService + header map[string]string + query map[string]string + async *bool } -func (p *TemplateServiceRemoveRequest) Header(key, value string) *TemplateServiceRemoveRequest { +func (p *MacPoolServiceRemoveRequest) Header(key, value string) *MacPoolServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -46068,7 +48933,7 @@ func (p *TemplateServiceRemoveRequest) Header(key, value string) *TemplateServic return p } -func (p *TemplateServiceRemoveRequest) Query(key, value string) *TemplateServiceRemoveRequest { +func (p *MacPoolServiceRemoveRequest) Query(key, value string) *MacPoolServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -46076,13 +48941,13 @@ func (p *TemplateServiceRemoveRequest) Query(key, value string) *TemplateService return p } -func (p *TemplateServiceRemoveRequest) Async(async bool) *TemplateServiceRemoveRequest { +func (p *MacPoolServiceRemoveRequest) Async(async bool) *MacPoolServiceRemoveRequest { p.async = &async return p } -func (p *TemplateServiceRemoveRequest) Send() (*TemplateServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateService.connection.URL(), p.TemplateService.path) +func (p *MacPoolServiceRemoveRequest) Send() (*MacPoolServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.MacPoolService.connection.URL(), p.MacPoolService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -46101,7 +48966,7 @@ func (p *TemplateServiceRemoveRequest) Send() (*TemplateServiceRemoveResponse, e return nil, err } - for hk, hv := range p.TemplateService.connection.headers { + for hk, hv := range p.MacPoolService.connection.headers { req.Header.Add(hk, hv) } @@ -46116,18 +48981,18 @@ func (p *TemplateServiceRemoveRequest) Send() (*TemplateServiceRemoveResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateService.connection.authenticate() + token, err := p.MacPoolService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateService.connection.client.Do(req) + resp, err := p.MacPoolService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateService.connection.logFunc != nil { + if p.MacPoolService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -46136,7 +49001,7 @@ func (p *TemplateServiceRemoveRequest) Send() (*TemplateServiceRemoveResponse, e if err != nil { return nil, err } - p.TemplateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.MacPoolService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -46145,10 +49010,10 @@ func (p *TemplateServiceRemoveRequest) Send() (*TemplateServiceRemoveResponse, e if errReadBody != nil { return nil, errReadBody } - return new(TemplateServiceRemoveResponse), nil + return new(MacPoolServiceRemoveResponse), nil } -func (p *TemplateServiceRemoveRequest) MustSend() *TemplateServiceRemoveResponse { +func (p *MacPoolServiceRemoveRequest) MustSend() *MacPoolServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -46157,38 +49022,65 @@ func (p *TemplateServiceRemoveRequest) MustSend() *TemplateServiceRemoveResponse } // -// Removes a virtual machine template. +// Removes a MAC address pool. +// For example, to remove the MAC address pool having id `123` send a request like this: // [source] // ---- -// DELETE /ovirt-engine/api/templates/123 +// DELETE /ovirt-engine/api/macpools/123 // ---- // -type TemplateServiceRemoveResponse struct { +type MacPoolServiceRemoveResponse struct { } // -// Removes a virtual machine template. +// Removes a MAC address pool. +// For example, to remove the MAC address pool having id `123` send a request like this: // [source] // ---- -// DELETE /ovirt-engine/api/templates/123 +// DELETE /ovirt-engine/api/macpools/123 // ---- // -func (p *TemplateService) Remove() *TemplateServiceRemoveRequest { - return &TemplateServiceRemoveRequest{TemplateService: p} +func (p *MacPoolService) Remove() *MacPoolServiceRemoveRequest { + return &MacPoolServiceRemoveRequest{MacPoolService: p} } // -// Exports a template to an export domain. +// Updates a MAC address pool. +// The `name`, `description`, `allow_duplicates`, and `ranges` attributes can be updated. +// For example, to update the MAC address pool of id `123` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/macpools/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// UpdatedMACPool +// An updated MAC address pool +// false +// +// +// 00:1A:4A:16:01:51 +// 00:1A:4A:16:01:e6 +// +// +// 02:1A:4A:01:00:00 +// 02:1A:4A:FF:FF:FF +// +// +// +// ---- // -type TemplateServiceExportToExportDomainRequest struct { - TemplateService *TemplateService - header map[string]string - query map[string]string - exclusive *bool - storageDomain *StorageDomain +type MacPoolServiceUpdateRequest struct { + MacPoolService *MacPoolService + header map[string]string + query map[string]string + async *bool + pool *MacPool } -func (p *TemplateServiceExportToExportDomainRequest) Header(key, value string) *TemplateServiceExportToExportDomainRequest { +func (p *MacPoolServiceUpdateRequest) Header(key, value string) *MacPoolServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -46196,7 +49088,7 @@ func (p *TemplateServiceExportToExportDomainRequest) Header(key, value string) * return p } -func (p *TemplateServiceExportToExportDomainRequest) Query(key, value string) *TemplateServiceExportToExportDomainRequest { +func (p *MacPoolServiceUpdateRequest) Query(key, value string) *MacPoolServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -46204,28 +49096,23 @@ func (p *TemplateServiceExportToExportDomainRequest) Query(key, value string) *T return p } -func (p *TemplateServiceExportToExportDomainRequest) Exclusive(exclusive bool) *TemplateServiceExportToExportDomainRequest { - p.exclusive = &exclusive +func (p *MacPoolServiceUpdateRequest) Async(async bool) *MacPoolServiceUpdateRequest { + p.async = &async return p } -func (p *TemplateServiceExportToExportDomainRequest) StorageDomain(storageDomain *StorageDomain) *TemplateServiceExportToExportDomainRequest { - p.storageDomain = storageDomain +func (p *MacPoolServiceUpdateRequest) Pool(pool *MacPool) *MacPoolServiceUpdateRequest { + p.pool = pool return p } -func (p *TemplateServiceExportToExportDomainRequest) Send() (*TemplateServiceExportToExportDomainResponse, error) { - rawURL := fmt.Sprintf("%s%s/toexportdomain", p.TemplateService.connection.URL(), p.TemplateService.path) - actionBuilder := NewActionBuilder() - if p.exclusive != nil { - actionBuilder.Exclusive(*p.exclusive) - } - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *MacPoolServiceUpdateRequest) Send() (*MacPoolServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.MacPoolService.connection.URL(), p.MacPoolService.path) values := make(url.Values) + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -46236,14 +49123,17 @@ func (p *TemplateServiceExportToExportDomainRequest) Send() (*TemplateServiceExp } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLMacPoolWriteOne(writer, p.pool, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateService.connection.headers { + for hk, hv := range p.MacPoolService.connection.headers { req.Header.Add(hk, hv) } @@ -46258,18 +49148,18 @@ func (p *TemplateServiceExportToExportDomainRequest) Send() (*TemplateServiceExp req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateService.connection.authenticate() + token, err := p.MacPoolService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateService.connection.client.Do(req) + resp, err := p.MacPoolService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateService.connection.logFunc != nil { + if p.MacPoolService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -46278,16 +49168,24 @@ func (p *TemplateServiceExportToExportDomainRequest) Send() (*TemplateServiceExp if err != nil { return nil, err } - p.TemplateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.MacPoolService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(TemplateServiceExportToExportDomainResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLMacPoolReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &MacPoolServiceUpdateResponse{pool: result}, nil } -func (p *TemplateServiceExportToExportDomainRequest) MustSend() *TemplateServiceExportToExportDomainResponse { +func (p *MacPoolServiceUpdateRequest) MustSend() *MacPoolServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -46296,33 +49194,156 @@ func (p *TemplateServiceExportToExportDomainRequest) MustSend() *TemplateService } // -// Exports a template to an export domain. +// Updates a MAC address pool. +// The `name`, `description`, `allow_duplicates`, and `ranges` attributes can be updated. +// For example, to update the MAC address pool of id `123` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/macpools/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// UpdatedMACPool +// An updated MAC address pool +// false +// +// +// 00:1A:4A:16:01:51 +// 00:1A:4A:16:01:e6 +// +// +// 02:1A:4A:01:00:00 +// 02:1A:4A:FF:FF:FF +// +// +// +// ---- +// +type MacPoolServiceUpdateResponse struct { + pool *MacPool +} + +func (p *MacPoolServiceUpdateResponse) Pool() (*MacPool, bool) { + if p.pool != nil { + return p.pool, true + } + return nil, false +} + +func (p *MacPoolServiceUpdateResponse) MustPool() *MacPool { + if p.pool == nil { + panic("pool in response does not exist") + } + return p.pool +} + +// +// Updates a MAC address pool. +// The `name`, `description`, `allow_duplicates`, and `ranges` attributes can be updated. +// For example, to update the MAC address pool of id `123` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/macpools/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// UpdatedMACPool +// An updated MAC address pool +// false +// +// +// 00:1A:4A:16:01:51 +// 00:1A:4A:16:01:e6 +// +// +// 02:1A:4A:01:00:00 +// 02:1A:4A:FF:FF:FF +// +// +// +// ---- +// +func (p *MacPoolService) Update() *MacPoolServiceUpdateRequest { + return &MacPoolServiceUpdateRequest{MacPoolService: p} +} + +// +// Returns a reference to the service that manages the permissions that are associated with the MacPool. +// +func (op *MacPoolService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *MacPoolService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *MacPoolService) String() string { + return fmt.Sprintf("MacPoolService:%s", op.path) +} + +// // -type TemplateServiceExportToExportDomainResponse struct { +type MacPoolsService struct { + BaseService } -// -// Exports a template to an export domain. -// -func (p *TemplateService) ExportToExportDomain() *TemplateServiceExportToExportDomainRequest { - return &TemplateServiceExportToExportDomainRequest{TemplateService: p} +func NewMacPoolsService(connection *Connection, path string) *MacPoolsService { + var result MacPoolsService + result.connection = connection + result.path = path + return &result } // -// Exports a template as an OVA file to a given path on a specified host. +// Creates a new MAC address pool. +// Creation of a MAC address pool requires values for the `name` and `ranges` attributes. +// For example, to create MAC address pool send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/macpools +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// MACPool +// A MAC address pool +// true +// false +// +// +// 00:1A:4A:16:01:51 +// 00:1A:4A:16:01:e6 +// +// +// +// ---- // -type TemplateServiceExportToPathOnHostRequest struct { - TemplateService *TemplateService +type MacPoolsServiceAddRequest struct { + MacPoolsService *MacPoolsService header map[string]string query map[string]string - directory *string - exclusive *bool - filename *string - host *Host - storageDomain *StorageDomain + pool *MacPool } -func (p *TemplateServiceExportToPathOnHostRequest) Header(key, value string) *TemplateServiceExportToPathOnHostRequest { +func (p *MacPoolsServiceAddRequest) Header(key, value string) *MacPoolsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -46330,7 +49351,7 @@ func (p *TemplateServiceExportToPathOnHostRequest) Header(key, value string) *Te return p } -func (p *TemplateServiceExportToPathOnHostRequest) Query(key, value string) *TemplateServiceExportToPathOnHostRequest { +func (p *MacPoolsServiceAddRequest) Query(key, value string) *MacPoolsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -46338,49 +49359,13 @@ func (p *TemplateServiceExportToPathOnHostRequest) Query(key, value string) *Tem return p } -func (p *TemplateServiceExportToPathOnHostRequest) Directory(directory string) *TemplateServiceExportToPathOnHostRequest { - p.directory = &directory - return p -} - -func (p *TemplateServiceExportToPathOnHostRequest) Exclusive(exclusive bool) *TemplateServiceExportToPathOnHostRequest { - p.exclusive = &exclusive - return p -} - -func (p *TemplateServiceExportToPathOnHostRequest) Filename(filename string) *TemplateServiceExportToPathOnHostRequest { - p.filename = &filename - return p -} - -func (p *TemplateServiceExportToPathOnHostRequest) Host(host *Host) *TemplateServiceExportToPathOnHostRequest { - p.host = host - return p -} - -func (p *TemplateServiceExportToPathOnHostRequest) StorageDomain(storageDomain *StorageDomain) *TemplateServiceExportToPathOnHostRequest { - p.storageDomain = storageDomain +func (p *MacPoolsServiceAddRequest) Pool(pool *MacPool) *MacPoolsServiceAddRequest { + p.pool = pool return p } -func (p *TemplateServiceExportToPathOnHostRequest) Send() (*TemplateServiceExportToPathOnHostResponse, error) { - rawURL := fmt.Sprintf("%s%s/topathonhost", p.TemplateService.connection.URL(), p.TemplateService.path) - actionBuilder := NewActionBuilder() - if p.directory != nil { - actionBuilder.Directory(*p.directory) - } - if p.exclusive != nil { - actionBuilder.Exclusive(*p.exclusive) - } - if p.filename != nil { - actionBuilder.Filename(*p.filename) - } - actionBuilder.Host(p.host) - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *MacPoolsServiceAddRequest) Send() (*MacPoolsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.MacPoolsService.connection.URL(), p.MacPoolsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -46392,14 +49377,17 @@ func (p *TemplateServiceExportToPathOnHostRequest) Send() (*TemplateServiceExpor } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLMacPoolWriteOne(writer, p.pool, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateService.connection.headers { + for hk, hv := range p.MacPoolsService.connection.headers { req.Header.Add(hk, hv) } @@ -46414,18 +49402,18 @@ func (p *TemplateServiceExportToPathOnHostRequest) Send() (*TemplateServiceExpor req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateService.connection.authenticate() + token, err := p.MacPoolsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateService.connection.client.Do(req) + resp, err := p.MacPoolsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateService.connection.logFunc != nil { + if p.MacPoolsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -46434,16 +49422,24 @@ func (p *TemplateServiceExportToPathOnHostRequest) Send() (*TemplateServiceExpor if err != nil { return nil, err } - p.TemplateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.MacPoolsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(TemplateServiceExportToPathOnHostResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLMacPoolReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &MacPoolsServiceAddResponse{pool: result}, nil } -func (p *TemplateServiceExportToPathOnHostRequest) MustSend() *TemplateServiceExportToPathOnHostResponse { +func (p *MacPoolsServiceAddRequest) MustSend() *MacPoolsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -46452,54 +49448,90 @@ func (p *TemplateServiceExportToPathOnHostRequest) MustSend() *TemplateServiceEx } // -// Exports a template as an OVA file to a given path on a specified host. +// Creates a new MAC address pool. +// Creation of a MAC address pool requires values for the `name` and `ranges` attributes. +// For example, to create MAC address pool send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/macpools +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// MACPool +// A MAC address pool +// true +// false +// +// +// 00:1A:4A:16:01:51 +// 00:1A:4A:16:01:e6 +// +// +// +// ---- // -type TemplateServiceExportToPathOnHostResponse struct { +type MacPoolsServiceAddResponse struct { + pool *MacPool } -// -// Exports a template as an OVA file to a given path on a specified host. -// -func (p *TemplateService) ExportToPathOnHost() *TemplateServiceExportToPathOnHostRequest { - return &TemplateServiceExportToPathOnHostRequest{TemplateService: p} +func (p *MacPoolsServiceAddResponse) Pool() (*MacPool, bool) { + if p.pool != nil { + return p.pool, true + } + return nil, false +} + +func (p *MacPoolsServiceAddResponse) MustPool() *MacPool { + if p.pool == nil { + panic("pool in response does not exist") + } + return p.pool } // -// Updates the template. -// The `name`, `description`, `type`, `memory`, `cpu`, `topology`, `os`, `high_availability`, `display`, -// `stateless`, `usb`, and `timezone` elements can be updated after a template has been created. -// For example, to update a template so that it has 1 GiB of memory send a request like this: +// Creates a new MAC address pool. +// Creation of a MAC address pool requires values for the `name` and `ranges` attributes. +// For example, to create MAC address pool send a request like this: // [source] // ---- -// PUT /ovirt-engine/api/templates/123 -// ---- -// With the following request body: -// [source,xml] -// ---- -// +// POST /ovirt-engine/api/macpools // ---- -// The `version_name` name attribute is the only one that can be updated within the `version` attribute used for -// template versions: +// With a request body like this: // [source,xml] // ---- -// +// +// MACPool +// A MAC address pool +// true +// false +// +// +// 00:1A:4A:16:01:51 +// 00:1A:4A:16:01:e6 +// +// +// // ---- // -type TemplateServiceUpdateRequest struct { - TemplateService *TemplateService +func (p *MacPoolsService) Add() *MacPoolsServiceAddRequest { + return &MacPoolsServiceAddRequest{MacPoolsService: p} +} + +// +// Return the list of MAC address pools of the system. +// The returned list of MAC address pools isn't guaranteed. +// +type MacPoolsServiceListRequest struct { + MacPoolsService *MacPoolsService header map[string]string query map[string]string - async *bool - template *Template + follow *string + max *int64 } -func (p *TemplateServiceUpdateRequest) Header(key, value string) *TemplateServiceUpdateRequest { +func (p *MacPoolsServiceListRequest) Header(key, value string) *MacPoolsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -46507,7 +49539,7 @@ func (p *TemplateServiceUpdateRequest) Header(key, value string) *TemplateServic return p } -func (p *TemplateServiceUpdateRequest) Query(key, value string) *TemplateServiceUpdateRequest { +func (p *MacPoolsServiceListRequest) Query(key, value string) *MacPoolsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -46515,21 +49547,25 @@ func (p *TemplateServiceUpdateRequest) Query(key, value string) *TemplateService return p } -func (p *TemplateServiceUpdateRequest) Async(async bool) *TemplateServiceUpdateRequest { - p.async = &async +func (p *MacPoolsServiceListRequest) Follow(follow string) *MacPoolsServiceListRequest { + p.follow = &follow return p } -func (p *TemplateServiceUpdateRequest) Template(template *Template) *TemplateServiceUpdateRequest { - p.template = template +func (p *MacPoolsServiceListRequest) Max(max int64) *MacPoolsServiceListRequest { + p.max = &max return p } -func (p *TemplateServiceUpdateRequest) Send() (*TemplateServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateService.connection.URL(), p.TemplateService.path) +func (p *MacPoolsServiceListRequest) Send() (*MacPoolsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.MacPoolsService.connection.URL(), p.MacPoolsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } if p.query != nil { @@ -46540,19 +49576,12 @@ func (p *TemplateServiceUpdateRequest) Send() (*TemplateServiceUpdateResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLTemplateWriteOne(writer, p.template, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.TemplateService.connection.headers { + for hk, hv := range p.MacPoolsService.connection.headers { req.Header.Add(hk, hv) } @@ -46567,18 +49596,18 @@ func (p *TemplateServiceUpdateRequest) Send() (*TemplateServiceUpdateResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateService.connection.authenticate() + token, err := p.MacPoolsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateService.connection.client.Do(req) + resp, err := p.MacPoolsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateService.connection.logFunc != nil { + if p.MacPoolsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -46587,7 +49616,7 @@ func (p *TemplateServiceUpdateRequest) Send() (*TemplateServiceUpdateResponse, e if err != nil { return nil, err } - p.TemplateService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.MacPoolsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -46597,14 +49626,14 @@ func (p *TemplateServiceUpdateRequest) Send() (*TemplateServiceUpdateResponse, e return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLTemplateReadOne(reader, nil, "") + result, err := XMLMacPoolReadMany(reader, nil) if err != nil { return nil, err } - return &TemplateServiceUpdateResponse{template: result}, nil + return &MacPoolsServiceListResponse{pools: result}, nil } -func (p *TemplateServiceUpdateRequest) MustSend() *TemplateServiceUpdateResponse { +func (p *MacPoolsServiceListRequest) MustSend() *MacPoolsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -46613,212 +49642,121 @@ func (p *TemplateServiceUpdateRequest) MustSend() *TemplateServiceUpdateResponse } // -// Updates the template. -// The `name`, `description`, `type`, `memory`, `cpu`, `topology`, `os`, `high_availability`, `display`, -// `stateless`, `usb`, and `timezone` elements can be updated after a template has been created. -// For example, to update a template so that it has 1 GiB of memory send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/templates/123 -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// ---- -// The `version_name` name attribute is the only one that can be updated within the `version` attribute used for -// template versions: -// [source,xml] -// ---- -// -// ---- +// Return the list of MAC address pools of the system. +// The returned list of MAC address pools isn't guaranteed. // -type TemplateServiceUpdateResponse struct { - template *Template +type MacPoolsServiceListResponse struct { + pools *MacPoolSlice } -func (p *TemplateServiceUpdateResponse) Template() (*Template, bool) { - if p.template != nil { - return p.template, true +func (p *MacPoolsServiceListResponse) Pools() (*MacPoolSlice, bool) { + if p.pools != nil { + return p.pools, true } return nil, false } -func (p *TemplateServiceUpdateResponse) MustTemplate() *Template { - if p.template == nil { - panic("template in response does not exist") +func (p *MacPoolsServiceListResponse) MustPools() *MacPoolSlice { + if p.pools == nil { + panic("pools in response does not exist") } - return p.template -} - -// -// Updates the template. -// The `name`, `description`, `type`, `memory`, `cpu`, `topology`, `os`, `high_availability`, `display`, -// `stateless`, `usb`, and `timezone` elements can be updated after a template has been created. -// For example, to update a template so that it has 1 GiB of memory send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/templates/123 -// ---- -// With the following request body: -// [source,xml] -// ---- -// -// ---- -// The `version_name` name attribute is the only one that can be updated within the `version` attribute used for -// template versions: -// [source,xml] -// ---- -// -// ---- -// -func (p *TemplateService) Update() *TemplateServiceUpdateRequest { - return &TemplateServiceUpdateRequest{TemplateService: p} + return p.pools } // -// Returns a reference to the service that manages the CD-ROMs that are associated with the template. +// Return the list of MAC address pools of the system. +// The returned list of MAC address pools isn't guaranteed. // -func (op *TemplateService) CdromsService() *TemplateCdromsService { - return NewTemplateCdromsService(op.connection, fmt.Sprintf("%s/cdroms", op.path)) +func (p *MacPoolsService) List() *MacPoolsServiceListRequest { + return &MacPoolsServiceListRequest{MacPoolsService: p} } // -// Returns a reference to the service that manages a specific -// disk attachment of the template. // -func (op *TemplateService) DiskAttachmentsService() *TemplateDiskAttachmentsService { - return NewTemplateDiskAttachmentsService(op.connection, fmt.Sprintf("%s/diskattachments", op.path)) +func (op *MacPoolsService) MacPoolService(id string) *MacPoolService { + return NewMacPoolService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // -// Returns a reference to the service that manages the graphical consoles that are associated with the template. +// Service locator method, returns individual service on which the URI is dispatched. // -func (op *TemplateService) GraphicsConsolesService() *TemplateGraphicsConsolesService { - return NewTemplateGraphicsConsolesService(op.connection, fmt.Sprintf("%s/graphicsconsoles", op.path)) +func (op *MacPoolsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.MacPoolService(path), nil + } + return op.MacPoolService(path[:index]).Service(path[index+1:]) } -// -// Returns a reference to the service that manages the NICs that are associated with the template. -// -func (op *TemplateService) NicsService() *TemplateNicsService { - return NewTemplateNicsService(op.connection, fmt.Sprintf("%s/nics", op.path)) +func (op *MacPoolsService) String() string { + return fmt.Sprintf("MacPoolsService:%s", op.path) } // -// Returns a reference to the service that manages the permissions that are associated with the template. // -func (op *TemplateService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +type MeasurableService struct { + BaseService } -// -// Returns a reference to the service that manages the tags that are associated with the template. -// -func (op *TemplateService) TagsService() *AssignedTagsService { - return NewAssignedTagsService(op.connection, fmt.Sprintf("%s/tags", op.path)) +func NewMeasurableService(connection *Connection, path string) *MeasurableService { + var result MeasurableService + result.connection = connection + result.path = path + return &result } // -// Returns a reference to the service that manages the _watchdogs_ that are associated with the template. // -func (op *TemplateService) WatchdogsService() *TemplateWatchdogsService { - return NewTemplateWatchdogsService(op.connection, fmt.Sprintf("%s/watchdogs", op.path)) +func (op *MeasurableService) StatisticsService() *StatisticsService { + return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *TemplateService) Service(path string) (Service, error) { +func (op *MeasurableService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "cdroms" { - return op.CdromsService(), nil - } - if strings.HasPrefix(path, "cdroms/") { - return op.CdromsService().Service(path[7:]) - } - if path == "diskattachments" { - return op.DiskAttachmentsService(), nil - } - if strings.HasPrefix(path, "diskattachments/") { - return op.DiskAttachmentsService().Service(path[16:]) - } - if path == "graphicsconsoles" { - return op.GraphicsConsolesService(), nil - } - if strings.HasPrefix(path, "graphicsconsoles/") { - return op.GraphicsConsolesService().Service(path[17:]) - } - if path == "nics" { - return op.NicsService(), nil - } - if strings.HasPrefix(path, "nics/") { - return op.NicsService().Service(path[5:]) - } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) - } - if path == "tags" { - return op.TagsService(), nil - } - if strings.HasPrefix(path, "tags/") { - return op.TagsService().Service(path[5:]) - } - if path == "watchdogs" { - return op.WatchdogsService(), nil + if path == "statistics" { + return op.StatisticsService(), nil } - if strings.HasPrefix(path, "watchdogs/") { - return op.WatchdogsService().Service(path[10:]) + if strings.HasPrefix(path, "statistics/") { + return op.StatisticsService().Service(path[11:]) } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *TemplateService) String() string { - return fmt.Sprintf("TemplateService:%s", op.path) +func (op *MeasurableService) String() string { + return fmt.Sprintf("MeasurableService:%s", op.path) } // -// A service to manage a host. // -type HostService struct { +type MoveableService struct { BaseService } -func NewHostService(connection *Connection, path string) *HostService { - var result HostService +func NewMoveableService(connection *Connection, path string) *MoveableService { + var result MoveableService result.connection = connection result.path = path return &result } // -// Activates the host for use, for example to run virtual machines. // -type HostServiceActivateRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool +type MoveableServiceMoveRequest struct { + MoveableService *MoveableService + header map[string]string + query map[string]string + async *bool } -func (p *HostServiceActivateRequest) Header(key, value string) *HostServiceActivateRequest { +func (p *MoveableServiceMoveRequest) Header(key, value string) *MoveableServiceMoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -46826,7 +49764,7 @@ func (p *HostServiceActivateRequest) Header(key, value string) *HostServiceActiv return p } -func (p *HostServiceActivateRequest) Query(key, value string) *HostServiceActivateRequest { +func (p *MoveableServiceMoveRequest) Query(key, value string) *MoveableServiceMoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -46834,13 +49772,13 @@ func (p *HostServiceActivateRequest) Query(key, value string) *HostServiceActiva return p } -func (p *HostServiceActivateRequest) Async(async bool) *HostServiceActivateRequest { +func (p *MoveableServiceMoveRequest) Async(async bool) *MoveableServiceMoveRequest { p.async = &async return p } -func (p *HostServiceActivateRequest) Send() (*HostServiceActivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/activate", p.HostService.connection.URL(), p.HostService.path) +func (p *MoveableServiceMoveRequest) Send() (*MoveableServiceMoveResponse, error) { + rawURL := fmt.Sprintf("%s%s/move", p.MoveableService.connection.URL(), p.MoveableService.path) actionBuilder := NewActionBuilder() if p.async != nil { actionBuilder.Async(*p.async) @@ -46867,7 +49805,7 @@ func (p *HostServiceActivateRequest) Send() (*HostServiceActivateResponse, error return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.MoveableService.connection.headers { req.Header.Add(hk, hv) } @@ -46882,18 +49820,18 @@ func (p *HostServiceActivateRequest) Send() (*HostServiceActivateResponse, error req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.MoveableService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.MoveableService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.MoveableService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -46902,51 +49840,71 @@ func (p *HostServiceActivateRequest) Send() (*HostServiceActivateResponse, error if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.MoveableService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } _, errCheckAction := CheckAction(resp) if errCheckAction != nil { return nil, errCheckAction } - return new(HostServiceActivateResponse), nil + return new(MoveableServiceMoveResponse), nil +} + +func (p *MoveableServiceMoveRequest) MustSend() *MoveableServiceMoveResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// +type MoveableServiceMoveResponse struct { +} + +// +// +func (p *MoveableService) Move() *MoveableServiceMoveRequest { + return &MoveableServiceMoveRequest{MoveableService: p} } -func (p *HostServiceActivateRequest) MustSend() *HostServiceActivateResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *MoveableService) Service(path string) (Service, error) { + if path == "" { + return op, nil } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -// -// Activates the host for use, for example to run virtual machines. -// -type HostServiceActivateResponse struct { +func (op *MoveableService) String() string { + return fmt.Sprintf("MoveableService:%s", op.path) } // -// Activates the host for use, for example to run virtual machines. // -func (p *HostService) Activate() *HostServiceActivateRequest { - return &HostServiceActivateRequest{HostService: p} +type NetworkAttachmentService struct { + BaseService +} + +func NewNetworkAttachmentService(connection *Connection, path string) *NetworkAttachmentService { + var result NetworkAttachmentService + result.connection = connection + result.path = path + return &result } // -// Approve a pre-installed Hypervisor host for usage in the virtualization environment. -// This action also accepts an optional cluster element to define the target cluster for this host. // -type HostServiceApproveRequest struct { - HostService *HostService - header map[string]string - query map[string]string - activate *bool - async *bool - cluster *Cluster - host *Host +type NetworkAttachmentServiceGetRequest struct { + NetworkAttachmentService *NetworkAttachmentService + header map[string]string + query map[string]string + follow *string } -func (p *HostServiceApproveRequest) Header(key, value string) *HostServiceApproveRequest { +func (p *NetworkAttachmentServiceGetRequest) Header(key, value string) *NetworkAttachmentServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -46954,7 +49912,7 @@ func (p *HostServiceApproveRequest) Header(key, value string) *HostServiceApprov return p } -func (p *HostServiceApproveRequest) Query(key, value string) *HostServiceApproveRequest { +func (p *NetworkAttachmentServiceGetRequest) Query(key, value string) *NetworkAttachmentServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -46962,42 +49920,18 @@ func (p *HostServiceApproveRequest) Query(key, value string) *HostServiceApprove return p } -func (p *HostServiceApproveRequest) Activate(activate bool) *HostServiceApproveRequest { - p.activate = &activate - return p -} - -func (p *HostServiceApproveRequest) Async(async bool) *HostServiceApproveRequest { - p.async = &async - return p -} - -func (p *HostServiceApproveRequest) Cluster(cluster *Cluster) *HostServiceApproveRequest { - p.cluster = cluster - return p -} - -func (p *HostServiceApproveRequest) Host(host *Host) *HostServiceApproveRequest { - p.host = host +func (p *NetworkAttachmentServiceGetRequest) Follow(follow string) *NetworkAttachmentServiceGetRequest { + p.follow = &follow return p } -func (p *HostServiceApproveRequest) Send() (*HostServiceApproveResponse, error) { - rawURL := fmt.Sprintf("%s%s/approve", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.activate != nil { - actionBuilder.Activate(*p.activate) - } - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Cluster(p.cluster) - actionBuilder.Host(p.host) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworkAttachmentServiceGetRequest) Send() (*NetworkAttachmentServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkAttachmentService.connection.URL(), p.NetworkAttachmentService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -47006,16 +49940,12 @@ func (p *HostServiceApproveRequest) Send() (*HostServiceApproveResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkAttachmentService.connection.headers { req.Header.Add(hk, hv) } @@ -47030,18 +49960,18 @@ func (p *HostServiceApproveRequest) Send() (*HostServiceApproveResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkAttachmentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkAttachmentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkAttachmentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -47050,16 +49980,24 @@ func (p *HostServiceApproveRequest) Send() (*HostServiceApproveResponse, error) if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkAttachmentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceApproveResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkAttachmentReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NetworkAttachmentServiceGetResponse{attachment: result}, nil } -func (p *HostServiceApproveRequest) MustSend() *HostServiceApproveResponse { +func (p *NetworkAttachmentServiceGetRequest) MustSend() *NetworkAttachmentServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -47068,51 +50006,41 @@ func (p *HostServiceApproveRequest) MustSend() *HostServiceApproveResponse { } // -// Approve a pre-installed Hypervisor host for usage in the virtualization environment. -// This action also accepts an optional cluster element to define the target cluster for this host. // -type HostServiceApproveResponse struct { +type NetworkAttachmentServiceGetResponse struct { + attachment *NetworkAttachment +} + +func (p *NetworkAttachmentServiceGetResponse) Attachment() (*NetworkAttachment, bool) { + if p.attachment != nil { + return p.attachment, true + } + return nil, false +} + +func (p *NetworkAttachmentServiceGetResponse) MustAttachment() *NetworkAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") + } + return p.attachment } // -// Approve a pre-installed Hypervisor host for usage in the virtualization environment. -// This action also accepts an optional cluster element to define the target cluster for this host. // -func (p *HostService) Approve() *HostServiceApproveRequest { - return &HostServiceApproveRequest{HostService: p} +func (p *NetworkAttachmentService) Get() *NetworkAttachmentServiceGetRequest { + return &NetworkAttachmentServiceGetRequest{NetworkAttachmentService: p} } // -// Marks the network configuration as good and persists it inside the host. -// An API user commits the network configuration to persist a host network interface attachment or detachment, or -// persist the creation and deletion of a bonded interface. -// IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is -// not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and -// automatically reverts to the previous networking configuration. -// For example, to commit the network configuration of host with id `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/commitnetconfig -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// ---- -// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in -// the <> request, in which case the new -// configuration is automatically saved in the {hypervisor-name} upon completing the setup and -// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without -// waiting for a separate <> request. // -type HostServiceCommitNetConfigRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool +type NetworkAttachmentServiceRemoveRequest struct { + NetworkAttachmentService *NetworkAttachmentService + header map[string]string + query map[string]string + async *bool } -func (p *HostServiceCommitNetConfigRequest) Header(key, value string) *HostServiceCommitNetConfigRequest { +func (p *NetworkAttachmentServiceRemoveRequest) Header(key, value string) *NetworkAttachmentServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -47120,7 +50048,7 @@ func (p *HostServiceCommitNetConfigRequest) Header(key, value string) *HostServi return p } -func (p *HostServiceCommitNetConfigRequest) Query(key, value string) *HostServiceCommitNetConfigRequest { +func (p *NetworkAttachmentServiceRemoveRequest) Query(key, value string) *NetworkAttachmentServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -47128,22 +50056,18 @@ func (p *HostServiceCommitNetConfigRequest) Query(key, value string) *HostServic return p } -func (p *HostServiceCommitNetConfigRequest) Async(async bool) *HostServiceCommitNetConfigRequest { +func (p *NetworkAttachmentServiceRemoveRequest) Async(async bool) *NetworkAttachmentServiceRemoveRequest { p.async = &async return p } -func (p *HostServiceCommitNetConfigRequest) Send() (*HostServiceCommitNetConfigResponse, error) { - rawURL := fmt.Sprintf("%s%s/commitnetconfig", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() +func (p *NetworkAttachmentServiceRemoveRequest) Send() (*NetworkAttachmentServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkAttachmentService.connection.URL(), p.NetworkAttachmentService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -47152,16 +50076,12 @@ func (p *HostServiceCommitNetConfigRequest) Send() (*HostServiceCommitNetConfigR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkAttachmentService.connection.headers { req.Header.Add(hk, hv) } @@ -47176,18 +50096,18 @@ func (p *HostServiceCommitNetConfigRequest) Send() (*HostServiceCommitNetConfigR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkAttachmentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkAttachmentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkAttachmentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -47196,16 +50116,19 @@ func (p *HostServiceCommitNetConfigRequest) Send() (*HostServiceCommitNetConfigR if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkAttachmentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceCommitNetConfigResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(NetworkAttachmentServiceRemoveResponse), nil } -func (p *HostServiceCommitNetConfigRequest) MustSend() *HostServiceCommitNetConfigResponse { +func (p *NetworkAttachmentServiceRemoveRequest) MustSend() *NetworkAttachmentServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -47214,82 +50137,28 @@ func (p *HostServiceCommitNetConfigRequest) MustSend() *HostServiceCommitNetConf } // -// Marks the network configuration as good and persists it inside the host. -// An API user commits the network configuration to persist a host network interface attachment or detachment, or -// persist the creation and deletion of a bonded interface. -// IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is -// not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and -// automatically reverts to the previous networking configuration. -// For example, to commit the network configuration of host with id `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/commitnetconfig -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// ---- -// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in -// the <> request, in which case the new -// configuration is automatically saved in the {hypervisor-name} upon completing the setup and -// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without -// waiting for a separate <> request. // -type HostServiceCommitNetConfigResponse struct { +type NetworkAttachmentServiceRemoveResponse struct { } // -// Marks the network configuration as good and persists it inside the host. -// An API user commits the network configuration to persist a host network interface attachment or detachment, or -// persist the creation and deletion of a bonded interface. -// IMPORTANT: Networking configuration is only committed after the engine has established that host connectivity is -// not lost as a result of the configuration changes. If host connectivity is lost, the host requires a reboot and -// automatically reverts to the previous networking configuration. -// For example, to commit the network configuration of host with id `123` send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/commitnetconfig -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// ---- -// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in -// the <> request, in which case the new -// configuration is automatically saved in the {hypervisor-name} upon completing the setup and -// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without -// waiting for a separate <> request. // -func (p *HostService) CommitNetConfig() *HostServiceCommitNetConfigRequest { - return &HostServiceCommitNetConfigRequest{HostService: p} +func (p *NetworkAttachmentService) Remove() *NetworkAttachmentServiceRemoveRequest { + return &NetworkAttachmentServiceRemoveRequest{NetworkAttachmentService: p} } // -// Copy the network configuration of the specified host to current host. -// To copy networks from another host, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/copyhostnetworks -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// -// ---- +// Update the specified network attachment on the host. // -type HostServiceCopyHostNetworksRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - sourceHost *Host +type NetworkAttachmentServiceUpdateRequest struct { + NetworkAttachmentService *NetworkAttachmentService + header map[string]string + query map[string]string + async *bool + attachment *NetworkAttachment } -func (p *HostServiceCopyHostNetworksRequest) Header(key, value string) *HostServiceCopyHostNetworksRequest { +func (p *NetworkAttachmentServiceUpdateRequest) Header(key, value string) *NetworkAttachmentServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -47297,7 +50166,7 @@ func (p *HostServiceCopyHostNetworksRequest) Header(key, value string) *HostServ return p } -func (p *HostServiceCopyHostNetworksRequest) Query(key, value string) *HostServiceCopyHostNetworksRequest { +func (p *NetworkAttachmentServiceUpdateRequest) Query(key, value string) *NetworkAttachmentServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -47305,28 +50174,23 @@ func (p *HostServiceCopyHostNetworksRequest) Query(key, value string) *HostServi return p } -func (p *HostServiceCopyHostNetworksRequest) Async(async bool) *HostServiceCopyHostNetworksRequest { +func (p *NetworkAttachmentServiceUpdateRequest) Async(async bool) *NetworkAttachmentServiceUpdateRequest { p.async = &async return p } -func (p *HostServiceCopyHostNetworksRequest) SourceHost(sourceHost *Host) *HostServiceCopyHostNetworksRequest { - p.sourceHost = sourceHost +func (p *NetworkAttachmentServiceUpdateRequest) Attachment(attachment *NetworkAttachment) *NetworkAttachmentServiceUpdateRequest { + p.attachment = attachment return p } -func (p *HostServiceCopyHostNetworksRequest) Send() (*HostServiceCopyHostNetworksResponse, error) { - rawURL := fmt.Sprintf("%s%s/copyhostnetworks", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() +func (p *NetworkAttachmentServiceUpdateRequest) Send() (*NetworkAttachmentServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkAttachmentService.connection.URL(), p.NetworkAttachmentService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.SourceHost(p.sourceHost) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -47337,14 +50201,17 @@ func (p *HostServiceCopyHostNetworksRequest) Send() (*HostServiceCopyHostNetwork } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkAttachmentWriteOne(writer, p.attachment, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkAttachmentService.connection.headers { req.Header.Add(hk, hv) } @@ -47359,18 +50226,18 @@ func (p *HostServiceCopyHostNetworksRequest) Send() (*HostServiceCopyHostNetwork req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkAttachmentService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkAttachmentService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkAttachmentService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -47379,16 +50246,24 @@ func (p *HostServiceCopyHostNetworksRequest) Send() (*HostServiceCopyHostNetwork if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkAttachmentService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceCopyHostNetworksResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkAttachmentReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NetworkAttachmentServiceUpdateResponse{attachment: result}, nil } -func (p *HostServiceCopyHostNetworksRequest) MustSend() *HostServiceCopyHostNetworksResponse { +func (p *NetworkAttachmentServiceUpdateRequest) MustSend() *NetworkAttachmentServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -47397,55 +50272,72 @@ func (p *HostServiceCopyHostNetworksRequest) MustSend() *HostServiceCopyHostNetw } // -// Copy the network configuration of the specified host to current host. -// To copy networks from another host, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/copyhostnetworks -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// -// ---- +// Update the specified network attachment on the host. // -type HostServiceCopyHostNetworksResponse struct { +type NetworkAttachmentServiceUpdateResponse struct { + attachment *NetworkAttachment +} + +func (p *NetworkAttachmentServiceUpdateResponse) Attachment() (*NetworkAttachment, bool) { + if p.attachment != nil { + return p.attachment, true + } + return nil, false +} + +func (p *NetworkAttachmentServiceUpdateResponse) MustAttachment() *NetworkAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") + } + return p.attachment } // -// Copy the network configuration of the specified host to current host. -// To copy networks from another host, send a request like this: -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/copyhostnetworks -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// -// -// ---- +// Update the specified network attachment on the host. // -func (p *HostService) CopyHostNetworks() *HostServiceCopyHostNetworksRequest { - return &HostServiceCopyHostNetworksRequest{HostService: p} +func (p *NetworkAttachmentService) Update() *NetworkAttachmentServiceUpdateRequest { + return &NetworkAttachmentServiceUpdateRequest{NetworkAttachmentService: p} } // -// Deactivates the host to perform maintenance tasks. +// Service locator method, returns individual service on which the URI is dispatched. // -type HostServiceDeactivateRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - reason *string - stopGlusterService *bool +func (op *NetworkAttachmentService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *HostServiceDeactivateRequest) Header(key, value string) *HostServiceDeactivateRequest { +func (op *NetworkAttachmentService) String() string { + return fmt.Sprintf("NetworkAttachmentService:%s", op.path) +} + +// +// Manages the set of network attachments of a host or host NIC. +// +type NetworkAttachmentsService struct { + BaseService +} + +func NewNetworkAttachmentsService(connection *Connection, path string) *NetworkAttachmentsService { + var result NetworkAttachmentsService + result.connection = connection + result.path = path + return &result +} + +// +// Add a new network attachment to the network interface. +// +type NetworkAttachmentsServiceAddRequest struct { + NetworkAttachmentsService *NetworkAttachmentsService + header map[string]string + query map[string]string + attachment *NetworkAttachment +} + +func (p *NetworkAttachmentsServiceAddRequest) Header(key, value string) *NetworkAttachmentsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -47453,7 +50345,7 @@ func (p *HostServiceDeactivateRequest) Header(key, value string) *HostServiceDea return p } -func (p *HostServiceDeactivateRequest) Query(key, value string) *HostServiceDeactivateRequest { +func (p *NetworkAttachmentsServiceAddRequest) Query(key, value string) *NetworkAttachmentsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -47461,37 +50353,13 @@ func (p *HostServiceDeactivateRequest) Query(key, value string) *HostServiceDeac return p } -func (p *HostServiceDeactivateRequest) Async(async bool) *HostServiceDeactivateRequest { - p.async = &async - return p -} - -func (p *HostServiceDeactivateRequest) Reason(reason string) *HostServiceDeactivateRequest { - p.reason = &reason - return p -} - -func (p *HostServiceDeactivateRequest) StopGlusterService(stopGlusterService bool) *HostServiceDeactivateRequest { - p.stopGlusterService = &stopGlusterService +func (p *NetworkAttachmentsServiceAddRequest) Attachment(attachment *NetworkAttachment) *NetworkAttachmentsServiceAddRequest { + p.attachment = attachment return p } -func (p *HostServiceDeactivateRequest) Send() (*HostServiceDeactivateResponse, error) { - rawURL := fmt.Sprintf("%s%s/deactivate", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.reason != nil { - actionBuilder.Reason(*p.reason) - } - if p.stopGlusterService != nil { - actionBuilder.StopGlusterService(*p.stopGlusterService) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworkAttachmentsServiceAddRequest) Send() (*NetworkAttachmentsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkAttachmentsService.connection.URL(), p.NetworkAttachmentsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -47503,14 +50371,17 @@ func (p *HostServiceDeactivateRequest) Send() (*HostServiceDeactivateResponse, e } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkAttachmentWriteOne(writer, p.attachment, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkAttachmentsService.connection.headers { req.Header.Add(hk, hv) } @@ -47525,18 +50396,18 @@ func (p *HostServiceDeactivateRequest) Send() (*HostServiceDeactivateResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkAttachmentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkAttachmentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkAttachmentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -47545,16 +50416,24 @@ func (p *HostServiceDeactivateRequest) Send() (*HostServiceDeactivateResponse, e if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) + } + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkAttachmentReadOne(reader, nil, "") + if err != nil { + return nil, err } - return new(HostServiceDeactivateResponse), nil + return &NetworkAttachmentsServiceAddResponse{attachment: result}, nil } -func (p *HostServiceDeactivateRequest) MustSend() *HostServiceDeactivateResponse { +func (p *NetworkAttachmentsServiceAddRequest) MustSend() *NetworkAttachmentsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -47563,30 +50442,46 @@ func (p *HostServiceDeactivateRequest) MustSend() *HostServiceDeactivateResponse } // -// Deactivates the host to perform maintenance tasks. +// Add a new network attachment to the network interface. // -type HostServiceDeactivateResponse struct { +type NetworkAttachmentsServiceAddResponse struct { + attachment *NetworkAttachment +} + +func (p *NetworkAttachmentsServiceAddResponse) Attachment() (*NetworkAttachment, bool) { + if p.attachment != nil { + return p.attachment, true + } + return nil, false +} + +func (p *NetworkAttachmentsServiceAddResponse) MustAttachment() *NetworkAttachment { + if p.attachment == nil { + panic("attachment in response does not exist") + } + return p.attachment } // -// Deactivates the host to perform maintenance tasks. +// Add a new network attachment to the network interface. // -func (p *HostService) Deactivate() *HostServiceDeactivateRequest { - return &HostServiceDeactivateRequest{HostService: p} +func (p *NetworkAttachmentsService) Add() *NetworkAttachmentsServiceAddRequest { + return &NetworkAttachmentsServiceAddRequest{NetworkAttachmentsService: p} } // -// Enrolls the certificate of the host. Useful in case you get a warning that it is about to expire or has already -// expired. +// Returns the list of network attachments of the host or host NIC. +// The order of the returned list of network attachments isn't guaranteed. // -type HostServiceEnrollCertificateRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool +type NetworkAttachmentsServiceListRequest struct { + NetworkAttachmentsService *NetworkAttachmentsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *HostServiceEnrollCertificateRequest) Header(key, value string) *HostServiceEnrollCertificateRequest { +func (p *NetworkAttachmentsServiceListRequest) Header(key, value string) *NetworkAttachmentsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -47594,7 +50489,7 @@ func (p *HostServiceEnrollCertificateRequest) Header(key, value string) *HostSer return p } -func (p *HostServiceEnrollCertificateRequest) Query(key, value string) *HostServiceEnrollCertificateRequest { +func (p *NetworkAttachmentsServiceListRequest) Query(key, value string) *NetworkAttachmentsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -47602,22 +50497,27 @@ func (p *HostServiceEnrollCertificateRequest) Query(key, value string) *HostServ return p } -func (p *HostServiceEnrollCertificateRequest) Async(async bool) *HostServiceEnrollCertificateRequest { - p.async = &async +func (p *NetworkAttachmentsServiceListRequest) Follow(follow string) *NetworkAttachmentsServiceListRequest { + p.follow = &follow return p } -func (p *HostServiceEnrollCertificateRequest) Send() (*HostServiceEnrollCertificateResponse, error) { - rawURL := fmt.Sprintf("%s%s/enrollcertificate", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *NetworkAttachmentsServiceListRequest) Max(max int64) *NetworkAttachmentsServiceListRequest { + p.max = &max + return p +} + +func (p *NetworkAttachmentsServiceListRequest) Send() (*NetworkAttachmentsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkAttachmentsService.connection.URL(), p.NetworkAttachmentsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -47626,16 +50526,12 @@ func (p *HostServiceEnrollCertificateRequest) Send() (*HostServiceEnrollCertific if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkAttachmentsService.connection.headers { req.Header.Add(hk, hv) } @@ -47650,18 +50546,18 @@ func (p *HostServiceEnrollCertificateRequest) Send() (*HostServiceEnrollCertific req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkAttachmentsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkAttachmentsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkAttachmentsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -47670,16 +50566,24 @@ func (p *HostServiceEnrollCertificateRequest) Send() (*HostServiceEnrollCertific if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkAttachmentsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceEnrollCertificateResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkAttachmentReadMany(reader, nil) + if err != nil { + return nil, err + } + return &NetworkAttachmentsServiceListResponse{attachments: result}, nil } -func (p *HostServiceEnrollCertificateRequest) MustSend() *HostServiceEnrollCertificateResponse { +func (p *NetworkAttachmentsServiceListRequest) MustSend() *NetworkAttachmentsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -47688,55 +50592,97 @@ func (p *HostServiceEnrollCertificateRequest) MustSend() *HostServiceEnrollCerti } // -// Enrolls the certificate of the host. Useful in case you get a warning that it is about to expire or has already -// expired. +// Returns the list of network attachments of the host or host NIC. +// The order of the returned list of network attachments isn't guaranteed. // -type HostServiceEnrollCertificateResponse struct { +type NetworkAttachmentsServiceListResponse struct { + attachments *NetworkAttachmentSlice +} + +func (p *NetworkAttachmentsServiceListResponse) Attachments() (*NetworkAttachmentSlice, bool) { + if p.attachments != nil { + return p.attachments, true + } + return nil, false +} + +func (p *NetworkAttachmentsServiceListResponse) MustAttachments() *NetworkAttachmentSlice { + if p.attachments == nil { + panic("attachments in response does not exist") + } + return p.attachments } // -// Enrolls the certificate of the host. Useful in case you get a warning that it is about to expire or has already -// expired. +// Returns the list of network attachments of the host or host NIC. +// The order of the returned list of network attachments isn't guaranteed. // -func (p *HostService) EnrollCertificate() *HostServiceEnrollCertificateRequest { - return &HostServiceEnrollCertificateRequest{HostService: p} +func (p *NetworkAttachmentsService) List() *NetworkAttachmentsServiceListRequest { + return &NetworkAttachmentsServiceListRequest{NetworkAttachmentsService: p} } // -// Controls the host's power management device. -// For example, to start the host. This can be done via: -// [source] +// +func (op *NetworkAttachmentsService) AttachmentService(id string) *NetworkAttachmentService { + return NewNetworkAttachmentService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworkAttachmentsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.AttachmentService(path), nil + } + return op.AttachmentService(path[:index]).Service(path[index+1:]) +} + +func (op *NetworkAttachmentsService) String() string { + return fmt.Sprintf("NetworkAttachmentsService:%s", op.path) +} + +// +// Manages a network filter. +// [source,xml] // ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --data ' -// -// start -// -// ' \ -// "${url}/hosts/123/fence" +// +// example-network-filter-b +// +// 4 +// 0 +// -1 +// -1 +// +// // ---- +// Please note that version is referring to the minimal support version for the specific filter. // -type HostServiceFenceRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - fenceType *string - maintenanceAfterRestart *bool +type NetworkFilterService struct { + BaseService } -func (p *HostServiceFenceRequest) Header(key, value string) *HostServiceFenceRequest { +func NewNetworkFilterService(connection *Connection, path string) *NetworkFilterService { + var result NetworkFilterService + result.connection = connection + result.path = path + return &result +} + +// +// Retrieves a representation of the network filter. +// +type NetworkFilterServiceGetRequest struct { + NetworkFilterService *NetworkFilterService + header map[string]string + query map[string]string + follow *string +} + +func (p *NetworkFilterServiceGetRequest) Header(key, value string) *NetworkFilterServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -47744,7 +50690,7 @@ func (p *HostServiceFenceRequest) Header(key, value string) *HostServiceFenceReq return p } -func (p *HostServiceFenceRequest) Query(key, value string) *HostServiceFenceRequest { +func (p *NetworkFilterServiceGetRequest) Query(key, value string) *NetworkFilterServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -47752,38 +50698,18 @@ func (p *HostServiceFenceRequest) Query(key, value string) *HostServiceFenceRequ return p } -func (p *HostServiceFenceRequest) Async(async bool) *HostServiceFenceRequest { - p.async = &async - return p -} - -func (p *HostServiceFenceRequest) FenceType(fenceType string) *HostServiceFenceRequest { - p.fenceType = &fenceType - return p -} - -func (p *HostServiceFenceRequest) MaintenanceAfterRestart(maintenanceAfterRestart bool) *HostServiceFenceRequest { - p.maintenanceAfterRestart = &maintenanceAfterRestart +func (p *NetworkFilterServiceGetRequest) Follow(follow string) *NetworkFilterServiceGetRequest { + p.follow = &follow return p } -func (p *HostServiceFenceRequest) Send() (*HostServiceFenceResponse, error) { - rawURL := fmt.Sprintf("%s%s/fence", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.fenceType != nil { - actionBuilder.FenceType(*p.fenceType) - } - if p.maintenanceAfterRestart != nil { - actionBuilder.MaintenanceAfterRestart(*p.maintenanceAfterRestart) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworkFilterServiceGetRequest) Send() (*NetworkFilterServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkFilterService.connection.URL(), p.NetworkFilterService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -47792,16 +50718,12 @@ func (p *HostServiceFenceRequest) Send() (*HostServiceFenceResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkFilterService.connection.headers { req.Header.Add(hk, hv) } @@ -47816,18 +50738,18 @@ func (p *HostServiceFenceRequest) Send() (*HostServiceFenceResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkFilterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkFilterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkFilterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -47836,17 +50758,24 @@ func (p *HostServiceFenceRequest) Send() (*HostServiceFenceResponse, error) { if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkFilterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustPowerManagement() - return &HostServiceFenceResponse{powerManagement: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkFilterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NetworkFilterServiceGetResponse{networkFilter: result}, nil } -func (p *HostServiceFenceRequest) MustSend() *HostServiceFenceResponse { +func (p *NetworkFilterServiceGetRequest) MustSend() *NetworkFilterServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -47855,97 +50784,123 @@ func (p *HostServiceFenceRequest) MustSend() *HostServiceFenceResponse { } // -// Controls the host's power management device. -// For example, to start the host. This can be done via: -// [source] -// ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --data ' -// -// start -// -// ' \ -// "${url}/hosts/123/fence" -// ---- +// Retrieves a representation of the network filter. // -type HostServiceFenceResponse struct { - powerManagement *PowerManagement +type NetworkFilterServiceGetResponse struct { + networkFilter *NetworkFilter } -func (p *HostServiceFenceResponse) PowerManagement() (*PowerManagement, bool) { - if p.powerManagement != nil { - return p.powerManagement, true +func (p *NetworkFilterServiceGetResponse) NetworkFilter() (*NetworkFilter, bool) { + if p.networkFilter != nil { + return p.networkFilter, true } return nil, false } -func (p *HostServiceFenceResponse) MustPowerManagement() *PowerManagement { - if p.powerManagement == nil { - panic("powerManagement in response does not exist") +func (p *NetworkFilterServiceGetResponse) MustNetworkFilter() *NetworkFilter { + if p.networkFilter == nil { + panic("networkFilter in response does not exist") } - return p.powerManagement + return p.networkFilter } // -// Controls the host's power management device. -// For example, to start the host. This can be done via: -// [source] -// ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --data ' -// -// start -// -// ' \ -// "${url}/hosts/123/fence" -// ---- +// Retrieves a representation of the network filter. // -func (p *HostService) Fence() *HostServiceFenceRequest { - return &HostServiceFenceRequest{HostService: p} +func (p *NetworkFilterService) Get() *NetworkFilterServiceGetRequest { + return &NetworkFilterServiceGetRequest{NetworkFilterService: p} } // -// To manually set a host as the storage pool manager (SPM). +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworkFilterService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *NetworkFilterService) String() string { + return fmt.Sprintf("NetworkFilterService:%s", op.path) +} + +// +// Represents a readonly network filters sub-collection. +// The network filter enables to filter packets send to/from the VM's nic according to defined rules. +// For more information please refer to <> service documentation +// Network filters are supported in different versions, starting from version 3.0. +// A network filter is defined for each vnic profile. +// A vnic profile is defined for a specific network. +// A network can be assigned to several different clusters. In the future, each network will be defined in +// cluster level. +// Currently, each network is being defined at data center level. Potential network filters for each network +// are determined by the network's data center compatibility version V. +// V must be >= the network filter version in order to configure this network filter for a specific network. +// Please note, that if a network is assigned to cluster with a version supporting a network filter, the filter +// may not be available due to the data center version being smaller then the network filter's version. +// Example of listing all of the supported network filters for a specific cluster: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/forceselectspm +// GET http://localhost:8080/ovirt-engine/api/clusters/{cluster:id}/networkfilters // ---- -// With a request body like this: +// Output: // [source,xml] // ---- -// +// +// +// example-network-filter-a +// +// 4 +// 0 +// -1 +// -1 +// +// +// +// example-network-filter-b +// +// 4 +// 0 +// -1 +// -1 +// +// +// +// example-network-filter-a +// +// 3 +// 0 +// -1 +// -1 +// +// +// // ---- // -type HostServiceForceSelectSpmRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool +type NetworkFiltersService struct { + BaseService } -func (p *HostServiceForceSelectSpmRequest) Header(key, value string) *HostServiceForceSelectSpmRequest { +func NewNetworkFiltersService(connection *Connection, path string) *NetworkFiltersService { + var result NetworkFiltersService + result.connection = connection + result.path = path + return &result +} + +// +// Retrieves the representations of the network filters. +// The order of the returned list of network filters isn't guaranteed. +// +type NetworkFiltersServiceListRequest struct { + NetworkFiltersService *NetworkFiltersService + header map[string]string + query map[string]string + follow *string +} + +func (p *NetworkFiltersServiceListRequest) Header(key, value string) *NetworkFiltersServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -47953,7 +50908,7 @@ func (p *HostServiceForceSelectSpmRequest) Header(key, value string) *HostServic return p } -func (p *HostServiceForceSelectSpmRequest) Query(key, value string) *HostServiceForceSelectSpmRequest { +func (p *NetworkFiltersServiceListRequest) Query(key, value string) *NetworkFiltersServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -47961,22 +50916,18 @@ func (p *HostServiceForceSelectSpmRequest) Query(key, value string) *HostService return p } -func (p *HostServiceForceSelectSpmRequest) Async(async bool) *HostServiceForceSelectSpmRequest { - p.async = &async +func (p *NetworkFiltersServiceListRequest) Follow(follow string) *NetworkFiltersServiceListRequest { + p.follow = &follow return p } -func (p *HostServiceForceSelectSpmRequest) Send() (*HostServiceForceSelectSpmResponse, error) { - rawURL := fmt.Sprintf("%s%s/forceselectspm", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworkFiltersServiceListRequest) Send() (*NetworkFiltersServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkFiltersService.connection.URL(), p.NetworkFiltersService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -47985,16 +50936,12 @@ func (p *HostServiceForceSelectSpmRequest) Send() (*HostServiceForceSelectSpmRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkFiltersService.connection.headers { req.Header.Add(hk, hv) } @@ -48009,18 +50956,18 @@ func (p *HostServiceForceSelectSpmRequest) Send() (*HostServiceForceSelectSpmRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkFiltersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkFiltersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkFiltersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -48029,16 +50976,24 @@ func (p *HostServiceForceSelectSpmRequest) Send() (*HostServiceForceSelectSpmRes if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkFiltersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceForceSelectSpmResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkFilterReadMany(reader, nil) + if err != nil { + return nil, err + } + return &NetworkFiltersServiceListResponse{filters: result}, nil } -func (p *HostServiceForceSelectSpmRequest) MustSend() *HostServiceForceSelectSpmResponse { +func (p *NetworkFiltersServiceListRequest) MustSend() *NetworkFiltersServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -48047,53 +51002,82 @@ func (p *HostServiceForceSelectSpmRequest) MustSend() *HostServiceForceSelectSpm } // -// To manually set a host as the storage pool manager (SPM). -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/forceselectspm -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// ---- +// Retrieves the representations of the network filters. +// The order of the returned list of network filters isn't guaranteed. // -type HostServiceForceSelectSpmResponse struct { +type NetworkFiltersServiceListResponse struct { + filters *NetworkFilterSlice +} + +func (p *NetworkFiltersServiceListResponse) Filters() (*NetworkFilterSlice, bool) { + if p.filters != nil { + return p.filters, true + } + return nil, false +} + +func (p *NetworkFiltersServiceListResponse) MustFilters() *NetworkFilterSlice { + if p.filters == nil { + panic("filters in response does not exist") + } + return p.filters } // -// To manually set a host as the storage pool manager (SPM). -// [source] -// ---- -// POST /ovirt-engine/api/hosts/123/forceselectspm -// ---- -// With a request body like this: -// [source,xml] -// ---- -// -// ---- +// Retrieves the representations of the network filters. +// The order of the returned list of network filters isn't guaranteed. // -func (p *HostService) ForceSelectSpm() *HostServiceForceSelectSpmRequest { - return &HostServiceForceSelectSpmRequest{HostService: p} +func (p *NetworkFiltersService) List() *NetworkFiltersServiceListRequest { + return &NetworkFiltersServiceListRequest{NetworkFiltersService: p} } // -// Gets the host details. -// [source] -// ---- -// GET /ovirt-engine/api/hosts/123 -// ---- // -type HostServiceGetRequest struct { - HostService *HostService - header map[string]string - query map[string]string - allContent *bool - filter *bool - follow *string +func (op *NetworkFiltersService) NetworkFilterService(id string) *NetworkFilterService { + return NewNetworkFilterService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *HostServiceGetRequest) Header(key, value string) *HostServiceGetRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworkFiltersService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.NetworkFilterService(path), nil + } + return op.NetworkFilterService(path[:index]).Service(path[index+1:]) +} + +func (op *NetworkFiltersService) String() string { + return fmt.Sprintf("NetworkFiltersService:%s", op.path) +} + +// +// +type NetworkLabelService struct { + BaseService +} + +func NewNetworkLabelService(connection *Connection, path string) *NetworkLabelService { + var result NetworkLabelService + result.connection = connection + result.path = path + return &result +} + +// +// +type NetworkLabelServiceGetRequest struct { + NetworkLabelService *NetworkLabelService + header map[string]string + query map[string]string + follow *string +} + +func (p *NetworkLabelServiceGetRequest) Header(key, value string) *NetworkLabelServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -48101,7 +51085,7 @@ func (p *HostServiceGetRequest) Header(key, value string) *HostServiceGetRequest return p } -func (p *HostServiceGetRequest) Query(key, value string) *HostServiceGetRequest { +func (p *NetworkLabelServiceGetRequest) Query(key, value string) *NetworkLabelServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -48109,32 +51093,14 @@ func (p *HostServiceGetRequest) Query(key, value string) *HostServiceGetRequest return p } -func (p *HostServiceGetRequest) AllContent(allContent bool) *HostServiceGetRequest { - p.allContent = &allContent - return p -} - -func (p *HostServiceGetRequest) Filter(filter bool) *HostServiceGetRequest { - p.filter = &filter - return p -} - -func (p *HostServiceGetRequest) Follow(follow string) *HostServiceGetRequest { +func (p *NetworkLabelServiceGetRequest) Follow(follow string) *NetworkLabelServiceGetRequest { p.follow = &follow return p } -func (p *HostServiceGetRequest) Send() (*HostServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostService.connection.URL(), p.HostService.path) +func (p *NetworkLabelServiceGetRequest) Send() (*NetworkLabelServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkLabelService.connection.URL(), p.NetworkLabelService.path) values := make(url.Values) - if p.allContent != nil { - values["all_content"] = []string{fmt.Sprintf("%v", *p.allContent)} - } - - if p.filter != nil { - values["filter"] = []string{fmt.Sprintf("%v", *p.filter)} - } - if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } @@ -48152,7 +51118,7 @@ func (p *HostServiceGetRequest) Send() (*HostServiceGetResponse, error) { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -48167,18 +51133,18 @@ func (p *HostServiceGetRequest) Send() (*HostServiceGetResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -48187,7 +51153,7 @@ func (p *HostServiceGetRequest) Send() (*HostServiceGetResponse, error) { if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -48197,14 +51163,14 @@ func (p *HostServiceGetRequest) Send() (*HostServiceGetResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLHostReadOne(reader, nil, "") + result, err := XMLNetworkLabelReadOne(reader, nil, "") if err != nil { return nil, err } - return &HostServiceGetResponse{host: result}, nil + return &NetworkLabelServiceGetResponse{label: result}, nil } -func (p *HostServiceGetRequest) MustSend() *HostServiceGetResponse { +func (p *NetworkLabelServiceGetRequest) MustSend() *NetworkLabelServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -48213,101 +51179,47 @@ func (p *HostServiceGetRequest) MustSend() *HostServiceGetResponse { } // -// Gets the host details. -// [source] -// ---- -// GET /ovirt-engine/api/hosts/123 -// ---- // -type HostServiceGetResponse struct { - host *Host +type NetworkLabelServiceGetResponse struct { + label *NetworkLabel } -func (p *HostServiceGetResponse) Host() (*Host, bool) { - if p.host != nil { - return p.host, true +func (p *NetworkLabelServiceGetResponse) Label() (*NetworkLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *HostServiceGetResponse) MustHost() *Host { - if p.host == nil { - panic("host in response does not exist") +func (p *NetworkLabelServiceGetResponse) MustLabel() *NetworkLabel { + if p.label == nil { + panic("label in response does not exist") } - return p.host + return p.label } // -// Gets the host details. -// [source] -// ---- -// GET /ovirt-engine/api/hosts/123 -// ---- // -func (p *HostService) Get() *HostServiceGetRequest { - return &HostServiceGetRequest{HostService: p} +func (p *NetworkLabelService) Get() *NetworkLabelServiceGetRequest { + return &NetworkLabelServiceGetRequest{NetworkLabelService: p} } // -// Installs the latest version of VDSM and related software on the host. -// The action also performs every configuration steps on the host which is done during adding host to the engine: -// kdump configuration, hosted-engine deploy, kernel options changes, etc. -// The host type defines additional parameters for the action. -// Example of installing a host, using `curl` and JSON, plain: -// [source,bash] -// ---- -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --request PUT \ -// --header "Content-Type: application/json" \ -// --header "Accept: application/json" \ -// --header "Version: 4" \ -// --user "admin@internal:..." \ -// --data ' -// { -// "root_password": "myrootpassword" -// } -// ' \ -// "https://engine.example.com/ovirt-engine/api/hosts/123" -// ---- -// Example of installing a host using `curl` and JSON with hosted engine components: -// [source,bash] +// Removes a label from a logical network. +// For example, to remove the label `exemplary` from a logical network having id `123` send the following request: +// [source] // ---- -// curl \ -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --request PUT \ -// --header "Content-Type: application/json" \ -// --header "Accept: application/json" \ -// --header "Version: 4" \ -// --user "admin@internal:..." \ -// --data ' -// { -// "root_password": "myrootpassword" -// } -// ' \ -// "https://engine.example.com/ovirt-engine/api/hosts/123?deploy_hosted_engine=true" +// DELETE /ovirt-engine/api/networks/123/networklabels/exemplary // ---- -// IMPORTANT: Since version 4.1.2 of the engine, when a host is reinstalled we override the host firewall -// definitions by default. // -type HostServiceInstallRequest struct { - HostService *HostService - header map[string]string - query map[string]string - activate *bool - async *bool - deployHostedEngine *bool - host *Host - image *string - rootPassword *string - ssh *Ssh - undeployHostedEngine *bool +type NetworkLabelServiceRemoveRequest struct { + NetworkLabelService *NetworkLabelService + header map[string]string + query map[string]string + async *bool } -func (p *HostServiceInstallRequest) Header(key, value string) *HostServiceInstallRequest { +func (p *NetworkLabelServiceRemoveRequest) Header(key, value string) *NetworkLabelServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -48315,7 +51227,7 @@ func (p *HostServiceInstallRequest) Header(key, value string) *HostServiceInstal return p } -func (p *HostServiceInstallRequest) Query(key, value string) *HostServiceInstallRequest { +func (p *NetworkLabelServiceRemoveRequest) Query(key, value string) *NetworkLabelServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -48323,74 +51235,18 @@ func (p *HostServiceInstallRequest) Query(key, value string) *HostServiceInstall return p } -func (p *HostServiceInstallRequest) Activate(activate bool) *HostServiceInstallRequest { - p.activate = &activate - return p -} - -func (p *HostServiceInstallRequest) Async(async bool) *HostServiceInstallRequest { +func (p *NetworkLabelServiceRemoveRequest) Async(async bool) *NetworkLabelServiceRemoveRequest { p.async = &async return p } -func (p *HostServiceInstallRequest) DeployHostedEngine(deployHostedEngine bool) *HostServiceInstallRequest { - p.deployHostedEngine = &deployHostedEngine - return p -} - -func (p *HostServiceInstallRequest) Host(host *Host) *HostServiceInstallRequest { - p.host = host - return p -} - -func (p *HostServiceInstallRequest) Image(image string) *HostServiceInstallRequest { - p.image = &image - return p -} - -func (p *HostServiceInstallRequest) RootPassword(rootPassword string) *HostServiceInstallRequest { - p.rootPassword = &rootPassword - return p -} - -func (p *HostServiceInstallRequest) Ssh(ssh *Ssh) *HostServiceInstallRequest { - p.ssh = ssh - return p -} - -func (p *HostServiceInstallRequest) UndeployHostedEngine(undeployHostedEngine bool) *HostServiceInstallRequest { - p.undeployHostedEngine = &undeployHostedEngine - return p -} - -func (p *HostServiceInstallRequest) Send() (*HostServiceInstallResponse, error) { - rawURL := fmt.Sprintf("%s%s/install", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.activate != nil { - actionBuilder.Activate(*p.activate) - } +func (p *NetworkLabelServiceRemoveRequest) Send() (*NetworkLabelServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkLabelService.connection.URL(), p.NetworkLabelService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.deployHostedEngine != nil { - actionBuilder.DeployHostedEngine(*p.deployHostedEngine) - } - actionBuilder.Host(p.host) - if p.image != nil { - actionBuilder.Image(*p.image) - } - if p.rootPassword != nil { - actionBuilder.RootPassword(*p.rootPassword) - } - actionBuilder.Ssh(p.ssh) - if p.undeployHostedEngine != nil { - actionBuilder.UndeployHostedEngine(*p.undeployHostedEngine) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -48399,16 +51255,12 @@ func (p *HostServiceInstallRequest) Send() (*HostServiceInstallResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkLabelService.connection.headers { req.Header.Add(hk, hv) } @@ -48423,18 +51275,18 @@ func (p *HostServiceInstallRequest) Send() (*HostServiceInstallResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkLabelService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkLabelService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkLabelService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -48443,16 +51295,19 @@ func (p *HostServiceInstallRequest) Send() (*HostServiceInstallResponse, error) if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkLabelService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceInstallResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(NetworkLabelServiceRemoveResponse), nil } -func (p *HostServiceInstallRequest) MustSend() *HostServiceInstallResponse { +func (p *NetworkLabelServiceRemoveRequest) MustSend() *NetworkLabelServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -48461,141 +51316,79 @@ func (p *HostServiceInstallRequest) MustSend() *HostServiceInstallResponse { } // -// Installs the latest version of VDSM and related software on the host. -// The action also performs every configuration steps on the host which is done during adding host to the engine: -// kdump configuration, hosted-engine deploy, kernel options changes, etc. -// The host type defines additional parameters for the action. -// Example of installing a host, using `curl` and JSON, plain: -// [source,bash] -// ---- -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --request PUT \ -// --header "Content-Type: application/json" \ -// --header "Accept: application/json" \ -// --header "Version: 4" \ -// --user "admin@internal:..." \ -// --data ' -// { -// "root_password": "myrootpassword" -// } -// ' \ -// "https://engine.example.com/ovirt-engine/api/hosts/123" -// ---- -// Example of installing a host using `curl` and JSON with hosted engine components: -// [source,bash] +// Removes a label from a logical network. +// For example, to remove the label `exemplary` from a logical network having id `123` send the following request: +// [source] // ---- -// curl \ -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --request PUT \ -// --header "Content-Type: application/json" \ -// --header "Accept: application/json" \ -// --header "Version: 4" \ -// --user "admin@internal:..." \ -// --data ' -// { -// "root_password": "myrootpassword" -// } -// ' \ -// "https://engine.example.com/ovirt-engine/api/hosts/123?deploy_hosted_engine=true" +// DELETE /ovirt-engine/api/networks/123/networklabels/exemplary // ---- -// IMPORTANT: Since version 4.1.2 of the engine, when a host is reinstalled we override the host firewall -// definitions by default. // -type HostServiceInstallResponse struct { +type NetworkLabelServiceRemoveResponse struct { } // -// Installs the latest version of VDSM and related software on the host. -// The action also performs every configuration steps on the host which is done during adding host to the engine: -// kdump configuration, hosted-engine deploy, kernel options changes, etc. -// The host type defines additional parameters for the action. -// Example of installing a host, using `curl` and JSON, plain: -// [source,bash] -// ---- -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --request PUT \ -// --header "Content-Type: application/json" \ -// --header "Accept: application/json" \ -// --header "Version: 4" \ -// --user "admin@internal:..." \ -// --data ' -// { -// "root_password": "myrootpassword" -// } -// ' \ -// "https://engine.example.com/ovirt-engine/api/hosts/123" -// ---- -// Example of installing a host using `curl` and JSON with hosted engine components: -// [source,bash] +// Removes a label from a logical network. +// For example, to remove the label `exemplary` from a logical network having id `123` send the following request: +// [source] // ---- -// curl \ -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --request PUT \ -// --header "Content-Type: application/json" \ -// --header "Accept: application/json" \ -// --header "Version: 4" \ -// --user "admin@internal:..." \ -// --data ' -// { -// "root_password": "myrootpassword" -// } -// ' \ -// "https://engine.example.com/ovirt-engine/api/hosts/123?deploy_hosted_engine=true" +// DELETE /ovirt-engine/api/networks/123/networklabels/exemplary // ---- -// IMPORTANT: Since version 4.1.2 of the engine, when a host is reinstalled we override the host firewall -// definitions by default. // -func (p *HostService) Install() *HostServiceInstallRequest { - return &HostServiceInstallRequest{HostService: p} +func (p *NetworkLabelService) Remove() *NetworkLabelServiceRemoveRequest { + return &NetworkLabelServiceRemoveRequest{NetworkLabelService: p} } // -// Discovers iSCSI targets on the host, using the initiator details. -// For example, to discover iSCSI targets available in `myiscsi.example.com`, -// from host `123`, send a request like this: +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworkLabelService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *NetworkLabelService) String() string { + return fmt.Sprintf("NetworkLabelService:%s", op.path) +} + +// +// Manages the ser of labels attached to a network or to a host NIC. +// +type NetworkLabelsService struct { + BaseService +} + +func NewNetworkLabelsService(connection *Connection, path string) *NetworkLabelsService { + var result NetworkLabelsService + result.connection = connection + result.path = path + return &result +} + +// +// Attaches label to logical network. +// You can attach labels to a logical network to automate the association of that logical network with physical host +// network interfaces to which the same label has been attached. +// For example, to attach the label `mylabel` to a logical network having id `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/iscsidiscover +// POST /ovirt-engine/api/networks/123/networklabels // ---- // With a request body like this: // [source,xml] // ---- -// -// -//
myiscsi.example.com
-//
-//
-// ---- -// The result will be like this: -// [source,xml] -// ---- -// -// -//
10.35.1.72
-// 3260 -// 10.35.1.72:3260,1 -// iqn.2015-08.com.tgt:444 -//
-//
+// // ---- // -type HostServiceIscsiDiscoverRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - iscsi *IscsiDetails +type NetworkLabelsServiceAddRequest struct { + NetworkLabelsService *NetworkLabelsService + header map[string]string + query map[string]string + label *NetworkLabel } -func (p *HostServiceIscsiDiscoverRequest) Header(key, value string) *HostServiceIscsiDiscoverRequest { +func (p *NetworkLabelsServiceAddRequest) Header(key, value string) *NetworkLabelsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -48603,7 +51396,7 @@ func (p *HostServiceIscsiDiscoverRequest) Header(key, value string) *HostService return p } -func (p *HostServiceIscsiDiscoverRequest) Query(key, value string) *HostServiceIscsiDiscoverRequest { +func (p *NetworkLabelsServiceAddRequest) Query(key, value string) *NetworkLabelsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -48611,27 +51404,13 @@ func (p *HostServiceIscsiDiscoverRequest) Query(key, value string) *HostServiceI return p } -func (p *HostServiceIscsiDiscoverRequest) Async(async bool) *HostServiceIscsiDiscoverRequest { - p.async = &async - return p -} - -func (p *HostServiceIscsiDiscoverRequest) Iscsi(iscsi *IscsiDetails) *HostServiceIscsiDiscoverRequest { - p.iscsi = iscsi +func (p *NetworkLabelsServiceAddRequest) Label(label *NetworkLabel) *NetworkLabelsServiceAddRequest { + p.label = label return p } -func (p *HostServiceIscsiDiscoverRequest) Send() (*HostServiceIscsiDiscoverResponse, error) { - rawURL := fmt.Sprintf("%s%s/iscsidiscover", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Iscsi(p.iscsi) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworkLabelsServiceAddRequest) Send() (*NetworkLabelsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkLabelsService.connection.URL(), p.NetworkLabelsService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -48643,14 +51422,17 @@ func (p *HostServiceIscsiDiscoverRequest) Send() (*HostServiceIscsiDiscoverRespo } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkLabelWriteOne(writer, p.label, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -48665,18 +51447,18 @@ func (p *HostServiceIscsiDiscoverRequest) Send() (*HostServiceIscsiDiscoverRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -48685,17 +51467,24 @@ func (p *HostServiceIscsiDiscoverRequest) Send() (*HostServiceIscsiDiscoverRespo if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - result := action.MustIscsiTargets() - return &HostServiceIscsiDiscoverResponse{iscsiTargets: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkLabelReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NetworkLabelsServiceAddResponse{label: result}, nil } -func (p *HostServiceIscsiDiscoverRequest) MustSend() *HostServiceIscsiDiscoverResponse { +func (p *NetworkLabelsServiceAddRequest) MustSend() *NetworkLabelsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -48704,114 +51493,70 @@ func (p *HostServiceIscsiDiscoverRequest) MustSend() *HostServiceIscsiDiscoverRe } // -// Discovers iSCSI targets on the host, using the initiator details. -// For example, to discover iSCSI targets available in `myiscsi.example.com`, -// from host `123`, send a request like this: +// Attaches label to logical network. +// You can attach labels to a logical network to automate the association of that logical network with physical host +// network interfaces to which the same label has been attached. +// For example, to attach the label `mylabel` to a logical network having id `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/iscsidiscover +// POST /ovirt-engine/api/networks/123/networklabels // ---- // With a request body like this: // [source,xml] // ---- -// -// -//
myiscsi.example.com
-//
-//
-// ---- -// The result will be like this: -// [source,xml] -// ---- -// -// -//
10.35.1.72
-// 3260 -// 10.35.1.72:3260,1 -// iqn.2015-08.com.tgt:444 -//
-//
+// // ---- // -type HostServiceIscsiDiscoverResponse struct { - discoveredTargets *IscsiDetailsSlice - iscsiTargets []string -} - -func (p *HostServiceIscsiDiscoverResponse) DiscoveredTargets() (*IscsiDetailsSlice, bool) { - if p.discoveredTargets != nil { - return p.discoveredTargets, true - } - return nil, false -} - -func (p *HostServiceIscsiDiscoverResponse) MustDiscoveredTargets() *IscsiDetailsSlice { - if p.discoveredTargets == nil { - panic("discoveredTargets in response does not exist") - } - return p.discoveredTargets +type NetworkLabelsServiceAddResponse struct { + label *NetworkLabel } -func (p *HostServiceIscsiDiscoverResponse) IscsiTargets() ([]string, bool) { - if p.iscsiTargets != nil { - return p.iscsiTargets, true +func (p *NetworkLabelsServiceAddResponse) Label() (*NetworkLabel, bool) { + if p.label != nil { + return p.label, true } return nil, false } -func (p *HostServiceIscsiDiscoverResponse) MustIscsiTargets() []string { - if p.iscsiTargets == nil { - panic("iscsiTargets in response does not exist") +func (p *NetworkLabelsServiceAddResponse) MustLabel() *NetworkLabel { + if p.label == nil { + panic("label in response does not exist") } - return p.iscsiTargets + return p.label } // -// Discovers iSCSI targets on the host, using the initiator details. -// For example, to discover iSCSI targets available in `myiscsi.example.com`, -// from host `123`, send a request like this: +// Attaches label to logical network. +// You can attach labels to a logical network to automate the association of that logical network with physical host +// network interfaces to which the same label has been attached. +// For example, to attach the label `mylabel` to a logical network having id `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/iscsidiscover +// POST /ovirt-engine/api/networks/123/networklabels // ---- // With a request body like this: // [source,xml] // ---- -// -// -//
myiscsi.example.com
-//
-//
-// ---- -// The result will be like this: -// [source,xml] -// ---- -// -// -//
10.35.1.72
-// 3260 -// 10.35.1.72:3260,1 -// iqn.2015-08.com.tgt:444 -//
-//
+// // ---- // -func (p *HostService) IscsiDiscover() *HostServiceIscsiDiscoverRequest { - return &HostServiceIscsiDiscoverRequest{HostService: p} +func (p *NetworkLabelsService) Add() *NetworkLabelsServiceAddRequest { + return &NetworkLabelsServiceAddRequest{NetworkLabelsService: p} } // -// Login to iSCSI targets on the host, using the target details. +// Returns the list of labels attached to the network or host NIC. +// The order of the returned list of labels isn't guaranteed. // -type HostServiceIscsiLoginRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - iscsi *IscsiDetails +type NetworkLabelsServiceListRequest struct { + NetworkLabelsService *NetworkLabelsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *HostServiceIscsiLoginRequest) Header(key, value string) *HostServiceIscsiLoginRequest { +func (p *NetworkLabelsServiceListRequest) Header(key, value string) *NetworkLabelsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -48819,7 +51564,7 @@ func (p *HostServiceIscsiLoginRequest) Header(key, value string) *HostServiceIsc return p } -func (p *HostServiceIscsiLoginRequest) Query(key, value string) *HostServiceIscsiLoginRequest { +func (p *NetworkLabelsServiceListRequest) Query(key, value string) *NetworkLabelsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -48827,28 +51572,27 @@ func (p *HostServiceIscsiLoginRequest) Query(key, value string) *HostServiceIscs return p } -func (p *HostServiceIscsiLoginRequest) Async(async bool) *HostServiceIscsiLoginRequest { - p.async = &async +func (p *NetworkLabelsServiceListRequest) Follow(follow string) *NetworkLabelsServiceListRequest { + p.follow = &follow return p } -func (p *HostServiceIscsiLoginRequest) Iscsi(iscsi *IscsiDetails) *HostServiceIscsiLoginRequest { - p.iscsi = iscsi +func (p *NetworkLabelsServiceListRequest) Max(max int64) *NetworkLabelsServiceListRequest { + p.max = &max return p } -func (p *HostServiceIscsiLoginRequest) Send() (*HostServiceIscsiLoginResponse, error) { - rawURL := fmt.Sprintf("%s%s/iscsilogin", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *NetworkLabelsServiceListRequest) Send() (*NetworkLabelsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkLabelsService.connection.URL(), p.NetworkLabelsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - actionBuilder.Iscsi(p.iscsi) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -48857,16 +51601,12 @@ func (p *HostServiceIscsiLoginRequest) Send() (*HostServiceIscsiLoginResponse, e if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkLabelsService.connection.headers { req.Header.Add(hk, hv) } @@ -48881,18 +51621,18 @@ func (p *HostServiceIscsiLoginRequest) Send() (*HostServiceIscsiLoginResponse, e req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkLabelsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkLabelsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkLabelsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -48901,16 +51641,24 @@ func (p *HostServiceIscsiLoginRequest) Send() (*HostServiceIscsiLoginResponse, e if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkLabelsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceIscsiLoginResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkLabelReadMany(reader, nil) + if err != nil { + return nil, err + } + return &NetworkLabelsServiceListResponse{labels: result}, nil } -func (p *HostServiceIscsiLoginRequest) MustSend() *HostServiceIscsiLoginResponse { +func (p *NetworkLabelsServiceListRequest) MustSend() *NetworkLabelsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -48919,29 +51667,106 @@ func (p *HostServiceIscsiLoginRequest) MustSend() *HostServiceIscsiLoginResponse } // -// Login to iSCSI targets on the host, using the target details. +// Returns the list of labels attached to the network or host NIC. +// The order of the returned list of labels isn't guaranteed. // -type HostServiceIscsiLoginResponse struct { +type NetworkLabelsServiceListResponse struct { + labels *NetworkLabelSlice +} + +func (p *NetworkLabelsServiceListResponse) Labels() (*NetworkLabelSlice, bool) { + if p.labels != nil { + return p.labels, true + } + return nil, false +} + +func (p *NetworkLabelsServiceListResponse) MustLabels() *NetworkLabelSlice { + if p.labels == nil { + panic("labels in response does not exist") + } + return p.labels } // -// Login to iSCSI targets on the host, using the target details. +// Returns the list of labels attached to the network or host NIC. +// The order of the returned list of labels isn't guaranteed. // -func (p *HostService) IscsiLogin() *HostServiceIscsiLoginRequest { - return &HostServiceIscsiLoginRequest{HostService: p} +func (p *NetworkLabelsService) List() *NetworkLabelsServiceListRequest { + return &NetworkLabelsServiceListRequest{NetworkLabelsService: p} } // -// Refresh the host devices and capabilities. // -type HostServiceRefreshRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool +func (op *NetworkLabelsService) LabelService(id string) *NetworkLabelService { + return NewNetworkLabelService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *HostServiceRefreshRequest) Header(key, value string) *HostServiceRefreshRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworkLabelsService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.LabelService(path), nil + } + return op.LabelService(path[:index]).Service(path[index+1:]) +} + +func (op *NetworkLabelsService) String() string { + return fmt.Sprintf("NetworkLabelsService:%s", op.path) +} + +// +// A service managing a network +// +type NetworkService struct { + BaseService +} + +func NewNetworkService(connection *Connection, path string) *NetworkService { + var result NetworkService + result.connection = connection + result.path = path + return &result +} + +// +// Gets a logical network. +// For example: +// [source] +// ---- +// GET /ovirt-engine/api/networks/123 +// ---- +// Will respond: +// [source,xml] +// ---- +// +// ovirtmgmt +// Default Management Network +// +// +// +// 0 +// false +// +// vm +// +// +// +// ---- +// +type NetworkServiceGetRequest struct { + NetworkService *NetworkService + header map[string]string + query map[string]string + follow *string +} + +func (p *NetworkServiceGetRequest) Header(key, value string) *NetworkServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -48949,7 +51774,7 @@ func (p *HostServiceRefreshRequest) Header(key, value string) *HostServiceRefres return p } -func (p *HostServiceRefreshRequest) Query(key, value string) *HostServiceRefreshRequest { +func (p *NetworkServiceGetRequest) Query(key, value string) *NetworkServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -48957,22 +51782,18 @@ func (p *HostServiceRefreshRequest) Query(key, value string) *HostServiceRefresh return p } -func (p *HostServiceRefreshRequest) Async(async bool) *HostServiceRefreshRequest { - p.async = &async +func (p *NetworkServiceGetRequest) Follow(follow string) *NetworkServiceGetRequest { + p.follow = &follow return p } -func (p *HostServiceRefreshRequest) Send() (*HostServiceRefreshResponse, error) { - rawURL := fmt.Sprintf("%s%s/refresh", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworkServiceGetRequest) Send() (*NetworkServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkService.connection.URL(), p.NetworkService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -48981,16 +51802,12 @@ func (p *HostServiceRefreshRequest) Send() (*HostServiceRefreshResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -49005,18 +51822,18 @@ func (p *HostServiceRefreshRequest) Send() (*HostServiceRefreshResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -49025,16 +51842,24 @@ func (p *HostServiceRefreshRequest) Send() (*HostServiceRefreshResponse, error) if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceRefreshResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NetworkServiceGetResponse{network: result}, nil } -func (p *HostServiceRefreshRequest) MustSend() *HostServiceRefreshResponse { +func (p *NetworkServiceGetRequest) MustSend() *NetworkServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -49043,44 +51868,106 @@ func (p *HostServiceRefreshRequest) MustSend() *HostServiceRefreshResponse { } // -// Refresh the host devices and capabilities. +// Gets a logical network. +// For example: +// [source] +// ---- +// GET /ovirt-engine/api/networks/123 +// ---- +// Will respond: +// [source,xml] +// ---- +// +// ovirtmgmt +// Default Management Network +// +// +// +// 0 +// false +// +// vm +// +// +// +// ---- // -type HostServiceRefreshResponse struct { +type NetworkServiceGetResponse struct { + network *Network +} + +func (p *NetworkServiceGetResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true + } + return nil, false +} + +func (p *NetworkServiceGetResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") + } + return p.network } // -// Refresh the host devices and capabilities. +// Gets a logical network. +// For example: +// [source] +// ---- +// GET /ovirt-engine/api/networks/123 +// ---- +// Will respond: +// [source,xml] +// ---- +// +// ovirtmgmt +// Default Management Network +// +// +// +// 0 +// false +// +// vm +// +// +// +// ---- // -func (p *HostService) Refresh() *HostServiceRefreshRequest { - return &HostServiceRefreshRequest{HostService: p} +func (p *NetworkService) Get() *NetworkServiceGetRequest { + return &NetworkServiceGetRequest{NetworkService: p} } // -// Remove the host from the system. +// Removes a logical network, or the association of a logical network to a data center. +// For example, to remove the logical network `123` send a request like this: // [source] // ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request DELETE \ -// --header "Version: 4" \ -// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc" +// DELETE /ovirt-engine/api/networks/123 +// ---- +// Each network is bound exactly to one data center. So if we disassociate network with data center it has the same +// result as if we would just remove that network. However it might be more specific to say we're removing network +// `456` of data center `123`. +// For example, to remove the association of network `456` to data center `123` send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/networks/456 // ---- +// NOTE: To remove an external logical network, the network has to be removed directly from its provider by +// https://developer.openstack.org/api-ref/network[OpenStack Networking API]. +// The entity representing the external network inside {product-name} is removed automatically, +// if <> is enabled for the provider, +// otherwise the entity has to be removed using this method. // -type HostServiceRemoveRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - force *bool +type NetworkServiceRemoveRequest struct { + NetworkService *NetworkService + header map[string]string + query map[string]string + async *bool } -func (p *HostServiceRemoveRequest) Header(key, value string) *HostServiceRemoveRequest { +func (p *NetworkServiceRemoveRequest) Header(key, value string) *NetworkServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -49088,7 +51975,7 @@ func (p *HostServiceRemoveRequest) Header(key, value string) *HostServiceRemoveR return p } -func (p *HostServiceRemoveRequest) Query(key, value string) *HostServiceRemoveRequest { +func (p *NetworkServiceRemoveRequest) Query(key, value string) *NetworkServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -49096,27 +51983,18 @@ func (p *HostServiceRemoveRequest) Query(key, value string) *HostServiceRemoveRe return p } -func (p *HostServiceRemoveRequest) Async(async bool) *HostServiceRemoveRequest { +func (p *NetworkServiceRemoveRequest) Async(async bool) *NetworkServiceRemoveRequest { p.async = &async return p } -func (p *HostServiceRemoveRequest) Force(force bool) *HostServiceRemoveRequest { - p.force = &force - return p -} - -func (p *HostServiceRemoveRequest) Send() (*HostServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostService.connection.URL(), p.HostService.path) +func (p *NetworkServiceRemoveRequest) Send() (*NetworkServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkService.connection.URL(), p.NetworkService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - if p.force != nil { - values["force"] = []string{fmt.Sprintf("%v", *p.force)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -49130,7 +52008,7 @@ func (p *HostServiceRemoveRequest) Send() (*HostServiceRemoveResponse, error) { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -49145,18 +52023,18 @@ func (p *HostServiceRemoveRequest) Send() (*HostServiceRemoveResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -49165,7 +52043,7 @@ func (p *HostServiceRemoveRequest) Send() (*HostServiceRemoveResponse, error) { if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -49174,10 +52052,10 @@ func (p *HostServiceRemoveRequest) Send() (*HostServiceRemoveResponse, error) { if errReadBody != nil { return nil, errReadBody } - return new(HostServiceRemoveResponse), nil + return new(NetworkServiceRemoveResponse), nil } -func (p *HostServiceRemoveRequest) MustSend() *HostServiceRemoveResponse { +func (p *NetworkServiceRemoveRequest) MustSend() *NetworkServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -49186,222 +52064,94 @@ func (p *HostServiceRemoveRequest) MustSend() *HostServiceRemoveResponse { } // -// Remove the host from the system. +// Removes a logical network, or the association of a logical network to a data center. +// For example, to remove the logical network `123` send a request like this: // [source] // ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request DELETE \ -// --header "Version: 4" \ -// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc" +// DELETE /ovirt-engine/api/networks/123 +// ---- +// Each network is bound exactly to one data center. So if we disassociate network with data center it has the same +// result as if we would just remove that network. However it might be more specific to say we're removing network +// `456` of data center `123`. +// For example, to remove the association of network `456` to data center `123` send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/networks/456 // ---- +// NOTE: To remove an external logical network, the network has to be removed directly from its provider by +// https://developer.openstack.org/api-ref/network[OpenStack Networking API]. +// The entity representing the external network inside {product-name} is removed automatically, +// if <> is enabled for the provider, +// otherwise the entity has to be removed using this method. // -type HostServiceRemoveResponse struct { +type NetworkServiceRemoveResponse struct { } // -// Remove the host from the system. +// Removes a logical network, or the association of a logical network to a data center. +// For example, to remove the logical network `123` send a request like this: // [source] // ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request DELETE \ -// --header "Version: 4" \ -// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc" +// DELETE /ovirt-engine/api/networks/123 +// ---- +// Each network is bound exactly to one data center. So if we disassociate network with data center it has the same +// result as if we would just remove that network. However it might be more specific to say we're removing network +// `456` of data center `123`. +// For example, to remove the association of network `456` to data center `123` send a request like this: +// [source] // ---- +// DELETE /ovirt-engine/api/datacenters/123/networks/456 +// ---- +// NOTE: To remove an external logical network, the network has to be removed directly from its provider by +// https://developer.openstack.org/api-ref/network[OpenStack Networking API]. +// The entity representing the external network inside {product-name} is removed automatically, +// if <> is enabled for the provider, +// otherwise the entity has to be removed using this method. // -func (p *HostService) Remove() *HostServiceRemoveRequest { - return &HostServiceRemoveRequest{HostService: p} +func (p *NetworkService) Remove() *NetworkServiceRemoveRequest { + return &NetworkServiceRemoveRequest{NetworkService: p} } // -// This method is used to change the configuration of the network interfaces of a host. -// For example, if you have a host with three network interfaces `eth0`, `eth1` and `eth2` and you want to configure -// a new bond using `eth0` and `eth1`, and put a VLAN on top of it. Using a simple shell script and the `curl` -// command line HTTP client that can be done as follows: +// Updates a logical network. +// The `name`, `description`, `ip`, `vlan`, `stp` and `display` attributes can be updated. +// For example, to update the description of the logical network `123` send a request like this: // [source] // ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --data ' -// -// -// -// bond0 -// -// -// -// -// -// -// -// eth1 -// -// -// eth2 -// -// -// -// -// -// -// -// -// myvlan -// -// -// bond0 -// -// -// static -// -// -//
192.168.122.10
-// 255.255.255.0 -//
-//
-//
-// -// -// 1.1.1.1 -// 2.2.2.2 -// -// -//
-//
-//
-// ' \ -// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" +// PUT /ovirt-engine/api/networks/123 // ---- -// NOTE: This is valid for version 4 of the API. In previous versions some elements were represented as XML -// attributes instead of XML elements. In particular the `options` and `ip` elements were represented as follows: +// With a request body like this: // [source,xml] // ---- -// -// -// +// +// My updated description +// // ---- -// The same thing can be done using the Python SDK with the following code: -// [source,python] +// The maximum transmission unit of a network is set using a PUT request to +// specify the integer value of the `mtu` attribute. +// For example, to set the maximum transmission unit send a request like this: +// [source] // ---- -// # Find the service that manages the collection of hosts: -// hosts_service = connection.system_service().hosts_service() -// # Find the host: -// host = hosts_service.list(search='name=myhost')[0] -// # Find the service that manages the host: -// host_service = hosts_service.host_service(host.id) -// # Configure the network adding a bond with two slaves and attaching it to a -// # network with an static IP address: -// host_service.setup_networks( -// modified_bonds=[ -// types.HostNic( -// name='bond0', -// bonding=types.Bonding( -// options=[ -// types.Option( -// name='mode', -// value='4', -// ), -// types.Option( -// name='miimon', -// value='100', -// ), -// ], -// slaves=[ -// types.HostNic( -// name='eth1', -// ), -// types.HostNic( -// name='eth2', -// ), -// ], -// ), -// ), -// ], -// modified_network_attachments=[ -// types.NetworkAttachment( -// network=types.Network( -// name='myvlan', -// ), -// host_nic=types.HostNic( -// name='bond0', -// ), -// ip_address_assignments=[ -// types.IpAddressAssignment( -// assignment_method=types.BootProtocol.STATIC, -// ip=types.Ip( -// address='192.168.122.10', -// netmask='255.255.255.0', -// ), -// ), -// ], -// dns_resolver_configuration=types.DnsResolverConfiguration( -// name_servers=[ -// '1.1.1.1', -// '2.2.2.2', -// ], -// ), -// ), -// ], -// ) -// # After modifying the network configuration it is very important to make it -// # persistent: -// host_service.commit_net_config() +// PUT /ovirt-engine/api/datacenters/123/networks/456 // ---- -// IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied -// when the host is rebooted, remember to call <>. -// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in -// the <> request, in which case the new -// configuration is automatically saved in the {hypervisor-name} upon completing the setup and -// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without -// waiting for a separate <> request. +// With a request body like this: +// [source,xml] +// ---- +// +// 1500 +// +// ---- +// NOTE: Updating external networks is not propagated to the provider. // -type HostServiceSetupNetworksRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - checkConnectivity *bool - commitOnSuccess *bool - connectivityTimeout *int64 - modifiedBonds *HostNicSlice - modifiedLabels *NetworkLabelSlice - modifiedNetworkAttachments *NetworkAttachmentSlice - removedBonds *HostNicSlice - removedLabels *NetworkLabelSlice - removedNetworkAttachments *NetworkAttachmentSlice - synchronizedNetworkAttachments *NetworkAttachmentSlice +type NetworkServiceUpdateRequest struct { + NetworkService *NetworkService + header map[string]string + query map[string]string + async *bool + network *Network } -func (p *HostServiceSetupNetworksRequest) Header(key, value string) *HostServiceSetupNetworksRequest { +func (p *NetworkServiceUpdateRequest) Header(key, value string) *NetworkServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -49409,7 +52159,7 @@ func (p *HostServiceSetupNetworksRequest) Header(key, value string) *HostService return p } -func (p *HostServiceSetupNetworksRequest) Query(key, value string) *HostServiceSetupNetworksRequest { +func (p *NetworkServiceUpdateRequest) Query(key, value string) *NetworkServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -49417,144 +52167,23 @@ func (p *HostServiceSetupNetworksRequest) Query(key, value string) *HostServiceS return p } -func (p *HostServiceSetupNetworksRequest) Async(async bool) *HostServiceSetupNetworksRequest { +func (p *NetworkServiceUpdateRequest) Async(async bool) *NetworkServiceUpdateRequest { p.async = &async return p } -func (p *HostServiceSetupNetworksRequest) CheckConnectivity(checkConnectivity bool) *HostServiceSetupNetworksRequest { - p.checkConnectivity = &checkConnectivity - return p -} - -func (p *HostServiceSetupNetworksRequest) CommitOnSuccess(commitOnSuccess bool) *HostServiceSetupNetworksRequest { - p.commitOnSuccess = &commitOnSuccess - return p -} - -func (p *HostServiceSetupNetworksRequest) ConnectivityTimeout(connectivityTimeout int64) *HostServiceSetupNetworksRequest { - p.connectivityTimeout = &connectivityTimeout - return p -} - -func (p *HostServiceSetupNetworksRequest) ModifiedBonds(modifiedBonds *HostNicSlice) *HostServiceSetupNetworksRequest { - p.modifiedBonds = modifiedBonds - return p -} - -func (p *HostServiceSetupNetworksRequest) ModifiedBondsOfAny(anys ...*HostNic) *HostServiceSetupNetworksRequest { - if p.modifiedBonds == nil { - p.modifiedBonds = new(HostNicSlice) - } - p.modifiedBonds.slice = append(p.modifiedBonds.slice, anys...) - return p -} - -func (p *HostServiceSetupNetworksRequest) ModifiedLabels(modifiedLabels *NetworkLabelSlice) *HostServiceSetupNetworksRequest { - p.modifiedLabels = modifiedLabels - return p -} - -func (p *HostServiceSetupNetworksRequest) ModifiedLabelsOfAny(anys ...*NetworkLabel) *HostServiceSetupNetworksRequest { - if p.modifiedLabels == nil { - p.modifiedLabels = new(NetworkLabelSlice) - } - p.modifiedLabels.slice = append(p.modifiedLabels.slice, anys...) - return p -} - -func (p *HostServiceSetupNetworksRequest) ModifiedNetworkAttachments(modifiedNetworkAttachments *NetworkAttachmentSlice) *HostServiceSetupNetworksRequest { - p.modifiedNetworkAttachments = modifiedNetworkAttachments - return p -} - -func (p *HostServiceSetupNetworksRequest) ModifiedNetworkAttachmentsOfAny(anys ...*NetworkAttachment) *HostServiceSetupNetworksRequest { - if p.modifiedNetworkAttachments == nil { - p.modifiedNetworkAttachments = new(NetworkAttachmentSlice) - } - p.modifiedNetworkAttachments.slice = append(p.modifiedNetworkAttachments.slice, anys...) - return p -} - -func (p *HostServiceSetupNetworksRequest) RemovedBonds(removedBonds *HostNicSlice) *HostServiceSetupNetworksRequest { - p.removedBonds = removedBonds - return p -} - -func (p *HostServiceSetupNetworksRequest) RemovedBondsOfAny(anys ...*HostNic) *HostServiceSetupNetworksRequest { - if p.removedBonds == nil { - p.removedBonds = new(HostNicSlice) - } - p.removedBonds.slice = append(p.removedBonds.slice, anys...) - return p -} - -func (p *HostServiceSetupNetworksRequest) RemovedLabels(removedLabels *NetworkLabelSlice) *HostServiceSetupNetworksRequest { - p.removedLabels = removedLabels - return p -} - -func (p *HostServiceSetupNetworksRequest) RemovedLabelsOfAny(anys ...*NetworkLabel) *HostServiceSetupNetworksRequest { - if p.removedLabels == nil { - p.removedLabels = new(NetworkLabelSlice) - } - p.removedLabels.slice = append(p.removedLabels.slice, anys...) - return p -} - -func (p *HostServiceSetupNetworksRequest) RemovedNetworkAttachments(removedNetworkAttachments *NetworkAttachmentSlice) *HostServiceSetupNetworksRequest { - p.removedNetworkAttachments = removedNetworkAttachments - return p -} - -func (p *HostServiceSetupNetworksRequest) RemovedNetworkAttachmentsOfAny(anys ...*NetworkAttachment) *HostServiceSetupNetworksRequest { - if p.removedNetworkAttachments == nil { - p.removedNetworkAttachments = new(NetworkAttachmentSlice) - } - p.removedNetworkAttachments.slice = append(p.removedNetworkAttachments.slice, anys...) - return p -} - -func (p *HostServiceSetupNetworksRequest) SynchronizedNetworkAttachments(synchronizedNetworkAttachments *NetworkAttachmentSlice) *HostServiceSetupNetworksRequest { - p.synchronizedNetworkAttachments = synchronizedNetworkAttachments - return p -} - -func (p *HostServiceSetupNetworksRequest) SynchronizedNetworkAttachmentsOfAny(anys ...*NetworkAttachment) *HostServiceSetupNetworksRequest { - if p.synchronizedNetworkAttachments == nil { - p.synchronizedNetworkAttachments = new(NetworkAttachmentSlice) - } - p.synchronizedNetworkAttachments.slice = append(p.synchronizedNetworkAttachments.slice, anys...) +func (p *NetworkServiceUpdateRequest) Network(network *Network) *NetworkServiceUpdateRequest { + p.network = network return p } -func (p *HostServiceSetupNetworksRequest) Send() (*HostServiceSetupNetworksResponse, error) { - rawURL := fmt.Sprintf("%s%s/setupnetworks", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() +func (p *NetworkServiceUpdateRequest) Send() (*NetworkServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworkService.connection.URL(), p.NetworkService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.checkConnectivity != nil { - actionBuilder.CheckConnectivity(*p.checkConnectivity) - } - if p.commitOnSuccess != nil { - actionBuilder.CommitOnSuccess(*p.commitOnSuccess) - } - if p.connectivityTimeout != nil { - actionBuilder.ConnectivityTimeout(*p.connectivityTimeout) - } - actionBuilder.ModifiedBonds(p.modifiedBonds) - actionBuilder.ModifiedLabels(p.modifiedLabels) - actionBuilder.ModifiedNetworkAttachments(p.modifiedNetworkAttachments) - actionBuilder.RemovedBonds(p.removedBonds) - actionBuilder.RemovedLabels(p.removedLabels) - actionBuilder.RemovedNetworkAttachments(p.removedNetworkAttachments) - actionBuilder.SynchronizedNetworkAttachments(p.synchronizedNetworkAttachments) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -49565,14 +52194,17 @@ func (p *HostServiceSetupNetworksRequest) Send() (*HostServiceSetupNetworksRespo } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkWriteOne(writer, p.network, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworkService.connection.headers { req.Header.Add(hk, hv) } @@ -49587,18 +52219,18 @@ func (p *HostServiceSetupNetworksRequest) Send() (*HostServiceSetupNetworksRespo req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworkService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworkService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworkService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -49607,366 +52239,236 @@ func (p *HostServiceSetupNetworksRequest) Send() (*HostServiceSetupNetworksRespo if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworkService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceSetupNetworksResponse), nil -} - -func (p *HostServiceSetupNetworksRequest) MustSend() *HostServiceSetupNetworksResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkReadOne(reader, nil, "") + if err != nil { + return nil, err } + return &NetworkServiceUpdateResponse{network: result}, nil } -// -// This method is used to change the configuration of the network interfaces of a host. -// For example, if you have a host with three network interfaces `eth0`, `eth1` and `eth2` and you want to configure -// a new bond using `eth0` and `eth1`, and put a VLAN on top of it. Using a simple shell script and the `curl` -// command line HTTP client that can be done as follows: -// [source] -// ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --data ' -// -// -// -// bond0 -// -// -// -// -// -// -// -// eth1 -// -// -// eth2 -// -// -// -// -// -// -// -// -// myvlan -// -// -// bond0 -// -// -// static -// -// -//
192.168.122.10
-// 255.255.255.0 -//
-//
-//
-// -// -// 1.1.1.1 -// 2.2.2.2 -// -// -//
-//
-//
-// ' \ -// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" +func (p *NetworkServiceUpdateRequest) MustSend() *NetworkServiceUpdateResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// Updates a logical network. +// The `name`, `description`, `ip`, `vlan`, `stp` and `display` attributes can be updated. +// For example, to update the description of the logical network `123` send a request like this: +// [source] // ---- -// NOTE: This is valid for version 4 of the API. In previous versions some elements were represented as XML -// attributes instead of XML elements. In particular the `options` and `ip` elements were represented as follows: +// PUT /ovirt-engine/api/networks/123 +// ---- +// With a request body like this: // [source,xml] // ---- -// -// -// +// +// My updated description +// // ---- -// The same thing can be done using the Python SDK with the following code: -// [source,python] +// The maximum transmission unit of a network is set using a PUT request to +// specify the integer value of the `mtu` attribute. +// For example, to set the maximum transmission unit send a request like this: +// [source] // ---- -// # Find the service that manages the collection of hosts: -// hosts_service = connection.system_service().hosts_service() -// # Find the host: -// host = hosts_service.list(search='name=myhost')[0] -// # Find the service that manages the host: -// host_service = hosts_service.host_service(host.id) -// # Configure the network adding a bond with two slaves and attaching it to a -// # network with an static IP address: -// host_service.setup_networks( -// modified_bonds=[ -// types.HostNic( -// name='bond0', -// bonding=types.Bonding( -// options=[ -// types.Option( -// name='mode', -// value='4', -// ), -// types.Option( -// name='miimon', -// value='100', -// ), -// ], -// slaves=[ -// types.HostNic( -// name='eth1', -// ), -// types.HostNic( -// name='eth2', -// ), -// ], -// ), -// ), -// ], -// modified_network_attachments=[ -// types.NetworkAttachment( -// network=types.Network( -// name='myvlan', -// ), -// host_nic=types.HostNic( -// name='bond0', -// ), -// ip_address_assignments=[ -// types.IpAddressAssignment( -// assignment_method=types.BootProtocol.STATIC, -// ip=types.Ip( -// address='192.168.122.10', -// netmask='255.255.255.0', -// ), -// ), -// ], -// dns_resolver_configuration=types.DnsResolverConfiguration( -// name_servers=[ -// '1.1.1.1', -// '2.2.2.2', -// ], -// ), -// ), -// ], -// ) -// # After modifying the network configuration it is very important to make it -// # persistent: -// host_service.commit_net_config() +// PUT /ovirt-engine/api/datacenters/123/networks/456 // ---- -// IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied -// when the host is rebooted, remember to call <>. -// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in -// the <> request, in which case the new -// configuration is automatically saved in the {hypervisor-name} upon completing the setup and -// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without -// waiting for a separate <> request. +// With a request body like this: +// [source,xml] +// ---- +// +// 1500 +// +// ---- +// NOTE: Updating external networks is not propagated to the provider. // -type HostServiceSetupNetworksResponse struct { +type NetworkServiceUpdateResponse struct { + network *Network +} + +func (p *NetworkServiceUpdateResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true + } + return nil, false +} + +func (p *NetworkServiceUpdateResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") + } + return p.network } // -// This method is used to change the configuration of the network interfaces of a host. -// For example, if you have a host with three network interfaces `eth0`, `eth1` and `eth2` and you want to configure -// a new bond using `eth0` and `eth1`, and put a VLAN on top of it. Using a simple shell script and the `curl` -// command line HTTP client that can be done as follows: +// Updates a logical network. +// The `name`, `description`, `ip`, `vlan`, `stp` and `display` attributes can be updated. +// For example, to update the description of the logical network `123` send a request like this: // [source] // ---- -// #!/bin/sh -ex -// url="https://engine.example.com/ovirt-engine/api" -// user="admin@internal" -// password="..." -// curl \ -// --verbose \ -// --cacert /etc/pki/ovirt-engine/ca.pem \ -// --user "${user}:${password}" \ -// --request POST \ -// --header "Version: 4" \ -// --header "Content-Type: application/xml" \ -// --header "Accept: application/xml" \ -// --data ' -// -// -// -// bond0 -// -// -// -// -// -// -// -// eth1 -// -// -// eth2 -// -// -// -// -// -// -// -// -// myvlan -// -// -// bond0 -// -// -// static -// -// -//
192.168.122.10
-// 255.255.255.0 -//
-//
-//
-// -// -// 1.1.1.1 -// 2.2.2.2 -// -// -//
-//
-//
-// ' \ -// "${url}/hosts/1ff7a191-2f3b-4eff-812b-9f91a30c3acc/setupnetworks" +// PUT /ovirt-engine/api/networks/123 // ---- -// NOTE: This is valid for version 4 of the API. In previous versions some elements were represented as XML -// attributes instead of XML elements. In particular the `options` and `ip` elements were represented as follows: +// With a request body like this: // [source,xml] // ---- -// -// -// +// +// My updated description +// // ---- -// The same thing can be done using the Python SDK with the following code: -// [source,python] +// The maximum transmission unit of a network is set using a PUT request to +// specify the integer value of the `mtu` attribute. +// For example, to set the maximum transmission unit send a request like this: +// [source] // ---- -// # Find the service that manages the collection of hosts: -// hosts_service = connection.system_service().hosts_service() -// # Find the host: -// host = hosts_service.list(search='name=myhost')[0] -// # Find the service that manages the host: -// host_service = hosts_service.host_service(host.id) -// # Configure the network adding a bond with two slaves and attaching it to a -// # network with an static IP address: -// host_service.setup_networks( -// modified_bonds=[ -// types.HostNic( -// name='bond0', -// bonding=types.Bonding( -// options=[ -// types.Option( -// name='mode', -// value='4', -// ), -// types.Option( -// name='miimon', -// value='100', -// ), -// ], -// slaves=[ -// types.HostNic( -// name='eth1', -// ), -// types.HostNic( -// name='eth2', -// ), -// ], -// ), -// ), -// ], -// modified_network_attachments=[ -// types.NetworkAttachment( -// network=types.Network( -// name='myvlan', -// ), -// host_nic=types.HostNic( -// name='bond0', -// ), -// ip_address_assignments=[ -// types.IpAddressAssignment( -// assignment_method=types.BootProtocol.STATIC, -// ip=types.Ip( -// address='192.168.122.10', -// netmask='255.255.255.0', -// ), -// ), -// ], -// dns_resolver_configuration=types.DnsResolverConfiguration( -// name_servers=[ -// '1.1.1.1', -// '2.2.2.2', -// ], -// ), -// ), -// ], -// ) -// # After modifying the network configuration it is very important to make it -// # persistent: -// host_service.commit_net_config() +// PUT /ovirt-engine/api/datacenters/123/networks/456 // ---- -// IMPORTANT: To make sure that the network configuration has been saved in the host, and that it will be applied -// when the host is rebooted, remember to call <>. -// IMPORTANT: Since {engine-name} 4.3, it is possible to also specify `commit_on_success` in -// the <> request, in which case the new -// configuration is automatically saved in the {hypervisor-name} upon completing the setup and -// re-establishing connectivity between the {hypervisor-name} and {engine-name}, and without -// waiting for a separate <> request. +// With a request body like this: +// [source,xml] +// ---- +// +// 1500 +// +// ---- +// NOTE: Updating external networks is not propagated to the provider. // -func (p *HostService) SetupNetworks() *HostServiceSetupNetworksRequest { - return &HostServiceSetupNetworksRequest{HostService: p} +func (p *NetworkService) Update() *NetworkServiceUpdateRequest { + return &NetworkServiceUpdateRequest{NetworkService: p} } // -// To synchronize all networks on the host, send a request like this: +// Reference to the service that manages the network labels assigned to this network. +// +func (op *NetworkService) NetworkLabelsService() *NetworkLabelsService { + return NewNetworkLabelsService(op.connection, fmt.Sprintf("%s/networklabels", op.path)) +} + +// +// Reference to the service that manages the permissions assigned to this network. +// +func (op *NetworkService) PermissionsService() *AssignedPermissionsService { + return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) +} + +// +// Reference to the service that manages the vNIC profiles assigned to this network. +// +func (op *NetworkService) VnicProfilesService() *AssignedVnicProfilesService { + return NewAssignedVnicProfilesService(op.connection, fmt.Sprintf("%s/vnicprofiles", op.path)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworkService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + if path == "networklabels" { + return op.NetworkLabelsService(), nil + } + if strings.HasPrefix(path, "networklabels/") { + return op.NetworkLabelsService().Service(path[14:]) + } + if path == "permissions" { + return op.PermissionsService(), nil + } + if strings.HasPrefix(path, "permissions/") { + return op.PermissionsService().Service(path[12:]) + } + if path == "vnicprofiles" { + return op.VnicProfilesService(), nil + } + if strings.HasPrefix(path, "vnicprofiles/") { + return op.VnicProfilesService().Service(path[13:]) + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *NetworkService) String() string { + return fmt.Sprintf("NetworkService:%s", op.path) +} + +// +// Manages logical networks. +// The engine creates a default `ovirtmgmt` network on installation. This network acts as the management network for +// access to hypervisor hosts. This network is associated with the `Default` cluster and is a member of the `Default` +// data center. +// +type NetworksService struct { + BaseService +} + +func NewNetworksService(connection *Connection, path string) *NetworksService { + var result NetworksService + result.connection = connection + result.path = path + return &result +} + +// +// Creates a new logical network, or associates an existing network with a data center. +// Creation of a new network requires the `name` and `data_center` elements. +// For example, to create a network named `mynetwork` for data center `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/syncallnetworks +// POST /ovirt-engine/api/networks // ---- // With a request body like this: // [source,xml] // ---- -// +// +// mynetwork +// +// +// ---- +// To associate the existing network `456` with the data center `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/networks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ovirtmgmt +// +// ---- +// To create a network named `exnetwork` on top of an external _OpenStack_ network provider `456` send a request +// like this: +// [source] +// ---- +// POST /ovirt-engine/api/networks +// ---- +// [source,xml] +// ---- +// +// exnetwork +// +// +// // ---- // -type HostServiceSyncAllNetworksRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool +type NetworksServiceAddRequest struct { + NetworksService *NetworksService + header map[string]string + query map[string]string + network *Network } -func (p *HostServiceSyncAllNetworksRequest) Header(key, value string) *HostServiceSyncAllNetworksRequest { +func (p *NetworksServiceAddRequest) Header(key, value string) *NetworksServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -49974,7 +52476,7 @@ func (p *HostServiceSyncAllNetworksRequest) Header(key, value string) *HostServi return p } -func (p *HostServiceSyncAllNetworksRequest) Query(key, value string) *HostServiceSyncAllNetworksRequest { +func (p *NetworksServiceAddRequest) Query(key, value string) *NetworksServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -49982,21 +52484,13 @@ func (p *HostServiceSyncAllNetworksRequest) Query(key, value string) *HostServic return p } -func (p *HostServiceSyncAllNetworksRequest) Async(async bool) *HostServiceSyncAllNetworksRequest { - p.async = &async +func (p *NetworksServiceAddRequest) Network(network *Network) *NetworksServiceAddRequest { + p.network = network return p } -func (p *HostServiceSyncAllNetworksRequest) Send() (*HostServiceSyncAllNetworksResponse, error) { - rawURL := fmt.Sprintf("%s%s/syncallnetworks", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NetworksServiceAddRequest) Send() (*NetworksServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworksService.connection.URL(), p.NetworksService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -50008,14 +52502,17 @@ func (p *HostServiceSyncAllNetworksRequest) Send() (*HostServiceSyncAllNetworksR } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkWriteOne(writer, p.network, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworksService.connection.headers { req.Header.Add(hk, hv) } @@ -50030,18 +52527,18 @@ func (p *HostServiceSyncAllNetworksRequest) Send() (*HostServiceSyncAllNetworksR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -50050,67 +52547,180 @@ func (p *HostServiceSyncAllNetworksRequest) Send() (*HostServiceSyncAllNetworksR if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) + } + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NetworksServiceAddResponse{network: result}, nil +} + +func (p *NetworksServiceAddRequest) MustSend() *NetworksServiceAddResponse { + if v, err := p.Send(); err != nil { + panic(err) + } else { + return v + } +} + +// +// Creates a new logical network, or associates an existing network with a data center. +// Creation of a new network requires the `name` and `data_center` elements. +// For example, to create a network named `mynetwork` for data center `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/networks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// mynetwork +// +// +// ---- +// To associate the existing network `456` with the data center `123` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/networks +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// ovirtmgmt +// +// ---- +// To create a network named `exnetwork` on top of an external _OpenStack_ network provider `456` send a request +// like this: +// [source] +// ---- +// POST /ovirt-engine/api/networks +// ---- +// [source,xml] +// ---- +// +// exnetwork +// +// +// +// ---- +// +type NetworksServiceAddResponse struct { + network *Network +} + +func (p *NetworksServiceAddResponse) Network() (*Network, bool) { + if p.network != nil { + return p.network, true } - return new(HostServiceSyncAllNetworksResponse), nil + return nil, false } -func (p *HostServiceSyncAllNetworksRequest) MustSend() *HostServiceSyncAllNetworksResponse { - if v, err := p.Send(); err != nil { - panic(err) - } else { - return v +func (p *NetworksServiceAddResponse) MustNetwork() *Network { + if p.network == nil { + panic("network in response does not exist") } + return p.network } // -// To synchronize all networks on the host, send a request like this: +// Creates a new logical network, or associates an existing network with a data center. +// Creation of a new network requires the `name` and `data_center` elements. +// For example, to create a network named `mynetwork` for data center `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/syncallnetworks +// POST /ovirt-engine/api/networks // ---- // With a request body like this: // [source,xml] // ---- -// +// +// mynetwork +// +// // ---- -// -type HostServiceSyncAllNetworksResponse struct { -} - -// -// To synchronize all networks on the host, send a request like this: +// To associate the existing network `456` with the data center `123` send a request like this: // [source] // ---- -// POST /ovirt-engine/api/hosts/123/syncallnetworks +// POST /ovirt-engine/api/datacenters/123/networks // ---- // With a request body like this: // [source,xml] // ---- -// +// +// ovirtmgmt +// +// ---- +// To create a network named `exnetwork` on top of an external _OpenStack_ network provider `456` send a request +// like this: +// [source] +// ---- +// POST /ovirt-engine/api/networks +// ---- +// [source,xml] +// ---- +// +// exnetwork +// +// +// // ---- // -func (p *HostService) SyncAllNetworks() *HostServiceSyncAllNetworksRequest { - return &HostServiceSyncAllNetworksRequest{HostService: p} +func (p *NetworksService) Add() *NetworksServiceAddRequest { + return &NetworksServiceAddRequest{NetworksService: p} } // -// Discovers the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are -// required. +// List logical networks. +// For example: +// [source] +// ---- +// GET /ovirt-engine/api/networks +// ---- +// Will respond: +// [source,xml] +// ---- +// +// +// ovirtmgmt +// Default Management Network +// +// +// +// 0 +// false +// +// vm +// +// +// +// ... +// +// ---- +// The order of the returned list of networks is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type HostServiceUnregisteredStorageDomainsDiscoverRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - iscsi *IscsiDetails +type NetworksServiceListRequest struct { + NetworksService *NetworksService + header map[string]string + query map[string]string + caseSensitive *bool + follow *string + max *int64 + search *string } -func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Header(key, value string) *HostServiceUnregisteredStorageDomainsDiscoverRequest { +func (p *NetworksServiceListRequest) Header(key, value string) *NetworksServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -50118,7 +52728,7 @@ func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Header(key, value return p } -func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Query(key, value string) *HostServiceUnregisteredStorageDomainsDiscoverRequest { +func (p *NetworksServiceListRequest) Query(key, value string) *NetworksServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -50126,28 +52736,45 @@ func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Query(key, value return p } -func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Async(async bool) *HostServiceUnregisteredStorageDomainsDiscoverRequest { - p.async = &async +func (p *NetworksServiceListRequest) CaseSensitive(caseSensitive bool) *NetworksServiceListRequest { + p.caseSensitive = &caseSensitive return p } -func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Iscsi(iscsi *IscsiDetails) *HostServiceUnregisteredStorageDomainsDiscoverRequest { - p.iscsi = iscsi +func (p *NetworksServiceListRequest) Follow(follow string) *NetworksServiceListRequest { + p.follow = &follow return p } -func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Send() (*HostServiceUnregisteredStorageDomainsDiscoverResponse, error) { - rawURL := fmt.Sprintf("%s%s/unregisteredstoragedomainsdiscover", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *NetworksServiceListRequest) Max(max int64) *NetworksServiceListRequest { + p.max = &max + return p +} + +func (p *NetworksServiceListRequest) Search(search string) *NetworksServiceListRequest { + p.search = &search + return p +} + +func (p *NetworksServiceListRequest) Send() (*NetworksServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NetworksService.connection.URL(), p.NetworksService.path) + values := make(url.Values) + if p.caseSensitive != nil { + values["case_sensitive"] = []string{fmt.Sprintf("%v", *p.caseSensitive)} } - actionBuilder.Iscsi(p.iscsi) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - values := make(url.Values) + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} + } + + if p.search != nil { + values["search"] = []string{fmt.Sprintf("%v", *p.search)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -50156,16 +52783,12 @@ func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Send() (*HostServ if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NetworksService.connection.headers { req.Header.Add(hk, hv) } @@ -50180,18 +52803,18 @@ func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Send() (*HostServ req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NetworksService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NetworksService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NetworksService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -50200,17 +52823,24 @@ func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) Send() (*HostServ if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NetworksService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustStorageDomains() - return &HostServiceUnregisteredStorageDomainsDiscoverResponse{storageDomains: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkReadMany(reader, nil) + if err != nil { + return nil, err + } + return &NetworksServiceListResponse{networks: result}, nil } -func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) MustSend() *HostServiceUnregisteredStorageDomainsDiscoverResponse { +func (p *NetworksServiceListRequest) MustSend() *NetworksServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -50219,61 +52849,137 @@ func (p *HostServiceUnregisteredStorageDomainsDiscoverRequest) MustSend() *HostS } // -// Discovers the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are -// required. +// List logical networks. +// For example: +// [source] +// ---- +// GET /ovirt-engine/api/networks +// ---- +// Will respond: +// [source,xml] +// ---- +// +// +// ovirtmgmt +// Default Management Network +// +// +// +// 0 +// false +// +// vm +// +// +// +// ... +// +// ---- +// The order of the returned list of networks is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type HostServiceUnregisteredStorageDomainsDiscoverResponse struct { - storageDomains *StorageDomainSlice +type NetworksServiceListResponse struct { + networks *NetworkSlice } -func (p *HostServiceUnregisteredStorageDomainsDiscoverResponse) StorageDomains() (*StorageDomainSlice, bool) { - if p.storageDomains != nil { - return p.storageDomains, true +func (p *NetworksServiceListResponse) Networks() (*NetworkSlice, bool) { + if p.networks != nil { + return p.networks, true } return nil, false } -func (p *HostServiceUnregisteredStorageDomainsDiscoverResponse) MustStorageDomains() *StorageDomainSlice { - if p.storageDomains == nil { - panic("storageDomains in response does not exist") +func (p *NetworksServiceListResponse) MustNetworks() *NetworkSlice { + if p.networks == nil { + panic("networks in response does not exist") } - return p.storageDomains -} - -// -// Discovers the block Storage Domains which are candidates to be imported to the setup. For FCP no arguments are -// required. -// -func (p *HostService) UnregisteredStorageDomainsDiscover() *HostServiceUnregisteredStorageDomainsDiscoverRequest { - return &HostServiceUnregisteredStorageDomainsDiscoverRequest{HostService: p} + return p.networks } // -// Update the host properties. -// For example, to update a the kernel command line of a host send a request like this: +// List logical networks. +// For example: // [source] // ---- -// PUT /ovirt-engine/api/hosts/123 +// GET /ovirt-engine/api/networks // ---- -// With request body like this: -// [source, xml] +// Will respond: +// [source,xml] // ---- -// -// -// vfio_iommu_type1.allow_unsafe_interrupts=1 -// -// +// +// +// ovirtmgmt +// Default Management Network +// +// +// +// 0 +// false +// +// vm +// +// +// +// ... +// // ---- +// The order of the returned list of networks is guaranteed only if the `sortby` clause is included in the +// `search` parameter. // -type HostServiceUpdateRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - host *Host +func (p *NetworksService) List() *NetworksServiceListRequest { + return &NetworksServiceListRequest{NetworksService: p} } -func (p *HostServiceUpdateRequest) Header(key, value string) *HostServiceUpdateRequest { +// +// Reference to the service that manages a specific network. +// +func (op *NetworksService) NetworkService(id string) *NetworkService { + return NewNetworkService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +} + +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NetworksService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.NetworkService(path), nil + } + return op.NetworkService(path[:index]).Service(path[index+1:]) +} + +func (op *NetworksService) String() string { + return fmt.Sprintf("NetworksService:%s", op.path) +} + +// +// This service manages a parameter for a network filter. +// +type NicNetworkFilterParameterService struct { + BaseService +} + +func NewNicNetworkFilterParameterService(connection *Connection, path string) *NicNetworkFilterParameterService { + var result NicNetworkFilterParameterService + result.connection = connection + result.path = path + return &result +} + +// +// Retrieves a representation of the network filter parameter. +// +type NicNetworkFilterParameterServiceGetRequest struct { + NicNetworkFilterParameterService *NicNetworkFilterParameterService + header map[string]string + query map[string]string + follow *string +} + +func (p *NicNetworkFilterParameterServiceGetRequest) Header(key, value string) *NicNetworkFilterParameterServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -50281,7 +52987,7 @@ func (p *HostServiceUpdateRequest) Header(key, value string) *HostServiceUpdateR return p } -func (p *HostServiceUpdateRequest) Query(key, value string) *HostServiceUpdateRequest { +func (p *NicNetworkFilterParameterServiceGetRequest) Query(key, value string) *NicNetworkFilterParameterServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -50289,21 +52995,16 @@ func (p *HostServiceUpdateRequest) Query(key, value string) *HostServiceUpdateRe return p } -func (p *HostServiceUpdateRequest) Async(async bool) *HostServiceUpdateRequest { - p.async = &async - return p -} - -func (p *HostServiceUpdateRequest) Host(host *Host) *HostServiceUpdateRequest { - p.host = host +func (p *NicNetworkFilterParameterServiceGetRequest) Follow(follow string) *NicNetworkFilterParameterServiceGetRequest { + p.follow = &follow return p } -func (p *HostServiceUpdateRequest) Send() (*HostServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.HostService.connection.URL(), p.HostService.path) +func (p *NicNetworkFilterParameterServiceGetRequest) Send() (*NicNetworkFilterParameterServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NicNetworkFilterParameterService.connection.URL(), p.NicNetworkFilterParameterService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } if p.query != nil { @@ -50314,19 +53015,12 @@ func (p *HostServiceUpdateRequest) Send() (*HostServiceUpdateResponse, error) { if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLHostWriteOne(writer, p.host, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NicNetworkFilterParameterService.connection.headers { req.Header.Add(hk, hv) } @@ -50341,18 +53035,18 @@ func (p *HostServiceUpdateRequest) Send() (*HostServiceUpdateResponse, error) { req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NicNetworkFilterParameterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NicNetworkFilterParameterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NicNetworkFilterParameterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -50361,7 +53055,7 @@ func (p *HostServiceUpdateRequest) Send() (*HostServiceUpdateResponse, error) { if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NicNetworkFilterParameterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -50371,14 +53065,14 @@ func (p *HostServiceUpdateRequest) Send() (*HostServiceUpdateResponse, error) { return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLHostReadOne(reader, nil, "") + result, err := XMLNetworkFilterParameterReadOne(reader, nil, "") if err != nil { return nil, err } - return &HostServiceUpdateResponse{host: result}, nil + return &NicNetworkFilterParameterServiceGetResponse{parameter: result}, nil } -func (p *HostServiceUpdateRequest) MustSend() *HostServiceUpdateResponse { +func (p *NicNetworkFilterParameterServiceGetRequest) MustSend() *NicNetworkFilterParameterServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -50387,129 +53081,66 @@ func (p *HostServiceUpdateRequest) MustSend() *HostServiceUpdateResponse { } // -// Update the host properties. -// For example, to update a the kernel command line of a host send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/hosts/123 -// ---- -// With request body like this: -// [source, xml] -// ---- -// -// -// vfio_iommu_type1.allow_unsafe_interrupts=1 -// -// -// ---- +// Retrieves a representation of the network filter parameter. // -type HostServiceUpdateResponse struct { - host *Host +type NicNetworkFilterParameterServiceGetResponse struct { + parameter *NetworkFilterParameter } -func (p *HostServiceUpdateResponse) Host() (*Host, bool) { - if p.host != nil { - return p.host, true +func (p *NicNetworkFilterParameterServiceGetResponse) Parameter() (*NetworkFilterParameter, bool) { + if p.parameter != nil { + return p.parameter, true } return nil, false } -func (p *HostServiceUpdateResponse) MustHost() *Host { - if p.host == nil { - panic("host in response does not exist") +func (p *NicNetworkFilterParameterServiceGetResponse) MustParameter() *NetworkFilterParameter { + if p.parameter == nil { + panic("parameter in response does not exist") } - return p.host + return p.parameter } // -// Update the host properties. -// For example, to update a the kernel command line of a host send a request like this: -// [source] -// ---- -// PUT /ovirt-engine/api/hosts/123 -// ---- -// With request body like this: -// [source, xml] -// ---- -// -// -// vfio_iommu_type1.allow_unsafe_interrupts=1 -// -// -// ---- +// Retrieves a representation of the network filter parameter. // -func (p *HostService) Update() *HostServiceUpdateRequest { - return &HostServiceUpdateRequest{HostService: p} +func (p *NicNetworkFilterParameterService) Get() *NicNetworkFilterParameterServiceGetRequest { + return &NicNetworkFilterParameterServiceGetRequest{NicNetworkFilterParameterService: p} } // -// Upgrades VDSM and selected software on the host. +// Removes the filter parameter. +// For example, to remove the filter parameter with id `123` on NIC `456` of virtual machine `789` +// send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/vms/789/nics/456/networkfilterparameters/123 +// ---- // -type HostServiceUpgradeRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - image *string - reboot *bool - timeout *int64 -} - -func (p *HostServiceUpgradeRequest) Header(key, value string) *HostServiceUpgradeRequest { - if p.header == nil { - p.header = make(map[string]string) - } - p.header[key] = value - return p -} - -func (p *HostServiceUpgradeRequest) Query(key, value string) *HostServiceUpgradeRequest { - if p.query == nil { - p.query = make(map[string]string) - } - p.query[key] = value - return p -} - -func (p *HostServiceUpgradeRequest) Async(async bool) *HostServiceUpgradeRequest { - p.async = &async - return p -} - -func (p *HostServiceUpgradeRequest) Image(image string) *HostServiceUpgradeRequest { - p.image = &image - return p -} - -func (p *HostServiceUpgradeRequest) Reboot(reboot bool) *HostServiceUpgradeRequest { - p.reboot = &reboot - return p -} - -func (p *HostServiceUpgradeRequest) Timeout(timeout int64) *HostServiceUpgradeRequest { - p.timeout = &timeout - return p +type NicNetworkFilterParameterServiceRemoveRequest struct { + NicNetworkFilterParameterService *NicNetworkFilterParameterService + header map[string]string + query map[string]string } -func (p *HostServiceUpgradeRequest) Send() (*HostServiceUpgradeResponse, error) { - rawURL := fmt.Sprintf("%s%s/upgrade", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.image != nil { - actionBuilder.Image(*p.image) - } - if p.reboot != nil { - actionBuilder.Reboot(*p.reboot) - } - if p.timeout != nil { - actionBuilder.Timeout(*p.timeout) +func (p *NicNetworkFilterParameterServiceRemoveRequest) Header(key, value string) *NicNetworkFilterParameterServiceRemoveRequest { + if p.header == nil { + p.header = make(map[string]string) } - action, err := actionBuilder.Build() - if err != nil { - return nil, err + p.header[key] = value + return p +} + +func (p *NicNetworkFilterParameterServiceRemoveRequest) Query(key, value string) *NicNetworkFilterParameterServiceRemoveRequest { + if p.query == nil { + p.query = make(map[string]string) } + p.query[key] = value + return p +} + +func (p *NicNetworkFilterParameterServiceRemoveRequest) Send() (*NicNetworkFilterParameterServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NicNetworkFilterParameterService.connection.URL(), p.NicNetworkFilterParameterService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -50519,16 +53150,12 @@ func (p *HostServiceUpgradeRequest) Send() (*HostServiceUpgradeResponse, error) if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NicNetworkFilterParameterService.connection.headers { req.Header.Add(hk, hv) } @@ -50543,18 +53170,18 @@ func (p *HostServiceUpgradeRequest) Send() (*HostServiceUpgradeResponse, error) req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NicNetworkFilterParameterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NicNetworkFilterParameterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NicNetworkFilterParameterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -50563,16 +53190,19 @@ func (p *HostServiceUpgradeRequest) Send() (*HostServiceUpgradeResponse, error) if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NicNetworkFilterParameterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceUpgradeResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(NicNetworkFilterParameterServiceRemoveResponse), nil } -func (p *HostServiceUpgradeRequest) MustSend() *HostServiceUpgradeResponse { +func (p *NicNetworkFilterParameterServiceRemoveRequest) MustSend() *NicNetworkFilterParameterServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -50581,31 +53211,55 @@ func (p *HostServiceUpgradeRequest) MustSend() *HostServiceUpgradeResponse { } // -// Upgrades VDSM and selected software on the host. +// Removes the filter parameter. +// For example, to remove the filter parameter with id `123` on NIC `456` of virtual machine `789` +// send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/vms/789/nics/456/networkfilterparameters/123 +// ---- // -type HostServiceUpgradeResponse struct { +type NicNetworkFilterParameterServiceRemoveResponse struct { } // -// Upgrades VDSM and selected software on the host. +// Removes the filter parameter. +// For example, to remove the filter parameter with id `123` on NIC `456` of virtual machine `789` +// send a request like this: +// [source] +// ---- +// DELETE /ovirt-engine/api/vms/789/nics/456/networkfilterparameters/123 +// ---- // -func (p *HostService) Upgrade() *HostServiceUpgradeRequest { - return &HostServiceUpgradeRequest{HostService: p} +func (p *NicNetworkFilterParameterService) Remove() *NicNetworkFilterParameterServiceRemoveRequest { + return &NicNetworkFilterParameterServiceRemoveRequest{NicNetworkFilterParameterService: p} } // -// Check if there are upgrades available for the host. If there are upgrades available an icon will be displayed -// next to host status icon in the Administration Portal. Audit log messages are also added to indicate the -// availability of upgrades. The upgrade can be started from the webadmin or by using the -// <> host action. +// Updates the network filter parameter. +// For example, to update the network filter parameter having with with id `123` on NIC `456` of +// virtual machine `789` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/vms/789/nics/456/networkfilterparameters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// updatedName +// updatedValue +// +// ---- // -type HostServiceUpgradeCheckRequest struct { - HostService *HostService - header map[string]string - query map[string]string +type NicNetworkFilterParameterServiceUpdateRequest struct { + NicNetworkFilterParameterService *NicNetworkFilterParameterService + header map[string]string + query map[string]string + parameter *NetworkFilterParameter } -func (p *HostServiceUpgradeCheckRequest) Header(key, value string) *HostServiceUpgradeCheckRequest { +func (p *NicNetworkFilterParameterServiceUpdateRequest) Header(key, value string) *NicNetworkFilterParameterServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -50613,7 +53267,7 @@ func (p *HostServiceUpgradeCheckRequest) Header(key, value string) *HostServiceU return p } -func (p *HostServiceUpgradeCheckRequest) Query(key, value string) *HostServiceUpgradeCheckRequest { +func (p *NicNetworkFilterParameterServiceUpdateRequest) Query(key, value string) *NicNetworkFilterParameterServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -50621,13 +53275,13 @@ func (p *HostServiceUpgradeCheckRequest) Query(key, value string) *HostServiceUp return p } -func (p *HostServiceUpgradeCheckRequest) Send() (*HostServiceUpgradeCheckResponse, error) { - rawURL := fmt.Sprintf("%s%s/upgradecheck", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NicNetworkFilterParameterServiceUpdateRequest) Parameter(parameter *NetworkFilterParameter) *NicNetworkFilterParameterServiceUpdateRequest { + p.parameter = parameter + return p +} + +func (p *NicNetworkFilterParameterServiceUpdateRequest) Send() (*NicNetworkFilterParameterServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NicNetworkFilterParameterService.connection.URL(), p.NicNetworkFilterParameterService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -50639,14 +53293,17 @@ func (p *HostServiceUpgradeCheckRequest) Send() (*HostServiceUpgradeCheckRespons } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkFilterParameterWriteOne(writer, p.parameter, "") + if err != nil { + return nil, err + } writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NicNetworkFilterParameterService.connection.headers { req.Header.Add(hk, hv) } @@ -50661,18 +53318,18 @@ func (p *HostServiceUpgradeCheckRequest) Send() (*HostServiceUpgradeCheckRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NicNetworkFilterParameterService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NicNetworkFilterParameterService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NicNetworkFilterParameterService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -50681,16 +53338,24 @@ func (p *HostServiceUpgradeCheckRequest) Send() (*HostServiceUpgradeCheckRespons if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NicNetworkFilterParameterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceUpgradeCheckResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkFilterParameterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NicNetworkFilterParameterServiceUpdateResponse{parameter: result}, nil } -func (p *HostServiceUpgradeCheckRequest) MustSend() *HostServiceUpgradeCheckResponse { +func (p *NicNetworkFilterParameterServiceUpdateRequest) MustSend() *NicNetworkFilterParameterServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -50699,37 +53364,114 @@ func (p *HostServiceUpgradeCheckRequest) MustSend() *HostServiceUpgradeCheckResp } // -// Check if there are upgrades available for the host. If there are upgrades available an icon will be displayed -// next to host status icon in the Administration Portal. Audit log messages are also added to indicate the -// availability of upgrades. The upgrade can be started from the webadmin or by using the -// <> host action. +// Updates the network filter parameter. +// For example, to update the network filter parameter having with with id `123` on NIC `456` of +// virtual machine `789` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/vms/789/nics/456/networkfilterparameters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// updatedName +// updatedValue +// +// ---- // -type HostServiceUpgradeCheckResponse struct { +type NicNetworkFilterParameterServiceUpdateResponse struct { + parameter *NetworkFilterParameter +} + +func (p *NicNetworkFilterParameterServiceUpdateResponse) Parameter() (*NetworkFilterParameter, bool) { + if p.parameter != nil { + return p.parameter, true + } + return nil, false +} + +func (p *NicNetworkFilterParameterServiceUpdateResponse) MustParameter() *NetworkFilterParameter { + if p.parameter == nil { + panic("parameter in response does not exist") + } + return p.parameter } // -// Check if there are upgrades available for the host. If there are upgrades available an icon will be displayed -// next to host status icon in the Administration Portal. Audit log messages are also added to indicate the -// availability of upgrades. The upgrade can be started from the webadmin or by using the -// <> host action. +// Updates the network filter parameter. +// For example, to update the network filter parameter having with with id `123` on NIC `456` of +// virtual machine `789` send a request like this: +// [source] +// ---- +// PUT /ovirt-engine/api/vms/789/nics/456/networkfilterparameters/123 +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// updatedName +// updatedValue +// +// ---- // -func (p *HostService) UpgradeCheck() *HostServiceUpgradeCheckRequest { - return &HostServiceUpgradeCheckRequest{HostService: p} +func (p *NicNetworkFilterParameterService) Update() *NicNetworkFilterParameterServiceUpdateRequest { + return &NicNetworkFilterParameterServiceUpdateRequest{NicNetworkFilterParameterService: p} } // +// Service locator method, returns individual service on which the URI is dispatched. // -type HostServiceApproveUsingRootPasswordRequest struct { - HostService *HostService - header map[string]string - query map[string]string - activate *bool - async *bool - cluster *Cluster - host *Host +func (op *NicNetworkFilterParameterService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *HostServiceApproveUsingRootPasswordRequest) Header(key, value string) *HostServiceApproveUsingRootPasswordRequest { +func (op *NicNetworkFilterParameterService) String() string { + return fmt.Sprintf("NicNetworkFilterParameterService:%s", op.path) +} + +// +// This service manages a collection of parameters for network filters. +// +type NicNetworkFilterParametersService struct { + BaseService +} + +func NewNicNetworkFilterParametersService(connection *Connection, path string) *NicNetworkFilterParametersService { + var result NicNetworkFilterParametersService + result.connection = connection + result.path = path + return &result +} + +// +// Add a network filter parameter. +// For example, to add the parameter for the network filter on NIC `456` of +// virtual machine `789` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/vms/789/nics/456/networkfilterparameters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// IP +// 10.0.1.2 +// +// ---- +// +type NicNetworkFilterParametersServiceAddRequest struct { + NicNetworkFilterParametersService *NicNetworkFilterParametersService + header map[string]string + query map[string]string + parameter *NetworkFilterParameter +} + +func (p *NicNetworkFilterParametersServiceAddRequest) Header(key, value string) *NicNetworkFilterParametersServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -50737,7 +53479,7 @@ func (p *HostServiceApproveUsingRootPasswordRequest) Header(key, value string) * return p } -func (p *HostServiceApproveUsingRootPasswordRequest) Query(key, value string) *HostServiceApproveUsingRootPasswordRequest { +func (p *NicNetworkFilterParametersServiceAddRequest) Query(key, value string) *NicNetworkFilterParametersServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -50745,41 +53487,13 @@ func (p *HostServiceApproveUsingRootPasswordRequest) Query(key, value string) *H return p } -func (p *HostServiceApproveUsingRootPasswordRequest) Activate(activate bool) *HostServiceApproveUsingRootPasswordRequest { - p.activate = &activate - return p -} - -func (p *HostServiceApproveUsingRootPasswordRequest) Async(async bool) *HostServiceApproveUsingRootPasswordRequest { - p.async = &async - return p -} - -func (p *HostServiceApproveUsingRootPasswordRequest) Cluster(cluster *Cluster) *HostServiceApproveUsingRootPasswordRequest { - p.cluster = cluster - return p -} - -func (p *HostServiceApproveUsingRootPasswordRequest) Host(host *Host) *HostServiceApproveUsingRootPasswordRequest { - p.host = host +func (p *NicNetworkFilterParametersServiceAddRequest) Parameter(parameter *NetworkFilterParameter) *NicNetworkFilterParametersServiceAddRequest { + p.parameter = parameter return p } -func (p *HostServiceApproveUsingRootPasswordRequest) Send() (*HostServiceApproveUsingRootPasswordResponse, error) { - rawURL := fmt.Sprintf("%s%s/usingrootpassword", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.activate != nil { - actionBuilder.Activate(*p.activate) - } - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Cluster(p.cluster) - actionBuilder.Host(p.host) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NicNetworkFilterParametersServiceAddRequest) Send() (*NicNetworkFilterParametersServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NicNetworkFilterParametersService.connection.URL(), p.NicNetworkFilterParametersService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -50791,14 +53505,17 @@ func (p *HostServiceApproveUsingRootPasswordRequest) Send() (*HostServiceApprove } var body bytes.Buffer writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") + err := XMLNetworkFilterParameterWriteOne(writer, p.parameter, "") + if err != nil { + return nil, err + } writer.Flush() req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NicNetworkFilterParametersService.connection.headers { req.Header.Add(hk, hv) } @@ -50813,18 +53530,18 @@ func (p *HostServiceApproveUsingRootPasswordRequest) Send() (*HostServiceApprove req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NicNetworkFilterParametersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NicNetworkFilterParametersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NicNetworkFilterParametersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -50833,16 +53550,24 @@ func (p *HostServiceApproveUsingRootPasswordRequest) Send() (*HostServiceApprove if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NicNetworkFilterParametersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200, 201, 202}) { + return nil, CheckFault(resp) } - return new(HostServiceApproveUsingRootPasswordResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkFilterParameterReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &NicNetworkFilterParametersServiceAddResponse{parameter: result}, nil } -func (p *HostServiceApproveUsingRootPasswordRequest) MustSend() *HostServiceApproveUsingRootPasswordResponse { +func (p *NicNetworkFilterParametersServiceAddRequest) MustSend() *NicNetworkFilterParametersServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -50851,35 +53576,73 @@ func (p *HostServiceApproveUsingRootPasswordRequest) MustSend() *HostServiceAppr } // +// Add a network filter parameter. +// For example, to add the parameter for the network filter on NIC `456` of +// virtual machine `789` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/vms/789/nics/456/networkfilterparameters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// IP +// 10.0.1.2 +// +// ---- // -type HostServiceApproveUsingRootPasswordResponse struct { +type NicNetworkFilterParametersServiceAddResponse struct { + parameter *NetworkFilterParameter +} + +func (p *NicNetworkFilterParametersServiceAddResponse) Parameter() (*NetworkFilterParameter, bool) { + if p.parameter != nil { + return p.parameter, true + } + return nil, false +} + +func (p *NicNetworkFilterParametersServiceAddResponse) MustParameter() *NetworkFilterParameter { + if p.parameter == nil { + panic("parameter in response does not exist") + } + return p.parameter } // +// Add a network filter parameter. +// For example, to add the parameter for the network filter on NIC `456` of +// virtual machine `789` send a request like this: +// [source] +// ---- +// POST /ovirt-engine/api/vms/789/nics/456/networkfilterparameters +// ---- +// With a request body like this: +// [source,xml] +// ---- +// +// IP +// 10.0.1.2 +// +// ---- // -func (p *HostService) ApproveUsingRootPassword() *HostServiceApproveUsingRootPasswordRequest { - return &HostServiceApproveUsingRootPasswordRequest{HostService: p} +func (p *NicNetworkFilterParametersService) Add() *NicNetworkFilterParametersServiceAddRequest { + return &NicNetworkFilterParametersServiceAddRequest{NicNetworkFilterParametersService: p} } // -// Install VDSM and other packages required to get the host ready to be used in the engine providing the root -// password. This has been deprecated. +// Retrieves the representations of the network filter parameters. +// The order of the returned list of network filters isn't guaranteed. // -type HostServiceInstallUsingRootPasswordRequest struct { - HostService *HostService - header map[string]string - query map[string]string - activate *bool - async *bool - deployHostedEngine *bool - host *Host - image *string - rootPassword *string - ssh *Ssh - undeployHostedEngine *bool +type NicNetworkFilterParametersServiceListRequest struct { + NicNetworkFilterParametersService *NicNetworkFilterParametersService + header map[string]string + query map[string]string + follow *string } -func (p *HostServiceInstallUsingRootPasswordRequest) Header(key, value string) *HostServiceInstallUsingRootPasswordRequest { +func (p *NicNetworkFilterParametersServiceListRequest) Header(key, value string) *NicNetworkFilterParametersServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -50887,7 +53650,7 @@ func (p *HostServiceInstallUsingRootPasswordRequest) Header(key, value string) * return p } -func (p *HostServiceInstallUsingRootPasswordRequest) Query(key, value string) *HostServiceInstallUsingRootPasswordRequest { +func (p *NicNetworkFilterParametersServiceListRequest) Query(key, value string) *NicNetworkFilterParametersServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -50895,74 +53658,18 @@ func (p *HostServiceInstallUsingRootPasswordRequest) Query(key, value string) *H return p } -func (p *HostServiceInstallUsingRootPasswordRequest) Activate(activate bool) *HostServiceInstallUsingRootPasswordRequest { - p.activate = &activate - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) Async(async bool) *HostServiceInstallUsingRootPasswordRequest { - p.async = &async - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) DeployHostedEngine(deployHostedEngine bool) *HostServiceInstallUsingRootPasswordRequest { - p.deployHostedEngine = &deployHostedEngine - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) Host(host *Host) *HostServiceInstallUsingRootPasswordRequest { - p.host = host - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) Image(image string) *HostServiceInstallUsingRootPasswordRequest { - p.image = &image - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) RootPassword(rootPassword string) *HostServiceInstallUsingRootPasswordRequest { - p.rootPassword = &rootPassword - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) Ssh(ssh *Ssh) *HostServiceInstallUsingRootPasswordRequest { - p.ssh = ssh - return p -} - -func (p *HostServiceInstallUsingRootPasswordRequest) UndeployHostedEngine(undeployHostedEngine bool) *HostServiceInstallUsingRootPasswordRequest { - p.undeployHostedEngine = &undeployHostedEngine +func (p *NicNetworkFilterParametersServiceListRequest) Follow(follow string) *NicNetworkFilterParametersServiceListRequest { + p.follow = &follow return p } -func (p *HostServiceInstallUsingRootPasswordRequest) Send() (*HostServiceInstallUsingRootPasswordResponse, error) { - rawURL := fmt.Sprintf("%s%s/usingrootpassword", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.activate != nil { - actionBuilder.Activate(*p.activate) - } - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.deployHostedEngine != nil { - actionBuilder.DeployHostedEngine(*p.deployHostedEngine) - } - actionBuilder.Host(p.host) - if p.image != nil { - actionBuilder.Image(*p.image) - } - if p.rootPassword != nil { - actionBuilder.RootPassword(*p.rootPassword) - } - actionBuilder.Ssh(p.ssh) - if p.undeployHostedEngine != nil { - actionBuilder.UndeployHostedEngine(*p.undeployHostedEngine) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *NicNetworkFilterParametersServiceListRequest) Send() (*NicNetworkFilterParametersServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.NicNetworkFilterParametersService.connection.URL(), p.NicNetworkFilterParametersService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -50971,16 +53678,12 @@ func (p *HostServiceInstallUsingRootPasswordRequest) Send() (*HostServiceInstall if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.NicNetworkFilterParametersService.connection.headers { req.Header.Add(hk, hv) } @@ -50995,18 +53698,18 @@ func (p *HostServiceInstallUsingRootPasswordRequest) Send() (*HostServiceInstall req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.NicNetworkFilterParametersService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.NicNetworkFilterParametersService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.NicNetworkFilterParametersService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -51015,16 +53718,24 @@ func (p *HostServiceInstallUsingRootPasswordRequest) Send() (*HostServiceInstall if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.NicNetworkFilterParametersService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) + } + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLNetworkFilterParameterReadMany(reader, nil) + if err != nil { + return nil, err } - return new(HostServiceInstallUsingRootPasswordResponse), nil + return &NicNetworkFilterParametersServiceListResponse{parameters: result}, nil } -func (p *HostServiceInstallUsingRootPasswordRequest) MustSend() *HostServiceInstallUsingRootPasswordResponse { +func (p *NicNetworkFilterParametersServiceListRequest) MustSend() *NicNetworkFilterParametersServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -51033,32 +53744,83 @@ func (p *HostServiceInstallUsingRootPasswordRequest) MustSend() *HostServiceInst } // -// Install VDSM and other packages required to get the host ready to be used in the engine providing the root -// password. This has been deprecated. +// Retrieves the representations of the network filter parameters. +// The order of the returned list of network filters isn't guaranteed. // -type HostServiceInstallUsingRootPasswordResponse struct { +type NicNetworkFilterParametersServiceListResponse struct { + parameters *NetworkFilterParameterSlice +} + +func (p *NicNetworkFilterParametersServiceListResponse) Parameters() (*NetworkFilterParameterSlice, bool) { + if p.parameters != nil { + return p.parameters, true + } + return nil, false +} + +func (p *NicNetworkFilterParametersServiceListResponse) MustParameters() *NetworkFilterParameterSlice { + if p.parameters == nil { + panic("parameters in response does not exist") + } + return p.parameters } // -// Install VDSM and other packages required to get the host ready to be used in the engine providing the root -// password. This has been deprecated. +// Retrieves the representations of the network filter parameters. +// The order of the returned list of network filters isn't guaranteed. // -func (p *HostService) InstallUsingRootPassword() *HostServiceInstallUsingRootPasswordRequest { - return &HostServiceInstallUsingRootPasswordRequest{HostService: p} +func (p *NicNetworkFilterParametersService) List() *NicNetworkFilterParametersServiceListRequest { + return &NicNetworkFilterParametersServiceListRequest{NicNetworkFilterParametersService: p} } // -// Update the specified host in the system. This is deprecated and is provided only for backwards compatibility. +// Reference to the service that manages a specific network filter parameter. // -type HostServiceUpdateUsingRootPasswordRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - host *Host +func (op *NicNetworkFilterParametersService) ParameterService(id string) *NicNetworkFilterParameterService { + return NewNicNetworkFilterParameterService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *HostServiceUpdateUsingRootPasswordRequest) Header(key, value string) *HostServiceUpdateUsingRootPasswordRequest { +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *NicNetworkFilterParametersService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + index := strings.Index(path, "/") + if index == -1 { + return op.ParameterService(path), nil + } + return op.ParameterService(path[:index]).Service(path[index+1:]) +} + +func (op *NicNetworkFilterParametersService) String() string { + return fmt.Sprintf("NicNetworkFilterParametersService:%s", op.path) +} + +// +// +type OperatingSystemService struct { + BaseService +} + +func NewOperatingSystemService(connection *Connection, path string) *OperatingSystemService { + var result OperatingSystemService + result.connection = connection + result.path = path + return &result +} + +// +// +type OperatingSystemServiceGetRequest struct { + OperatingSystemService *OperatingSystemService + header map[string]string + query map[string]string + follow *string +} + +func (p *OperatingSystemServiceGetRequest) Header(key, value string) *OperatingSystemServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -51066,7 +53828,7 @@ func (p *HostServiceUpdateUsingRootPasswordRequest) Header(key, value string) *H return p } -func (p *HostServiceUpdateUsingRootPasswordRequest) Query(key, value string) *HostServiceUpdateUsingRootPasswordRequest { +func (p *OperatingSystemServiceGetRequest) Query(key, value string) *OperatingSystemServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -51074,28 +53836,18 @@ func (p *HostServiceUpdateUsingRootPasswordRequest) Query(key, value string) *Ho return p } -func (p *HostServiceUpdateUsingRootPasswordRequest) Async(async bool) *HostServiceUpdateUsingRootPasswordRequest { - p.async = &async - return p -} - -func (p *HostServiceUpdateUsingRootPasswordRequest) Host(host *Host) *HostServiceUpdateUsingRootPasswordRequest { - p.host = host +func (p *OperatingSystemServiceGetRequest) Follow(follow string) *OperatingSystemServiceGetRequest { + p.follow = &follow return p } -func (p *HostServiceUpdateUsingRootPasswordRequest) Send() (*HostServiceUpdateUsingRootPasswordResponse, error) { - rawURL := fmt.Sprintf("%s%s/usingrootpassword", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Host(p.host) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *OperatingSystemServiceGetRequest) Send() (*OperatingSystemServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.OperatingSystemService.connection.URL(), p.OperatingSystemService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -51104,16 +53856,12 @@ func (p *HostServiceUpdateUsingRootPasswordRequest) Send() (*HostServiceUpdateUs if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.OperatingSystemService.connection.headers { req.Header.Add(hk, hv) } @@ -51128,18 +53876,18 @@ func (p *HostServiceUpdateUsingRootPasswordRequest) Send() (*HostServiceUpdateUs req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.OperatingSystemService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.OperatingSystemService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.OperatingSystemService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -51148,17 +53896,24 @@ func (p *HostServiceUpdateUsingRootPasswordRequest) Send() (*HostServiceUpdateUs if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.OperatingSystemService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustHost() - return &HostServiceUpdateUsingRootPasswordResponse{host: result}, nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLOperatingSystemInfoReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &OperatingSystemServiceGetResponse{operatingSystem: result}, nil } -func (p *HostServiceUpdateUsingRootPasswordRequest) MustSend() *HostServiceUpdateUsingRootPasswordResponse { +func (p *OperatingSystemServiceGetRequest) MustSend() *OperatingSystemServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -51167,48 +53922,72 @@ func (p *HostServiceUpdateUsingRootPasswordRequest) MustSend() *HostServiceUpdat } // -// Update the specified host in the system. This is deprecated and is provided only for backwards compatibility. // -type HostServiceUpdateUsingRootPasswordResponse struct { - host *Host +type OperatingSystemServiceGetResponse struct { + operatingSystem *OperatingSystemInfo } -func (p *HostServiceUpdateUsingRootPasswordResponse) Host() (*Host, bool) { - if p.host != nil { - return p.host, true +func (p *OperatingSystemServiceGetResponse) OperatingSystem() (*OperatingSystemInfo, bool) { + if p.operatingSystem != nil { + return p.operatingSystem, true } return nil, false } -func (p *HostServiceUpdateUsingRootPasswordResponse) MustHost() *Host { - if p.host == nil { - panic("host in response does not exist") +func (p *OperatingSystemServiceGetResponse) MustOperatingSystem() *OperatingSystemInfo { + if p.operatingSystem == nil { + panic("operatingSystem in response does not exist") } - return p.host + return p.operatingSystem } // -// Update the specified host in the system. This is deprecated and is provided only for backwards compatibility. // -func (p *HostService) UpdateUsingRootPassword() *HostServiceUpdateUsingRootPasswordRequest { - return &HostServiceUpdateUsingRootPasswordRequest{HostService: p} +func (p *OperatingSystemService) Get() *OperatingSystemServiceGetRequest { + return &OperatingSystemServiceGetRequest{OperatingSystemService: p} } // -// Approve the specified host to be added to the engine by using ssh authentication. This occurs when the host -// registers itself with the engine. +// Service locator method, returns individual service on which the URI is dispatched. // -type HostServiceApproveUsingSshRequest struct { - HostService *HostService - header map[string]string - query map[string]string - activate *bool - async *bool - cluster *Cluster - host *Host +func (op *OperatingSystemService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *HostServiceApproveUsingSshRequest) Header(key, value string) *HostServiceApproveUsingSshRequest { +func (op *OperatingSystemService) String() string { + return fmt.Sprintf("OperatingSystemService:%s", op.path) +} + +// +// Manages the set of types of operating systems available in the system. +// +type OperatingSystemsService struct { + BaseService +} + +func NewOperatingSystemsService(connection *Connection, path string) *OperatingSystemsService { + var result OperatingSystemsService + result.connection = connection + result.path = path + return &result +} + +// +// Returns the list of types of operating system available in the system. +// The order of the returned list of operating systems isn't guaranteed. +// +type OperatingSystemsServiceListRequest struct { + OperatingSystemsService *OperatingSystemsService + header map[string]string + query map[string]string + follow *string + max *int64 +} + +func (p *OperatingSystemsServiceListRequest) Header(key, value string) *OperatingSystemsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -51216,7 +53995,7 @@ func (p *HostServiceApproveUsingSshRequest) Header(key, value string) *HostServi return p } -func (p *HostServiceApproveUsingSshRequest) Query(key, value string) *HostServiceApproveUsingSshRequest { +func (p *OperatingSystemsServiceListRequest) Query(key, value string) *OperatingSystemsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -51224,42 +54003,27 @@ func (p *HostServiceApproveUsingSshRequest) Query(key, value string) *HostServic return p } -func (p *HostServiceApproveUsingSshRequest) Activate(activate bool) *HostServiceApproveUsingSshRequest { - p.activate = &activate - return p -} - -func (p *HostServiceApproveUsingSshRequest) Async(async bool) *HostServiceApproveUsingSshRequest { - p.async = &async - return p -} - -func (p *HostServiceApproveUsingSshRequest) Cluster(cluster *Cluster) *HostServiceApproveUsingSshRequest { - p.cluster = cluster +func (p *OperatingSystemsServiceListRequest) Follow(follow string) *OperatingSystemsServiceListRequest { + p.follow = &follow return p } -func (p *HostServiceApproveUsingSshRequest) Host(host *Host) *HostServiceApproveUsingSshRequest { - p.host = host +func (p *OperatingSystemsServiceListRequest) Max(max int64) *OperatingSystemsServiceListRequest { + p.max = &max return p } -func (p *HostServiceApproveUsingSshRequest) Send() (*HostServiceApproveUsingSshResponse, error) { - rawURL := fmt.Sprintf("%s%s/usingssh", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.activate != nil { - actionBuilder.Activate(*p.activate) - } - if p.async != nil { - actionBuilder.Async(*p.async) +func (p *OperatingSystemsServiceListRequest) Send() (*OperatingSystemsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.OperatingSystemsService.connection.URL(), p.OperatingSystemsService.path) + values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} } - actionBuilder.Cluster(p.cluster) - actionBuilder.Host(p.host) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -51268,16 +54032,12 @@ func (p *HostServiceApproveUsingSshRequest) Send() (*HostServiceApproveUsingSshR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.OperatingSystemsService.connection.headers { req.Header.Add(hk, hv) } @@ -51292,18 +54052,18 @@ func (p *HostServiceApproveUsingSshRequest) Send() (*HostServiceApproveUsingSshR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.OperatingSystemsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.OperatingSystemsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.OperatingSystemsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -51312,16 +54072,24 @@ func (p *HostServiceApproveUsingSshRequest) Send() (*HostServiceApproveUsingSshR if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.OperatingSystemsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceApproveUsingSshResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLOperatingSystemInfoReadMany(reader, nil) + if err != nil { + return nil, err + } + return &OperatingSystemsServiceListResponse{operatingSystem: result}, nil } -func (p *HostServiceApproveUsingSshRequest) MustSend() *HostServiceApproveUsingSshResponse { +func (p *OperatingSystemsServiceListRequest) MustSend() *OperatingSystemsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -51330,122 +54098,109 @@ func (p *HostServiceApproveUsingSshRequest) MustSend() *HostServiceApproveUsingS } // -// Approve the specified host to be added to the engine by using ssh authentication. This occurs when the host -// registers itself with the engine. +// Returns the list of types of operating system available in the system. +// The order of the returned list of operating systems isn't guaranteed. // -type HostServiceApproveUsingSshResponse struct { +type OperatingSystemsServiceListResponse struct { + operatingSystem *OperatingSystemInfoSlice +} + +func (p *OperatingSystemsServiceListResponse) OperatingSystem() (*OperatingSystemInfoSlice, bool) { + if p.operatingSystem != nil { + return p.operatingSystem, true + } + return nil, false +} + +func (p *OperatingSystemsServiceListResponse) MustOperatingSystem() *OperatingSystemInfoSlice { + if p.operatingSystem == nil { + panic("operatingSystem in response does not exist") + } + return p.operatingSystem } // -// Approve the specified host to be added to the engine by using ssh authentication. This occurs when the host -// registers itself with the engine. +// Returns the list of types of operating system available in the system. +// The order of the returned list of operating systems isn't guaranteed. // -func (p *HostService) ApproveUsingSsh() *HostServiceApproveUsingSshRequest { - return &HostServiceApproveUsingSshRequest{HostService: p} +func (p *OperatingSystemsService) List() *OperatingSystemsServiceListRequest { + return &OperatingSystemsServiceListRequest{OperatingSystemsService: p} } // -// Install VDSM and other packages required to get the host ready to be used in the engine providing the SSH -// password. // -type HostServiceInstallUsingSshRequest struct { - HostService *HostService - header map[string]string - query map[string]string - activate *bool - async *bool - deployHostedEngine *bool - host *Host - image *string - rootPassword *string - ssh *Ssh - undeployHostedEngine *bool +func (op *OperatingSystemsService) OperatingSystemService(id string) *OperatingSystemService { + return NewOperatingSystemService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } -func (p *HostServiceInstallUsingSshRequest) Header(key, value string) *HostServiceInstallUsingSshRequest { - if p.header == nil { - p.header = make(map[string]string) +// +// Service locator method, returns individual service on which the URI is dispatched. +// +func (op *OperatingSystemsService) Service(path string) (Service, error) { + if path == "" { + return op, nil } - p.header[key] = value - return p -} - -func (p *HostServiceInstallUsingSshRequest) Query(key, value string) *HostServiceInstallUsingSshRequest { - if p.query == nil { - p.query = make(map[string]string) + index := strings.Index(path, "/") + if index == -1 { + return op.OperatingSystemService(path), nil } - p.query[key] = value - return p -} - -func (p *HostServiceInstallUsingSshRequest) Activate(activate bool) *HostServiceInstallUsingSshRequest { - p.activate = &activate - return p + return op.OperatingSystemService(path[:index]).Service(path[index+1:]) } -func (p *HostServiceInstallUsingSshRequest) Async(async bool) *HostServiceInstallUsingSshRequest { - p.async = &async - return p +func (op *OperatingSystemsService) String() string { + return fmt.Sprintf("OperatingSystemsService:%s", op.path) } -func (p *HostServiceInstallUsingSshRequest) DeployHostedEngine(deployHostedEngine bool) *HostServiceInstallUsingSshRequest { - p.deployHostedEngine = &deployHostedEngine - return p +// +// +type PermissionService struct { + BaseService } -func (p *HostServiceInstallUsingSshRequest) Host(host *Host) *HostServiceInstallUsingSshRequest { - p.host = host - return p +func NewPermissionService(connection *Connection, path string) *PermissionService { + var result PermissionService + result.connection = connection + result.path = path + return &result } -func (p *HostServiceInstallUsingSshRequest) Image(image string) *HostServiceInstallUsingSshRequest { - p.image = &image - return p +// +// +type PermissionServiceGetRequest struct { + PermissionService *PermissionService + header map[string]string + query map[string]string + follow *string } -func (p *HostServiceInstallUsingSshRequest) RootPassword(rootPassword string) *HostServiceInstallUsingSshRequest { - p.rootPassword = &rootPassword +func (p *PermissionServiceGetRequest) Header(key, value string) *PermissionServiceGetRequest { + if p.header == nil { + p.header = make(map[string]string) + } + p.header[key] = value return p } -func (p *HostServiceInstallUsingSshRequest) Ssh(ssh *Ssh) *HostServiceInstallUsingSshRequest { - p.ssh = ssh +func (p *PermissionServiceGetRequest) Query(key, value string) *PermissionServiceGetRequest { + if p.query == nil { + p.query = make(map[string]string) + } + p.query[key] = value return p } -func (p *HostServiceInstallUsingSshRequest) UndeployHostedEngine(undeployHostedEngine bool) *HostServiceInstallUsingSshRequest { - p.undeployHostedEngine = &undeployHostedEngine +func (p *PermissionServiceGetRequest) Follow(follow string) *PermissionServiceGetRequest { + p.follow = &follow return p } -func (p *HostServiceInstallUsingSshRequest) Send() (*HostServiceInstallUsingSshResponse, error) { - rawURL := fmt.Sprintf("%s%s/usingssh", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() - if p.activate != nil { - actionBuilder.Activate(*p.activate) - } - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.deployHostedEngine != nil { - actionBuilder.DeployHostedEngine(*p.deployHostedEngine) - } - actionBuilder.Host(p.host) - if p.image != nil { - actionBuilder.Image(*p.image) - } - if p.rootPassword != nil { - actionBuilder.RootPassword(*p.rootPassword) - } - actionBuilder.Ssh(p.ssh) - if p.undeployHostedEngine != nil { - actionBuilder.UndeployHostedEngine(*p.undeployHostedEngine) - } - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *PermissionServiceGetRequest) Send() (*PermissionServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.PermissionService.connection.URL(), p.PermissionService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -51454,16 +54209,12 @@ func (p *HostServiceInstallUsingSshRequest) Send() (*HostServiceInstallUsingSshR if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.PermissionService.connection.headers { req.Header.Add(hk, hv) } @@ -51478,18 +54229,18 @@ func (p *HostServiceInstallUsingSshRequest) Send() (*HostServiceInstallUsingSshR req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.PermissionService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.PermissionService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.PermissionService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -51498,16 +54249,24 @@ func (p *HostServiceInstallUsingSshRequest) Send() (*HostServiceInstallUsingSshR if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.PermissionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(HostServiceInstallUsingSshResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLPermissionReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &PermissionServiceGetResponse{permission: result}, nil } -func (p *HostServiceInstallUsingSshRequest) MustSend() *HostServiceInstallUsingSshResponse { +func (p *PermissionServiceGetRequest) MustSend() *PermissionServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -51516,32 +54275,41 @@ func (p *HostServiceInstallUsingSshRequest) MustSend() *HostServiceInstallUsingS } // -// Install VDSM and other packages required to get the host ready to be used in the engine providing the SSH -// password. // -type HostServiceInstallUsingSshResponse struct { +type PermissionServiceGetResponse struct { + permission *Permission +} + +func (p *PermissionServiceGetResponse) Permission() (*Permission, bool) { + if p.permission != nil { + return p.permission, true + } + return nil, false +} + +func (p *PermissionServiceGetResponse) MustPermission() *Permission { + if p.permission == nil { + panic("permission in response does not exist") + } + return p.permission } // -// Install VDSM and other packages required to get the host ready to be used in the engine providing the SSH -// password. // -func (p *HostService) InstallUsingSsh() *HostServiceInstallUsingSshRequest { - return &HostServiceInstallUsingSshRequest{HostService: p} +func (p *PermissionService) Get() *PermissionServiceGetRequest { + return &PermissionServiceGetRequest{PermissionService: p} } // -// Updates the specified host in the system. // -type HostServiceUpdateUsingSshRequest struct { - HostService *HostService - header map[string]string - query map[string]string - async *bool - host *Host +type PermissionServiceRemoveRequest struct { + PermissionService *PermissionService + header map[string]string + query map[string]string + async *bool } -func (p *HostServiceUpdateUsingSshRequest) Header(key, value string) *HostServiceUpdateUsingSshRequest { +func (p *PermissionServiceRemoveRequest) Header(key, value string) *PermissionServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -51549,7 +54317,7 @@ func (p *HostServiceUpdateUsingSshRequest) Header(key, value string) *HostServic return p } -func (p *HostServiceUpdateUsingSshRequest) Query(key, value string) *HostServiceUpdateUsingSshRequest { +func (p *PermissionServiceRemoveRequest) Query(key, value string) *PermissionServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -51557,28 +54325,18 @@ func (p *HostServiceUpdateUsingSshRequest) Query(key, value string) *HostService return p } -func (p *HostServiceUpdateUsingSshRequest) Async(async bool) *HostServiceUpdateUsingSshRequest { +func (p *PermissionServiceRemoveRequest) Async(async bool) *PermissionServiceRemoveRequest { p.async = &async return p } -func (p *HostServiceUpdateUsingSshRequest) Host(host *Host) *HostServiceUpdateUsingSshRequest { - p.host = host - return p -} - -func (p *HostServiceUpdateUsingSshRequest) Send() (*HostServiceUpdateUsingSshResponse, error) { - rawURL := fmt.Sprintf("%s%s/usingssh", p.HostService.connection.URL(), p.HostService.path) - actionBuilder := NewActionBuilder() +func (p *PermissionServiceRemoveRequest) Send() (*PermissionServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.PermissionService.connection.URL(), p.PermissionService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - actionBuilder.Host(p.host) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -51587,16 +54345,12 @@ func (p *HostServiceUpdateUsingSshRequest) Send() (*HostServiceUpdateUsingSshRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.HostService.connection.headers { + for hk, hv := range p.PermissionService.connection.headers { req.Header.Add(hk, hv) } @@ -51611,18 +54365,18 @@ func (p *HostServiceUpdateUsingSshRequest) Send() (*HostServiceUpdateUsingSshRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.HostService.connection.authenticate() + token, err := p.PermissionService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.HostService.connection.client.Do(req) + resp, err := p.PermissionService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.HostService.connection.logFunc != nil { + if p.PermissionService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -51631,17 +54385,19 @@ func (p *HostServiceUpdateUsingSshRequest) Send() (*HostServiceUpdateUsingSshRes if err != nil { return nil, err } - p.HostService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.PermissionService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - action, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - result := action.MustHost() - return &HostServiceUpdateUsingSshResponse{host: result}, nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(PermissionServiceRemoveResponse), nil } -func (p *HostServiceUpdateUsingSshRequest) MustSend() *HostServiceUpdateUsingSshResponse { +func (p *PermissionServiceRemoveRequest) MustSend() *PermissionServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -51650,271 +54406,68 @@ func (p *HostServiceUpdateUsingSshRequest) MustSend() *HostServiceUpdateUsingSsh } // -// Updates the specified host in the system. -// -type HostServiceUpdateUsingSshResponse struct { - host *Host -} - -func (p *HostServiceUpdateUsingSshResponse) Host() (*Host, bool) { - if p.host != nil { - return p.host, true - } - return nil, false -} - -func (p *HostServiceUpdateUsingSshResponse) MustHost() *Host { - if p.host == nil { - panic("host in response does not exist") - } - return p.host -} - -// -// Updates the specified host in the system. -// -func (p *HostService) UpdateUsingSsh() *HostServiceUpdateUsingSshRequest { - return &HostServiceUpdateUsingSshRequest{HostService: p} -} - -// -// List of scheduling labels assigned to this host. -// -func (op *HostService) AffinityLabelsService() *AssignedAffinityLabelsService { - return NewAssignedAffinityLabelsService(op.connection, fmt.Sprintf("%s/affinitylabels", op.path)) -} - -// -// A reference to the host devices service. Use this service to view the devices of the host object. -// -func (op *HostService) DevicesService() *HostDevicesService { - return NewHostDevicesService(op.connection, fmt.Sprintf("%s/devices", op.path)) -} - -// -// External network providers provisioned by the system on the host. -// -func (op *HostService) ExternalNetworkProviderConfigurationsService() *ExternalNetworkProviderConfigurationsService { - return NewExternalNetworkProviderConfigurationsService(op.connection, fmt.Sprintf("%s/externalnetworkproviderconfigurations", op.path)) -} - -// -// A reference to the fence agents service. Use this service to manage fence and power management agents on the host -// object. -// -func (op *HostService) FenceAgentsService() *FenceAgentsService { - return NewFenceAgentsService(op.connection, fmt.Sprintf("%s/fenceagents", op.path)) -} - -// -// A reference to the host hooks service. Use this service to view the hooks available in the host object. -// -func (op *HostService) HooksService() *HostHooksService { - return NewHostHooksService(op.connection, fmt.Sprintf("%s/hooks", op.path)) -} - -// -// A reference to the service that can show the applicable errata available on the host. This information is taken -// from Katello. -// -func (op *HostService) KatelloErrataService() *KatelloErrataService { - return NewKatelloErrataService(op.connection, fmt.Sprintf("%s/katelloerrata", op.path)) -} - -// -// A reference to the network attachments service. You can use this service to attach Logical networks to host -// interfaces. -// -func (op *HostService) NetworkAttachmentsService() *NetworkAttachmentsService { - return NewNetworkAttachmentsService(op.connection, fmt.Sprintf("%s/networkattachments", op.path)) -} - -// -// A reference to the service that manages the network interface devices on the host. -// -func (op *HostService) NicsService() *HostNicsService { - return NewHostNicsService(op.connection, fmt.Sprintf("%s/nics", op.path)) -} - -// -// A reference to the service that manage NUMA nodes for the host. -// -func (op *HostService) NumaNodesService() *HostNumaNodesService { - return NewHostNumaNodesService(op.connection, fmt.Sprintf("%s/numanodes", op.path)) -} - -// -// A reference to the host permission service. -// Use this service to manage permissions on the host object. -// -func (op *HostService) PermissionsService() *AssignedPermissionsService { - return NewAssignedPermissionsService(op.connection, fmt.Sprintf("%s/permissions", op.path)) -} - -// -// -func (op *HostService) StatisticsService() *StatisticsService { - return NewStatisticsService(op.connection, fmt.Sprintf("%s/statistics", op.path)) -} - -// -// A reference to the service that manages the host's storage. -// -func (op *HostService) StorageService() *HostStorageService { - return NewHostStorageService(op.connection, fmt.Sprintf("%s/storage", op.path)) -} - -// -// A reference to storage connection extensions. -// -func (op *HostService) StorageConnectionExtensionsService() *StorageServerConnectionExtensionsService { - return NewStorageServerConnectionExtensionsService(op.connection, fmt.Sprintf("%s/storageconnectionextensions", op.path)) -} - -// -// A reference to the host tags service. Use this service to manage tags on the host object. // -func (op *HostService) TagsService() *AssignedTagsService { - return NewAssignedTagsService(op.connection, fmt.Sprintf("%s/tags", op.path)) +type PermissionServiceRemoveResponse struct { } // -// A reference to unmanaged networks. // -func (op *HostService) UnmanagedNetworksService() *UnmanagedNetworksService { - return NewUnmanagedNetworksService(op.connection, fmt.Sprintf("%s/unmanagednetworks", op.path)) +func (p *PermissionService) Remove() *PermissionServiceRemoveRequest { + return &PermissionServiceRemoveRequest{PermissionService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *HostService) Service(path string) (Service, error) { +func (op *PermissionService) Service(path string) (Service, error) { if path == "" { return op, nil } - if path == "affinitylabels" { - return op.AffinityLabelsService(), nil - } - if strings.HasPrefix(path, "affinitylabels/") { - return op.AffinityLabelsService().Service(path[15:]) - } - if path == "devices" { - return op.DevicesService(), nil - } - if strings.HasPrefix(path, "devices/") { - return op.DevicesService().Service(path[8:]) - } - if path == "externalnetworkproviderconfigurations" { - return op.ExternalNetworkProviderConfigurationsService(), nil - } - if strings.HasPrefix(path, "externalnetworkproviderconfigurations/") { - return op.ExternalNetworkProviderConfigurationsService().Service(path[38:]) - } - if path == "fenceagents" { - return op.FenceAgentsService(), nil - } - if strings.HasPrefix(path, "fenceagents/") { - return op.FenceAgentsService().Service(path[12:]) - } - if path == "hooks" { - return op.HooksService(), nil - } - if strings.HasPrefix(path, "hooks/") { - return op.HooksService().Service(path[6:]) - } - if path == "katelloerrata" { - return op.KatelloErrataService(), nil - } - if strings.HasPrefix(path, "katelloerrata/") { - return op.KatelloErrataService().Service(path[14:]) - } - if path == "networkattachments" { - return op.NetworkAttachmentsService(), nil - } - if strings.HasPrefix(path, "networkattachments/") { - return op.NetworkAttachmentsService().Service(path[19:]) - } - if path == "nics" { - return op.NicsService(), nil - } - if strings.HasPrefix(path, "nics/") { - return op.NicsService().Service(path[5:]) - } - if path == "numanodes" { - return op.NumaNodesService(), nil - } - if strings.HasPrefix(path, "numanodes/") { - return op.NumaNodesService().Service(path[10:]) - } - if path == "permissions" { - return op.PermissionsService(), nil - } - if strings.HasPrefix(path, "permissions/") { - return op.PermissionsService().Service(path[12:]) - } - if path == "statistics" { - return op.StatisticsService(), nil - } - if strings.HasPrefix(path, "statistics/") { - return op.StatisticsService().Service(path[11:]) - } - if path == "storage" { - return op.StorageService(), nil - } - if strings.HasPrefix(path, "storage/") { - return op.StorageService().Service(path[8:]) - } - if path == "storageconnectionextensions" { - return op.StorageConnectionExtensionsService(), nil - } - if strings.HasPrefix(path, "storageconnectionextensions/") { - return op.StorageConnectionExtensionsService().Service(path[28:]) - } - if path == "tags" { - return op.TagsService(), nil - } - if strings.HasPrefix(path, "tags/") { - return op.TagsService().Service(path[5:]) - } - if path == "unmanagednetworks" { - return op.UnmanagedNetworksService(), nil - } - if strings.HasPrefix(path, "unmanagednetworks/") { - return op.UnmanagedNetworksService().Service(path[18:]) - } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *HostService) String() string { - return fmt.Sprintf("HostService:%s", op.path) +func (op *PermissionService) String() string { + return fmt.Sprintf("PermissionService:%s", op.path) } // +// A service to manage a specific permit of the role. // -type TemplateDiskService struct { +type PermitService struct { BaseService } -func NewTemplateDiskService(connection *Connection, path string) *TemplateDiskService { - var result TemplateDiskService +func NewPermitService(connection *Connection, path string) *PermitService { + var result PermitService result.connection = connection result.path = path return &result } // -// Copy the specified disk attached to the template to a specific storage domain. +// Gets the information about the permit of the role. +// For example to retrieve the information about the permit with the id `456` of the role with the id `123` +// send a request like this: +// .... +// GET /ovirt-engine/api/roles/123/permits/456 +// .... +// [source,xml] +// ---- +// +// change_vm_cd +// false +// +// +// ---- // -type TemplateDiskServiceCopyRequest struct { - TemplateDiskService *TemplateDiskService - header map[string]string - query map[string]string - async *bool - filter *bool - storageDomain *StorageDomain +type PermitServiceGetRequest struct { + PermitService *PermitService + header map[string]string + query map[string]string + follow *string } -func (p *TemplateDiskServiceCopyRequest) Header(key, value string) *TemplateDiskServiceCopyRequest { +func (p *PermitServiceGetRequest) Header(key, value string) *PermitServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -51922,7 +54475,7 @@ func (p *TemplateDiskServiceCopyRequest) Header(key, value string) *TemplateDisk return p } -func (p *TemplateDiskServiceCopyRequest) Query(key, value string) *TemplateDiskServiceCopyRequest { +func (p *PermitServiceGetRequest) Query(key, value string) *PermitServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -51930,36 +54483,18 @@ func (p *TemplateDiskServiceCopyRequest) Query(key, value string) *TemplateDiskS return p } -func (p *TemplateDiskServiceCopyRequest) Async(async bool) *TemplateDiskServiceCopyRequest { - p.async = &async - return p -} - -func (p *TemplateDiskServiceCopyRequest) Filter(filter bool) *TemplateDiskServiceCopyRequest { - p.filter = &filter - return p -} - -func (p *TemplateDiskServiceCopyRequest) StorageDomain(storageDomain *StorageDomain) *TemplateDiskServiceCopyRequest { - p.storageDomain = storageDomain +func (p *PermitServiceGetRequest) Follow(follow string) *PermitServiceGetRequest { + p.follow = &follow return p } -func (p *TemplateDiskServiceCopyRequest) Send() (*TemplateDiskServiceCopyResponse, error) { - rawURL := fmt.Sprintf("%s%s/copy", p.TemplateDiskService.connection.URL(), p.TemplateDiskService.path) - actionBuilder := NewActionBuilder() - if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.filter != nil { - actionBuilder.Filter(*p.filter) - } - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err - } +func (p *PermitServiceGetRequest) Send() (*PermitServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.PermitService.connection.URL(), p.PermitService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -51968,16 +54503,12 @@ func (p *TemplateDiskServiceCopyRequest) Send() (*TemplateDiskServiceCopyRespons if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.TemplateDiskService.connection.headers { + for hk, hv := range p.PermitService.connection.headers { req.Header.Add(hk, hv) } @@ -51992,18 +54523,18 @@ func (p *TemplateDiskServiceCopyRequest) Send() (*TemplateDiskServiceCopyRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateDiskService.connection.authenticate() + token, err := p.PermitService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateDiskService.connection.client.Do(req) + resp, err := p.PermitService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateDiskService.connection.logFunc != nil { + if p.PermitService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52012,16 +54543,24 @@ func (p *TemplateDiskServiceCopyRequest) Send() (*TemplateDiskServiceCopyRespons if err != nil { return nil, err } - p.TemplateDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.PermitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(TemplateDiskServiceCopyResponse), nil + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + reader := NewXMLReader(respBodyBytes) + result, err := XMLPermitReadOne(reader, nil, "") + if err != nil { + return nil, err + } + return &PermitServiceGetResponse{permit: result}, nil } -func (p *TemplateDiskServiceCopyRequest) MustSend() *TemplateDiskServiceCopyResponse { +func (p *PermitServiceGetRequest) MustSend() *PermitServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52030,30 +54569,74 @@ func (p *TemplateDiskServiceCopyRequest) MustSend() *TemplateDiskServiceCopyResp } // -// Copy the specified disk attached to the template to a specific storage domain. +// Gets the information about the permit of the role. +// For example to retrieve the information about the permit with the id `456` of the role with the id `123` +// send a request like this: +// .... +// GET /ovirt-engine/api/roles/123/permits/456 +// .... +// [source,xml] +// ---- +// +// change_vm_cd +// false +// +// +// ---- // -type TemplateDiskServiceCopyResponse struct { +type PermitServiceGetResponse struct { + permit *Permit +} + +func (p *PermitServiceGetResponse) Permit() (*Permit, bool) { + if p.permit != nil { + return p.permit, true + } + return nil, false +} + +func (p *PermitServiceGetResponse) MustPermit() *Permit { + if p.permit == nil { + panic("permit in response does not exist") + } + return p.permit } // -// Copy the specified disk attached to the template to a specific storage domain. +// Gets the information about the permit of the role. +// For example to retrieve the information about the permit with the id `456` of the role with the id `123` +// send a request like this: +// .... +// GET /ovirt-engine/api/roles/123/permits/456 +// .... +// [source,xml] +// ---- +// +// change_vm_cd +// false +// +// +// ---- // -func (p *TemplateDiskService) Copy() *TemplateDiskServiceCopyRequest { - return &TemplateDiskServiceCopyRequest{TemplateDiskService: p} +func (p *PermitService) Get() *PermitServiceGetRequest { + return &PermitServiceGetRequest{PermitService: p} } // +// Removes the permit from the role. +// For example to remove the permit with id `456` from the role with id `123` send a request like this: +// .... +// DELETE /ovirt-engine/api/roles/123/permits/456 +// .... // -type TemplateDiskServiceExportRequest struct { - TemplateDiskService *TemplateDiskService - header map[string]string - query map[string]string - async *bool - filter *bool - storageDomain *StorageDomain +type PermitServiceRemoveRequest struct { + PermitService *PermitService + header map[string]string + query map[string]string + async *bool } -func (p *TemplateDiskServiceExportRequest) Header(key, value string) *TemplateDiskServiceExportRequest { +func (p *PermitServiceRemoveRequest) Header(key, value string) *PermitServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -52061,7 +54644,7 @@ func (p *TemplateDiskServiceExportRequest) Header(key, value string) *TemplateDi return p } -func (p *TemplateDiskServiceExportRequest) Query(key, value string) *TemplateDiskServiceExportRequest { +func (p *PermitServiceRemoveRequest) Query(key, value string) *PermitServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -52069,36 +54652,18 @@ func (p *TemplateDiskServiceExportRequest) Query(key, value string) *TemplateDis return p } -func (p *TemplateDiskServiceExportRequest) Async(async bool) *TemplateDiskServiceExportRequest { +func (p *PermitServiceRemoveRequest) Async(async bool) *PermitServiceRemoveRequest { p.async = &async return p } -func (p *TemplateDiskServiceExportRequest) Filter(filter bool) *TemplateDiskServiceExportRequest { - p.filter = &filter - return p -} - -func (p *TemplateDiskServiceExportRequest) StorageDomain(storageDomain *StorageDomain) *TemplateDiskServiceExportRequest { - p.storageDomain = storageDomain - return p -} - -func (p *TemplateDiskServiceExportRequest) Send() (*TemplateDiskServiceExportResponse, error) { - rawURL := fmt.Sprintf("%s%s/export", p.TemplateDiskService.connection.URL(), p.TemplateDiskService.path) - actionBuilder := NewActionBuilder() +func (p *PermitServiceRemoveRequest) Send() (*PermitServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.PermitService.connection.URL(), p.PermitService.path) + values := make(url.Values) if p.async != nil { - actionBuilder.Async(*p.async) - } - if p.filter != nil { - actionBuilder.Filter(*p.filter) - } - actionBuilder.StorageDomain(p.storageDomain) - action, err := actionBuilder.Build() - if err != nil { - return nil, err + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } - values := make(url.Values) + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -52107,16 +54672,12 @@ func (p *TemplateDiskServiceExportRequest) Send() (*TemplateDiskServiceExportRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err = XMLActionWriteOne(writer, action, "") - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.TemplateDiskService.connection.headers { + for hk, hv := range p.PermitService.connection.headers { req.Header.Add(hk, hv) } @@ -52131,18 +54692,18 @@ func (p *TemplateDiskServiceExportRequest) Send() (*TemplateDiskServiceExportRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateDiskService.connection.authenticate() + token, err := p.PermitService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateDiskService.connection.client.Do(req) + resp, err := p.PermitService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateDiskService.connection.logFunc != nil { + if p.PermitService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52151,16 +54712,19 @@ func (p *TemplateDiskServiceExportRequest) Send() (*TemplateDiskServiceExportRes if err != nil { return nil, err } - p.TemplateDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.PermitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - _, errCheckAction := CheckAction(resp) - if errCheckAction != nil { - return nil, errCheckAction + if !Contains(resp.StatusCode, []int{200}) { + return nil, CheckFault(resp) } - return new(TemplateDiskServiceExportResponse), nil + _, errReadBody := ioutil.ReadAll(resp.Body) + if errReadBody != nil { + return nil, errReadBody + } + return new(PermitServiceRemoveResponse), nil } -func (p *TemplateDiskServiceExportRequest) MustSend() *TemplateDiskServiceExportResponse { +func (p *PermitServiceRemoveRequest) MustSend() *PermitServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52169,26 +54733,76 @@ func (p *TemplateDiskServiceExportRequest) MustSend() *TemplateDiskServiceExport } // +// Removes the permit from the role. +// For example to remove the permit with id `456` from the role with id `123` send a request like this: +// .... +// DELETE /ovirt-engine/api/roles/123/permits/456 +// .... +// +type PermitServiceRemoveResponse struct { +} + // -type TemplateDiskServiceExportResponse struct { +// Removes the permit from the role. +// For example to remove the permit with id `456` from the role with id `123` send a request like this: +// .... +// DELETE /ovirt-engine/api/roles/123/permits/456 +// .... +// +func (p *PermitService) Remove() *PermitServiceRemoveRequest { + return &PermitServiceRemoveRequest{PermitService: p} } // +// Service locator method, returns individual service on which the URI is dispatched. // -func (p *TemplateDiskService) Export() *TemplateDiskServiceExportRequest { - return &TemplateDiskServiceExportRequest{TemplateDiskService: p} +func (op *PermitService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) +} + +func (op *PermitService) String() string { + return fmt.Sprintf("PermitService:%s", op.path) } // +// Represents a permits sub-collection of the specific role. // -type TemplateDiskServiceGetRequest struct { - TemplateDiskService *TemplateDiskService - header map[string]string - query map[string]string - follow *string +type PermitsService struct { + BaseService } -func (p *TemplateDiskServiceGetRequest) Header(key, value string) *TemplateDiskServiceGetRequest { +func NewPermitsService(connection *Connection, path string) *PermitsService { + var result PermitsService + result.connection = connection + result.path = path + return &result +} + +// +// Adds a permit to the role. The permit name can be retrieved from the <> service. +// For example to assign a permit `create_vm` to the role with id `123` send a request like this: +// .... +// POST /ovirt-engine/api/roles/123/permits +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// create_vm +// +// ---- +// +type PermitsServiceAddRequest struct { + PermitsService *PermitsService + header map[string]string + query map[string]string + permit *Permit +} + +func (p *PermitsServiceAddRequest) Header(key, value string) *PermitsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -52196,7 +54810,7 @@ func (p *TemplateDiskServiceGetRequest) Header(key, value string) *TemplateDiskS return p } -func (p *TemplateDiskServiceGetRequest) Query(key, value string) *TemplateDiskServiceGetRequest { +func (p *PermitsServiceAddRequest) Query(key, value string) *PermitsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -52204,18 +54818,14 @@ func (p *TemplateDiskServiceGetRequest) Query(key, value string) *TemplateDiskSe return p } -func (p *TemplateDiskServiceGetRequest) Follow(follow string) *TemplateDiskServiceGetRequest { - p.follow = &follow +func (p *PermitsServiceAddRequest) Permit(permit *Permit) *PermitsServiceAddRequest { + p.permit = permit return p } -func (p *TemplateDiskServiceGetRequest) Send() (*TemplateDiskServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateDiskService.connection.URL(), p.TemplateDiskService.path) +func (p *PermitsServiceAddRequest) Send() (*PermitsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.PermitsService.connection.URL(), p.PermitsService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -52224,12 +54834,19 @@ func (p *TemplateDiskServiceGetRequest) Send() (*TemplateDiskServiceGetResponse, if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLPermitWriteOne(writer, p.permit, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.TemplateDiskService.connection.headers { + for hk, hv := range p.PermitsService.connection.headers { req.Header.Add(hk, hv) } @@ -52244,18 +54861,18 @@ func (p *TemplateDiskServiceGetRequest) Send() (*TemplateDiskServiceGetResponse, req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateDiskService.connection.authenticate() + token, err := p.PermitsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateDiskService.connection.client.Do(req) + resp, err := p.PermitsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateDiskService.connection.logFunc != nil { + if p.PermitsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52264,9 +54881,9 @@ func (p *TemplateDiskServiceGetRequest) Send() (*TemplateDiskServiceGetResponse, if err != nil { return nil, err } - p.TemplateDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.PermitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -52274,14 +54891,14 @@ func (p *TemplateDiskServiceGetRequest) Send() (*TemplateDiskServiceGetResponse, return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLDiskReadOne(reader, nil, "") + result, err := XMLPermitReadOne(reader, nil, "") if err != nil { return nil, err } - return &TemplateDiskServiceGetResponse{disk: result}, nil + return &PermitsServiceAddResponse{permit: result}, nil } -func (p *TemplateDiskServiceGetRequest) MustSend() *TemplateDiskServiceGetResponse { +func (p *PermitsServiceAddRequest) MustSend() *PermitsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52290,41 +54907,87 @@ func (p *TemplateDiskServiceGetRequest) MustSend() *TemplateDiskServiceGetRespon } // +// Adds a permit to the role. The permit name can be retrieved from the <> service. +// For example to assign a permit `create_vm` to the role with id `123` send a request like this: +// .... +// POST /ovirt-engine/api/roles/123/permits +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// create_vm +// +// ---- // -type TemplateDiskServiceGetResponse struct { - disk *Disk +type PermitsServiceAddResponse struct { + permit *Permit } -func (p *TemplateDiskServiceGetResponse) Disk() (*Disk, bool) { - if p.disk != nil { - return p.disk, true +func (p *PermitsServiceAddResponse) Permit() (*Permit, bool) { + if p.permit != nil { + return p.permit, true } return nil, false } -func (p *TemplateDiskServiceGetResponse) MustDisk() *Disk { - if p.disk == nil { - panic("disk in response does not exist") +func (p *PermitsServiceAddResponse) MustPermit() *Permit { + if p.permit == nil { + panic("permit in response does not exist") } - return p.disk + return p.permit } // +// Adds a permit to the role. The permit name can be retrieved from the <> service. +// For example to assign a permit `create_vm` to the role with id `123` send a request like this: +// .... +// POST /ovirt-engine/api/roles/123/permits +// .... +// With a request body like this: +// [source,xml] +// ---- +// +// create_vm +// +// ---- // -func (p *TemplateDiskService) Get() *TemplateDiskServiceGetRequest { - return &TemplateDiskServiceGetRequest{TemplateDiskService: p} +func (p *PermitsService) Add() *PermitsServiceAddRequest { + return &PermitsServiceAddRequest{PermitsService: p} } // +// List the permits of the role. +// For example to list the permits of the role with the id `123` send a request like this: +// .... +// GET /ovirt-engine/api/roles/123/permits +// .... +// [source,xml] +// ---- +// +// +// change_vm_cd +// false +// +// +// +// connect_to_vm +// false +// +// +// +// ---- +// The order of the returned list of permits isn't guaranteed. // -type TemplateDiskServiceRemoveRequest struct { - TemplateDiskService *TemplateDiskService - header map[string]string - query map[string]string - async *bool +type PermitsServiceListRequest struct { + PermitsService *PermitsService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *TemplateDiskServiceRemoveRequest) Header(key, value string) *TemplateDiskServiceRemoveRequest { +func (p *PermitsServiceListRequest) Header(key, value string) *PermitsServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -52332,7 +54995,7 @@ func (p *TemplateDiskServiceRemoveRequest) Header(key, value string) *TemplateDi return p } -func (p *TemplateDiskServiceRemoveRequest) Query(key, value string) *TemplateDiskServiceRemoveRequest { +func (p *PermitsServiceListRequest) Query(key, value string) *PermitsServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -52340,16 +55003,25 @@ func (p *TemplateDiskServiceRemoveRequest) Query(key, value string) *TemplateDis return p } -func (p *TemplateDiskServiceRemoveRequest) Async(async bool) *TemplateDiskServiceRemoveRequest { - p.async = &async +func (p *PermitsServiceListRequest) Follow(follow string) *PermitsServiceListRequest { + p.follow = &follow return p } -func (p *TemplateDiskServiceRemoveRequest) Send() (*TemplateDiskServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.TemplateDiskService.connection.URL(), p.TemplateDiskService.path) +func (p *PermitsServiceListRequest) Max(max int64) *PermitsServiceListRequest { + p.max = &max + return p +} + +func (p *PermitsServiceListRequest) Send() (*PermitsServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.PermitsService.connection.URL(), p.PermitsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + + if p.max != nil { + values["max"] = []string{fmt.Sprintf("%v", *p.max)} } if p.query != nil { @@ -52360,12 +55032,12 @@ func (p *TemplateDiskServiceRemoveRequest) Send() (*TemplateDiskServiceRemoveRes if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("DELETE", rawURL, nil) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.TemplateDiskService.connection.headers { + for hk, hv := range p.PermitsService.connection.headers { req.Header.Add(hk, hv) } @@ -52380,18 +55052,18 @@ func (p *TemplateDiskServiceRemoveRequest) Send() (*TemplateDiskServiceRemoveRes req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.TemplateDiskService.connection.authenticate() + token, err := p.PermitsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.TemplateDiskService.connection.client.Do(req) + resp, err := p.PermitsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.TemplateDiskService.connection.logFunc != nil { + if p.PermitsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52400,19 +55072,24 @@ func (p *TemplateDiskServiceRemoveRequest) Send() (*TemplateDiskServiceRemoveRes if err != nil { return nil, err } - p.TemplateDiskService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.PermitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - _, errReadBody := ioutil.ReadAll(resp.Body) + respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - return new(TemplateDiskServiceRemoveResponse), nil + reader := NewXMLReader(respBodyBytes) + result, err := XMLPermitReadMany(reader, nil) + if err != nil { + return nil, err + } + return &PermitsServiceListResponse{permits: result}, nil } -func (p *TemplateDiskServiceRemoveRequest) MustSend() *TemplateDiskServiceRemoveResponse { +func (p *PermitsServiceListRequest) MustSend() *PermitsServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52421,54 +55098,138 @@ func (p *TemplateDiskServiceRemoveRequest) MustSend() *TemplateDiskServiceRemove } // +// List the permits of the role. +// For example to list the permits of the role with the id `123` send a request like this: +// .... +// GET /ovirt-engine/api/roles/123/permits +// .... +// [source,xml] +// ---- +// +// +// change_vm_cd +// false +// +// +// +// connect_to_vm +// false +// +// +// +// ---- +// The order of the returned list of permits isn't guaranteed. // -type TemplateDiskServiceRemoveResponse struct { +type PermitsServiceListResponse struct { + permits *PermitSlice +} + +func (p *PermitsServiceListResponse) Permits() (*PermitSlice, bool) { + if p.permits != nil { + return p.permits, true + } + return nil, false +} + +func (p *PermitsServiceListResponse) MustPermits() *PermitSlice { + if p.permits == nil { + panic("permits in response does not exist") + } + return p.permits } // +// List the permits of the role. +// For example to list the permits of the role with the id `123` send a request like this: +// .... +// GET /ovirt-engine/api/roles/123/permits +// .... +// [source,xml] +// ---- +// +// +// change_vm_cd +// false +// +// +// +// connect_to_vm +// false +// +// +// +// ---- +// The order of the returned list of permits isn't guaranteed. // -func (p *TemplateDiskService) Remove() *TemplateDiskServiceRemoveRequest { - return &TemplateDiskServiceRemoveRequest{TemplateDiskService: p} +func (p *PermitsService) List() *PermitsServiceListRequest { + return &PermitsServiceListRequest{PermitsService: p} +} + +// +// Sub-resource locator method, returns individual permit resource on which the remainder of the URI is dispatched. +// +func (op *PermitsService) PermitService(id string) *PermitService { + return NewPermitService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *TemplateDiskService) Service(path string) (Service, error) { +func (op *PermitsService) Service(path string) (Service, error) { if path == "" { return op, nil } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) + index := strings.Index(path, "/") + if index == -1 { + return op.PermitService(path), nil + } + return op.PermitService(path[:index]).Service(path[index+1:]) } -func (op *TemplateDiskService) String() string { - return fmt.Sprintf("TemplateDiskService:%s", op.path) +func (op *PermitsService) String() string { + return fmt.Sprintf("PermitsService:%s", op.path) } // // -type VmGraphicsConsolesService struct { +type QosService struct { BaseService } -func NewVmGraphicsConsolesService(connection *Connection, path string) *VmGraphicsConsolesService { - var result VmGraphicsConsolesService +func NewQosService(connection *Connection, path string) *QosService { + var result QosService result.connection = connection result.path = path return &result } // -// Add new graphics console to the virtual machine. +// Get specified QoS in the data center. +// [source] +// ---- +// GET /ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// You will get response like this one below: +// [source,xml] +// ---- +// +// 123 +// 123 +// 1 +// 1 +// storage +// +// +// ---- // -type VmGraphicsConsolesServiceAddRequest struct { - VmGraphicsConsolesService *VmGraphicsConsolesService - header map[string]string - query map[string]string - console *GraphicsConsole +type QosServiceGetRequest struct { + QosService *QosService + header map[string]string + query map[string]string + follow *string } -func (p *VmGraphicsConsolesServiceAddRequest) Header(key, value string) *VmGraphicsConsolesServiceAddRequest { +func (p *QosServiceGetRequest) Header(key, value string) *QosServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -52476,7 +55237,7 @@ func (p *VmGraphicsConsolesServiceAddRequest) Header(key, value string) *VmGraph return p } -func (p *VmGraphicsConsolesServiceAddRequest) Query(key, value string) *VmGraphicsConsolesServiceAddRequest { +func (p *QosServiceGetRequest) Query(key, value string) *QosServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -52484,14 +55245,18 @@ func (p *VmGraphicsConsolesServiceAddRequest) Query(key, value string) *VmGraphi return p } -func (p *VmGraphicsConsolesServiceAddRequest) Console(console *GraphicsConsole) *VmGraphicsConsolesServiceAddRequest { - p.console = console +func (p *QosServiceGetRequest) Follow(follow string) *QosServiceGetRequest { + p.follow = &follow return p } -func (p *VmGraphicsConsolesServiceAddRequest) Send() (*VmGraphicsConsolesServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmGraphicsConsolesService.connection.URL(), p.VmGraphicsConsolesService.path) +func (p *QosServiceGetRequest) Send() (*QosServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QosService.connection.URL(), p.QosService.path) values := make(url.Values) + if p.follow != nil { + values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + } + if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -52500,19 +55265,12 @@ func (p *VmGraphicsConsolesServiceAddRequest) Send() (*VmGraphicsConsolesService if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - var body bytes.Buffer - writer := NewXMLWriter(&body) - err := XMLGraphicsConsoleWriteOne(writer, p.console, "") - if err != nil { - return nil, err - } - writer.Flush() - req, err := http.NewRequest("POST", rawURL, &body) + req, err := http.NewRequest("GET", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.VmGraphicsConsolesService.connection.headers { + for hk, hv := range p.QosService.connection.headers { req.Header.Add(hk, hv) } @@ -52527,18 +55285,18 @@ func (p *VmGraphicsConsolesServiceAddRequest) Send() (*VmGraphicsConsolesService req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmGraphicsConsolesService.connection.authenticate() + token, err := p.QosService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmGraphicsConsolesService.connection.client.Do(req) + resp, err := p.QosService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmGraphicsConsolesService.connection.logFunc != nil { + if p.QosService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52547,9 +55305,9 @@ func (p *VmGraphicsConsolesServiceAddRequest) Send() (*VmGraphicsConsolesService if err != nil { return nil, err } - p.VmGraphicsConsolesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QosService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200, 201, 202}) { + if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -52557,14 +55315,14 @@ func (p *VmGraphicsConsolesServiceAddRequest) Send() (*VmGraphicsConsolesService return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLGraphicsConsoleReadOne(reader, nil, "") + result, err := XMLQosReadOne(reader, nil, "") if err != nil { return nil, err } - return &VmGraphicsConsolesServiceAddResponse{console: result}, nil + return &QosServiceGetResponse{qos: result}, nil } -func (p *VmGraphicsConsolesServiceAddRequest) MustSend() *VmGraphicsConsolesServiceAddResponse { +func (p *QosServiceGetRequest) MustSend() *QosServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52573,53 +55331,80 @@ func (p *VmGraphicsConsolesServiceAddRequest) MustSend() *VmGraphicsConsolesServ } // -// Add new graphics console to the virtual machine. +// Get specified QoS in the data center. +// [source] +// ---- +// GET /ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// You will get response like this one below: +// [source,xml] +// ---- +// +// 123 +// 123 +// 1 +// 1 +// storage +// +// +// ---- // -type VmGraphicsConsolesServiceAddResponse struct { - console *GraphicsConsole +type QosServiceGetResponse struct { + qos *Qos } -func (p *VmGraphicsConsolesServiceAddResponse) Console() (*GraphicsConsole, bool) { - if p.console != nil { - return p.console, true +func (p *QosServiceGetResponse) Qos() (*Qos, bool) { + if p.qos != nil { + return p.qos, true } return nil, false } -func (p *VmGraphicsConsolesServiceAddResponse) MustConsole() *GraphicsConsole { - if p.console == nil { - panic("console in response does not exist") +func (p *QosServiceGetResponse) MustQos() *Qos { + if p.qos == nil { + panic("qos in response does not exist") } - return p.console + return p.qos } // -// Add new graphics console to the virtual machine. +// Get specified QoS in the data center. +// [source] +// ---- +// GET /ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// You will get response like this one below: +// [source,xml] +// ---- +// +// 123 +// 123 +// 1 +// 1 +// storage +// +// +// ---- // -func (p *VmGraphicsConsolesService) Add() *VmGraphicsConsolesServiceAddRequest { - return &VmGraphicsConsolesServiceAddRequest{VmGraphicsConsolesService: p} +func (p *QosService) Get() *QosServiceGetRequest { + return &QosServiceGetRequest{QosService: p} } // -// Lists all the configured graphics consoles of the virtual machine. -// IMPORTANT: By default, when the `current` parameter is not specified, the data returned -// corresponds to the next execution of the virtual machine. In the current implementation of -// the system this means that the `address` and `port` attributes will not be populated because -// the system does not know what address and port will be used for the next execution. Since in most -// cases those attributes are needed, it is strongly advised to aways explicitly include the -// `current` parameter with the value `true`. -// The order of the returned list of graphics consoles is not guaranteed. +// Remove specified QoS from datacenter. +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/qoss/123 +// ---- // -type VmGraphicsConsolesServiceListRequest struct { - VmGraphicsConsolesService *VmGraphicsConsolesService - header map[string]string - query map[string]string - current *bool - follow *string - max *int64 +type QosServiceRemoveRequest struct { + QosService *QosService + header map[string]string + query map[string]string + async *bool } -func (p *VmGraphicsConsolesServiceListRequest) Header(key, value string) *VmGraphicsConsolesServiceListRequest { +func (p *QosServiceRemoveRequest) Header(key, value string) *QosServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -52627,7 +55412,7 @@ func (p *VmGraphicsConsolesServiceListRequest) Header(key, value string) *VmGrap return p } -func (p *VmGraphicsConsolesServiceListRequest) Query(key, value string) *VmGraphicsConsolesServiceListRequest { +func (p *QosServiceRemoveRequest) Query(key, value string) *QosServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -52635,34 +55420,16 @@ func (p *VmGraphicsConsolesServiceListRequest) Query(key, value string) *VmGraph return p } -func (p *VmGraphicsConsolesServiceListRequest) Current(current bool) *VmGraphicsConsolesServiceListRequest { - p.current = ¤t - return p -} - -func (p *VmGraphicsConsolesServiceListRequest) Follow(follow string) *VmGraphicsConsolesServiceListRequest { - p.follow = &follow - return p -} - -func (p *VmGraphicsConsolesServiceListRequest) Max(max int64) *VmGraphicsConsolesServiceListRequest { - p.max = &max +func (p *QosServiceRemoveRequest) Async(async bool) *QosServiceRemoveRequest { + p.async = &async return p } -func (p *VmGraphicsConsolesServiceListRequest) Send() (*VmGraphicsConsolesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmGraphicsConsolesService.connection.URL(), p.VmGraphicsConsolesService.path) +func (p *QosServiceRemoveRequest) Send() (*QosServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QosService.connection.URL(), p.QosService.path) values := make(url.Values) - if p.current != nil { - values["current"] = []string{fmt.Sprintf("%v", *p.current)} - } - - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} - } - - if p.max != nil { - values["max"] = []string{fmt.Sprintf("%v", *p.max)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -52673,12 +55440,12 @@ func (p *VmGraphicsConsolesServiceListRequest) Send() (*VmGraphicsConsolesServic if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + req, err := http.NewRequest("DELETE", rawURL, nil) if err != nil { return nil, err } - for hk, hv := range p.VmGraphicsConsolesService.connection.headers { + for hk, hv := range p.QosService.connection.headers { req.Header.Add(hk, hv) } @@ -52693,18 +55460,18 @@ func (p *VmGraphicsConsolesServiceListRequest) Send() (*VmGraphicsConsolesServic req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmGraphicsConsolesService.connection.authenticate() + token, err := p.QosService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmGraphicsConsolesService.connection.client.Do(req) + resp, err := p.QosService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmGraphicsConsolesService.connection.logFunc != nil { + if p.QosService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52713,24 +55480,19 @@ func (p *VmGraphicsConsolesServiceListRequest) Send() (*VmGraphicsConsolesServic if err != nil { return nil, err } - p.VmGraphicsConsolesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QosService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) } - respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) + _, errReadBody := ioutil.ReadAll(resp.Body) if errReadBody != nil { return nil, errReadBody } - reader := NewXMLReader(respBodyBytes) - result, err := XMLGraphicsConsoleReadMany(reader, nil) - if err != nil { - return nil, err - } - return &VmGraphicsConsolesServiceListResponse{consoles: result}, nil + return new(QosServiceRemoveResponse), nil } -func (p *VmGraphicsConsolesServiceListRequest) MustSend() *VmGraphicsConsolesServiceListResponse { +func (p *QosServiceRemoveRequest) MustSend() *QosServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52739,110 +55501,61 @@ func (p *VmGraphicsConsolesServiceListRequest) MustSend() *VmGraphicsConsolesSer } // -// Lists all the configured graphics consoles of the virtual machine. -// IMPORTANT: By default, when the `current` parameter is not specified, the data returned -// corresponds to the next execution of the virtual machine. In the current implementation of -// the system this means that the `address` and `port` attributes will not be populated because -// the system does not know what address and port will be used for the next execution. Since in most -// cases those attributes are needed, it is strongly advised to aways explicitly include the -// `current` parameter with the value `true`. -// The order of the returned list of graphics consoles is not guaranteed. -// -type VmGraphicsConsolesServiceListResponse struct { - consoles *GraphicsConsoleSlice -} - -func (p *VmGraphicsConsolesServiceListResponse) Consoles() (*GraphicsConsoleSlice, bool) { - if p.consoles != nil { - return p.consoles, true - } - return nil, false -} - -func (p *VmGraphicsConsolesServiceListResponse) MustConsoles() *GraphicsConsoleSlice { - if p.consoles == nil { - panic("consoles in response does not exist") - } - return p.consoles -} - -// -// Lists all the configured graphics consoles of the virtual machine. -// IMPORTANT: By default, when the `current` parameter is not specified, the data returned -// corresponds to the next execution of the virtual machine. In the current implementation of -// the system this means that the `address` and `port` attributes will not be populated because -// the system does not know what address and port will be used for the next execution. Since in most -// cases those attributes are needed, it is strongly advised to aways explicitly include the -// `current` parameter with the value `true`. -// The order of the returned list of graphics consoles is not guaranteed. -// -func (p *VmGraphicsConsolesService) List() *VmGraphicsConsolesServiceListRequest { - return &VmGraphicsConsolesServiceListRequest{VmGraphicsConsolesService: p} -} - -// -// Returns a reference to the service that manages a specific virtual machine graphics console. +// Remove specified QoS from datacenter. +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/qoss/123 +// ---- // -func (op *VmGraphicsConsolesService) ConsoleService(id string) *VmGraphicsConsoleService { - return NewVmGraphicsConsoleService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +type QosServiceRemoveResponse struct { } // -// Service locator method, returns individual service on which the URI is dispatched. +// Remove specified QoS from datacenter. +// [source] +// ---- +// DELETE /ovirt-engine/api/datacenters/123/qoss/123 +// ---- // -func (op *VmGraphicsConsolesService) Service(path string) (Service, error) { - if path == "" { - return op, nil - } - index := strings.Index(path, "/") - if index == -1 { - return op.ConsoleService(path), nil - } - return op.ConsoleService(path[:index]).Service(path[index+1:]) -} - -func (op *VmGraphicsConsolesService) String() string { - return fmt.Sprintf("VmGraphicsConsolesService:%s", op.path) +func (p *QosService) Remove() *QosServiceRemoveRequest { + return &QosServiceRemoveRequest{QosService: p} } // -// Manages a network filter. +// Update the specified QoS in the dataCenter. +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// For example with curl: +// [source] +// ---- +// curl -u admin@internal:123456 -X PUT -H "content-type: application/xml" -d \ +// "32132110" \ +// https://engine/ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// You will receive response like this: // [source,xml] // ---- -// -// example-network-filter-b -// -// 4 -// 0 -// -1 -// -1 -// -// +// +// 321 +// 321 +// 10 +// 1 +// storage +// +// // ---- -// Please note that version is referring to the minimal support version for the specific filter. -// -type NetworkFilterService struct { - BaseService -} - -func NewNetworkFilterService(connection *Connection, path string) *NetworkFilterService { - var result NetworkFilterService - result.connection = connection - result.path = path - return &result -} - -// -// Retrieves a representation of the network filter. // -type NetworkFilterServiceGetRequest struct { - NetworkFilterService *NetworkFilterService - header map[string]string - query map[string]string - follow *string +type QosServiceUpdateRequest struct { + QosService *QosService + header map[string]string + query map[string]string + async *bool + qos *Qos } -func (p *NetworkFilterServiceGetRequest) Header(key, value string) *NetworkFilterServiceGetRequest { +func (p *QosServiceUpdateRequest) Header(key, value string) *QosServiceUpdateRequest { if p.header == nil { p.header = make(map[string]string) } @@ -52850,7 +55563,7 @@ func (p *NetworkFilterServiceGetRequest) Header(key, value string) *NetworkFilte return p } -func (p *NetworkFilterServiceGetRequest) Query(key, value string) *NetworkFilterServiceGetRequest { +func (p *QosServiceUpdateRequest) Query(key, value string) *QosServiceUpdateRequest { if p.query == nil { p.query = make(map[string]string) } @@ -52858,16 +55571,21 @@ func (p *NetworkFilterServiceGetRequest) Query(key, value string) *NetworkFilter return p } -func (p *NetworkFilterServiceGetRequest) Follow(follow string) *NetworkFilterServiceGetRequest { - p.follow = &follow +func (p *QosServiceUpdateRequest) Async(async bool) *QosServiceUpdateRequest { + p.async = &async return p } -func (p *NetworkFilterServiceGetRequest) Send() (*NetworkFilterServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.NetworkFilterService.connection.URL(), p.NetworkFilterService.path) +func (p *QosServiceUpdateRequest) Qos(qos *Qos) *QosServiceUpdateRequest { + p.qos = qos + return p +} + +func (p *QosServiceUpdateRequest) Send() (*QosServiceUpdateResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QosService.connection.URL(), p.QosService.path) values := make(url.Values) - if p.follow != nil { - values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} + if p.async != nil { + values["async"] = []string{fmt.Sprintf("%v", *p.async)} } if p.query != nil { @@ -52878,12 +55596,19 @@ func (p *NetworkFilterServiceGetRequest) Send() (*NetworkFilterServiceGetRespons if len(values) > 0 { rawURL = fmt.Sprintf("%s?%s", rawURL, values.Encode()) } - req, err := http.NewRequest("GET", rawURL, nil) + var body bytes.Buffer + writer := NewXMLWriter(&body) + err := XMLQosWriteOne(writer, p.qos, "") + if err != nil { + return nil, err + } + writer.Flush() + req, err := http.NewRequest("PUT", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.NetworkFilterService.connection.headers { + for hk, hv := range p.QosService.connection.headers { req.Header.Add(hk, hv) } @@ -52898,18 +55623,18 @@ func (p *NetworkFilterServiceGetRequest) Send() (*NetworkFilterServiceGetRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.NetworkFilterService.connection.authenticate() + token, err := p.QosService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.NetworkFilterService.connection.client.Do(req) + resp, err := p.QosService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.NetworkFilterService.connection.logFunc != nil { + if p.QosService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -52918,7 +55643,7 @@ func (p *NetworkFilterServiceGetRequest) Send() (*NetworkFilterServiceGetRespons if err != nil { return nil, err } - p.NetworkFilterService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QosService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -52928,14 +55653,14 @@ func (p *NetworkFilterServiceGetRequest) Send() (*NetworkFilterServiceGetRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLNetworkFilterReadOne(reader, nil, "") + result, err := XMLQosReadOne(reader, nil, "") if err != nil { return nil, err } - return &NetworkFilterServiceGetResponse{networkFilter: result}, nil + return &QosServiceUpdateResponse{qos: result}, nil } -func (p *NetworkFilterServiceGetRequest) MustSend() *NetworkFilterServiceGetResponse { +func (p *QosServiceUpdateRequest) MustSend() *QosServiceUpdateResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -52944,71 +55669,133 @@ func (p *NetworkFilterServiceGetRequest) MustSend() *NetworkFilterServiceGetResp } // -// Retrieves a representation of the network filter. +// Update the specified QoS in the dataCenter. +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// For example with curl: +// [source] +// ---- +// curl -u admin@internal:123456 -X PUT -H "content-type: application/xml" -d \ +// "32132110" \ +// https://engine/ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// You will receive response like this: +// [source,xml] +// ---- +// +// 321 +// 321 +// 10 +// 1 +// storage +// +// +// ---- // -type NetworkFilterServiceGetResponse struct { - networkFilter *NetworkFilter +type QosServiceUpdateResponse struct { + qos *Qos } -func (p *NetworkFilterServiceGetResponse) NetworkFilter() (*NetworkFilter, bool) { - if p.networkFilter != nil { - return p.networkFilter, true +func (p *QosServiceUpdateResponse) Qos() (*Qos, bool) { + if p.qos != nil { + return p.qos, true } return nil, false } -func (p *NetworkFilterServiceGetResponse) MustNetworkFilter() *NetworkFilter { - if p.networkFilter == nil { - panic("networkFilter in response does not exist") +func (p *QosServiceUpdateResponse) MustQos() *Qos { + if p.qos == nil { + panic("qos in response does not exist") } - return p.networkFilter + return p.qos } // -// Retrieves a representation of the network filter. +// Update the specified QoS in the dataCenter. +// [source] +// ---- +// PUT /ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// For example with curl: +// [source] +// ---- +// curl -u admin@internal:123456 -X PUT -H "content-type: application/xml" -d \ +// "32132110" \ +// https://engine/ovirt-engine/api/datacenters/123/qoss/123 +// ---- +// You will receive response like this: +// [source,xml] +// ---- +// +// 321 +// 321 +// 10 +// 1 +// storage +// +// +// ---- // -func (p *NetworkFilterService) Get() *NetworkFilterServiceGetRequest { - return &NetworkFilterServiceGetRequest{NetworkFilterService: p} +func (p *QosService) Update() *QosServiceUpdateRequest { + return &QosServiceUpdateRequest{QosService: p} } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *NetworkFilterService) Service(path string) (Service, error) { +func (op *QosService) Service(path string) (Service, error) { if path == "" { return op, nil } return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (op *NetworkFilterService) String() string { - return fmt.Sprintf("NetworkFilterService:%s", op.path) +func (op *QosService) String() string { + return fmt.Sprintf("QosService:%s", op.path) } // +// Manages the set of _quality of service_ configurations available in a data center. // -type AssignedVnicProfilesService struct { +type QossService struct { BaseService } -func NewAssignedVnicProfilesService(connection *Connection, path string) *AssignedVnicProfilesService { - var result AssignedVnicProfilesService +func NewQossService(connection *Connection, path string) *QossService { + var result QossService result.connection = connection result.path = path return &result } // -// Add a new virtual network interface card profile for the network. +// Add a new QoS to the dataCenter. +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/qoss +// ---- +// The response will look as follows: +// [source,xml] +// ---- +// +// 123 +// 123 +// 10 +// storage +// +// +// ---- // -type AssignedVnicProfilesServiceAddRequest struct { - AssignedVnicProfilesService *AssignedVnicProfilesService - header map[string]string - query map[string]string - profile *VnicProfile +type QossServiceAddRequest struct { + QossService *QossService + header map[string]string + query map[string]string + qos *Qos } -func (p *AssignedVnicProfilesServiceAddRequest) Header(key, value string) *AssignedVnicProfilesServiceAddRequest { +func (p *QossServiceAddRequest) Header(key, value string) *QossServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -53016,7 +55803,7 @@ func (p *AssignedVnicProfilesServiceAddRequest) Header(key, value string) *Assig return p } -func (p *AssignedVnicProfilesServiceAddRequest) Query(key, value string) *AssignedVnicProfilesServiceAddRequest { +func (p *QossServiceAddRequest) Query(key, value string) *QossServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -53024,13 +55811,13 @@ func (p *AssignedVnicProfilesServiceAddRequest) Query(key, value string) *Assign return p } -func (p *AssignedVnicProfilesServiceAddRequest) Profile(profile *VnicProfile) *AssignedVnicProfilesServiceAddRequest { - p.profile = profile +func (p *QossServiceAddRequest) Qos(qos *Qos) *QossServiceAddRequest { + p.qos = qos return p } -func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesServiceAddResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedVnicProfilesService.connection.URL(), p.AssignedVnicProfilesService.path) +func (p *QossServiceAddRequest) Send() (*QossServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QossService.connection.URL(), p.QossService.path) values := make(url.Values) if p.query != nil { for k, v := range p.query { @@ -53042,7 +55829,7 @@ func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesSer } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLVnicProfileWriteOne(writer, p.profile, "") + err := XMLQosWriteOne(writer, p.qos, "") if err != nil { return nil, err } @@ -53052,7 +55839,7 @@ func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesSer return nil, err } - for hk, hv := range p.AssignedVnicProfilesService.connection.headers { + for hk, hv := range p.QossService.connection.headers { req.Header.Add(hk, hv) } @@ -53067,18 +55854,18 @@ func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesSer req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedVnicProfilesService.connection.authenticate() + token, err := p.QossService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedVnicProfilesService.connection.client.Do(req) + resp, err := p.QossService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedVnicProfilesService.connection.logFunc != nil { + if p.QossService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -53087,7 +55874,7 @@ func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesSer if err != nil { return nil, err } - p.AssignedVnicProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QossService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) @@ -53097,14 +55884,14 @@ func (p *AssignedVnicProfilesServiceAddRequest) Send() (*AssignedVnicProfilesSer return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLVnicProfileReadOne(reader, nil, "") + result, err := XMLQosReadOne(reader, nil, "") if err != nil { return nil, err } - return &AssignedVnicProfilesServiceAddResponse{profile: result}, nil + return &QossServiceAddResponse{qos: result}, nil } -func (p *AssignedVnicProfilesServiceAddRequest) MustSend() *AssignedVnicProfilesServiceAddResponse { +func (p *QossServiceAddRequest) MustSend() *QossServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -53113,46 +55900,89 @@ func (p *AssignedVnicProfilesServiceAddRequest) MustSend() *AssignedVnicProfiles } // -// Add a new virtual network interface card profile for the network. +// Add a new QoS to the dataCenter. +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/qoss +// ---- +// The response will look as follows: +// [source,xml] +// ---- +// +// 123 +// 123 +// 10 +// storage +// +// +// ---- // -type AssignedVnicProfilesServiceAddResponse struct { - profile *VnicProfile +type QossServiceAddResponse struct { + qos *Qos } -func (p *AssignedVnicProfilesServiceAddResponse) Profile() (*VnicProfile, bool) { - if p.profile != nil { - return p.profile, true +func (p *QossServiceAddResponse) Qos() (*Qos, bool) { + if p.qos != nil { + return p.qos, true } return nil, false } -func (p *AssignedVnicProfilesServiceAddResponse) MustProfile() *VnicProfile { - if p.profile == nil { - panic("profile in response does not exist") +func (p *QossServiceAddResponse) MustQos() *Qos { + if p.qos == nil { + panic("qos in response does not exist") } - return p.profile + return p.qos } // -// Add a new virtual network interface card profile for the network. +// Add a new QoS to the dataCenter. +// [source] +// ---- +// POST /ovirt-engine/api/datacenters/123/qoss +// ---- +// The response will look as follows: +// [source,xml] +// ---- +// +// 123 +// 123 +// 10 +// storage +// +// +// ---- // -func (p *AssignedVnicProfilesService) Add() *AssignedVnicProfilesServiceAddRequest { - return &AssignedVnicProfilesServiceAddRequest{AssignedVnicProfilesService: p} +func (p *QossService) Add() *QossServiceAddRequest { + return &QossServiceAddRequest{QossService: p} } // -// Returns the list of VNIC profiles assifned to the network. -// The order of the returned VNIC profiles isn't guaranteed. +// Returns the list of _quality of service_ configurations available in the data center. +// [source] +// ---- +// GET /ovirt-engine/api/datacenter/123/qoss +// ---- +// You will get response which will look like this: +// [source, xml] +// ---- +// +// ... +// ... +// ... +// +// ---- +// The returned list of quality of service configurations isn't guaranteed. // -type AssignedVnicProfilesServiceListRequest struct { - AssignedVnicProfilesService *AssignedVnicProfilesService - header map[string]string - query map[string]string - follow *string - max *int64 +type QossServiceListRequest struct { + QossService *QossService + header map[string]string + query map[string]string + follow *string + max *int64 } -func (p *AssignedVnicProfilesServiceListRequest) Header(key, value string) *AssignedVnicProfilesServiceListRequest { +func (p *QossServiceListRequest) Header(key, value string) *QossServiceListRequest { if p.header == nil { p.header = make(map[string]string) } @@ -53160,7 +55990,7 @@ func (p *AssignedVnicProfilesServiceListRequest) Header(key, value string) *Assi return p } -func (p *AssignedVnicProfilesServiceListRequest) Query(key, value string) *AssignedVnicProfilesServiceListRequest { +func (p *QossServiceListRequest) Query(key, value string) *QossServiceListRequest { if p.query == nil { p.query = make(map[string]string) } @@ -53168,18 +55998,18 @@ func (p *AssignedVnicProfilesServiceListRequest) Query(key, value string) *Assig return p } -func (p *AssignedVnicProfilesServiceListRequest) Follow(follow string) *AssignedVnicProfilesServiceListRequest { +func (p *QossServiceListRequest) Follow(follow string) *QossServiceListRequest { p.follow = &follow return p } -func (p *AssignedVnicProfilesServiceListRequest) Max(max int64) *AssignedVnicProfilesServiceListRequest { +func (p *QossServiceListRequest) Max(max int64) *QossServiceListRequest { p.max = &max return p } -func (p *AssignedVnicProfilesServiceListRequest) Send() (*AssignedVnicProfilesServiceListResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.AssignedVnicProfilesService.connection.URL(), p.AssignedVnicProfilesService.path) +func (p *QossServiceListRequest) Send() (*QossServiceListResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QossService.connection.URL(), p.QossService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -53202,7 +56032,7 @@ func (p *AssignedVnicProfilesServiceListRequest) Send() (*AssignedVnicProfilesSe return nil, err } - for hk, hv := range p.AssignedVnicProfilesService.connection.headers { + for hk, hv := range p.QossService.connection.headers { req.Header.Add(hk, hv) } @@ -53217,18 +56047,18 @@ func (p *AssignedVnicProfilesServiceListRequest) Send() (*AssignedVnicProfilesSe req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.AssignedVnicProfilesService.connection.authenticate() + token, err := p.QossService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.AssignedVnicProfilesService.connection.client.Do(req) + resp, err := p.QossService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.AssignedVnicProfilesService.connection.logFunc != nil { + if p.QossService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -53237,7 +56067,7 @@ func (p *AssignedVnicProfilesServiceListRequest) Send() (*AssignedVnicProfilesSe if err != nil { return nil, err } - p.AssignedVnicProfilesService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QossService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -53247,14 +56077,14 @@ func (p *AssignedVnicProfilesServiceListRequest) Send() (*AssignedVnicProfilesSe return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLVnicProfileReadMany(reader, nil) + result, err := XMLQosReadMany(reader, nil) if err != nil { return nil, err } - return &AssignedVnicProfilesServiceListResponse{profiles: result}, nil + return &QossServiceListResponse{qoss: result}, nil } -func (p *AssignedVnicProfilesServiceListRequest) MustSend() *AssignedVnicProfilesServiceListResponse { +func (p *QossServiceListRequest) MustSend() *QossServiceListResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -53263,67 +56093,94 @@ func (p *AssignedVnicProfilesServiceListRequest) MustSend() *AssignedVnicProfile } // -// Returns the list of VNIC profiles assifned to the network. -// The order of the returned VNIC profiles isn't guaranteed. +// Returns the list of _quality of service_ configurations available in the data center. +// [source] +// ---- +// GET /ovirt-engine/api/datacenter/123/qoss +// ---- +// You will get response which will look like this: +// [source, xml] +// ---- +// +// ... +// ... +// ... +// +// ---- +// The returned list of quality of service configurations isn't guaranteed. // -type AssignedVnicProfilesServiceListResponse struct { - profiles *VnicProfileSlice +type QossServiceListResponse struct { + qoss *QosSlice } -func (p *AssignedVnicProfilesServiceListResponse) Profiles() (*VnicProfileSlice, bool) { - if p.profiles != nil { - return p.profiles, true +func (p *QossServiceListResponse) Qoss() (*QosSlice, bool) { + if p.qoss != nil { + return p.qoss, true } return nil, false } -func (p *AssignedVnicProfilesServiceListResponse) MustProfiles() *VnicProfileSlice { - if p.profiles == nil { - panic("profiles in response does not exist") +func (p *QossServiceListResponse) MustQoss() *QosSlice { + if p.qoss == nil { + panic("qoss in response does not exist") } - return p.profiles + return p.qoss } // -// Returns the list of VNIC profiles assifned to the network. -// The order of the returned VNIC profiles isn't guaranteed. +// Returns the list of _quality of service_ configurations available in the data center. +// [source] +// ---- +// GET /ovirt-engine/api/datacenter/123/qoss +// ---- +// You will get response which will look like this: +// [source, xml] +// ---- +// +// ... +// ... +// ... +// +// ---- +// The returned list of quality of service configurations isn't guaranteed. // -func (p *AssignedVnicProfilesService) List() *AssignedVnicProfilesServiceListRequest { - return &AssignedVnicProfilesServiceListRequest{AssignedVnicProfilesService: p} +func (p *QossService) List() *QossServiceListRequest { + return &QossServiceListRequest{QossService: p} } // +// A reference to a service managing a specific QoS. // -func (op *AssignedVnicProfilesService) ProfileService(id string) *AssignedVnicProfileService { - return NewAssignedVnicProfileService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) +func (op *QossService) QosService(id string) *QosService { + return NewQosService(op.connection, fmt.Sprintf("%s/%s", op.path, id)) } // // Service locator method, returns individual service on which the URI is dispatched. // -func (op *AssignedVnicProfilesService) Service(path string) (Service, error) { +func (op *QossService) Service(path string) (Service, error) { if path == "" { return op, nil } index := strings.Index(path, "/") if index == -1 { - return op.ProfileService(path), nil + return op.QosService(path), nil } - return op.ProfileService(path[:index]).Service(path[index+1:]) + return op.QosService(path[:index]).Service(path[index+1:]) } -func (op *AssignedVnicProfilesService) String() string { - return fmt.Sprintf("AssignedVnicProfilesService:%s", op.path) +func (op *QossService) String() string { + return fmt.Sprintf("QossService:%s", op.path) } // // -type VmNumaNodeService struct { +type QuotaClusterLimitService struct { BaseService } -func NewVmNumaNodeService(connection *Connection, path string) *VmNumaNodeService { - var result VmNumaNodeService +func NewQuotaClusterLimitService(connection *Connection, path string) *QuotaClusterLimitService { + var result QuotaClusterLimitService result.connection = connection result.path = path return &result @@ -53331,14 +56188,14 @@ func NewVmNumaNodeService(connection *Connection, path string) *VmNumaNodeServic // // -type VmNumaNodeServiceGetRequest struct { - VmNumaNodeService *VmNumaNodeService - header map[string]string - query map[string]string - follow *string +type QuotaClusterLimitServiceGetRequest struct { + QuotaClusterLimitService *QuotaClusterLimitService + header map[string]string + query map[string]string + follow *string } -func (p *VmNumaNodeServiceGetRequest) Header(key, value string) *VmNumaNodeServiceGetRequest { +func (p *QuotaClusterLimitServiceGetRequest) Header(key, value string) *QuotaClusterLimitServiceGetRequest { if p.header == nil { p.header = make(map[string]string) } @@ -53346,7 +56203,7 @@ func (p *VmNumaNodeServiceGetRequest) Header(key, value string) *VmNumaNodeServi return p } -func (p *VmNumaNodeServiceGetRequest) Query(key, value string) *VmNumaNodeServiceGetRequest { +func (p *QuotaClusterLimitServiceGetRequest) Query(key, value string) *QuotaClusterLimitServiceGetRequest { if p.query == nil { p.query = make(map[string]string) } @@ -53354,13 +56211,13 @@ func (p *VmNumaNodeServiceGetRequest) Query(key, value string) *VmNumaNodeServic return p } -func (p *VmNumaNodeServiceGetRequest) Follow(follow string) *VmNumaNodeServiceGetRequest { +func (p *QuotaClusterLimitServiceGetRequest) Follow(follow string) *QuotaClusterLimitServiceGetRequest { p.follow = &follow return p } -func (p *VmNumaNodeServiceGetRequest) Send() (*VmNumaNodeServiceGetResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNumaNodeService.connection.URL(), p.VmNumaNodeService.path) +func (p *QuotaClusterLimitServiceGetRequest) Send() (*QuotaClusterLimitServiceGetResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QuotaClusterLimitService.connection.URL(), p.QuotaClusterLimitService.path) values := make(url.Values) if p.follow != nil { values["follow"] = []string{fmt.Sprintf("%v", *p.follow)} @@ -53379,7 +56236,7 @@ func (p *VmNumaNodeServiceGetRequest) Send() (*VmNumaNodeServiceGetResponse, err return nil, err } - for hk, hv := range p.VmNumaNodeService.connection.headers { + for hk, hv := range p.QuotaClusterLimitService.connection.headers { req.Header.Add(hk, hv) } @@ -53394,18 +56251,18 @@ func (p *VmNumaNodeServiceGetRequest) Send() (*VmNumaNodeServiceGetResponse, err req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNumaNodeService.connection.authenticate() + token, err := p.QuotaClusterLimitService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNumaNodeService.connection.client.Do(req) + resp, err := p.QuotaClusterLimitService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNumaNodeService.connection.logFunc != nil { + if p.QuotaClusterLimitService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -53414,7 +56271,7 @@ func (p *VmNumaNodeServiceGetRequest) Send() (*VmNumaNodeServiceGetResponse, err if err != nil { return nil, err } - p.VmNumaNodeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QuotaClusterLimitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -53424,14 +56281,14 @@ func (p *VmNumaNodeServiceGetRequest) Send() (*VmNumaNodeServiceGetResponse, err return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLVirtualNumaNodeReadOne(reader, nil, "") + result, err := XMLQuotaClusterLimitReadOne(reader, nil, "") if err != nil { return nil, err } - return &VmNumaNodeServiceGetResponse{node: result}, nil + return &QuotaClusterLimitServiceGetResponse{limit: result}, nil } -func (p *VmNumaNodeServiceGetRequest) MustSend() *VmNumaNodeServiceGetResponse { +func (p *QuotaClusterLimitServiceGetRequest) MustSend() *QuotaClusterLimitServiceGetResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -53441,48 +56298,40 @@ func (p *VmNumaNodeServiceGetRequest) MustSend() *VmNumaNodeServiceGetResponse { // // -type VmNumaNodeServiceGetResponse struct { - node *VirtualNumaNode +type QuotaClusterLimitServiceGetResponse struct { + limit *QuotaClusterLimit } -func (p *VmNumaNodeServiceGetResponse) Node() (*VirtualNumaNode, bool) { - if p.node != nil { - return p.node, true +func (p *QuotaClusterLimitServiceGetResponse) Limit() (*QuotaClusterLimit, bool) { + if p.limit != nil { + return p.limit, true } return nil, false } -func (p *VmNumaNodeServiceGetResponse) MustNode() *VirtualNumaNode { - if p.node == nil { - panic("node in response does not exist") +func (p *QuotaClusterLimitServiceGetResponse) MustLimit() *QuotaClusterLimit { + if p.limit == nil { + panic("limit in response does not exist") } - return p.node + return p.limit } // // -func (p *VmNumaNodeService) Get() *VmNumaNodeServiceGetRequest { - return &VmNumaNodeServiceGetRequest{VmNumaNodeService: p} +func (p *QuotaClusterLimitService) Get() *QuotaClusterLimitServiceGetRequest { + return &QuotaClusterLimitServiceGetRequest{QuotaClusterLimitService: p} } // -// Removes a virtual NUMA node. -// An example of removing a virtual NUMA node: -// [source] -// ---- -// DELETE /ovirt-engine/api/vms/123/numanodes/456 -// ---- -// NOTE: It's required to remove the numa nodes from the highest index -// first. // -type VmNumaNodeServiceRemoveRequest struct { - VmNumaNodeService *VmNumaNodeService - header map[string]string - query map[string]string - async *bool +type QuotaClusterLimitServiceRemoveRequest struct { + QuotaClusterLimitService *QuotaClusterLimitService + header map[string]string + query map[string]string + async *bool } -func (p *VmNumaNodeServiceRemoveRequest) Header(key, value string) *VmNumaNodeServiceRemoveRequest { +func (p *QuotaClusterLimitServiceRemoveRequest) Header(key, value string) *QuotaClusterLimitServiceRemoveRequest { if p.header == nil { p.header = make(map[string]string) } @@ -53490,7 +56339,7 @@ func (p *VmNumaNodeServiceRemoveRequest) Header(key, value string) *VmNumaNodeSe return p } -func (p *VmNumaNodeServiceRemoveRequest) Query(key, value string) *VmNumaNodeServiceRemoveRequest { +func (p *QuotaClusterLimitServiceRemoveRequest) Query(key, value string) *QuotaClusterLimitServiceRemoveRequest { if p.query == nil { p.query = make(map[string]string) } @@ -53498,13 +56347,13 @@ func (p *VmNumaNodeServiceRemoveRequest) Query(key, value string) *VmNumaNodeSer return p } -func (p *VmNumaNodeServiceRemoveRequest) Async(async bool) *VmNumaNodeServiceRemoveRequest { +func (p *QuotaClusterLimitServiceRemoveRequest) Async(async bool) *QuotaClusterLimitServiceRemoveRequest { p.async = &async return p } -func (p *VmNumaNodeServiceRemoveRequest) Send() (*VmNumaNodeServiceRemoveResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNumaNodeService.connection.URL(), p.VmNumaNodeService.path) +func (p *QuotaClusterLimitServiceRemoveRequest) Send() (*QuotaClusterLimitServiceRemoveResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QuotaClusterLimitService.connection.URL(), p.QuotaClusterLimitService.path) values := make(url.Values) if p.async != nil { values["async"] = []string{fmt.Sprintf("%v", *p.async)} @@ -53523,7 +56372,7 @@ func (p *VmNumaNodeServiceRemoveRequest) Send() (*VmNumaNodeServiceRemoveRespons return nil, err } - for hk, hv := range p.VmNumaNodeService.connection.headers { + for hk, hv := range p.QuotaClusterLimitService.connection.headers { req.Header.Add(hk, hv) } @@ -53538,18 +56387,18 @@ func (p *VmNumaNodeServiceRemoveRequest) Send() (*VmNumaNodeServiceRemoveRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNumaNodeService.connection.authenticate() + token, err := p.QuotaClusterLimitService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNumaNodeService.connection.client.Do(req) + resp, err := p.QuotaClusterLimitService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNumaNodeService.connection.logFunc != nil { + if p.QuotaClusterLimitService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -53558,7 +56407,7 @@ func (p *VmNumaNodeServiceRemoveRequest) Send() (*VmNumaNodeServiceRemoveRespons if err != nil { return nil, err } - p.VmNumaNodeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QuotaClusterLimitService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } if !Contains(resp.StatusCode, []int{200}) { return nil, CheckFault(resp) @@ -53567,10 +56416,10 @@ func (p *VmNumaNodeServiceRemoveRequest) Send() (*VmNumaNodeServiceRemoveRespons if errReadBody != nil { return nil, errReadBody } - return new(VmNumaNodeServiceRemoveResponse), nil + return new(QuotaClusterLimitServiceRemoveResponse), nil } -func (p *VmNumaNodeServiceRemoveRequest) MustSend() *VmNumaNodeServiceRemoveResponse { +func (p *QuotaClusterLimitServiceRemoveRequest) MustSend() *QuotaClusterLimitServiceRemoveResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -53579,60 +56428,55 @@ func (p *VmNumaNodeServiceRemoveRequest) MustSend() *VmNumaNodeServiceRemoveResp } // -// Removes a virtual NUMA node. -// An example of removing a virtual NUMA node: -// [source] -// ---- -// DELETE /ovirt-engine/api/vms/123/numanodes/456 -// ---- -// NOTE: It's required to remove the numa nodes from the highest index -// first. // -type VmNumaNodeServiceRemoveResponse struct { +type QuotaClusterLimitServiceRemoveResponse struct { } // -// Removes a virtual NUMA node. -// An example of removing a virtual NUMA node: -// [source] -// ---- -// DELETE /ovirt-engine/api/vms/123/numanodes/456 -// ---- -// NOTE: It's required to remove the numa nodes from the highest index -// first. // -func (p *VmNumaNodeService) Remove() *VmNumaNodeServiceRemoveRequest { - return &VmNumaNodeServiceRemoveRequest{VmNumaNodeService: p} +func (p *QuotaClusterLimitService) Remove() *QuotaClusterLimitServiceRemoveRequest { + return &QuotaClusterLimitServiceRemoveRequest{QuotaClusterLimitService: p} } // -// Updates a virtual NUMA node. -// An example of pinning a virtual NUMA node to a physical NUMA node on the host: -// [source] -// ---- -// PUT /ovirt-engine/api/vms/123/numanodes/456 -// ---- -// The request body should contain the following: -// [source,xml] -// ---- -// -// -// -// 0 -// -// -// -// ---- +// Service locator method, returns individual service on which the URI is dispatched. // -type VmNumaNodeServiceUpdateRequest struct { - VmNumaNodeService *VmNumaNodeService - header map[string]string - query map[string]string - async *bool - node *VirtualNumaNode +func (op *QuotaClusterLimitService) Service(path string) (Service, error) { + if path == "" { + return op, nil + } + return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) } -func (p *VmNumaNodeServiceUpdateRequest) Header(key, value string) *VmNumaNodeServiceUpdateRequest { +func (op *QuotaClusterLimitService) String() string { + return fmt.Sprintf("QuotaClusterLimitService:%s", op.path) +} + +// +// Manages the set of quota limits configured for a cluster. +// +type QuotaClusterLimitsService struct { + BaseService +} + +func NewQuotaClusterLimitsService(connection *Connection, path string) *QuotaClusterLimitsService { + var result QuotaClusterLimitsService + result.connection = connection + result.path = path + return &result +} + +// +// Add a cluster limit to a specified Quota. +// +type QuotaClusterLimitsServiceAddRequest struct { + QuotaClusterLimitsService *QuotaClusterLimitsService + header map[string]string + query map[string]string + limit *QuotaClusterLimit +} + +func (p *QuotaClusterLimitsServiceAddRequest) Header(key, value string) *QuotaClusterLimitsServiceAddRequest { if p.header == nil { p.header = make(map[string]string) } @@ -53640,7 +56484,7 @@ func (p *VmNumaNodeServiceUpdateRequest) Header(key, value string) *VmNumaNodeSe return p } -func (p *VmNumaNodeServiceUpdateRequest) Query(key, value string) *VmNumaNodeServiceUpdateRequest { +func (p *QuotaClusterLimitsServiceAddRequest) Query(key, value string) *QuotaClusterLimitsServiceAddRequest { if p.query == nil { p.query = make(map[string]string) } @@ -53648,23 +56492,14 @@ func (p *VmNumaNodeServiceUpdateRequest) Query(key, value string) *VmNumaNodeSer return p } -func (p *VmNumaNodeServiceUpdateRequest) Async(async bool) *VmNumaNodeServiceUpdateRequest { - p.async = &async - return p -} - -func (p *VmNumaNodeServiceUpdateRequest) Node(node *VirtualNumaNode) *VmNumaNodeServiceUpdateRequest { - p.node = node +func (p *QuotaClusterLimitsServiceAddRequest) Limit(limit *QuotaClusterLimit) *QuotaClusterLimitsServiceAddRequest { + p.limit = limit return p } -func (p *VmNumaNodeServiceUpdateRequest) Send() (*VmNumaNodeServiceUpdateResponse, error) { - rawURL := fmt.Sprintf("%s%s", p.VmNumaNodeService.connection.URL(), p.VmNumaNodeService.path) +func (p *QuotaClusterLimitsServiceAddRequest) Send() (*QuotaClusterLimitsServiceAddResponse, error) { + rawURL := fmt.Sprintf("%s%s", p.QuotaClusterLimitsService.connection.URL(), p.QuotaClusterLimitsService.path) values := make(url.Values) - if p.async != nil { - values["async"] = []string{fmt.Sprintf("%v", *p.async)} - } - if p.query != nil { for k, v := range p.query { values[k] = []string{v} @@ -53675,17 +56510,17 @@ func (p *VmNumaNodeServiceUpdateRequest) Send() (*VmNumaNodeServiceUpdateRespons } var body bytes.Buffer writer := NewXMLWriter(&body) - err := XMLVirtualNumaNodeWriteOne(writer, p.node, "") + err := XMLQuotaClusterLimitWriteOne(writer, p.limit, "") if err != nil { return nil, err } writer.Flush() - req, err := http.NewRequest("PUT", rawURL, &body) + req, err := http.NewRequest("POST", rawURL, &body) if err != nil { return nil, err } - for hk, hv := range p.VmNumaNodeService.connection.headers { + for hk, hv := range p.QuotaClusterLimitsService.connection.headers { req.Header.Add(hk, hv) } @@ -53700,18 +56535,18 @@ func (p *VmNumaNodeServiceUpdateRequest) Send() (*VmNumaNodeServiceUpdateRespons req.Header.Add("Content-Type", "application/xml") req.Header.Add("Accept", "application/xml") // get OAuth access token - token, err := p.VmNumaNodeService.connection.authenticate() + token, err := p.QuotaClusterLimitsService.connection.authenticate() if err != nil { return nil, err } req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) // Send the request and wait for the response - resp, err := p.VmNumaNodeService.connection.client.Do(req) + resp, err := p.QuotaClusterLimitsService.connection.client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - if p.VmNumaNodeService.connection.logFunc != nil { + if p.QuotaClusterLimitsService.connection.logFunc != nil { dumpReq, err := httputil.DumpRequestOut(req, true) if err != nil { return nil, err @@ -53720,9 +56555,9 @@ func (p *VmNumaNodeServiceUpdateRequest) Send() (*VmNumaNodeServiceUpdateRespons if err != nil { return nil, err } - p.VmNumaNodeService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) + p.QuotaClusterLimitsService.connection.logFunc("<<<<<>>>>>\n", string(dumpReq), string(dumpResp)) } - if !Contains(resp.StatusCode, []int{200}) { + if !Contains(resp.StatusCode, []int{200, 201, 202}) { return nil, CheckFault(resp) } respBodyBytes, errReadBody := ioutil.ReadAll(resp.Body) @@ -53730,14 +56565,14 @@ func (p *VmNumaNodeServiceUpdateRequest) Send() (*VmNumaNodeServiceUpdateRespons return nil, errReadBody } reader := NewXMLReader(respBodyBytes) - result, err := XMLVirtualNumaNodeReadOne(reader, nil, "") + result, err := XMLQuotaClusterLimitReadOne(reader, nil, "") if err != nil { return nil, err } - return &VmNumaNodeServiceUpdateResponse{node: result}, nil + return &QuotaClusterLimitsServiceAddResponse{limit: result}, nil } -func (p *VmNumaNodeServiceUpdateRequest) MustSend() *VmNumaNodeServiceUpdateResponse { +func (p *QuotaClusterLimitsServiceAddRequest) MustSend() *QuotaClusterLimitsServiceAddResponse { if v, err := p.Send(); err != nil { panic(err) } else { @@ -53746,119 +56581,46 @@ func (p *VmNumaNodeServiceUpdateRequest) MustSend() *VmNumaNodeServiceUpdateResp } // -// Updates a virtual NUMA node. -// An example of pinning a virtual NUMA node to a physical NUMA node on the host: -// [source] -// ---- -// PUT /ovirt-engine/api/vms/123/numanodes/456 -// ---- -// The request body should contain the following: -// [source,xml] -// ---- -// -// -// -// 0 -// -// -// -// ---- +// Add a cluster limit to a specified Quota. // -type VmNumaNodeServiceUpdateResponse struct { - node *VirtualNumaNode +type QuotaClusterLimitsServiceAddResponse struct { + limit *QuotaClusterLimit } -func (p *VmNumaNodeServiceUpdateResponse) Node() (*VirtualNumaNode, bool) { - if p.node != nil { - return p.node, true +func (p *QuotaClusterLimitsServiceAddResponse) Limit() (*QuotaClusterLimit, bool) { + if p.limit != nil { + return p.limit, true } return nil, false } -func (p *VmNumaNodeServiceUpdateResponse) MustNode() *VirtualNumaNode { - if p.node == nil { - panic("node in response does not exist") - } - return p.node -} - -// -// Updates a virtual NUMA node. -// An example of pinning a virtual NUMA node to a physical NUMA node on the host: -// [source] -// ---- -// PUT /ovirt-engine/api/vms/123/numanodes/456 -// ---- -// The request body should contain the following: -// [source,xml] -// ---- -// -// -// -// 0 -// -// -// -// ---- -// -func (p *VmNumaNodeService) Update() *VmNumaNodeServiceUpdateRequest { - return &VmNumaNodeServiceUpdateRequest{VmNumaNodeService: p} -} - -// -// Service locator method, returns individual service on which the URI is dispatched. -// -func (op *VmNumaNodeService) Service(path string) (Service, error) { - if path == "" { - return op, nil +func (p *QuotaClusterLimitsServiceAddResponse) MustLimit() *QuotaClusterLimit { + if p.limit == nil { + panic("limit in response does not exist") } - return nil, fmt.Errorf("The path <%s> doesn't correspond to any service", path) -} - -func (op *VmNumaNodeService) String() string { - return fmt.Sprintf("VmNumaNodeService:%s", op.path) + return p.limit } // -// Provides read-write access to virtual machines pools. +// Add a cluster limit to a specified Quota. // -type VmPoolsService struct { - BaseService -} - -func NewVmPoolsService(connection *Connection, path string) *VmPoolsService { - var result VmPoolsService - result.connection = connection - result.path = path - return &result +func (p *QuotaClusterLimitsService) Add() *QuotaClusterLimitsServiceAddRequest { + return &QuotaClusterLimitsServiceAddRequest{QuotaClusterLimitsService: p} } // -// Creates a new virtual machine pool. -// A new pool requires the `name`, `cluster` and `template` attributes. Identify the cluster and template with the -// `id` or `name` nested attributes: -// [source] -// ---- -// POST /ovirt-engine/api/vmpools -// ---- -// With the following body: -// [source,xml] -// ---- -// -// mypool -// -//